]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/llvm/tools/clang/include/clang/Index/USRGeneration.h
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / llvm / tools / clang / include / clang / Index / USRGeneration.h
1 //===- USRGeneration.h - Routines for USR generation ----------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_CLANG_INDEX_USRGENERATION_H
11 #define LLVM_CLANG_INDEX_USRGENERATION_H
12
13 #include "clang/Basic/LLVM.h"
14 #include "llvm/ADT/StringRef.h"
15
16 namespace clang {
17   class Decl;
18
19 namespace index {
20
21 static inline StringRef getUSRSpacePrefix() {
22   return "c:";
23 }
24
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);
28
29 /// \brief Generate a USR fragment for an Objective-C class.
30 void generateUSRForObjCClass(StringRef Cls, raw_ostream &OS);
31
32 /// \brief Generate a USR fragment for an Objective-C class category.
33 void generateUSRForObjCCategory(StringRef Cls, StringRef Cat, raw_ostream &OS);
34
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);
39
40 /// \brief Generate a USR fragment for an Objective-C method.
41 void generateUSRForObjCMethod(StringRef Sel, bool IsInstanceMethod,
42                               raw_ostream &OS);
43
44 /// \brief Generate a USR fragment for an Objective-C property.
45 void generateUSRForObjCProperty(StringRef Prop, raw_ostream &OS);
46
47 /// \brief Generate a USR fragment for an Objective-C protocol.
48 void generateUSRForObjCProtocol(StringRef Prot, raw_ostream &OS);
49
50 } // namespace index
51 } // namespace clang
52
53 #endif // LLVM_CLANG_IDE_USRGENERATION_H
54