1259701Sdim//===- USRGeneration.h - Routines for USR generation ----------------------===// 2259701Sdim// 3259701Sdim// The LLVM Compiler Infrastructure 4259701Sdim// 5259701Sdim// This file is distributed under the University of Illinois Open Source 6259701Sdim// License. See LICENSE.TXT for details. 7259701Sdim// 8259701Sdim//===----------------------------------------------------------------------===// 9259701Sdim 10259701Sdim#ifndef LLVM_CLANG_INDEX_USRGENERATION_H 11259701Sdim#define LLVM_CLANG_INDEX_USRGENERATION_H 12259701Sdim 13259701Sdim#include "clang/Basic/LLVM.h" 14259701Sdim#include "llvm/ADT/StringRef.h" 15259701Sdim 16259701Sdimnamespace clang { 17259701Sdim class Decl; 18259701Sdim 19259701Sdimnamespace index { 20259701Sdim 21259701Sdimstatic inline StringRef getUSRSpacePrefix() { 22259701Sdim return "c:"; 23259701Sdim} 24259701Sdim 25259701Sdim/// \brief Generate a USR for a Decl, including the prefix. 26259701Sdim/// \returns true if the results should be ignored, false otherwise. 27259701Sdimbool generateUSRForDecl(const Decl *D, SmallVectorImpl<char> &Buf); 28259701Sdim 29259701Sdim/// \brief Generate a USR fragment for an Objective-C class. 30259701Sdimvoid generateUSRForObjCClass(StringRef Cls, raw_ostream &OS); 31259701Sdim 32259701Sdim/// \brief Generate a USR fragment for an Objective-C class category. 33259701Sdimvoid generateUSRForObjCCategory(StringRef Cls, StringRef Cat, raw_ostream &OS); 34259701Sdim 35259701Sdim/// \brief Generate a USR fragment for an Objective-C instance variable. The 36259701Sdim/// complete USR can be created by concatenating the USR for the 37259701Sdim/// encompassing class with this USR fragment. 38259701Sdimvoid generateUSRForObjCIvar(StringRef Ivar, raw_ostream &OS); 39259701Sdim 40259701Sdim/// \brief Generate a USR fragment for an Objective-C method. 41259701Sdimvoid generateUSRForObjCMethod(StringRef Sel, bool IsInstanceMethod, 42259701Sdim raw_ostream &OS); 43259701Sdim 44259701Sdim/// \brief Generate a USR fragment for an Objective-C property. 45259701Sdimvoid generateUSRForObjCProperty(StringRef Prop, raw_ostream &OS); 46259701Sdim 47259701Sdim/// \brief Generate a USR fragment for an Objective-C protocol. 48259701Sdimvoid generateUSRForObjCProtocol(StringRef Prot, raw_ostream &OS); 49259701Sdim 50259701Sdim} // namespace index 51259701Sdim} // namespace clang 52259701Sdim 53259701Sdim#endif // LLVM_CLANG_IDE_USRGENERATION_H 54259701Sdim 55