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
16namespace clang {
17  class Decl;
18
19namespace index {
20
21static 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.
27bool generateUSRForDecl(const Decl *D, SmallVectorImpl<char> &Buf);
28
29/// \brief Generate a USR fragment for an Objective-C class.
30void generateUSRForObjCClass(StringRef Cls, raw_ostream &OS);
31
32/// \brief Generate a USR fragment for an Objective-C class category.
33void 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.
38void generateUSRForObjCIvar(StringRef Ivar, raw_ostream &OS);
39
40/// \brief Generate a USR fragment for an Objective-C method.
41void generateUSRForObjCMethod(StringRef Sel, bool IsInstanceMethod,
42                              raw_ostream &OS);
43
44/// \brief Generate a USR fragment for an Objective-C property.
45void generateUSRForObjCProperty(StringRef Prop, raw_ostream &OS);
46
47/// \brief Generate a USR fragment for an Objective-C protocol.
48void generateUSRForObjCProtocol(StringRef Prot, raw_ostream &OS);
49
50} // namespace index
51} // namespace clang
52
53#endif // LLVM_CLANG_IDE_USRGENERATION_H
54
55