clang API Documentation

Classes | Functions
clang::index Namespace Reference

Classes

class  CommentToXMLConverter
class  SimpleFormatContext
 A small class to be used by libclang clients to format a declaration string in memory. This object is instantiated once and used each time a formatting is needed. More...

Functions

static StringRef getUSRSpacePrefix ()
bool generateUSRForDecl (const Decl *D, SmallVectorImpl< char > &Buf)
 Generate a USR for a Decl, including the USR prefix.
void generateUSRForObjCClass (StringRef Cls, raw_ostream &OS)
 Generate a USR fragment for an Objective-C class.
void generateUSRForObjCCategory (StringRef Cls, StringRef Cat, raw_ostream &OS)
 Generate a USR fragment for an Objective-C class category.
void generateUSRForObjCIvar (StringRef Ivar, raw_ostream &OS)
 Generate a USR fragment for an Objective-C instance variable. The complete USR can be created by concatenating the USR for the encompassing class with this USR fragment.
void generateUSRForObjCMethod (StringRef Sel, bool IsInstanceMethod, raw_ostream &OS)
 Generate a USR fragment for an Objective-C method.
void generateUSRForObjCProperty (StringRef Prop, raw_ostream &OS)
 Generate a USR fragment for an Objective-C property.
void generateUSRForObjCProtocol (StringRef Prot, raw_ostream &OS)
 Generate a USR fragment for an Objective-C protocol.
bool generateUSRForMacro (const MacroDefinition *MD, const SourceManager &SM, SmallVectorImpl< char > &Buf)
 Generate a USR for a macro, including the USR prefix.

Function Documentation

bool clang::index::generateUSRForDecl ( const Decl D,
SmallVectorImpl< char > &  Buf 
)

Generate a USR for a Decl, including the USR prefix.

Returns:
true if the results should be ignored, false otherwise.

Definition at line 797 of file USRGeneration.cpp.

bool clang::index::generateUSRForMacro ( const MacroDefinition MD,
const SourceManager SM,
SmallVectorImpl< char > &  Buf 
)

Generate a USR for a macro, including the USR prefix.

Returns:
true on error, false on success.

Definition at line 808 of file USRGeneration.cpp.

References clang::MacroDefinition::getLocation(), clang::IdentifierInfo::getName(), clang::MacroDefinition::getName(), getUSRSpacePrefix(), clang::SourceManager::isInSystemHeader(), clang::SourceLocation::isInvalid(), and printLoc().

void clang::index::generateUSRForObjCCategory ( StringRef  Cls,
StringRef  Cat,
raw_ostream &  OS 
)

Generate a USR fragment for an Objective-C class category.

Definition at line 774 of file USRGeneration.cpp.

void clang::index::generateUSRForObjCClass ( StringRef  Cls,
raw_ostream &  OS 
)

Generate a USR fragment for an Objective-C class.

Definition at line 770 of file USRGeneration.cpp.

void clang::index::generateUSRForObjCIvar ( StringRef  Ivar,
raw_ostream &  OS 
)

Generate a USR fragment for an Objective-C instance variable. The complete USR can be created by concatenating the USR for the encompassing class with this USR fragment.

Definition at line 779 of file USRGeneration.cpp.

void clang::index::generateUSRForObjCMethod ( StringRef  Sel,
bool  IsInstanceMethod,
raw_ostream &  OS 
)

Generate a USR fragment for an Objective-C method.

Definition at line 783 of file USRGeneration.cpp.

void clang::index::generateUSRForObjCProperty ( StringRef  Prop,
raw_ostream &  OS 
)

Generate a USR fragment for an Objective-C property.

Definition at line 789 of file USRGeneration.cpp.

void clang::index::generateUSRForObjCProtocol ( StringRef  Prot,
raw_ostream &  OS 
)

Generate a USR fragment for an Objective-C protocol.

Definition at line 793 of file USRGeneration.cpp.

static StringRef clang::index::getUSRSpacePrefix ( ) [inline, static]

Definition at line 23 of file USRGeneration.h.

Referenced by generateUSRForMacro().