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());
178 llvm_unreachable(
"Unexpected DeducedTemplate");
183 const auto Kind = TA.
getKind();
188 llvm_unreachable(
"Expected valid TemplateArgument");
196 ID.AddPointer(
nullptr);
225 assert(TPL &&
"Expecting non-null pointer.");
227 ID.AddInteger(TPL->
size());
228 for (
auto *ND : TPL->
asArray()) {
249 const unsigned size = Bools.size();
250 const unsigned remainder = size % unsigned_bits;
251 const unsigned loops = size / unsigned_bits;
252 auto I = Bools.rbegin();
254 for (
unsigned i = 0; i <
remainder; ++i) {
259 ID.AddInteger(value);
261 for (
unsigned i = 0; i < loops; ++i) {
263 for (
unsigned j = 0; j < unsigned_bits; ++j) {
268 ID.AddInteger(value);
271 assert(I == Bools.rend());
273 return ID.computeStableHash();
281 llvm::FoldingSetNodeID &ID;
285 ODRDeclVisitor(llvm::FoldingSetNodeID &ID,
ODRHash &Hash)
286 : ID(ID), Hash(Hash) {}
288 void AddStmt(
const Stmt *S) {
295 void AddIdentifierInfo(
const IdentifierInfo *II) {
302 void AddQualType(QualType
T) {
306 void AddDecl(
const Decl *D) {
313 void AddTemplateArgument(TemplateArgument TA) {
317 void Visit(
const Decl *D) {
322 void VisitNamedDecl(
const NamedDecl *D) {
323 if (
const auto *FD = dyn_cast<FunctionDecl>(D))
327 Inherited::VisitNamedDecl(D);
330 void VisitValueDecl(
const ValueDecl *D) {
331 if (
auto *DD = dyn_cast<DeclaratorDecl>(D); DD && DD->getTypeSourceInfo())
332 AddQualType(DD->getTypeSourceInfo()->getType());
334 Inherited::VisitValueDecl(D);
337 void VisitVarDecl(
const VarDecl *D) {
340 const bool HasInit = D->
hasInit();
345 Inherited::VisitVarDecl(D);
348 void VisitParmVarDecl(
const ParmVarDecl *D) {
350 Inherited::VisitParmVarDecl(D);
353 void VisitAccessSpecDecl(
const AccessSpecDecl *D) {
355 Inherited::VisitAccessSpecDecl(D);
358 void VisitStaticAssertDecl(
const StaticAssertDecl *D) {
362 Inherited::VisitStaticAssertDecl(D);
365 void VisitFieldDecl(
const FieldDecl *D) {
376 Inherited::VisitFieldDecl(D);
379 void VisitObjCIvarDecl(
const ObjCIvarDecl *D) {
381 Inherited::VisitObjCIvarDecl(D);
384 void VisitObjCPropertyDecl(
const ObjCPropertyDecl *D) {
390 Inherited::VisitObjCPropertyDecl(D);
393 void VisitFunctionDecl(
const FunctionDecl *D) {
397 Inherited::VisitFunctionDecl(D);
400 void VisitCXXMethodDecl(
const CXXMethodDecl *D) {
403 Inherited::VisitCXXMethodDecl(D);
406 void VisitObjCMethodDecl(
const ObjCMethodDecl *
Method) {
407 ID.AddInteger(
Method->getDeclKind());
416 ID.AddInteger(llvm::to_underlying(
Method->getImplementationControl()));
417 ID.AddInteger(
Method->getMethodFamily());
418 ImplicitParamDecl *Cmd =
Method->getCmdDecl();
423 ImplicitParamDecl *
Self =
Method->getSelfDecl();
426 ID.AddInteger(llvm::to_underlying(
Self->getParameterKind()));
430 if (
Method->getReturnTypeSourceInfo())
431 AddQualType(
Method->getReturnTypeSourceInfo()->getType());
433 ID.AddInteger(
Method->param_size());
434 for (
auto Param :
Method->parameters())
438 const bool IsDefinition =
Method->isThisDeclarationADefinition();
441 Stmt *Body =
Method->getBody();
448 llvm::SmallVector<const Decl *, 16> Decls;
449 for (Decl *SubDecl :
Method->decls())
451 Decls.push_back(SubDecl);
453 ID.AddInteger(Decls.size());
454 for (
auto SubDecl : Decls)
461 Inherited::VisitObjCMethodDecl(
Method);
464 void VisitTypedefNameDecl(
const TypedefNameDecl *D) {
467 Inherited::VisitTypedefNameDecl(D);
470 void VisitTypedefDecl(
const TypedefDecl *D) {
471 Inherited::VisitTypedefDecl(D);
474 void VisitTypeAliasDecl(
const TypeAliasDecl *D) {
475 Inherited::VisitTypeAliasDecl(D);
478 void VisitFriendDecl(
const FriendDecl *D) {
489 void VisitFriendTemplateDecl(
const FriendTemplateDecl *D) {
493 bool IsTemplateFriend =
495 FriendTemplateDecl::FriendTemplateEntityKind::Template;
497 if (!IsTemplateFriend) {
500 FriendTemplateDecl::FriendTemplateEntityKind::Type &&
509 void VisitTemplateTypeParmDecl(
const TemplateTypeParmDecl *D) {
511 const bool hasDefaultArgument =
514 if (hasDefaultArgument) {
524 Inherited::VisitTemplateTypeParmDecl(D);
527 void VisitNonTypeTemplateParmDecl(
const NonTypeTemplateParmDecl *D) {
529 const bool hasDefaultArgument =
532 if (hasDefaultArgument) {
537 Inherited::VisitNonTypeTemplateParmDecl(D);
540 void VisitTemplateTemplateParmDecl(
const TemplateTemplateParmDecl *D) {
542 const bool hasDefaultArgument =
545 if (hasDefaultArgument) {
550 Inherited::VisitTemplateTemplateParmDecl(D);
553 void VisitTemplateDecl(
const TemplateDecl *D) {
556 Inherited::VisitTemplateDecl(D);
559 void VisitRedeclarableTemplateDecl(
const RedeclarableTemplateDecl *D) {
561 Inherited::VisitRedeclarableTemplateDecl(D);
564 void VisitFunctionTemplateDecl(
const FunctionTemplateDecl *D) {
567 Inherited::VisitFunctionTemplateDecl(D);
570 void VisitEnumConstantDecl(
const EnumConstantDecl *D) {
572 Inherited::VisitEnumConstantDecl(D);
586 case Decl::AccessSpec:
587 case Decl::CXXConstructor:
588 case Decl::CXXDestructor:
589 case Decl::CXXMethod:
590 case Decl::EnumConstant:
593 case Decl::FriendTemplate:
594 case Decl::FunctionTemplate:
595 case Decl::StaticAssert:
596 case Decl::TypeAlias:
599 case Decl::ObjCMethod:
601 case Decl::ObjCProperty:
607 assert(D &&
"Expecting non-null pointer.");
609 ODRDeclVisitor(ID, *
this).Visit(D);
614 "Expected non-null record to be a definition.");
631 Decls.push_back(SubDecl);
632 if (
auto *
Function = dyn_cast<FunctionDecl>(SubDecl)) {
639 ID.AddInteger(Decls.size());
640 for (
auto SubDecl : Decls) {
650 ID.AddInteger(
Record->getNumBases());
651 auto Bases =
Record->bases();
652 for (
const auto &
Base : Bases) {
654 ID.AddInteger(
Base.isVirtual());
655 ID.AddInteger(
Base.getAccessSpecifierAsWritten());
661 "For CXXRecordDecl should call AddCXXRecordDecl.");
669 Decls.push_back(SubDecl);
672 ID.AddInteger(Decls.size());
673 for (
const Decl *SubDecl : Decls)
683 ID.AddInteger(SuperClass->getODRHash());
697 Decls.push_back(SubDecl);
699 ID.AddInteger(Decls.size());
700 for (
auto *SubDecl : Decls)
706 assert(
Function &&
"Expecting non-null pointer.");
712 if (
auto *F = dyn_cast<FunctionDecl>(DC)) {
713 if (F->isFunctionTemplateSpecialization()) {
718 if (F->getDependentSpecializationInfo())
727 ID.AddInteger(
Function->getDeclKind());
729 const auto *SpecializationArgs =
Function->getTemplateSpecializationArgs();
731 if (SpecializationArgs) {
732 ID.AddInteger(SpecializationArgs->size());
743 ID.AddInteger(
Function->getStorageClass());
754 ID.AddString(DeletedMessage->
getBytes());
760 ID.AddInteger(
Function->param_size());
761 for (
auto *Param :
Function->parameters())
769 const bool HasBody =
Function->isThisDeclarationADefinition() &&
787 Decls.push_back(SubDecl);
791 ID.AddInteger(Decls.size());
792 for (
auto SubDecl : Decls) {
802 if (
Enum->isScoped())
805 if (
Enum->getIntegerTypeSourceInfo())
811 for (
Decl *SubDecl :
Enum->decls()) {
814 Decls.push_back(SubDecl);
818 ID.AddInteger(Decls.size());
819 for (
auto SubDecl : Decls) {
840 Decls.push_back(SubDecl);
844 ID.AddInteger(Decls.size());
845 for (
auto *SubDecl : Decls) {
851 assert(D &&
"Expecting non-null pointer.");
854 const NamedDecl *ND = dyn_cast<NamedDecl>(D);
861 if (
auto *FD = dyn_cast<FunctionDecl>(D))
870 if (
auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D))
871 Args = CTSD->getTemplateArgs().asArray();
872 else if (
auto *VTSD = dyn_cast<VarTemplateSpecializationDecl>(D))
873 Args = VTSD->getTemplateArgs().asArray();
874 else if (
auto *FD = dyn_cast<FunctionDecl>(D))
875 if (FD->getTemplateSpecializationArgs())
876 Args = FD->getTemplateSpecializationArgs()->asArray();
878 for (
auto &TA : Args)
885class ODRTypeVisitor :
public TypeVisitor<ODRTypeVisitor> {
887 llvm::FoldingSetNodeID &ID;
891 ODRTypeVisitor(llvm::FoldingSetNodeID &ID,
ODRHash &Hash)
892 : ID(ID), Hash(Hash) {}
894 void AddStmt(
Stmt *S) {
901 void AddDecl(
const Decl *D) {
908 void AddQualType(QualType
T) {
912 void AddType(
const Type *
T) {
919 void AddNestedNameSpecifier(NestedNameSpecifier NNS) {
923 void AddIdentifierInfo(
const IdentifierInfo *II) {
930 void VisitQualifiers(Qualifiers Quals) {
935 bool handleTypedef(
const Type *
T) {
936 const auto *TypedefT = dyn_cast<TypedefType>(
T);
940 QualType UnderlyingType = TypedefT->desugar();
945 const auto *TagT = dyn_cast<TagType>(UnderlyingType);
946 if (!TagT || TagT->getQualifier())
949 if (TypedefT->getDecl()->getIdentifier() !=
950 TagT->getDecl()->getIdentifier())
953 ID.AddInteger(TagT->getTypeClass());
954 VisitTagType(TagT, TypedefT);
958 void Visit(
const Type *
T) {
959 if (handleTypedef(
T))
965 void VisitType(
const Type *
T) {}
967 void VisitAdjustedType(
const AdjustedType *
T) {
968 AddQualType(
T->getOriginalType());
973 void VisitDecayedType(
const DecayedType *
T) {
976 VisitAdjustedType(
T);
979 void VisitArrayType(
const ArrayType *
T) {
980 AddQualType(
T->getElementType());
981 ID.AddInteger(llvm::to_underlying(
T->getSizeModifier()));
982 VisitQualifiers(
T->getIndexTypeQualifiers());
985 void VisitConstantArrayType(
const ConstantArrayType *
T) {
990 void VisitArrayParameterType(
const ArrayParameterType *
T) {
991 VisitConstantArrayType(
T);
994 void VisitDependentSizedArrayType(
const DependentSizedArrayType *
T) {
995 AddStmt(
T->getSizeExpr());
999 void VisitIncompleteArrayType(
const IncompleteArrayType *
T) {
1003 void VisitVariableArrayType(
const VariableArrayType *
T) {
1004 AddStmt(
T->getSizeExpr());
1008 void VisitAttributedType(
const AttributedType *
T) {
1009 ID.AddInteger(
T->getAttrKind());
1010 AddQualType(
T->getModifiedType());
1015 void VisitBlockPointerType(
const BlockPointerType *
T) {
1020 void VisitBuiltinType(
const BuiltinType *
T) {
1021 ID.AddInteger(
T->getKind());
1025 void VisitComplexType(
const ComplexType *
T) {
1026 AddQualType(
T->getElementType());
1030 void VisitDecltypeType(
const DecltypeType *
T) {
1031 Hash.
AddStmt(
T->getUnderlyingExpr());
1035 void VisitDependentDecltypeType(
const DependentDecltypeType *
T) {
1036 VisitDecltypeType(
T);
1039 void VisitDeducedType(
const DeducedType *
T) {
1040 AddQualType(
T->getDeducedType());
1044 void VisitAutoType(
const AutoType *
T) {
1045 ID.AddInteger((
unsigned)
T->getKeyword());
1046 ID.AddInteger(
T->isConstrained());
1047 if (
T->isConstrained()) {
1049 ID.AddInteger(
T->getTypeConstraintArguments().size());
1050 for (
const auto &TA :
T->getTypeConstraintArguments())
1053 VisitDeducedType(
T);
1056 void VisitDeducedTemplateSpecializationType(
1057 const DeducedTemplateSpecializationType *
T) {
1059 VisitDeducedType(
T);
1062 void VisitDependentAddressSpaceType(
const DependentAddressSpaceType *
T) {
1064 AddStmt(
T->getAddrSpaceExpr());
1068 void VisitDependentSizedExtVectorType(
const DependentSizedExtVectorType *
T) {
1069 AddQualType(
T->getElementType());
1070 AddStmt(
T->getSizeExpr());
1074 void VisitFunctionType(
const FunctionType *
T) {
1083 void VisitFunctionNoProtoType(
const FunctionNoProtoType *
T) {
1084 VisitFunctionType(
T);
1087 void VisitFunctionProtoType(
const FunctionProtoType *
T) {
1090 AddQualType(ParamType);
1092 VisitFunctionType(
T);
1095 void VisitInjectedClassNameType(
const InjectedClassNameType *
T) {
1096 AddDecl(
T->getDecl()->getDefinitionOrSelf());
1100 void VisitMemberPointerType(
const MemberPointerType *
T) {
1102 AddNestedNameSpecifier(
T->getQualifier());
1106 void VisitObjCObjectPointerType(
const ObjCObjectPointerType *
T) {
1111 void VisitObjCObjectType(
const ObjCObjectType *
T) {
1112 AddDecl(
T->getInterface());
1114 auto TypeArgs =
T->getTypeArgsAsWritten();
1115 ID.AddInteger(TypeArgs.size());
1116 for (
auto Arg : TypeArgs) {
1120 auto Protocols =
T->getProtocols();
1121 ID.AddInteger(Protocols.size());
1122 for (
auto *Protocol : Protocols) {
1131 void VisitObjCInterfaceType(
const ObjCInterfaceType *
T) {
1133 VisitObjCObjectType(
T);
1136 void VisitObjCTypeParamType(
const ObjCTypeParamType *
T) {
1137 AddDecl(
T->getDecl());
1138 auto Protocols =
T->getProtocols();
1139 ID.AddInteger(Protocols.size());
1140 for (
auto *Protocol : Protocols) {
1147 void VisitPackExpansionType(
const PackExpansionType *
T) {
1148 AddQualType(
T->getPattern());
1152 void VisitParenType(
const ParenType *
T) {
1153 AddQualType(
T->getInnerType());
1157 void VisitPipeType(
const PipeType *
T) {
1158 AddQualType(
T->getElementType());
1163 void VisitPointerType(
const PointerType *
T) {
1168 void VisitReferenceType(
const ReferenceType *
T) {
1169 AddQualType(
T->getPointeeTypeAsWritten());
1173 void VisitLValueReferenceType(
const LValueReferenceType *
T) {
1174 VisitReferenceType(
T);
1177 void VisitRValueReferenceType(
const RValueReferenceType *
T) {
1178 VisitReferenceType(
T);
1182 VisitSubstTemplateTypeParmPackType(
const SubstTemplateTypeParmPackType *
T) {
1183 AddDecl(
T->getAssociatedDecl());
1188 void VisitSubstTemplateTypeParmType(
const SubstTemplateTypeParmType *
T) {
1189 AddDecl(
T->getAssociatedDecl());
1190 AddQualType(
T->getReplacementType());
1194 void VisitTagType(
const TagType *
T,
1195 const TypedefType *ElaboratedOverride =
nullptr) {
1196 ID.AddInteger(llvm::to_underlying(
1197 ElaboratedOverride ? ElaboratedTypeKeyword::None :
T->getKeyword()));
1198 AddNestedNameSpecifier(ElaboratedOverride
1199 ? ElaboratedOverride->getQualifier()
1200 :
T->getQualifier());
1201 AddDecl(
T->getDecl()->getDefinitionOrSelf());
1205 void VisitTemplateSpecializationType(
const TemplateSpecializationType *
T) {
1206 ID.AddInteger(
T->template_arguments().size());
1207 for (
const auto &TA :
T->template_arguments()) {
1214 void VisitTemplateTypeParmType(
const TemplateTypeParmType *
T) {
1215 ID.AddInteger(
T->getDepth());
1216 ID.AddInteger(
T->getIndex());
1218 AddDecl(
T->getDecl());
1221 void VisitTypedefType(
const TypedefType *
T) {
1222 ID.AddInteger(llvm::to_underlying(
T->getKeyword()));
1223 AddNestedNameSpecifier(
T->getQualifier());
1224 AddDecl(
T->getDecl());
1228 void VisitTypeOfExprType(
const TypeOfExprType *
T) {
1229 AddStmt(
T->getUnderlyingExpr());
1234 void VisitTypeOfType(
const TypeOfType *
T) {
1235 AddQualType(
T->getUnmodifiedType());
1239 void VisitTypeWithKeyword(
const TypeWithKeyword *
T) {
1240 ID.AddInteger(llvm::to_underlying(
T->getKeyword()));
1244 void VisitDependentNameType(
const DependentNameType *
T) {
1245 AddNestedNameSpecifier(
T->getQualifier());
1246 AddIdentifierInfo(
T->getIdentifier());
1247 VisitTypeWithKeyword(
T);
1250 void VisitUnaryTransformType(
const UnaryTransformType *
T) {
1251 AddQualType(
T->getUnderlyingType());
1252 AddQualType(
T->getBaseType());
1256 void VisitUnresolvedUsingType(
const UnresolvedUsingType *
T) {
1257 AddDecl(
T->getDecl());
1261 void VisitVectorType(
const VectorType *
T) {
1262 AddQualType(
T->getElementType());
1263 ID.AddInteger(
T->getNumElements());
1264 ID.AddInteger(llvm::to_underlying(
T->getVectorKind()));
1268 void VisitExtVectorType(
const ExtVectorType *
T) {
1275 assert(
T &&
"Expecting non-null pointer.");
1276 ODRTypeVisitor(ID, *
this).Visit(
T);
1289 Bools.push_back(
Value);
1303 ID.AddInteger(
Value.getLValueOffset().getQuantity());
1309 ID.AddInteger(
Value.getLValueOffset().getQuantity());
1311 bool OnePastTheEnd =
Value.isLValueOnePastTheEnd();
1312 if (
Value.hasLValuePath()) {
1316 if (
const auto *CAT = dyn_cast<ConstantArrayType>(AT))
1317 OnePastTheEnd |= CAT->getSize() == E.getAsArrayIndex();
1318 TypeSoFar = AT->getElementType();
1320 const Decl *D = E.getAsBaseOrMember().getPointer();
1321 if (
const auto *FD = dyn_cast<FieldDecl>(D)) {
1322 if (FD->getParent()->isUnion())
1323 ID.AddInteger(FD->getFieldIndex());
1324 TypeSoFar = FD->getType();
1333 if (
Value.isNullPointer())
1337 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
This represents one expression.
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.
virtual 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
TemplateName getFriendTemplateName() const
FriendTemplateEntityKind getFriendKind() const
ArrayRef< TemplateParameterList * > getTemplateParameterLists() 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 structure for storing a pack-index-template-name ([temp.names]).
TemplateName getPattern() const
Expr * getIndexExpr() 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.
bool isNull() const
Determine whether this template name is NULL.
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.
@ PackIndexingTemplate
A pack-index-template-name.
@ 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.
UsingShadowDecl * getAsUsingShadowDecl() const
Retrieve the using shadow declaration through which the underlying template declaration is introduced...
PackIndexingTemplateStorage * getAsPackIndexingTemplate() const
Retrieve the pack-index-template-name storage, if any.
Stores a list of template parameters for a TemplateDecl and its derived classes.
Expr * getRequiresClause()
The constraint-expression of the associated requires-clause.
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
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
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
Top level wrappers for InstallAPI frontend operations.
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
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)