25 assert(S &&
"Expecting non-null pointer.");
26 S->ProcessODRHash(ID, *
this);
30 assert(II &&
"Expecting non-null pointer.");
39 AddDeclarationNameImpl(Name);
48 auto Result = DeclNameMap.insert(std::make_pair(Name, DeclNameMap.size()));
49 ID.AddInteger(
Result.first->second);
60 auto Kind = Name.getNameKind();
73 unsigned NumArgs = S.getNumArgs();
74 ID.AddInteger(NumArgs);
77 unsigned SlotsToCheck = NumArgs > 0 ? NumArgs : 1;
78 for (
unsigned i = 0; i < SlotsToCheck; ++i) {
92 ID.AddInteger(Name.getCXXOverloadedOperator());
103 auto *Template = Name.getCXXDeductionGuideTemplate();
113 assert(NNS &&
"Expecting non-null pointer.");
142 auto Kind = Name.getKind();
147 AddDecl(Name.getAsTemplateDecl());
169 const auto Kind = TA.
getKind();
174 llvm_unreachable(
"Expected valid TemplateArgument");
182 ID.AddPointer(
nullptr);
211 assert(TPL &&
"Expecting non-null pointer.");
213 ID.AddInteger(TPL->
size());
214 for (
auto *ND : TPL->
asArray()) {
230 const unsigned size = Bools.size();
231 const unsigned remainder = size % unsigned_bits;
232 const unsigned loops = size / unsigned_bits;
233 auto I = Bools.rbegin();
235 for (
unsigned i = 0; i <
remainder; ++i) {
240 ID.AddInteger(value);
242 for (
unsigned i = 0; i < loops; ++i) {
244 for (
unsigned j = 0; j < unsigned_bits; ++j) {
249 ID.AddInteger(value);
252 assert(I == Bools.rend());
254 return ID.computeStableHash();
262 llvm::FoldingSetNodeID &
ID;
266 ODRDeclVisitor(llvm::FoldingSetNodeID &
ID,
ODRHash &Hash)
267 :
ID(
ID), Hash(Hash) {}
269 void AddStmt(
const Stmt *S) {
287 void AddDecl(
const Decl *
D) {
298 void Visit(
const Decl *
D) {
305 Inherited::VisitNamedDecl(
D);
309 if (
auto *DD = dyn_cast<DeclaratorDecl>(
D); DD && DD->getTypeSourceInfo())
310 AddQualType(DD->getTypeSourceInfo()->getType());
312 Inherited::VisitValueDecl(
D);
315 void VisitVarDecl(
const VarDecl *
D) {
318 const bool HasInit =
D->hasInit();
321 AddStmt(
D->getInit());
323 Inherited::VisitVarDecl(
D);
328 Inherited::VisitParmVarDecl(
D);
333 Inherited::VisitAccessSpecDecl(
D);
337 AddStmt(
D->getAssertExpr());
338 AddStmt(
D->getMessage());
340 Inherited::VisitStaticAssertDecl(
D);
344 const bool IsBitfield =
D->isBitField();
348 AddStmt(
D->getBitWidth());
352 AddStmt(
D->getInClassInitializer());
354 Inherited::VisitFieldDecl(
D);
358 ID.AddInteger(
D->getCanonicalAccessControl());
359 Inherited::VisitObjCIvarDecl(
D);
363 ID.AddInteger(
D->getPropertyAttributes());
364 ID.AddInteger(
D->getPropertyImplementation());
365 AddQualType(
D->getTypeSourceInfo()->getType());
368 Inherited::VisitObjCPropertyDecl(
D);
373 ID.AddInteger(
D->getODRHash());
375 Inherited::VisitFunctionDecl(
D);
381 Inherited::VisitCXXMethodDecl(
D);
399 ID.AddInteger(llvm::to_underlying(
Cmd->getParameterKind()));
404 ID.AddInteger(llvm::to_underlying(Self->getParameterKind()));
429 Decls.push_back(SubDecl);
431 ID.AddInteger(Decls.size());
432 for (
auto SubDecl : Decls)
439 Inherited::VisitObjCMethodDecl(Method);
443 AddQualType(
D->getUnderlyingType());
445 Inherited::VisitTypedefNameDecl(
D);
449 Inherited::VisitTypedefDecl(
D);
453 Inherited::VisitTypeAliasDecl(
D);
462 AddDecl(
D->getFriendDecl());
469 const bool hasDefaultArgument =
470 D->hasDefaultArgument() && !
D->defaultArgumentWasInherited();
472 if (hasDefaultArgument) {
473 AddTemplateArgument(
D->getDefaultArgument().getArgument());
482 Inherited::VisitTemplateTypeParmDecl(
D);
487 const bool hasDefaultArgument =
488 D->hasDefaultArgument() && !
D->defaultArgumentWasInherited();
490 if (hasDefaultArgument) {
491 AddTemplateArgument(
D->getDefaultArgument().getArgument());
495 Inherited::VisitNonTypeTemplateParmDecl(
D);
500 const bool hasDefaultArgument =
501 D->hasDefaultArgument() && !
D->defaultArgumentWasInherited();
503 if (hasDefaultArgument) {
504 AddTemplateArgument(
D->getDefaultArgument().getArgument());
508 Inherited::VisitTemplateTemplateParmDecl(
D);
514 Inherited::VisitTemplateDecl(
D);
519 Inherited::VisitRedeclarableTemplateDecl(
D);
523 AddDecl(
D->getTemplatedDecl());
524 ID.AddInteger(
D->getTemplatedDecl()->getODRHash());
525 Inherited::VisitFunctionTemplateDecl(
D);
529 AddStmt(
D->getInitExpr());
530 Inherited::VisitEnumConstantDecl(
D);
544 case Decl::AccessSpec:
545 case Decl::CXXConstructor:
546 case Decl::CXXDestructor:
547 case Decl::CXXMethod:
548 case Decl::EnumConstant:
551 case Decl::FunctionTemplate:
552 case Decl::StaticAssert:
553 case Decl::TypeAlias:
556 case Decl::ObjCMethod:
558 case Decl::ObjCProperty:
564 assert(
D &&
"Expecting non-null pointer.");
566 ODRDeclVisitor(ID, *
this).Visit(
D);
571 "Expected non-null record to be a definition.");
575 if (isa<ClassTemplateSpecializationDecl>(DC)) {
588 Decls.push_back(SubDecl);
589 if (
auto *
Function = dyn_cast<FunctionDecl>(SubDecl)) {
596 ID.AddInteger(Decls.size());
597 for (
auto SubDecl : Decls) {
607 ID.AddInteger(
Record->getNumBases());
608 auto Bases =
Record->bases();
609 for (
const auto &
Base : Bases) {
611 ID.AddInteger(
Base.isVirtual());
612 ID.AddInteger(
Base.getAccessSpecifierAsWritten());
617 assert(!isa<CXXRecordDecl>(
Record) &&
618 "For CXXRecordDecl should call AddCXXRecordDecl.");
626 Decls.push_back(SubDecl);
629 ID.AddInteger(Decls.size());
630 for (
const Decl *SubDecl : Decls)
640 ID.AddInteger(SuperClass->getODRHash());
654 Decls.push_back(SubDecl);
656 ID.AddInteger(Decls.size());
657 for (
auto *SubDecl : Decls)
663 assert(
Function &&
"Expecting non-null pointer.");
668 if (isa<ClassTemplateSpecializationDecl>(DC))
return;
669 if (
auto *F = dyn_cast<FunctionDecl>(DC)) {
670 if (F->isFunctionTemplateSpecialization()) {
671 if (!isa<CXXMethodDecl>(DC))
return;
675 if (F->getDependentSpecializationInfo())
684 ID.AddInteger(
Function->getDeclKind());
686 const auto *SpecializationArgs =
Function->getTemplateSpecializationArgs();
688 if (SpecializationArgs) {
689 ID.AddInteger(SpecializationArgs->size());
695 if (
const auto *Method = dyn_cast<CXXMethodDecl>(
Function)) {
700 ID.AddInteger(
Function->getStorageClass());
711 ID.AddString(DeletedMessage->
getBytes());
717 ID.AddInteger(
Function->param_size());
718 for (
auto *Param :
Function->parameters())
726 const bool HasBody =
Function->isThisDeclarationADefinition() &&
744 Decls.push_back(SubDecl);
748 ID.AddInteger(Decls.size());
749 for (
auto SubDecl : Decls) {
759 if (
Enum->isScoped())
762 if (
Enum->getIntegerTypeSourceInfo())
768 for (
Decl *SubDecl :
Enum->decls()) {
770 assert(isa<EnumConstantDecl>(SubDecl) &&
"Unexpected Decl");
771 Decls.push_back(SubDecl);
775 ID.AddInteger(Decls.size());
776 for (
auto SubDecl : Decls) {
786 ID.AddInteger(
P->getReferencedProtocols().size());
795 for (
Decl *SubDecl :
P->decls()) {
797 Decls.push_back(SubDecl);
801 ID.AddInteger(Decls.size());
802 for (
auto *SubDecl : Decls) {
808 assert(
D &&
"Expecting non-null pointer.");
821 dyn_cast<ClassTemplateSpecializationDecl>(
D);
825 ID.AddInteger(List.size());
834class ODRTypeVisitor :
public TypeVisitor<ODRTypeVisitor> {
836 llvm::FoldingSetNodeID &
ID;
840 ODRTypeVisitor(llvm::FoldingSetNodeID &
ID,
ODRHash &Hash)
841 :
ID(
ID), Hash(Hash) {}
843 void AddStmt(
Stmt *S) {
850 void AddDecl(
const Decl *
D) {
861 void AddType(
const Type *
T) {
888 static const Type *RemoveTypedef(
const Type *
T) {
889 const auto *TypedefT = dyn_cast<TypedefType>(
T);
895 QualType UnderlyingType =
D->getUnderlyingType();
901 const auto *ElaboratedT = dyn_cast<ElaboratedType>(UnderlyingType);
906 if (ElaboratedT->getQualifier() !=
nullptr) {
910 QualType NamedType = ElaboratedT->getNamedType();
915 const auto *RecordT = dyn_cast<RecordType>(NamedType);
920 const IdentifierInfo *TypedefII = TypedefT->getDecl()->getIdentifier();
921 const IdentifierInfo *RecordII = RecordT->getDecl()->getIdentifier();
922 if (!TypedefII || !RecordII ||
930 void Visit(
const Type *
T) {
931 T = RemoveTypedef(
T);
936 void VisitType(
const Type *
T) {}
939 AddQualType(
T->getOriginalType());
947 VisitAdjustedType(
T);
951 AddQualType(
T->getElementType());
952 ID.AddInteger(llvm::to_underlying(
T->getSizeModifier()));
953 VisitQualifiers(
T->getIndexTypeQualifiers());
962 VisitConstantArrayType(
T);
966 AddStmt(
T->getSizeExpr());
975 AddStmt(
T->getSizeExpr());
980 ID.AddInteger(
T->getAttrKind());
981 AddQualType(
T->getModifiedType());
992 ID.AddInteger(
T->getKind());
997 AddQualType(
T->getElementType());
1002 AddStmt(
T->getUnderlyingExpr());
1007 VisitDecltypeType(
T);
1011 AddQualType(
T->getDeducedType());
1016 ID.AddInteger((
unsigned)
T->getKeyword());
1017 ID.AddInteger(
T->isConstrained());
1018 if (
T->isConstrained()) {
1019 AddDecl(
T->getTypeConstraintConcept());
1020 ID.AddInteger(
T->getTypeConstraintArguments().size());
1021 for (
const auto &TA :
T->getTypeConstraintArguments())
1024 VisitDeducedType(
T);
1027 void VisitDeducedTemplateSpecializationType(
1030 VisitDeducedType(
T);
1035 AddStmt(
T->getAddrSpaceExpr());
1040 AddQualType(
T->getElementType());
1041 AddStmt(
T->getSizeExpr());
1055 VisitFunctionType(
T);
1061 AddQualType(ParamType);
1063 VisitFunctionType(
T);
1067 AddDecl(
T->getDecl());
1073 AddType(
T->getClass());
1083 AddDecl(
T->getInterface());
1085 auto TypeArgs =
T->getTypeArgsAsWritten();
1086 ID.AddInteger(TypeArgs.size());
1087 for (
auto Arg : TypeArgs) {
1091 auto Protocols =
T->getProtocols();
1092 ID.AddInteger(Protocols.size());
1093 for (
auto *Protocol : Protocols) {
1104 VisitObjCObjectType(
T);
1108 AddDecl(
T->getDecl());
1109 auto Protocols =
T->getProtocols();
1110 ID.AddInteger(Protocols.size());
1111 for (
auto *Protocol : Protocols) {
1119 AddQualType(
T->getPattern());
1124 AddQualType(
T->getInnerType());
1129 AddQualType(
T->getElementType());
1140 AddQualType(
T->getPointeeTypeAsWritten());
1145 VisitReferenceType(
T);
1149 VisitReferenceType(
T);
1154 AddDecl(
T->getAssociatedDecl());
1160 AddDecl(
T->getAssociatedDecl());
1161 AddQualType(
T->getReplacementType());
1165 void VisitTagType(
const TagType *
T) {
1166 AddDecl(
T->getDecl());
1170 void VisitRecordType(
const RecordType *
T) { VisitTagType(
T); }
1171 void VisitEnumType(
const EnumType *
T) { VisitTagType(
T); }
1174 ID.AddInteger(
T->template_arguments().size());
1175 for (
const auto &TA :
T->template_arguments()) {
1183 ID.AddInteger(
T->getDepth());
1184 ID.AddInteger(
T->getIndex());
1186 AddDecl(
T->getDecl());
1190 AddDecl(
T->getDecl());
1195 AddStmt(
T->getUnderlyingExpr());
1201 AddQualType(
T->getUnmodifiedType());
1206 ID.AddInteger(llvm::to_underlying(
T->getKeyword()));
1211 AddNestedNameSpecifier(
T->getQualifier());
1212 AddIdentifierInfo(
T->getIdentifier());
1213 VisitTypeWithKeyword(
T);
1216 void VisitDependentTemplateSpecializationType(
1218 AddIdentifierInfo(
T->getIdentifier());
1219 AddNestedNameSpecifier(
T->getQualifier());
1220 ID.AddInteger(
T->template_arguments().size());
1221 for (
const auto &TA :
T->template_arguments()) {
1224 VisitTypeWithKeyword(
T);
1228 AddNestedNameSpecifier(
T->getQualifier());
1229 AddQualType(
T->getNamedType());
1230 VisitTypeWithKeyword(
T);
1234 AddQualType(
T->getUnderlyingType());
1235 AddQualType(
T->getBaseType());
1240 AddDecl(
T->getDecl());
1245 AddQualType(
T->getElementType());
1246 ID.AddInteger(
T->getNumElements());
1247 ID.AddInteger(llvm::to_underlying(
T->getVectorKind()));
1258 assert(
T &&
"Expecting non-null pointer.");
1259 ODRTypeVisitor(ID, *
this).Visit(
T);
1272 Bools.push_back(
Value);
1286 ID.AddInteger(
Value.getLValueOffset().getQuantity());
1292 ID.AddInteger(
Value.getLValueOffset().getQuantity());
1294 bool OnePastTheEnd =
Value.isLValueOnePastTheEnd();
1295 if (
Value.hasLValuePath()) {
1299 if (
const auto *CAT = dyn_cast<ConstantArrayType>(AT))
1300 OnePastTheEnd |= CAT->getSize() ==
E.getAsArrayIndex();
1301 TypeSoFar = AT->getElementType();
1303 const Decl *
D =
E.getAsBaseOrMember().getPointer();
1304 if (
const auto *FD = dyn_cast<FieldDecl>(
D)) {
1305 if (FD->getParent()->isUnion())
1306 ID.AddInteger(FD->getFieldIndex());
1307 TypeSoFar = FD->getType();
1316 if (
Value.isNullPointer())
1320 if (
Value.hasLValuePath())
llvm::MachO::Record Record
This file contains the declaration of the ODRHash class, which calculates a hash based on AST nodes,...
A non-discriminated union of a base, field, or array index.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
CharUnits getMemberPointerPathAdjustment(const APValue &MP) const
Find the 'this' offset for the member path in a pointer-to-member APValue.
QualType getRecordType(const RecordDecl *Decl) const
Represents an access specifier followed by colon ':'.
Represents a type which was implicitly adjusted by the semantic engine for arbitrary reasons.
Represents a constant array type that does not decay to a pointer when used as a function parameter.
Represents an array type, per C99 6.7.5.2 - Array Declarators.
An attributed type is a type to which a type attribute has been applied.
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
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.
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
Declaration of a class template.
Complex values, per C99 6.2.5p11.
A simple visitor class that helps create declaration visitors.
Represents the canonical version of C arrays with a specified constant size.
Represents a pointer type decayed from an array or function type.
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.
bool isFileContext() const
DeclContext * getLexicalParent()
getLexicalParent - Returns the containing lexical DeclContext.
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
Decl::Kind getDeclKind() const
Decl - This represents one declaration (or definition), e.g.
ASTContext & getASTContext() const LLVM_READONLY
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
bool isParameterPack() const
Whether this declaration is a parameter pack.
DeclContext * getDeclContext()
AccessSpecifier getAccess() const
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
The name of a declaration.
@ CXXConversionFunctionName
Represents the type decltype(expr) (C++11).
Represents a C++17 deduced template specialization type.
Common base class for placeholders for types that get replaced by placeholder type deduction: C++11 a...
Represents an extended address space qualifier where the input address space value is dependent.
Internal representation of canonical, dependent decltype(expr) types.
Represents a qualified type name for which the type name is dependent.
Represents an array type in C++ whose size is a value-dependent expression.
Represents an extended vector type where either the type or size is dependent.
Represents a template specialization type whose template cannot be resolved, e.g.
Represents a type that was referred to using an elaborated type keyword, e.g., struct S,...
An instance of this object exists for each enum constant that is defined.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums.
ExtVectorType - Extended vector type.
Represents a member of a struct/union/class.
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Represents a function declaration or definition.
Represents a K&R-style 'int foo()' function, which has no information available about its arguments.
Represents a prototype with parameter type info, e.g.
unsigned getNumParams() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx)
ArrayRef< QualType > getParamTypes() const
Declaration of a template function.
void Profile(llvm::FoldingSetNodeID &ID) const
FunctionType - C99 6.7.5.3 - Function Declarators.
ExtInfo getExtInfo() const
QualType getReturnType() const
One of these records is kept for each identifier that is lexed.
StringRef getName() const
Return the actual identifier string.
Represents a C array with an unspecified size.
The injected class name of a C++ class template or class template partial specialization.
An lvalue reference type, per C++11 [dcl.ref].
A pointer to member type per C++ 8.3.3 - Pointers to members.
This represents a decl that may have a name.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
IdentifierInfo * getAsIdentifier() const
Retrieve the identifier stored in this nested name specifier.
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
@ NamespaceAlias
A namespace alias, stored as a NamespaceAliasDecl*.
@ TypeSpec
A type, stored as a Type*.
@ TypeSpecWithTemplate
A type that was preceded by the 'template' keyword, stored as a Type*.
@ Super
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in.
@ Identifier
An identifier, stored as an IdentifierInfo*.
@ Global
The global specifier '::'. There is no stored value.
@ Namespace
A namespace, stored as a NamespaceDecl*.
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
void AddDecl(const Decl *D)
void AddStmt(const Stmt *S)
void AddStructuralValue(const APValue &)
void AddCXXRecordDecl(const CXXRecordDecl *Record)
void AddIdentifierInfo(const IdentifierInfo *II)
void AddObjCProtocolDecl(const ObjCProtocolDecl *P)
void AddDeclarationName(DeclarationName Name, bool TreatAsDecl=false)
void AddObjCInterfaceDecl(const ObjCInterfaceDecl *Record)
void AddType(const Type *T)
void AddEnumDecl(const EnumDecl *Enum)
void AddNestedNameSpecifier(const NestedNameSpecifier *NNS)
void AddFunctionDecl(const FunctionDecl *Function, bool SkipBody=false)
void AddBoolean(bool value)
void AddTemplateName(TemplateName Name)
void AddRecordDecl(const RecordDecl *Record)
void AddSubDecl(const Decl *D)
void AddQualType(QualType T)
void AddTemplateParameterList(const TemplateParameterList *TPL)
void AddTemplateArgument(TemplateArgument TA)
static bool isSubDeclToBeProcessed(const Decl *D, const DeclContext *Parent)
Represents an ObjC class declaration.
protocol_range protocols() const
const ObjCProtocolList & getReferencedProtocols() const
ObjCInterfaceDecl * getSuperClass() const
Interfaces are the core concept in Objective-C for object oriented design.
ObjCIvarDecl - Represents an ObjC instance variable.
ObjCMethodDecl - Represents an instance or class method declaration.
ImplicitParamDecl * getSelfDecl() const
bool hasBody() const override
Determine whether this method has a body.
ArrayRef< ParmVarDecl * > parameters() const
unsigned param_size() const
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
TypeSourceInfo * getReturnTypeSourceInfo() const
bool isSynthesizedAccessorStub() const
bool isDirectMethod() const
True if the method is tagged as objc_direct.
ImplicitParamDecl * getCmdDecl() const
bool isInstanceMethod() const
bool isThisDeclarationADefinition() const
Returns whether this specific method is a definition.
bool isThisDeclarationADesignatedInitializer() const
Returns true if this specific method declaration is marked with the designated initializer attribute.
ObjCMethodFamily getMethodFamily() const
Determines the family of this method.
ObjCImplementationControl getImplementationControl() const
bool hasSkippedBody() const
True if the method was a definition but its body was skipped.
Represents a pointer to an Objective C object.
Represents a class type in Objective C.
Represents one property declaration in an Objective-C interface.
Represents an Objective-C protocol declaration.
Represents a type parameter type in Objective C.
Represents a pack expansion of types.
Sugar for parentheses used when specifying types.
Represents a parameter to a function.
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
bool hasLocalQualifiers() const
Determine whether this particular QualType instance has any qualifiers, without looking through any t...
Represents a template name as written in source code.
TemplateName getUnderlyingTemplate() const
Return the underlying template name.
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
bool hasTemplateKeyword() const
Whether the template name was prefixed by the "template" keyword.
The collection of all-type qualifiers we support.
uint64_t getAsOpaqueValue() const
An rvalue reference type, per C++11 [dcl.ref].
Represents a struct/union/class.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Declaration of a redeclarable template.
Base for LValueReferenceType and RValueReferenceType.
Smart pointer class that efficiently represents Objective-C method names.
Represents a C++11 static_assert declaration.
Stmt - This represents one statement.
StringLiteral - This represents a string literal expression, e.g.
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
Represents the result of substituting a set of types for a template type parameter pack.
Represents the result of substituting a type for a template type parameter.
A template argument list.
Represents a template argument.
QualType getStructuralValueType() const
Get the type of a StructuralValue.
Expr * getAsExpr() const
Retrieve the template argument as an expression.
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.
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.
@ UsingTemplate
A template name that refers to a template declaration found through a specific using shadow declarati...
@ OverloadedTemplate
A set of overloaded template declarations.
@ Template
A single template declaration.
@ DependentTemplate
A dependent template name that has not been resolved to a template (or set of templates).
@ SubstTemplateTemplateParm
A template template parameter that has been substituted for some other template name.
@ SubstTemplateTemplateParmPack
A template template parameter pack that has been substituted for a template template argument pack,...
@ QualifiedTemplate
A qualified template name, where the qualification is kept to describe the source code as written.
@ AssumedTemplate
An unqualified-id that has been assumed to name a function template that will be found by ADL.
Stores a list of template parameters for a TemplateDecl and its derived classes.
ArrayRef< NamedDecl * > asArray()
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.
Declaration of a template type parameter.
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Models the abbreviated syntax to constrain a template type parameter: template <convertible_to<string...
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint,...
Represents a typeof (or typeof) expression (a C23 feature and GCC extension) or a typeof_unqual expre...
Represents typeof(type), a C23 feature and GCC extension, or `typeof_unqual(type),...
A container of type source information.
QualType getType() const
Return the type wrapped by this type source info.
A helper class for Type nodes having an ElaboratedTypeKeyword.
The base class of the type hierarchy.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
const ArrayType * getAsArrayTypeUnsafe() const
A variant of getAs<> for array types which silently discards qualifiers from the outermost type.
TypeClass getTypeClass() const
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Base class for declarations which introduce a typedef-name.
Represents the dependent type named by a dependently-scoped typename using declaration,...
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a variable declaration or definition.
Represents a C array with a specified size that is not an integer-constant-expression.
Represents a GCC generic vector type.
The JSON file list parser is used to communicate input to InstallAPI.
@ Specialization
We are substituting template parameters for template arguments in order to form a template specializa...
@ Result
The result type of a method or function.
const FunctionProtoType * T
@ Enum
The "enum" keyword introduces the elaborated-type-specifier.
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
const Type * Ty
The locally-unqualified type.
Qualifiers Quals
The local qualifiers.
#define remainder(__x, __y)