1 //===- USRGeneration.h - Routines for USR generation ----------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CLANG_INDEX_USRGENERATION_H
11 #define LLVM_CLANG_INDEX_USRGENERATION_H
13 #include "clang/Basic/LLVM.h"
14 #include "llvm/ADT/StringRef.h"
21 static inline StringRef getUSRSpacePrefix() {
25 /// \brief Generate a USR for a Decl, including the prefix.
26 /// \returns true if the results should be ignored, false otherwise.
27 bool generateUSRForDecl(const Decl *D, SmallVectorImpl<char> &Buf);
29 /// \brief Generate a USR fragment for an Objective-C class.
30 void generateUSRForObjCClass(StringRef Cls, raw_ostream &OS);
32 /// \brief Generate a USR fragment for an Objective-C class category.
33 void generateUSRForObjCCategory(StringRef Cls, StringRef Cat, raw_ostream &OS);
35 /// \brief Generate a USR fragment for an Objective-C instance variable. The
36 /// complete USR can be created by concatenating the USR for the
37 /// encompassing class with this USR fragment.
38 void generateUSRForObjCIvar(StringRef Ivar, raw_ostream &OS);
40 /// \brief Generate a USR fragment for an Objective-C method.
41 void generateUSRForObjCMethod(StringRef Sel, bool IsInstanceMethod,
44 /// \brief Generate a USR fragment for an Objective-C property.
45 void generateUSRForObjCProperty(StringRef Prop, raw_ostream &OS);
47 /// \brief Generate a USR fragment for an Objective-C protocol.
48 void generateUSRForObjCProtocol(StringRef Prot, raw_ostream &OS);
53 #endif // LLVM_CLANG_IDE_USRGENERATION_H