18#include "llvm/Support/Path.h"
19#include "llvm/Support/raw_ostream.h"
34 Loc =
SM.getExpansionLoc(Loc);
35 const std::pair<FileID, unsigned> &Decomposed =
SM.getDecomposedLoc(Loc);
38 OS << llvm::sys::path::filename(FE->
getName());
47 OS <<
'@' << Decomposed.second;
56 return attr->getDefinedIn();
64 llvm::raw_svector_ostream Out;
69 llvm::DenseMap<const Type *, unsigned> TypeSubstitutions;
83 bool ignoreResults()
const {
return IgnoreResults; }
99 void VisitTagDecl(
const TagDecl *D);
102 void VisitVarDecl(
const VarDecl *D);
111 IgnoreResults =
true;
115 IgnoreResults =
true;
118 void VisitUsingDecl(
const UsingDecl *D) {
122 bool EmittedDeclName = !EmitDeclName(D);
123 assert(EmittedDeclName &&
"EmitDeclName can not fail for UsingDecls");
124 (void)EmittedDeclName;
127 bool ShouldGenerateLocation(
const NamedDecl *D);
133 void GenExtSymbolContainer(
const NamedDecl *D);
137 bool GenLoc(
const Decl *D,
bool IncludeOffset);
146 void GenObjCClass(StringRef cls, StringRef ExtSymDefinedIn,
147 StringRef CategoryContextExtSymbolDefinedIn) {
149 CategoryContextExtSymbolDefinedIn);
153 void GenObjCCategory(StringRef cls, StringRef cat,
154 StringRef clsExt, StringRef catExt) {
159 void GenObjCProperty(StringRef prop,
bool isClassProp) {
164 void GenObjCProtocol(StringRef prot, StringRef ext) {
185bool USRGenerator::EmitDeclName(
const NamedDecl *D) {
193bool USRGenerator::ShouldGenerateLocation(
const NamedDecl *D) {
202 return !
SM.isInSystemHeader(Loc);
205void USRGenerator::VisitDeclContext(
const DeclContext *DC) {
206 if (
const NamedDecl *D = dyn_cast<NamedDecl>(DC))
208 else if (isa<LinkageSpecDecl>(DC))
212void USRGenerator::VisitFieldDecl(
const FieldDecl *D) {
219 Out << (isa<ObjCIvarDecl>(D) ?
"@" :
"@FI@");
220 if (EmitDeclName(D)) {
222 IgnoreResults =
true;
227void USRGenerator::VisitFunctionDecl(
const FunctionDecl *D) {
228 if (ShouldGenerateLocation(D) && GenLoc(D, isLocal(D)))
232 IgnoreResults =
true;
236 const unsigned StartSize = Buf.size();
238 if (Buf.size() == StartSize)
239 GenExtSymbolContainer(D);
241 bool IsTemplate =
false;
245 VisitTemplateParameterList(FunTmpl->getTemplateParameters());
252 Policy.SuppressTemplateArgsInCXXConstructors =
true;
257 !D->
hasAttr<OverloadableAttr>())
263 for (
unsigned I = 0, N = SpecArgs->size(); I != N; ++I) {
265 VisitTemplateArgument(SpecArgs->get(I));
273 for (
QualType PT : FPT->param_types()) {
294 if (
unsigned quals = MD->getMethodQualifiers().getCVRUQualifiers())
295 Out << (char)(
'0' + quals);
296 switch (MD->getRefQualifier()) {
304void USRGenerator::VisitNamedDecl(
const NamedDecl *D) {
308 if (EmitDeclName(D)) {
313 IgnoreResults =
true;
317void USRGenerator::VisitVarDecl(
const VarDecl *D) {
321 if (ShouldGenerateLocation(D) && GenLoc(D, isLocal(D)))
328 VisitTemplateParameterList(VarTmpl->getTemplateParameters());
330 = dyn_cast<VarTemplatePartialSpecializationDecl>(D)) {
332 VisitTemplateParameterList(PartialSpec->getTemplateParameters());
343 IgnoreResults =
true;
349 = dyn_cast<VarTemplateSpecializationDecl>(D)) {
352 for (
unsigned I = 0, N = Args.
size(); I != N; ++I) {
354 VisitTemplateArgument(Args.
get(I));
359void USRGenerator::VisitBindingDecl(
const BindingDecl *D) {
360 if (isLocal(D) && GenLoc(D,
true))
365void USRGenerator::VisitNonTypeTemplateParmDecl(
370void USRGenerator::VisitTemplateTemplateParmDecl(
375void USRGenerator::VisitNamespaceDecl(
const NamespaceDecl *D) {
403 if (
auto *ICD = dyn_cast<ObjCCategoryImplDecl>(D->
getDeclContext()))
404 return ICD->getCategoryDecl();
418 IgnoreResults =
true;
422 VisitObjCContainerDecl(ID, CD);
435 llvm_unreachable(
"Invalid ObjC container.");
436 case Decl::ObjCInterface:
437 case Decl::ObjCImplementation:
441 case Decl::ObjCCategory: {
449 IgnoreResults =
true;
455 Out <<
"objc(ext)" <<
ID->getName() <<
'@';
459 GenObjCCategory(
ID->getName(), CD->
getName(),
465 case Decl::ObjCCategoryImpl: {
473 IgnoreResults =
true;
476 GenObjCCategory(
ID->getName(), CD->
getName(),
481 case Decl::ObjCProtocol: {
501 VisitObjCPropertyDecl(PD);
505 IgnoreResults =
true;
508void USRGenerator::VisitTagDecl(
const TagDecl *D) {
511 if (!isa<EnumDecl>(D) &&
512 ShouldGenerateLocation(D) && GenLoc(D, isLocal(D)))
515 GenExtSymbolContainer(D);
520 bool AlreadyStarted =
false;
521 if (
const CXXRecordDecl *CXXRecord = dyn_cast<CXXRecordDecl>(D)) {
523 AlreadyStarted =
true;
526 case TagTypeKind::Interface:
527 case TagTypeKind::Class:
528 case TagTypeKind::Struct:
531 case TagTypeKind::Union:
534 case TagTypeKind::Enum:
535 llvm_unreachable(
"enum template");
537 VisitTemplateParameterList(ClassTmpl->getTemplateParameters());
539 = dyn_cast<ClassTemplatePartialSpecializationDecl>(CXXRecord)) {
540 AlreadyStarted =
true;
543 case TagTypeKind::Interface:
544 case TagTypeKind::Class:
545 case TagTypeKind::Struct:
548 case TagTypeKind::Union:
551 case TagTypeKind::Enum:
552 llvm_unreachable(
"enum partial specialization");
554 VisitTemplateParameterList(PartialSpec->getTemplateParameters());
558 if (!AlreadyStarted) {
560 case TagTypeKind::Interface:
561 case TagTypeKind::Class:
562 case TagTypeKind::Struct:
565 case TagTypeKind::Union:
568 case TagTypeKind::Enum:
575 assert(Buf.size() > 0);
576 const unsigned off = Buf.size() - 1;
578 if (EmitDeclName(D)) {
587 if (
auto *ED = dyn_cast<EnumDecl>(D)) {
590 auto enum_range = ED->enumerators();
591 if (enum_range.begin() != enum_range.end()) {
592 Out <<
'@' << **enum_range.begin();
601 = dyn_cast<ClassTemplateSpecializationDecl>(D)) {
604 for (
unsigned I = 0, N = Args.
size(); I != N; ++I) {
606 VisitTemplateArgument(Args.
get(I));
611void USRGenerator::VisitTypedefDecl(
const TypedefDecl *D) {
612 if (ShouldGenerateLocation(D) && GenLoc(D, isLocal(D)))
615 if (
const NamedDecl *DCN = dyn_cast<NamedDecl>(DC))
625void USRGenerator::GenExtSymbolContainer(
const NamedDecl *D) {
627 if (!Container.empty())
628 Out <<
"@M@" << Container;
631bool USRGenerator::GenLoc(
const Decl *D,
bool IncludeOffset) {
633 return IgnoreResults;
638 IgnoreResults =
true;
649 return IgnoreResults;
662void USRGenerator::VisitType(
QualType T) {
679 Out << ((char) (
'0' + qVal));
685 T = Expansion->getPattern();
689 switch (BT->getKind()) {
690 case BuiltinType::Void:
692 case BuiltinType::Bool:
694 case BuiltinType::UChar:
696 case BuiltinType::Char8:
698 case BuiltinType::Char16:
700 case BuiltinType::Char32:
702 case BuiltinType::UShort:
704 case BuiltinType::UInt:
706 case BuiltinType::ULong:
708 case BuiltinType::ULongLong:
710 case BuiltinType::UInt128:
712 case BuiltinType::Char_U:
713 case BuiltinType::Char_S:
715 case BuiltinType::SChar:
717 case BuiltinType::WChar_S:
718 case BuiltinType::WChar_U:
720 case BuiltinType::Short:
722 case BuiltinType::Int:
724 case BuiltinType::Long:
726 case BuiltinType::LongLong:
728 case BuiltinType::Int128:
730 case BuiltinType::Float16:
731 case BuiltinType::Half:
733 case BuiltinType::Float:
735 case BuiltinType::Double:
737 case BuiltinType::LongDouble:
739 case BuiltinType::Float128:
741 case BuiltinType::NullPtr:
743#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
744 case BuiltinType::Id: \
745 Out << "@BT@" << #Suffix << "_" << #ImgType; break;
746#include "clang/Basic/OpenCLImageTypes.def"
747#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
748 case BuiltinType::Id: \
749 Out << "@BT@" << #ExtType; break;
750#include "clang/Basic/OpenCLExtensionTypes.def"
751 case BuiltinType::OCLEvent:
752 Out <<
"@BT@OCLEvent";
break;
753 case BuiltinType::OCLClkEvent:
754 Out <<
"@BT@OCLClkEvent";
break;
755 case BuiltinType::OCLQueue:
756 Out <<
"@BT@OCLQueue";
break;
757 case BuiltinType::OCLReserveID:
758 Out <<
"@BT@OCLReserveID";
break;
759 case BuiltinType::OCLSampler:
760 Out <<
"@BT@OCLSampler";
break;
761#define SVE_TYPE(Name, Id, SingletonId) \
762 case BuiltinType::Id: \
763 Out << "@BT@" << Name; break;
764#include "clang/Basic/AArch64SVEACLETypes.def"
765#define PPC_VECTOR_TYPE(Name, Id, Size) \
766 case BuiltinType::Id: \
767 Out << "@BT@" << #Name; break;
768#include "clang/Basic/PPCTypes.def"
769#define RVV_TYPE(Name, Id, SingletonId) \
770 case BuiltinType::Id: \
771 Out << "@BT@" << Name; break;
772#include "clang/Basic/RISCVVTypes.def"
773#define WASM_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
774#include "clang/Basic/WebAssemblyReferenceTypes.def"
775 case BuiltinType::ShortAccum:
776 Out <<
"@BT@ShortAccum";
break;
777 case BuiltinType::Accum:
778 Out <<
"@BT@Accum";
break;
779 case BuiltinType::LongAccum:
780 Out <<
"@BT@LongAccum";
break;
781 case BuiltinType::UShortAccum:
782 Out <<
"@BT@UShortAccum";
break;
783 case BuiltinType::UAccum:
784 Out <<
"@BT@UAccum";
break;
785 case BuiltinType::ULongAccum:
786 Out <<
"@BT@ULongAccum";
break;
787 case BuiltinType::ShortFract:
788 Out <<
"@BT@ShortFract";
break;
789 case BuiltinType::Fract:
790 Out <<
"@BT@Fract";
break;
791 case BuiltinType::LongFract:
792 Out <<
"@BT@LongFract";
break;
793 case BuiltinType::UShortFract:
794 Out <<
"@BT@UShortFract";
break;
795 case BuiltinType::UFract:
796 Out <<
"@BT@UFract";
break;
797 case BuiltinType::ULongFract:
798 Out <<
"@BT@ULongFract";
break;
799 case BuiltinType::SatShortAccum:
800 Out <<
"@BT@SatShortAccum";
break;
801 case BuiltinType::SatAccum:
802 Out <<
"@BT@SatAccum";
break;
803 case BuiltinType::SatLongAccum:
804 Out <<
"@BT@SatLongAccum";
break;
805 case BuiltinType::SatUShortAccum:
806 Out <<
"@BT@SatUShortAccum";
break;
807 case BuiltinType::SatUAccum:
808 Out <<
"@BT@SatUAccum";
break;
809 case BuiltinType::SatULongAccum:
810 Out <<
"@BT@SatULongAccum";
break;
811 case BuiltinType::SatShortFract:
812 Out <<
"@BT@SatShortFract";
break;
813 case BuiltinType::SatFract:
814 Out <<
"@BT@SatFract";
break;
815 case BuiltinType::SatLongFract:
816 Out <<
"@BT@SatLongFract";
break;
817 case BuiltinType::SatUShortFract:
818 Out <<
"@BT@SatUShortFract";
break;
819 case BuiltinType::SatUFract:
820 Out <<
"@BT@SatUFract";
break;
821 case BuiltinType::SatULongFract:
822 Out <<
"@BT@SatULongFract";
break;
823 case BuiltinType::BFloat16:
824 Out <<
"@BT@__bf16";
break;
825 case BuiltinType::Ibm128:
826 Out <<
"@BT@__ibm128";
break;
827 case BuiltinType::ObjCId:
829 case BuiltinType::ObjCClass:
831 case BuiltinType::ObjCSel:
833#define BUILTIN_TYPE(Id, SingletonId)
834#define PLACEHOLDER_TYPE(Id, SingletonId) case BuiltinType::Id:
835#include "clang/AST/BuiltinTypes.def"
836 case BuiltinType::Dependent:
839 IgnoreResults =
true;
847 llvm::DenseMap<const Type *, unsigned>::iterator Substitution
848 = TypeSubstitutions.find(
T.getTypePtr());
849 if (Substitution != TypeSubstitutions.end()) {
850 Out <<
'S' << Substitution->second <<
'_';
854 unsigned Number = TypeSubstitutions.size();
855 TypeSubstitutions[
T.getTypePtr()] = Number;
880 VisitType(FT->getReturnType());
882 for (
const auto &I : FT->param_types()) {
887 if (FT->isVariadic())
898 T = CT->getElementType();
903 VisitTagDecl(TT->getDecl());
908 VisitObjCInterfaceDecl(OIT->getDecl());
913 VisitType(OIT->getBaseType());
914 for (
auto *Prot : OIT->getProtocols())
915 VisitObjCProtocolDecl(Prot);
919 Out <<
't' << TTP->getDepth() <<
'.' << TTP->getIndex();
925 VisitTemplateName(Spec->getTemplateName());
926 Out << Spec->template_arguments().size();
927 for (
const auto &Arg : Spec->template_arguments())
928 VisitTemplateArgument(Arg);
934 Out <<
':' << DNT->getIdentifier()->getName();
938 T = InjT->getInjectedSpecializationType();
943 Out << VT->getNumElements();
944 T = VT->getElementType();
947 if (
const auto *
const AT = dyn_cast<ArrayType>(
T)) {
949 switch (AT->getSizeModifier()) {
950 case ArraySizeModifier::Static:
953 case ArraySizeModifier::Star:
956 case ArraySizeModifier::Normal:
960 if (
const auto *
const CAT = dyn_cast<ConstantArrayType>(
T))
961 Out << CAT->getSize();
963 T = AT->getElementType();
973void USRGenerator::VisitTemplateParameterList(
977 Out <<
'>' << Params->
size();
979 PEnd = Params->
end();
982 if (isa<TemplateTypeParmDecl>(*
P)) {
983 if (cast<TemplateTypeParmDecl>(*P)->isParameterPack())
990 if (NTTP->isParameterPack())
993 VisitType(NTTP->getType());
1005void USRGenerator::VisitTemplateName(
TemplateName Name) {
1006 if (
TemplateDecl *Template = Name.getAsTemplateDecl()) {
1008 = dyn_cast<TemplateTemplateParmDecl>(Template)) {
1009 Out <<
't' << TTP->getDepth() <<
'.' << TTP->getIndex();
1046 VisitTemplateArgument(
P);
1064 Out << Hash.CalculateHash();
1071 if (ShouldGenerateLocation(D) && GenLoc(D, isLocal(D)))
1080 if (ShouldGenerateLocation(D) && GenLoc(D, isLocal(D)))
1088void USRGenerator::VisitConceptDecl(
const ConceptDecl *D) {
1089 if (ShouldGenerateLocation(D) && GenLoc(D, isLocal(D)))
1096void USRGenerator::VisitMSGuidDecl(
const MSGuidDecl *D) {
1099 D->NamedDecl::printName(Out);
1107 StringRef CatSymDefinedIn,
1109 if (ClsSymDefinedIn.empty() && CatSymDefinedIn.empty())
1111 if (CatSymDefinedIn.empty()) {
1112 OS <<
"@M@" << ClsSymDefinedIn <<
'@';
1115 OS <<
"@CM@" << CatSymDefinedIn <<
'@';
1116 if (ClsSymDefinedIn != CatSymDefinedIn) {
1117 OS << ClsSymDefinedIn <<
'@';
1122 StringRef ExtSymDefinedIn,
1123 StringRef CategoryContextExtSymbolDefinedIn) {
1125 CategoryContextExtSymbolDefinedIn, OS);
1126 OS <<
"objc(cs)" << Cls;
1131 StringRef ClsSymDefinedIn,
1132 StringRef CatSymDefinedIn) {
1134 OS <<
"objc(cy)" << Cls <<
'@' << Cat;
1142 bool IsInstanceMethod,
1144 OS << (IsInstanceMethod ?
"(im)" :
"(cm)") << Sel;
1149 OS << (isClassProp ?
"(cpy)" :
"(py)") << Prop;
1153 StringRef ExtSymDefinedIn) {
1154 if (!ExtSymDefinedIn.empty())
1155 OS <<
"@M@" << ExtSymDefinedIn <<
'@';
1156 OS <<
"objc(pl)" << Prot;
1160 StringRef ExtSymDefinedIn) {
1161 if (!ExtSymDefinedIn.empty())
1162 OS <<
"@M@" << ExtSymDefinedIn;
1163 OS <<
"@E@" << EnumName;
1168 OS <<
'@' << EnumConstantName;
1181 if (
auto *ExternalSymAttr = CD->
getAttr<ExternalSourceSymbolAttr>()) {
1182 if (!ExternalSymAttr->getUSR().empty()) {
1183 llvm::raw_svector_ostream Out(Buf);
1184 Out << ExternalSymAttr->getUSR();
1190 return UG.ignoreResults();
1206 if (MacroName.empty())
1209 llvm::raw_svector_ostream Out(Buf);
1213 bool ShouldGenerateLocation = Loc.
isValid() && !
SM.isInSystemHeader(Loc);
1216 if (ShouldGenerateLocation)
1227 T =
T.getCanonicalType();
1229 USRGenerator UG(&Ctx, Buf);
1231 return UG.ignoreResults();
1256 OS <<
"@M@" << ModName;
Defines the clang::ASTContext interface.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
Defines the clang::FileManager interface and associated types.
This file contains the declaration of the ODRHash class, which calculates a hash based on AST nodes,...
static void combineClassAndCategoryExtContainers(StringRef ClsSymDefinedIn, StringRef CatSymDefinedIn, raw_ostream &OS)
static void printQualifier(llvm::raw_ostream &Out, ASTContext &Ctx, NestedNameSpecifier *NNS)
static bool printLoc(llvm::raw_ostream &OS, SourceLocation Loc, const SourceManager &SM, bool IncludeOffset)
static const ObjCCategoryDecl * getCategoryContext(const NamedDecl *D)
static StringRef GetExternalSourceContainer(const NamedDecl *D)
__device__ __2f16 float __ockl_bool s
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
SourceManager & getSourceManager()
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
const LangOptions & getLangOpts() const
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...
A binding in a decomposition declaration.
This class is used for builtin types like 'int'.
Represents a static or instance method of a struct/union/class.
Represents a C++ struct/union/class.
Declaration of a class template.
CXXRecordDecl * getTemplatedDecl() const
Get the underlying class declarations of the template.
Represents a class template specialization, which refers to a class template with a given set of temp...
Complex values, per C99 6.2.5p11.
Declaration of a C++20 concept.
A simple visitor class that helps create declaration visitors.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Decl - This represents one declaration (or definition), e.g.
const DeclContext * getParentFunctionOrMethod(bool LexicalParent=false) const
If this decl is defined inside a function/method/block it returns the corresponding DeclContext,...
ASTContext & getASTContext() const LLVM_READONLY
ExternalSourceSymbolAttr * getExternalSourceSymbolAttr() const
Looks on this and related declarations for an applicable external source symbol attribute.
SourceLocation getLocation() const
DeclContext * getDeclContext()
SourceLocation getBeginLoc() const LLVM_READONLY
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
The name of a declaration.
void print(raw_ostream &OS, const PrintingPolicy &Policy) const
bool isEmpty() const
Evaluates true when this declaration name is empty.
Represents a qualified type name for which the type name is dependent.
Represents a member of a struct/union/class.
StringRef getName() const
The name of this FileEntry.
Represents a function declaration or definition.
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
QualType getReturnType() const
bool isVariadic() const
Whether this function is variadic.
const TemplateArgumentList * getTemplateSpecializationArgs() const
Retrieve the template arguments used to produce this function template specialization from the primar...
bool isExternC() const
Determines whether this function is a function with external, C linkage.
Represents a prototype with parameter type info, e.g.
Declaration of a template function.
FunctionDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
StringRef getName() const
Return the actual identifier string.
The injected class name of a C++ class template or class template partial specialization.
Represents a linkage specification.
Record the location of a macro definition.
SourceLocation getLocation() const
Retrieve the location of the macro name in the definition.
const IdentifierInfo * getName() const
Retrieve the name of the macro being defined.
Describes a module or submodule.
Module * Parent
The parent of this module.
std::string Name
The name of this module.
This represents a decl that may have a name.
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
bool isExternallyVisible() const
Represents a C++ namespace alias.
Represent a C++ namespace.
bool isAnonymousNamespace() const
Returns true if this is an anonymous namespace declaration.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool ResolveTemplateArguments=false) const
Print this nested name specifier to the given output stream.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
void AddStructuralValue(const APValue &)
ObjCCategoryDecl - Represents a category declaration.
ObjCInterfaceDecl * getClassInterface()
bool IsClassExtension() const
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
ObjCContainerDecl - Represents a container for method declarations.
const ObjCInterfaceDecl * getClassInterface() const
Represents an ObjC class declaration.
Interfaces are the core concept in Objective-C for object oriented design.
ObjCMethodDecl - Represents an instance or class method declaration.
Selector getSelector() const
bool isInstanceMethod() const
ObjCInterfaceDecl * getClassInterface()
Represents a pointer to an Objective C object.
Represents a class type in Objective C.
Represents one property declaration in an Objective-C interface.
bool isClassProperty() const
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
ObjCPropertyDecl * getPropertyDecl() const
Represents an Objective-C protocol declaration.
Represents a pack expansion of types.
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
QualType getCanonicalType() const
The collection of all-type qualifiers we support.
An rvalue reference type, per C++11 [dcl.ref].
Base for LValueReferenceType and RValueReferenceType.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
This class handles loading and caching of source files into memory.
Represents the declaration of a struct/union/class/enum.
bool isEmbeddedInDeclarator() const
True if this tag declaration is "embedded" (i.e., defined or declared for the very first time) in the...
TypedefNameDecl * getTypedefNameForAnonDecl() const
TagDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
bool isFreeStanding() const
True if this tag is free standing, e.g. "struct foo;".
TagKind getTagKind() const
A template argument list.
unsigned size() const
Retrieve the number of template arguments in this template argument list.
const TemplateArgument & get(unsigned Idx) const
Retrieve the template argument at a given index.
Represents a template argument.
QualType getStructuralValueType() const
Get the type of a StructuralValue.
QualType getAsType() const
Retrieve the type for a type template argument.
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
unsigned pack_size() const
The number of template arguments in the given template argument pack.
QualType getIntegralType() const
Retrieve the type of the integral value.
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
ArrayRef< TemplateArgument > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
@ Declaration
The template argument is a declaration that was provided for a pointer, reference,...
@ Template
The template argument is a template name that was provided for a template template parameter.
@ StructuralValue
The template argument is a non-type template argument that can't be represented by the special-case D...
@ Pack
The template argument is actually a parameter pack.
@ TemplateExpansion
The template argument is a pack expansion of a template name that was provided for a template templat...
@ NullPtr
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
@ Type
The template argument is a type.
@ Null
Represents an empty template argument, e.g., one that has not been deduced.
@ Integral
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
@ Expression
The template argument is an expression, and we've not resolved it to one of the other forms yet,...
ArgKind getKind() const
Return the kind of stored template argument.
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion,...
const APValue & getAsStructuralValue() const
Get the value of a StructuralValue.
The base class of all kinds of template declarations (e.g., class, function, etc.).
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Represents a C++ template name within the type system.
Stores a list of template parameters for a TemplateDecl and its derived classes.
NamedDecl *const * const_iterator
Iterates through the template parameters in this list.
Represents a type template specialization; the template must be a class template, a type alias templa...
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
Declaration of a template type parameter.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
bool isExtVectorType() const
const T * getAs() const
Member-template getAs<specific type>'.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Base class for declarations which introduce a typedef-name.
Represents a dependent using declaration which was marked with typename.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Represents a dependent using declaration which was not marked with typename.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Represents a C++ using-declaration.
Represents C++ using-directive.
Represents a variable declaration or definition.
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
Declaration of a variable template.
Represents a variable template specialization, which refers to a variable template with a given set o...
Represents a GCC generic vector type.
const internal::VariadicAllOfMatcher< Attr > attr
Matches attributes.
bool generateFullUSRForTopLevelModuleName(StringRef ModName, raw_ostream &OS)
Generate a USR for a top-level module name, including the USR prefix.
static StringRef getUSRSpacePrefix()
void generateUSRForObjCCategory(StringRef Cls, StringRef Cat, raw_ostream &OS, StringRef ClsExtSymbolDefinedIn="", StringRef CatExtSymbolDefinedIn="")
Generate a USR fragment for an Objective-C class category.
bool generateFullUSRForModule(const Module *Mod, raw_ostream &OS)
Generate a USR for a module, including the USR prefix.
bool generateUSRFragmentForModuleName(StringRef ModName, raw_ostream &OS)
Generate a USR fragment for a module name.
bool generateUSRForMacro(const MacroDefinitionRecord *MD, const SourceManager &SM, SmallVectorImpl< char > &Buf)
Generate a USR for a macro, including the USR prefix.
void generateUSRForObjCProperty(StringRef Prop, bool isClassProp, raw_ostream &OS)
Generate a USR fragment for an Objective-C property.
void generateUSRForEnumConstant(StringRef EnumConstantName, raw_ostream &OS)
Generate a USR fragment for an enum constant.
void generateUSRForObjCIvar(StringRef Ivar, raw_ostream &OS)
Generate a USR fragment for an Objective-C instance variable.
void generateUSRForObjCMethod(StringRef Sel, bool IsInstanceMethod, raw_ostream &OS)
Generate a USR fragment for an Objective-C method.
bool generateUSRForType(QualType T, ASTContext &Ctx, SmallVectorImpl< char > &Buf)
Generates a USR for a type.
void generateUSRForObjCClass(StringRef Cls, raw_ostream &OS, StringRef ExtSymbolDefinedIn="", StringRef CategoryContextExtSymbolDefinedIn="")
Generate a USR fragment for an Objective-C class.
void generateUSRForGlobalEnum(StringRef EnumName, raw_ostream &OS, StringRef ExtSymbolDefinedIn="")
Generate USR fragment for a global (non-nested) enum.
void generateUSRForObjCProtocol(StringRef Prot, raw_ostream &OS, StringRef ExtSymbolDefinedIn="")
Generate a USR fragment for an Objective-C protocol.
bool generateUSRFragmentForModule(const Module *Mod, raw_ostream &OS)
Generate a USR fragment for a module.
bool generateUSRForDecl(const Decl *D, SmallVectorImpl< char > &Buf)
Generate a USR for a Decl, including the USR prefix.
The JSON file list parser is used to communicate input to InstallAPI.
@ RQ_None
No ref-qualifier was provided.
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
const FunctionProtoType * T
Describes how types, statements, expressions, and declarations should be printed.
unsigned SuppressUnwrittenScope
Suppress printing parts of scope specifiers that are never written, e.g., for anonymous namespaces.
unsigned AnonymousTagLocations
When printing an anonymous tag name, also print the location of that entity (e.g.,...
unsigned ConstantArraySizeAsWritten
Whether we should print the sizes of constant array expressions as written in the sources.
unsigned SuppressTagKeyword
Whether type printing should skip printing the tag keyword.