24 assert(S &&
"Expecting non-null pointer.");
29 assert(II &&
"Expecting non-null pointer.");
39 AddDeclarationNameInfoImpl(NameInfo);
49 auto Result = DeclNameMap.insert(std::make_pair(Name, DeclNameMap.size()));
50 ID.AddInteger(
Result.first->second);
75 ID.AddInteger(NumArgs);
78 unsigned SlotsToCheck = NumArgs > 0 ? NumArgs : 1;
79 for (
unsigned i = 0; i < SlotsToCheck; ++i) {
116 ID.AddInteger(llvm::to_underlying(Kind));
140 ID.AddInteger(IO.getOperator());
170 llvm_unreachable(
"Unexpected DeducedTemplate");
175 const auto Kind = TA.
getKind();
180 llvm_unreachable(
"Expected valid TemplateArgument");
188 ID.AddPointer(
nullptr);
217 assert(TPL &&
"Expecting non-null pointer.");
219 ID.AddInteger(TPL->
size());
220 for (
auto *ND : TPL->
asArray()) {
236 const unsigned size = Bools.size();
237 const unsigned remainder = size % unsigned_bits;
238 const unsigned loops = size / unsigned_bits;
239 auto I = Bools.rbegin();
241 for (
unsigned i = 0; i <
remainder; ++i) {
246 ID.AddInteger(value);
248 for (
unsigned i = 0; i < loops; ++i) {
250 for (
unsigned j = 0; j < unsigned_bits; ++j) {
255 ID.AddInteger(value);
258 assert(I == Bools.rend());
260 return ID.computeStableHash();
268 llvm::FoldingSetNodeID &ID;
272 ODRDeclVisitor(llvm::FoldingSetNodeID &ID,
ODRHash &Hash)
273 : ID(ID), Hash(Hash) {}
275 void AddStmt(
const Stmt *S) {
282 void AddIdentifierInfo(
const IdentifierInfo *II) {
289 void AddQualType(QualType
T) {
293 void AddDecl(
const Decl *D) {
300 void AddTemplateArgument(TemplateArgument TA) {
304 void Visit(
const Decl *D) {
309 void VisitNamedDecl(
const NamedDecl *D) {
310 if (
const auto *FD = dyn_cast<FunctionDecl>(D))
314 Inherited::VisitNamedDecl(D);
317 void VisitValueDecl(
const ValueDecl *D) {
318 if (
auto *DD = dyn_cast<DeclaratorDecl>(D); DD && DD->getTypeSourceInfo())
319 AddQualType(DD->getTypeSourceInfo()->getType());
321 Inherited::VisitValueDecl(D);
324 void VisitVarDecl(
const VarDecl *D) {
327 const bool HasInit = D->
hasInit();
332 Inherited::VisitVarDecl(D);
335 void VisitParmVarDecl(
const ParmVarDecl *D) {
337 Inherited::VisitParmVarDecl(D);
340 void VisitAccessSpecDecl(
const AccessSpecDecl *D) {
342 Inherited::VisitAccessSpecDecl(D);
345 void VisitStaticAssertDecl(
const StaticAssertDecl *D) {
349 Inherited::VisitStaticAssertDecl(D);
352 void VisitFieldDecl(
const FieldDecl *D) {
363 Inherited::VisitFieldDecl(D);
366 void VisitObjCIvarDecl(
const ObjCIvarDecl *D) {
368 Inherited::VisitObjCIvarDecl(D);
371 void VisitObjCPropertyDecl(
const ObjCPropertyDecl *D) {
377 Inherited::VisitObjCPropertyDecl(D);
380 void VisitFunctionDecl(
const FunctionDecl *D) {
384 Inherited::VisitFunctionDecl(D);
387 void VisitCXXMethodDecl(
const CXXMethodDecl *D) {
390 Inherited::VisitCXXMethodDecl(D);
393 void VisitObjCMethodDecl(
const ObjCMethodDecl *
Method) {
394 ID.AddInteger(
Method->getDeclKind());
403 ID.AddInteger(llvm::to_underlying(
Method->getImplementationControl()));
404 ID.AddInteger(
Method->getMethodFamily());
405 ImplicitParamDecl *Cmd =
Method->getCmdDecl();
410 ImplicitParamDecl *
Self =
Method->getSelfDecl();
413 ID.AddInteger(llvm::to_underlying(
Self->getParameterKind()));
417 if (
Method->getReturnTypeSourceInfo())
418 AddQualType(
Method->getReturnTypeSourceInfo()->getType());
420 ID.AddInteger(
Method->param_size());
421 for (
auto Param :
Method->parameters())
425 const bool IsDefinition =
Method->isThisDeclarationADefinition();
428 Stmt *Body =
Method->getBody();
435 llvm::SmallVector<const Decl *, 16> Decls;
436 for (Decl *SubDecl :
Method->decls())
438 Decls.push_back(SubDecl);
440 ID.AddInteger(Decls.size());
441 for (
auto SubDecl : Decls)
448 Inherited::VisitObjCMethodDecl(
Method);
451 void VisitTypedefNameDecl(
const TypedefNameDecl *D) {
454 Inherited::VisitTypedefNameDecl(D);
457 void VisitTypedefDecl(
const TypedefDecl *D) {
458 Inherited::VisitTypedefDecl(D);
461 void VisitTypeAliasDecl(
const TypeAliasDecl *D) {
462 Inherited::VisitTypeAliasDecl(D);
465 void VisitFriendDecl(
const FriendDecl *D) {
476 void VisitTemplateTypeParmDecl(
const TemplateTypeParmDecl *D) {
478 const bool hasDefaultArgument =
481 if (hasDefaultArgument) {
491 Inherited::VisitTemplateTypeParmDecl(D);
494 void VisitNonTypeTemplateParmDecl(
const NonTypeTemplateParmDecl *D) {
496 const bool hasDefaultArgument =
499 if (hasDefaultArgument) {
504 Inherited::VisitNonTypeTemplateParmDecl(D);
507 void VisitTemplateTemplateParmDecl(
const TemplateTemplateParmDecl *D) {
509 const bool hasDefaultArgument =
512 if (hasDefaultArgument) {
517 Inherited::VisitTemplateTemplateParmDecl(D);
520 void VisitTemplateDecl(
const TemplateDecl *D) {
523 Inherited::VisitTemplateDecl(D);
526 void VisitRedeclarableTemplateDecl(
const RedeclarableTemplateDecl *D) {
528 Inherited::VisitRedeclarableTemplateDecl(D);
531 void VisitFunctionTemplateDecl(
const FunctionTemplateDecl *D) {
534 Inherited::VisitFunctionTemplateDecl(D);
537 void VisitEnumConstantDecl(
const EnumConstantDecl *D) {
539 Inherited::VisitEnumConstantDecl(D);
553 case Decl::AccessSpec:
554 case Decl::CXXConstructor:
555 case Decl::CXXDestructor:
556 case Decl::CXXMethod:
557 case Decl::EnumConstant:
560 case Decl::FunctionTemplate:
561 case Decl::StaticAssert:
562 case Decl::TypeAlias:
565 case Decl::ObjCMethod:
567 case Decl::ObjCProperty:
573 assert(D &&
"Expecting non-null pointer.");
575 ODRDeclVisitor(ID, *
this).Visit(D);
580 "Expected non-null record to be a definition.");
597 Decls.push_back(SubDecl);
598 if (
auto *
Function = dyn_cast<FunctionDecl>(SubDecl)) {
605 ID.AddInteger(Decls.size());
606 for (
auto SubDecl : Decls) {
616 ID.AddInteger(
Record->getNumBases());
617 auto Bases =
Record->bases();
618 for (
const auto &
Base : Bases) {
620 ID.AddInteger(
Base.isVirtual());
621 ID.AddInteger(
Base.getAccessSpecifierAsWritten());
627 "For CXXRecordDecl should call AddCXXRecordDecl.");
635 Decls.push_back(SubDecl);
638 ID.AddInteger(Decls.size());
639 for (
const Decl *SubDecl : Decls)
649 ID.AddInteger(SuperClass->getODRHash());
663 Decls.push_back(SubDecl);
665 ID.AddInteger(Decls.size());
666 for (
auto *SubDecl : Decls)
672 assert(
Function &&
"Expecting non-null pointer.");
678 if (
auto *F = dyn_cast<FunctionDecl>(DC)) {
679 if (F->isFunctionTemplateSpecialization()) {
684 if (F->getDependentSpecializationInfo())
693 ID.AddInteger(
Function->getDeclKind());
695 const auto *SpecializationArgs =
Function->getTemplateSpecializationArgs();
697 if (SpecializationArgs) {
698 ID.AddInteger(SpecializationArgs->size());
709 ID.AddInteger(
Function->getStorageClass());
720 ID.AddString(DeletedMessage->
getBytes());
726 ID.AddInteger(
Function->param_size());
727 for (
auto *Param :
Function->parameters())
735 const bool HasBody =
Function->isThisDeclarationADefinition() &&
753 Decls.push_back(SubDecl);
757 ID.AddInteger(Decls.size());
758 for (
auto SubDecl : Decls) {
768 if (
Enum->isScoped())
771 if (
Enum->getIntegerTypeSourceInfo())
777 for (
Decl *SubDecl :
Enum->decls()) {
780 Decls.push_back(SubDecl);
784 ID.AddInteger(Decls.size());
785 for (
auto SubDecl : Decls) {
806 Decls.push_back(SubDecl);
810 ID.AddInteger(Decls.size());
811 for (
auto *SubDecl : Decls) {
817 assert(D &&
"Expecting non-null pointer.");
820 const NamedDecl *ND = dyn_cast<NamedDecl>(D);
827 if (
auto *FD = dyn_cast<FunctionDecl>(D))
836 if (
auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D))
837 Args = CTSD->getTemplateArgs().asArray();
838 else if (
auto *VTSD = dyn_cast<VarTemplateSpecializationDecl>(D))
839 Args = VTSD->getTemplateArgs().asArray();
840 else if (
auto *FD = dyn_cast<FunctionDecl>(D))
841 if (FD->getTemplateSpecializationArgs())
842 Args = FD->getTemplateSpecializationArgs()->asArray();
844 for (
auto &TA : Args)
851class ODRTypeVisitor :
public TypeVisitor<ODRTypeVisitor> {
853 llvm::FoldingSetNodeID &ID;
857 ODRTypeVisitor(llvm::FoldingSetNodeID &ID,
ODRHash &Hash)
858 : ID(ID), Hash(Hash) {}
860 void AddStmt(
Stmt *S) {
867 void AddDecl(
const Decl *D) {
874 void AddQualType(QualType
T) {
878 void AddType(
const Type *
T) {
885 void AddNestedNameSpecifier(NestedNameSpecifier NNS) {
889 void AddIdentifierInfo(
const IdentifierInfo *II) {
896 void VisitQualifiers(Qualifiers Quals) {
901 bool handleTypedef(
const Type *
T) {
902 const auto *TypedefT = dyn_cast<TypedefType>(
T);
906 QualType UnderlyingType = TypedefT->desugar();
911 const auto *TagT = dyn_cast<TagType>(UnderlyingType);
912 if (!TagT || TagT->getQualifier())
915 if (TypedefT->getDecl()->getIdentifier() !=
916 TagT->getOriginalDecl()->getIdentifier())
919 ID.AddInteger(TagT->getTypeClass());
920 VisitTagType(TagT, TypedefT);
924 void Visit(
const Type *
T) {
925 if (handleTypedef(
T))
931 void VisitType(
const Type *
T) {}
933 void VisitAdjustedType(
const AdjustedType *
T) {
934 AddQualType(
T->getOriginalType());
939 void VisitDecayedType(
const DecayedType *
T) {
942 VisitAdjustedType(
T);
945 void VisitArrayType(
const ArrayType *
T) {
946 AddQualType(
T->getElementType());
947 ID.AddInteger(llvm::to_underlying(
T->getSizeModifier()));
948 VisitQualifiers(
T->getIndexTypeQualifiers());
951 void VisitConstantArrayType(
const ConstantArrayType *
T) {
956 void VisitArrayParameterType(
const ArrayParameterType *
T) {
957 VisitConstantArrayType(
T);
960 void VisitDependentSizedArrayType(
const DependentSizedArrayType *
T) {
961 AddStmt(
T->getSizeExpr());
965 void VisitIncompleteArrayType(
const IncompleteArrayType *
T) {
969 void VisitVariableArrayType(
const VariableArrayType *
T) {
970 AddStmt(
T->getSizeExpr());
974 void VisitAttributedType(
const AttributedType *
T) {
975 ID.AddInteger(
T->getAttrKind());
976 AddQualType(
T->getModifiedType());
981 void VisitBlockPointerType(
const BlockPointerType *
T) {
986 void VisitBuiltinType(
const BuiltinType *
T) {
987 ID.AddInteger(
T->getKind());
991 void VisitComplexType(
const ComplexType *
T) {
992 AddQualType(
T->getElementType());
996 void VisitDecltypeType(
const DecltypeType *
T) {
997 Hash.
AddStmt(
T->getUnderlyingExpr());
1001 void VisitDependentDecltypeType(
const DependentDecltypeType *
T) {
1002 VisitDecltypeType(
T);
1005 void VisitDeducedType(
const DeducedType *
T) {
1006 AddQualType(
T->getDeducedType());
1010 void VisitAutoType(
const AutoType *
T) {
1011 ID.AddInteger((
unsigned)
T->getKeyword());
1012 ID.AddInteger(
T->isConstrained());
1013 if (
T->isConstrained()) {
1014 AddDecl(
T->getTypeConstraintConcept());
1015 ID.AddInteger(
T->getTypeConstraintArguments().size());
1016 for (
const auto &TA :
T->getTypeConstraintArguments())
1019 VisitDeducedType(
T);
1022 void VisitDeducedTemplateSpecializationType(
1023 const DeducedTemplateSpecializationType *
T) {
1025 VisitDeducedType(
T);
1028 void VisitDependentAddressSpaceType(
const DependentAddressSpaceType *
T) {
1030 AddStmt(
T->getAddrSpaceExpr());
1034 void VisitDependentSizedExtVectorType(
const DependentSizedExtVectorType *
T) {
1035 AddQualType(
T->getElementType());
1036 AddStmt(
T->getSizeExpr());
1040 void VisitFunctionType(
const FunctionType *
T) {
1049 void VisitFunctionNoProtoType(
const FunctionNoProtoType *
T) {
1050 VisitFunctionType(
T);
1053 void VisitFunctionProtoType(
const FunctionProtoType *
T) {
1056 AddQualType(ParamType);
1058 VisitFunctionType(
T);
1061 void VisitInjectedClassNameType(
const InjectedClassNameType *
T) {
1062 AddDecl(
T->getOriginalDecl()->getDefinitionOrSelf());
1066 void VisitMemberPointerType(
const MemberPointerType *
T) {
1068 AddNestedNameSpecifier(
T->getQualifier());
1072 void VisitObjCObjectPointerType(
const ObjCObjectPointerType *
T) {
1077 void VisitObjCObjectType(
const ObjCObjectType *
T) {
1078 AddDecl(
T->getInterface());
1080 auto TypeArgs =
T->getTypeArgsAsWritten();
1081 ID.AddInteger(TypeArgs.size());
1082 for (
auto Arg : TypeArgs) {
1086 auto Protocols =
T->getProtocols();
1087 ID.AddInteger(Protocols.size());
1088 for (
auto *Protocol : Protocols) {
1097 void VisitObjCInterfaceType(
const ObjCInterfaceType *
T) {
1099 VisitObjCObjectType(
T);
1102 void VisitObjCTypeParamType(
const ObjCTypeParamType *
T) {
1103 AddDecl(
T->getDecl());
1104 auto Protocols =
T->getProtocols();
1105 ID.AddInteger(Protocols.size());
1106 for (
auto *Protocol : Protocols) {
1113 void VisitPackExpansionType(
const PackExpansionType *
T) {
1114 AddQualType(
T->getPattern());
1118 void VisitParenType(
const ParenType *
T) {
1119 AddQualType(
T->getInnerType());
1123 void VisitPipeType(
const PipeType *
T) {
1124 AddQualType(
T->getElementType());
1129 void VisitPointerType(
const PointerType *
T) {
1134 void VisitReferenceType(
const ReferenceType *
T) {
1135 AddQualType(
T->getPointeeTypeAsWritten());
1139 void VisitLValueReferenceType(
const LValueReferenceType *
T) {
1140 VisitReferenceType(
T);
1143 void VisitRValueReferenceType(
const RValueReferenceType *
T) {
1144 VisitReferenceType(
T);
1148 VisitSubstTemplateTypeParmPackType(
const SubstTemplateTypeParmPackType *
T) {
1149 AddDecl(
T->getAssociatedDecl());
1154 void VisitSubstTemplateTypeParmType(
const SubstTemplateTypeParmType *
T) {
1155 AddDecl(
T->getAssociatedDecl());
1156 AddQualType(
T->getReplacementType());
1160 void VisitTagType(
const TagType *
T,
1161 const TypedefType *ElaboratedOverride =
nullptr) {
1162 ID.AddInteger(llvm::to_underlying(
1163 ElaboratedOverride ? ElaboratedTypeKeyword::None :
T->getKeyword()));
1164 AddNestedNameSpecifier(ElaboratedOverride
1165 ? ElaboratedOverride->getQualifier()
1166 :
T->getQualifier());
1167 AddDecl(
T->getOriginalDecl()->getDefinitionOrSelf());
1171 void VisitTemplateSpecializationType(
const TemplateSpecializationType *
T) {
1172 ID.AddInteger(
T->template_arguments().size());
1173 for (
const auto &TA :
T->template_arguments()) {
1180 void VisitTemplateTypeParmType(
const TemplateTypeParmType *
T) {
1181 ID.AddInteger(
T->getDepth());
1182 ID.AddInteger(
T->getIndex());
1184 AddDecl(
T->getDecl());
1187 void VisitTypedefType(
const TypedefType *
T) {
1188 ID.AddInteger(llvm::to_underlying(
T->getKeyword()));
1189 AddNestedNameSpecifier(
T->getQualifier());
1190 AddDecl(
T->getDecl());
1194 void VisitTypeOfExprType(
const TypeOfExprType *
T) {
1195 AddStmt(
T->getUnderlyingExpr());
1200 void VisitTypeOfType(
const TypeOfType *
T) {
1201 AddQualType(
T->getUnmodifiedType());
1205 void VisitTypeWithKeyword(
const TypeWithKeyword *
T) {
1206 ID.AddInteger(llvm::to_underlying(
T->getKeyword()));
1210 void VisitDependentNameType(
const DependentNameType *
T) {
1211 AddNestedNameSpecifier(
T->getQualifier());
1212 AddIdentifierInfo(
T->getIdentifier());
1213 VisitTypeWithKeyword(
T);
1216 void VisitUnaryTransformType(
const UnaryTransformType *
T) {
1217 AddQualType(
T->getUnderlyingType());
1218 AddQualType(
T->getBaseType());
1222 void VisitUnresolvedUsingType(
const UnresolvedUsingType *
T) {
1223 AddDecl(
T->getDecl());
1227 void VisitVectorType(
const VectorType *
T) {
1228 AddQualType(
T->getElementType());
1229 ID.AddInteger(
T->getNumElements());
1230 ID.AddInteger(llvm::to_underlying(
T->getVectorKind()));
1234 void VisitExtVectorType(
const ExtVectorType *
T) {
1241 assert(
T &&
"Expecting non-null pointer.");
1242 ODRTypeVisitor(ID, *
this).Visit(
T);
1255 Bools.push_back(
Value);
1269 ID.AddInteger(
Value.getLValueOffset().getQuantity());
1275 ID.AddInteger(
Value.getLValueOffset().getQuantity());
1277 bool OnePastTheEnd =
Value.isLValueOnePastTheEnd();
1278 if (
Value.hasLValuePath()) {
1282 if (
const auto *CAT = dyn_cast<ConstantArrayType>(AT))
1283 OnePastTheEnd |= CAT->getSize() == E.getAsArrayIndex();
1284 TypeSoFar = AT->getElementType();
1286 const Decl *D = E.getAsBaseOrMember().getPointer();
1287 if (
const auto *FD = dyn_cast<FieldDecl>(D)) {
1288 if (FD->getParent()->isUnion())
1289 ID.AddInteger(FD->getFieldIndex());
1290 TypeSoFar = FD->getType();
1299 if (
Value.isNullPointer())
1303 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.
CanQualType getCanonicalTagType(const TagDecl *TD) const
Represents a C++ struct/union/class.
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
Declaration of a class template.
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.
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 - 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.
DeclContext * getDeclContext()
AccessSpecifier getAccess() const
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
The name of a declaration.
IdentifierInfo * getAsIdentifierInfo() const
Retrieve the IdentifierInfo * stored in this declaration name, or null if this declaration name isn't...
TemplateDecl * getCXXDeductionGuideTemplate() const
If this name is the name of a C++ deduction guide, return the template associated with that name.
const IdentifierInfo * getCXXLiteralIdentifier() const
If this name is the name of a literal operator, retrieve the identifier associated with it.
OverloadedOperatorKind getCXXOverloadedOperator() const
If this name is the name of an overloadable operator in C++ (e.g., operator+), retrieve the kind of o...
@ CXXConversionFunctionName
QualType getCXXNameType() const
If this name is one of the C++ names (of a constructor, destructor, or conversion function),...
Selector getObjCSelector() const
Get the Objective-C selector stored in this declaration name.
NameKind getNameKind() const
Determine what kind of name this is.
bool isEmpty() const
Evaluates true when this declaration name is empty.
Represents a dependent template name that cannot be resolved prior to template instantiation.
IdentifierOrOverloadedOperator getName() const
NestedNameSpecifier getQualifier() const
Return the nested name specifier that qualifies this name.
const Expr * getInitExpr() const
bool isMutable() const
Determines whether this field is mutable (C++ only).
Expr * getInClassInitializer() const
Get the C++11 default member initializer for this member, or null if one has not been set.
bool isBitField() const
Determines whether this field is a bitfield.
Expr * getBitWidth() const
Returns the expression that represents the bit width, if this field is a bit field.
NamedDecl * getFriendDecl() const
If this friend declaration doesn't name a type, return the inner declaration.
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
bool isPackExpansion() const
Represents a function declaration or definition.
unsigned getODRHash()
Returns ODRHash of the function.
unsigned getNumParams() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx)
ArrayRef< QualType > getParamTypes() const
FunctionDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
void Profile(llvm::FoldingSetNodeID &ID) const
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.
ImplicitParamKind getParameterKind() const
Returns the implicit parameter kind.
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>::".
NamespaceAndPrefix getAsNamespaceAndPrefix() const
const Type * getAsType() const
@ MicrosoftSuper
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in.
@ Global
The global specifier '::'. There is no stored value.
@ Type
A type, stored as a Type*.
@ Namespace
A namespace-like entity, stored as a NamespaceBaseDecl*.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
void AddDecl(const Decl *D)
void AddStmt(const Stmt *S)
void AddStructuralValue(const APValue &)
void AddDeclarationNameInfo(DeclarationNameInfo NameInfo, bool TreatAsDecl=false)
void AddCXXRecordDecl(const CXXRecordDecl *Record)
void AddDeclarationName(DeclarationName Name, bool TreatAsDecl=false)
void AddIdentifierInfo(const IdentifierInfo *II)
void AddObjCProtocolDecl(const ObjCProtocolDecl *P)
void AddObjCInterfaceDecl(const ObjCInterfaceDecl *Record)
void AddType(const Type *T)
void AddEnumDecl(const EnumDecl *Enum)
void AddDependentTemplateName(const DependentTemplateStorage &Name)
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 AddNestedNameSpecifier(NestedNameSpecifier NNS)
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
AccessControl getCanonicalAccessControl() const
TypeSourceInfo * getTypeSourceInfo() const
ObjCPropertyAttribute::Kind getPropertyAttributes() const
PropertyControl getPropertyImplementation() const
Represents an Objective-C protocol declaration.
const ObjCProtocolList & getReferencedProtocols() const
protocol_range protocols() const
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.
NestedNameSpecifier getQualifier() const
Return the nested name specifier that qualifies this name.
TemplateName getUnderlyingTemplate() const
Return the underlying template name.
bool hasTemplateKeyword() const
Whether the template name was prefixed by the "template" keyword.
uint64_t getAsOpaqueValue() const
Represents a struct/union/class.
bool isMemberSpecialization() const
Determines whether this template was a specialization of a member template.
Smart pointer class that efficiently represents Objective-C method names.
const IdentifierInfo * getIdentifierInfoForSlot(unsigned argIndex) const
Retrieve the identifier at a given position in the selector.
bool isKeywordSelector() const
bool isUnarySelector() const
bool isNull() const
Determine whether this is the empty selector.
unsigned getNumArgs() const
Stmt - This represents one statement.
void ProcessODRHash(llvm::FoldingSetNodeID &ID, ODRHash &Hash) const
Calculate a unique representation for a statement that is stable across compiler invocations.
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(...
const TemplateArgument & getArgument() const
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.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Represents a C++ template name within the type system.
TemplateDecl * getAsTemplateDecl(bool IgnoreDeduced=false) const
Retrieve the underlying template declaration that this template name refers to, if known.
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
@ 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,...
@ DeducedTemplate
A template name that refers to another TemplateName with deduced default arguments.
@ 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()
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
const TypeConstraint * getTypeConstraint() const
Returns the type constraint associated with this template parameter (if any).
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
bool isParameterPack() const
Returns whether this is a parameter pack.
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint,...
QualType getType() const
Return the type wrapped by this type source info.
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
QualType getUnderlyingType() const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
bool isStaticLocal() const
Returns true if a variable with function scope is a static local variable.
const Expr * getInit() const
The JSON file list parser is used to communicate input to InstallAPI.
bool isa(CodeGen::Address addr)
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
@ Result
The result type of a method or function.
const FunctionProtoType * T
@ Template
We are parsing a template declaration.
@ Type
The name was classified as a type.
U cast(CodeGen::Address addr)
@ Enum
The "enum" keyword introduces the elaborated-type-specifier.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
DeclarationName getName() const
getName - Returns the embedded declaration name.
TypeSourceInfo * getNamedTypeInfo() const
getNamedTypeInfo - Returns the source type info associated to the name.
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)