15 #include "llvm/Support/Path.h" 16 #include "llvm/Support/raw_ostream.h" 18 using namespace clang;
35 OS << llvm::sys::path::filename(FE->
getName());
44 OS <<
'@' << Decomposed.second;
53 return attr->getDefinedIn();
61 llvm::raw_svector_ostream Out;
66 llvm::DenseMap<const Type *, unsigned> TypeSubstitutions;
80 bool ignoreResults()
const {
return IgnoreResults; }
96 void VisitTagDecl(
const TagDecl *D);
99 void VisitVarDecl(
const VarDecl *D);
106 IgnoreResults =
true;
110 IgnoreResults =
true;
113 void VisitUsingDecl(
const UsingDecl *D) {
114 IgnoreResults =
true;
117 bool ShouldGenerateLocation(
const NamedDecl *D);
123 void GenExtSymbolContainer(
const NamedDecl *D);
127 bool GenLoc(
const Decl *D,
bool IncludeOffset);
136 void GenObjCClass(StringRef cls, StringRef ExtSymDefinedIn,
137 StringRef CategoryContextExtSymbolDefinedIn) {
139 CategoryContextExtSymbolDefinedIn);
143 void GenObjCCategory(StringRef cls, StringRef cat,
144 StringRef clsExt, StringRef catExt) {
149 void GenObjCProperty(StringRef prop,
bool isClassProp) {
154 void GenObjCProtocol(StringRef prot, StringRef ext) {
173 bool USRGenerator::EmitDeclName(
const NamedDecl *D) {
174 const unsigned startSize = Buf.size();
176 const unsigned endSize = Buf.size();
177 return startSize == endSize;
180 bool USRGenerator::ShouldGenerateLocation(
const NamedDecl *D) {
192 void USRGenerator::VisitDeclContext(
const DeclContext *DC) {
193 if (
const NamedDecl *D = dyn_cast<NamedDecl>(DC))
197 void USRGenerator::VisitFieldDecl(
const FieldDecl *D) {
204 Out << (isa<ObjCIvarDecl>(D) ?
"@" :
"@FI@");
205 if (EmitDeclName(D)) {
207 IgnoreResults =
true;
212 void USRGenerator::VisitFunctionDecl(
const FunctionDecl *D) {
213 if (ShouldGenerateLocation(D) && GenLoc(D, isLocal(D)))
216 const unsigned StartSize = Buf.size();
218 if (Buf.size() == StartSize)
219 GenExtSymbolContainer(D);
221 bool IsTemplate =
false;
225 VisitTemplateParameterList(FunTmpl->getTemplateParameters());
237 !D->
hasAttr<OverloadableAttr>())
243 for (
unsigned I = 0, N = SpecArgs->size(); I != N; ++I) {
245 VisitTemplateArgument(SpecArgs->get(I));
250 // Mangle in type information for the arguments. 251 for (auto PD : D->parameters()) { 253 VisitType(PD->getType()); 258 // Function templates can be overloaded by return type, for example: 260 // template <class T> typename T::A foo() {} 261 // template <class T> typename T::B foo() {} 264 VisitType(D->getReturnType()); 267 if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D)) { 270 if (unsigned quals = MD->getTypeQualifiers()) 271 Out << (char)('0
' + quals); 272 switch (MD->getRefQualifier()) { 274 case RQ_LValue: Out << '&
'; break; 275 case RQ_RValue: Out << "&&"; break; 280 void USRGenerator::VisitNamedDecl(const NamedDecl *D) { 281 VisitDeclContext(D->getDeclContext()); 284 if (EmitDeclName(D)) { 285 // The string can be empty if the declaration has no name; e.g., it is 286 // the ParmDecl with no name for declaration of a function pointer type, 287 // e.g.: void (*f)(void *); 288 // In this case, don't generate a USR.
289 IgnoreResults =
true;
293 void USRGenerator::VisitVarDecl(
const VarDecl *D) {
297 if (ShouldGenerateLocation(D) && GenLoc(D, isLocal(D)))
304 VisitTemplateParameterList(VarTmpl->getTemplateParameters());
306 = dyn_cast<VarTemplatePartialSpecializationDecl>(D)) {
308 VisitTemplateParameterList(PartialSpec->getTemplateParameters());
319 IgnoreResults =
true;
325 = dyn_cast<VarTemplateSpecializationDecl>(D)) {
328 for (unsigned I = 0, N = Args.size(); I != N; ++I) { 330 VisitTemplateArgument(Args.get(I)); 335 void USRGenerator::VisitNonTypeTemplateParmDecl( 336 const NonTypeTemplateParmDecl *D) { 337 GenLoc(D, /*IncludeOffset=*/true); 340 void USRGenerator::VisitTemplateTemplateParmDecl( 341 const TemplateTemplateParmDecl *D) { 342 GenLoc(D, /*IncludeOffset=*/true); 345 void USRGenerator::VisitNamespaceDecl(const NamespaceDecl *D) { 346 if (D->isAnonymousNamespace()) { 351 VisitDeclContext(D->getDeclContext()); 353 Out << "@N@" << D->getName(); 356 void USRGenerator::VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) { 357 VisitFunctionDecl(D->getTemplatedDecl()); 360 void USRGenerator::VisitClassTemplateDecl(const ClassTemplateDecl *D) { 361 VisitTagDecl(D->getTemplatedDecl()); 364 void USRGenerator::VisitNamespaceAliasDecl(const NamespaceAliasDecl *D) { 365 VisitDeclContext(D->getDeclContext()); 367 Out << "@NA@" << D->getName(); 370 void USRGenerator::VisitObjCMethodDecl(const ObjCMethodDecl *D) { 371 const DeclContext *container = D->getDeclContext(); 372 if (const ObjCProtocolDecl *pd = dyn_cast<ObjCProtocolDecl>(container)) { 376 // The USR for a method declared in a class extension or category is based on 377 // the ObjCInterfaceDecl, not the ObjCCategoryDecl. 378 const ObjCInterfaceDecl *ID = D->getClassInterface(); 380 IgnoreResults = true; 383 auto getCategoryContext = [](const ObjCMethodDecl *D) -> 384 const ObjCCategoryDecl * { 385 if (auto *CD = dyn_cast<ObjCCategoryDecl>(D->getDeclContext())) 387 if (auto *ICD = dyn_cast<ObjCCategoryImplDecl>(D->getDeclContext())) 388 return ICD->getCategoryDecl(); 391 auto *CD = getCategoryContext(D); 392 VisitObjCContainerDecl(ID, CD); 394 // Ideally we would use 'GenObjCMethod
', but this is such a hot path 395 // for Objective-C code that we don't want to use
397 Out << (D->isInstanceMethod() ?
"(im)" :
"(cm)")
405 llvm_unreachable(
"Invalid ObjC container.");
406 case Decl::ObjCInterface:
407 case Decl::ObjCImplementation:
411 case Decl::ObjCCategory: {
419 IgnoreResults =
true;
425 Out <<
"objc(ext)" << ID->
getName() <<
'@';
429 GenObjCCategory(ID->getName(), CD->
getName(),
435 case Decl::ObjCCategoryImpl: {
443 IgnoreResults =
true;
446 GenObjCCategory(ID->getName(), CD->
getName(),
451 case Decl::ObjCProtocol: {
471 VisitObjCPropertyDecl(PD);
475 IgnoreResults =
true;
478 void USRGenerator::VisitTagDecl(
const TagDecl *D) {
481 if (!isa<EnumDecl>(D) &&
482 ShouldGenerateLocation(D) && GenLoc(D, isLocal(D)))
485 GenExtSymbolContainer(D);
490 bool AlreadyStarted =
false;
491 if (
const CXXRecordDecl *CXXRecord = dyn_cast<CXXRecordDecl>(D)) {
493 AlreadyStarted =
true;
500 case TTK_Enum: llvm_unreachable(
"enum template");
502 VisitTemplateParameterList(ClassTmpl->getTemplateParameters());
504 = dyn_cast<ClassTemplatePartialSpecializationDecl>(CXXRecord)) {
505 AlreadyStarted =
true;
512 case TTK_Enum: llvm_unreachable(
"enum partial specialization");
514 VisitTemplateParameterList(PartialSpec->getTemplateParameters());
518 if (!AlreadyStarted) {
529 assert(Buf.size() > 0);
530 const unsigned off = Buf.size() - 1;
532 if (EmitDeclName(D)) {
542 if (
auto *ED = dyn_cast<EnumDecl>(D)) {
544 auto enum_range = ED->enumerators();
545 if (enum_range.begin() != enum_range.end()) {
546 Out <<
'@' << **enum_range.begin();
555 = dyn_cast<ClassTemplateSpecializationDecl>(D)) {
558 for (unsigned I = 0, N = Args.size(); I != N; ++I) { 560 VisitTemplateArgument(Args.get(I)); 565 void USRGenerator::VisitTypedefDecl(const TypedefDecl *D) { 566 if (ShouldGenerateLocation(D) && GenLoc(D, /*IncludeOffset=*/isLocal(D))) 568 const DeclContext *DC = D->getDeclContext(); 569 if (const NamedDecl *DCN = dyn_cast<NamedDecl>(DC)) 575 void USRGenerator::VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D) { 576 GenLoc(D, /*IncludeOffset=*/true); 579 void USRGenerator::GenExtSymbolContainer(const NamedDecl *D) { 580 StringRef Container = GetExternalSourceContainer(D); 581 if (!Container.empty()) 582 Out << "@M@" << Container; 585 bool USRGenerator::GenLoc(const Decl *D, bool IncludeOffset) { 587 return IgnoreResults; 590 // Guard against null declarations in invalid code. 592 IgnoreResults = true; 596 // Use the location of canonical decl. 597 D = D->getCanonicalDecl(); 600 IgnoreResults || printLoc(Out, D->getLocStart(), 601 Context->getSourceManager(), IncludeOffset); 603 return IgnoreResults; 606 static void printQualifier(llvm::raw_ostream &Out, ASTContext &Ctx, NestedNameSpecifier *NNS) { 607 // FIXME: Encode the qualifier, don't just print it.
610 PO.SuppressUnwrittenScope =
true;
611 PO.ConstantArraySizeAsWritten =
false;
612 PO.AnonymousTagLocations =
false;
616 void USRGenerator::VisitType(
QualType T) {
633 Out << ((char) (
'0' + qVal));
639 T = Expansion->getPattern();
643 unsigned char c =
'\0';
644 switch (BT->getKind()) {
645 case BuiltinType::Void:
647 case BuiltinType::Bool:
649 case BuiltinType::UChar:
651 case BuiltinType::Char16:
653 case BuiltinType::Char32:
655 case BuiltinType::UShort:
657 case BuiltinType::UInt:
659 case BuiltinType::ULong:
661 case BuiltinType::ULongLong:
663 case BuiltinType::UInt128:
665 case BuiltinType::Char_U:
666 case BuiltinType::Char_S:
668 case BuiltinType::SChar:
670 case BuiltinType::WChar_S:
671 case BuiltinType::WChar_U:
673 case BuiltinType::Short:
675 case BuiltinType::Int:
677 case BuiltinType::Long:
679 case BuiltinType::LongLong:
681 case BuiltinType::Int128:
683 case BuiltinType::Float16:
684 case BuiltinType::Half:
686 case BuiltinType::Float:
688 case BuiltinType::Double:
690 case BuiltinType::LongDouble:
692 case BuiltinType::Float128:
694 case BuiltinType::NullPtr:
696 #define BUILTIN_TYPE(Id, SingletonId) 697 #define PLACEHOLDER_TYPE(Id, SingletonId) case BuiltinType::Id: 698 #include "clang/AST/BuiltinTypes.def" 699 case BuiltinType::Dependent:
700 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ 701 case BuiltinType::Id: 702 #include "clang/Basic/OpenCLImageTypes.def" 703 case BuiltinType::OCLEvent:
704 case BuiltinType::OCLClkEvent:
705 case BuiltinType::OCLQueue:
706 case BuiltinType::OCLReserveID:
707 case BuiltinType::OCLSampler:
708 IgnoreResults =
true;
710 case BuiltinType::ObjCId:
712 case BuiltinType::ObjCClass:
714 case BuiltinType::ObjCSel:
723 llvm::DenseMap<const Type *, unsigned>::iterator Substitution
725 if (Substitution != TypeSubstitutions.end()) {
726 Out <<
'S' << Substitution->second <<
'_';
730 unsigned Number = TypeSubstitutions.size();
756 VisitType(FT->getReturnType());
758 for (
const auto &I : FT->param_types()) {
763 if (FT->isVariadic())
774 T = CT->getElementType();
779 VisitTagDecl(TT->getDecl());
784 VisitObjCInterfaceDecl(OIT->getDecl());
789 VisitType(OIT->getBaseType());
790 for (
auto *Prot : OIT->getProtocols())
791 VisitObjCProtocolDecl(Prot);
795 Out <<
't' << TTP->getDepth() <<
'.' << TTP->getIndex();
801 VisitTemplateName(Spec->getTemplateName()); 802 Out << Spec->getNumArgs(); 803 for (unsigned I = 0, N = Spec->getNumArgs(); I != N; ++I) 804 VisitTemplateArgument(Spec->getArg(I)); 807 if (const DependentNameType *DNT = T->getAs<DependentNameType>()) { 809 printQualifier(Out, Ctx, DNT->getQualifier()); 810 Out << ':
' << DNT->getIdentifier()->getName(); 813 if (const InjectedClassNameType *InjT = T->getAs<InjectedClassNameType>()) { 814 T = InjT->getInjectedSpecializationType(); 817 if (const auto *VT = T->getAs<VectorType>()) { 818 Out << (T->isExtVectorType() ? ']
' : '[
'); 819 Out << VT->getNumElements(); 820 T = VT->getElementType(); 823 if (const auto *const AT = dyn_cast<ArrayType>(T)) { 825 switch (AT->getSizeModifier()) { 826 case ArrayType::Static: 829 case ArrayType::Star: 832 case ArrayType::Normal: 836 if (const auto *const CAT = dyn_cast<ConstantArrayType>(T)) 837 Out << CAT->getSize(); 839 T = AT->getElementType(); 849 void USRGenerator::VisitTemplateParameterList( 850 const TemplateParameterList *Params) { 853 Out << '>
' << Params->size(); 854 for (TemplateParameterList::const_iterator P = Params->begin(), 855 PEnd = Params->end(); 858 if (isa<TemplateTypeParmDecl>(*P)) { 859 if (cast<TemplateTypeParmDecl>(*P)->isParameterPack()) 865 if (NonTypeTemplateParmDecl *NTTP = dyn_cast<NonTypeTemplateParmDecl>(*P)) { 866 if (NTTP->isParameterPack()) 869 VisitType(NTTP->getType()); 873 TemplateTemplateParmDecl *TTP = cast<TemplateTemplateParmDecl>(*P); 874 if (TTP->isParameterPack()) 877 VisitTemplateParameterList(TTP->getTemplateParameters()); 881 void USRGenerator::VisitTemplateName(TemplateName Name) { 882 if (TemplateDecl *Template = Name.getAsTemplateDecl()) { 883 if (TemplateTemplateParmDecl *TTP 884 = dyn_cast<TemplateTemplateParmDecl>(Template)) { 885 Out << 't
' << TTP->getDepth() << '.
' << TTP->getIndex(); 893 // FIXME: Visit dependent template names. 896 void USRGenerator::VisitTemplateArgument(const TemplateArgument &Arg) { 897 switch (Arg.getKind()) { 898 case TemplateArgument::Null: 901 case TemplateArgument::Declaration: 902 Visit(Arg.getAsDecl()); 905 case TemplateArgument::NullPtr: 908 case TemplateArgument::TemplateExpansion: 909 Out << 'P
'; // pack expansion of... 911 case TemplateArgument::Template: 912 VisitTemplateName(Arg.getAsTemplateOrTemplatePattern()); 915 case TemplateArgument::Expression: 916 // FIXME: Visit expressions. 919 case TemplateArgument::Pack: 920 Out << 'p
' << Arg.pack_size(); 921 for (const auto &P : Arg.pack_elements()) 922 VisitTemplateArgument(P); 925 case TemplateArgument::Type: 926 VisitType(Arg.getAsType()); 929 case TemplateArgument::Integral: 931 VisitType(Arg.getIntegralType()); 932 Out << Arg.getAsIntegral(); 937 void USRGenerator::VisitUnresolvedUsingValueDecl(const UnresolvedUsingValueDecl *D) { 938 if (ShouldGenerateLocation(D) && GenLoc(D, /*IncludeOffset=*/isLocal(D))) 940 VisitDeclContext(D->getDeclContext()); 942 printQualifier(Out, D->getASTContext(), D->getQualifier()); 946 void USRGenerator::VisitUnresolvedUsingTypenameDecl(const UnresolvedUsingTypenameDecl *D) { 947 if (ShouldGenerateLocation(D) && GenLoc(D, /*IncludeOffset=*/isLocal(D))) 949 VisitDeclContext(D->getDeclContext()); 951 printQualifier(Out, D->getASTContext(), D->getQualifier()); 952 Out << D->getName(); // Simple name. 957 //===----------------------------------------------------------------------===// 958 // USR generation functions. 959 //===----------------------------------------------------------------------===// 961 static void combineClassAndCategoryExtContainers(StringRef ClsSymDefinedIn, 962 StringRef CatSymDefinedIn, 964 if (ClsSymDefinedIn.empty() && CatSymDefinedIn.empty()) 966 if (CatSymDefinedIn.empty()) { 967 OS << "@M@" << ClsSymDefinedIn << '@
'; 970 OS << "@CM@" << CatSymDefinedIn << '@
'; 971 if (ClsSymDefinedIn != CatSymDefinedIn) { 972 OS << ClsSymDefinedIn << '@
'; 976 void clang::index::generateUSRForObjCClass(StringRef Cls, raw_ostream &OS, 977 StringRef ExtSymDefinedIn, 978 StringRef CategoryContextExtSymbolDefinedIn) { 979 combineClassAndCategoryExtContainers(ExtSymDefinedIn, 980 CategoryContextExtSymbolDefinedIn, OS); 981 OS << "objc(cs)" << Cls; 984 void clang::index::generateUSRForObjCCategory(StringRef Cls, StringRef Cat, 986 StringRef ClsSymDefinedIn, 987 StringRef CatSymDefinedIn) { 988 combineClassAndCategoryExtContainers(ClsSymDefinedIn, CatSymDefinedIn, OS); 989 OS << "objc(cy)" << Cls << '@
' << Cat; 992 void clang::index::generateUSRForObjCIvar(StringRef Ivar, raw_ostream &OS) { 996 void clang::index::generateUSRForObjCMethod(StringRef Sel, 997 bool IsInstanceMethod, 999 OS << (IsInstanceMethod ? "(im)" : "(cm)") << Sel; 1002 void clang::index::generateUSRForObjCProperty(StringRef Prop, bool isClassProp, 1004 OS << (isClassProp ? "(cpy)" : "(py)") << Prop; 1007 void clang::index::generateUSRForObjCProtocol(StringRef Prot, raw_ostream &OS, 1008 StringRef ExtSymDefinedIn) { 1009 if (!ExtSymDefinedIn.empty()) 1010 OS << "@M@" << ExtSymDefinedIn << '@
'; 1011 OS << "objc(pl)" << Prot; 1014 void clang::index::generateUSRForGlobalEnum(StringRef EnumName, raw_ostream &OS, 1015 StringRef ExtSymDefinedIn) { 1016 if (!ExtSymDefinedIn.empty()) 1017 OS << "@M@" << ExtSymDefinedIn; 1018 OS << "@E@" << EnumName; 1021 void clang::index::generateUSRForEnumConstant(StringRef EnumConstantName, 1023 OS << '@
' << EnumConstantName; 1026 bool clang::index::generateUSRForDecl(const Decl *D, 1027 SmallVectorImpl<char> &Buf) { 1030 // We don't ignore decls with invalid source locations.
Implicit decls, like
1036 return UG.ignoreResults();
1053 if (MacroName.empty() || Loc.
isInvalid())
1056 llvm::raw_svector_ostream Out(Buf);
1063 if (ShouldGenerateLocation)
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
Defines the clang::ASTContext interface.
An instance of this class is created to represent a function declaration or definition.
bool generateUSRForMacro(const MacroDefinitionRecord *MD, const SourceManager &SM, SmallVectorImpl< char > &Buf)
Generate a USR for a macro, including the USR prefix.
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
ObjCInterfaceDecl * getClassInterface()
void generateUSRForObjCCategory(StringRef Cls, StringRef Cat, raw_ostream &OS, StringRef ClsExtSymbolDefinedIn="", StringRef CatExtSymbolDefinedIn="")
Generate a USR fragment for an Objective-C class category.
bool isExternC() const
Determines whether this function is a function with external, C linkage.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
Decl - This represents one declaration (or definition), e.g.
Defines the C++ template declaration subclasses.
Declaration of a variable template.
NamespaceDecl - Represent a C++ namespace.
const DeclContext * getParentFunctionOrMethod() const
If this decl is defined inside a function/method/block it returns the corresponding DeclContext...
void generateUSRForObjCClass(StringRef Cls, raw_ostream &OS, StringRef ExtSymbolDefinedIn="", StringRef CategoryContextExtSymbolDefinedIn="")
Generate a USR fragment for an Objective-C class.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
const T * getAs() const
Member-template getAs<specific type>'.
The "__interface" keyword.
Represents a variable template specialization, which refers to a variable template with a given set o...
ObjCMethodDecl - Represents an instance or class method declaration.
Stores a list of template parameters for a TemplateDecl and its derived classes.
ExternalSourceSymbolAttr * getExternalSourceSymbolAttr() const
Looks on this and related declarations for an applicable external source symbol attribute.
Describes how types, statements, expressions, and declarations should be printed. ...
The collection of all-type qualifiers we support.
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
Represents a class template specialization, which refers to a class template with a given set of temp...
Represents a class type in Objective C.
static StringRef getUSRSpacePrefix()
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Record the location of a macro definition.
static bool printLoc(llvm::raw_ostream &OS, SourceLocation Loc, const SourceManager &SM, bool IncludeOffset)
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
bool isClassProperty() const
Represents a C++ using-declaration.
An rvalue reference type, per C++11 [dcl.ref].
ObjCContainerDecl - Represents a container for method declarations.
TagKind getTagKind() const
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
SourceLocation getExpansionLoc(SourceLocation Loc) const
Given a SourceLocation object Loc, return the expansion location referenced by the ID...
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
Represents an Objective-C protocol declaration.
Represents an ObjC class declaration.
Represents a linkage specification.
unsigned SuppressTemplateArgsInCXXConstructors
When true, suppresses printing template arguments in names of C++ constructors.
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Represents a prototype with parameter type info, e.g.
bool isInSystemHeader(SourceLocation Loc) const
Returns if a SourceLocation is in a system header.
const FileEntry * getFileEntryForID(FileID FID) const
Returns the FileEntry record for the provided FileID.
const FunctionProtoType * T
Declaration of a template type parameter.
const TemplateArgumentList * getTemplateSpecializationArgs() const
Retrieve the template arguments used to produce this function template specialization from the primar...
DeclContext * getDeclContext()
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Represents a C++ template name within the type system.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
static StringRef GetExternalSourceContainer(const NamedDecl *D)
virtual void printName(raw_ostream &os) const
Encodes a location in the source.
StringRef getName() const
Interfaces are the core concept in Objective-C for object oriented design.
TagDecl - Represents the declaration of a struct/union/class/enum.
ASTContext & getASTContext() const LLVM_READONLY
TagDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
Represents a dependent using declaration which was not marked with typename.
Cached information about one file (either on disk or in the virtual file system). ...
ObjCCategoryDecl - Represents a category declaration.
const IdentifierInfo * getName() const
Retrieve the name of the macro being defined.
Represents one property declaration in an Objective-C interface.
bool SuppressTagKeyword
Whether type printing should skip printing the tag keyword.
Represents a pack expansion of types.
StringRef getName() const
Return the actual identifier string.
Base class for declarations which introduce a typedef-name.
Represents a template argument.
const ObjCInterfaceDecl * getClassInterface() const
Dataflow Directional Tag Classes.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
bool isEmbeddedInDeclarator() const
Represents a dependent using declaration which was marked with typename.
DeclarationName - The name of a declaration.
void generateUSRForObjCProtocol(StringRef Prot, raw_ostream &OS, StringRef ExtSymbolDefinedIn="")
Generate a USR fragment for an Objective-C protocol.
Represents a pointer to an Objective C object.
Complex values, per C99 6.2.5p11.
SourceLocation getLocation() const
Retrieve the location of the macro name in the definition.
Base for LValueReferenceType and RValueReferenceType.
SourceManager & getSourceManager()
bool IsClassExtension() const
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
A template argument list.
TypedefNameDecl * getTypedefNameForAnonDecl() const
Represents a C++ struct/union/class.
void generateUSRForObjCProperty(StringRef Prop, bool isClassProp, raw_ostream &OS)
Generate a USR fragment for an Objective-C property.
const ObjCInterfaceDecl * getObjContainingInterface(const NamedDecl *ND) const
Returns the Objective-C interface that ND belongs to if it is an Objective-C method/property/ivar etc...
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
Declaration of a class template.
This class is used for builtin types like 'int'.
void print(raw_ostream &OS, const PrintingPolicy &Policy)
StringRef getName() const
getName - Get the name of identifier for this declaration as a StringRef.
Represents a type template specialization; the template must be a class template, a type alias templa...
ObjCPropertyDecl * getPropertyDecl() const
NamedDecl - This represents a decl with a name.
Represents a C++ namespace alias.
Represents C++ using-directive.
A simple visitor class that helps create declaration visitors.
bool isFreeStanding() const
const LangOptions & getLangOpts() const
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
This class handles loading and caching of source files into memory.
Declaration of a template function.
SourceLocation getLocation() const
bool isExternallyVisible() const
std::pair< FileID, unsigned > getDecomposedLoc(SourceLocation Loc) const
Decompose the specified location into a raw FileID + Offset pair.