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());
172 llvm_unreachable(
"Unexpected DeducedTemplate");
177 const auto Kind = TA.
getKind();
182 llvm_unreachable(
"Expected valid TemplateArgument");
190 ID.AddPointer(
nullptr);
219 assert(TPL &&
"Expecting non-null pointer.");
221 ID.AddInteger(TPL->
size());
222 for (
auto *ND : TPL->
asArray()) {
243 const unsigned size = Bools.size();
244 const unsigned remainder = size % unsigned_bits;
245 const unsigned loops = size / unsigned_bits;
246 auto I = Bools.rbegin();
248 for (
unsigned i = 0; i <
remainder; ++i) {
253 ID.AddInteger(value);
255 for (
unsigned i = 0; i < loops; ++i) {
257 for (
unsigned j = 0; j < unsigned_bits; ++j) {
262 ID.AddInteger(value);
265 assert(I == Bools.rend());
267 return ID.computeStableHash();
275 llvm::FoldingSetNodeID &ID;
279 ODRDeclVisitor(llvm::FoldingSetNodeID &ID,
ODRHash &Hash)
280 : ID(ID), Hash(Hash) {}
282 void AddStmt(
const Stmt *S) {
289 void AddIdentifierInfo(
const IdentifierInfo *II) {
296 void AddQualType(QualType
T) {
300 void AddDecl(
const Decl *D) {
307 void AddTemplateArgument(TemplateArgument TA) {
311 void Visit(
const Decl *D) {
316 void VisitNamedDecl(
const NamedDecl *D) {
317 if (
const auto *FD = dyn_cast<FunctionDecl>(D))
321 Inherited::VisitNamedDecl(D);
324 void VisitValueDecl(
const ValueDecl *D) {
325 if (
auto *DD = dyn_cast<DeclaratorDecl>(D); DD && DD->getTypeSourceInfo())
326 AddQualType(DD->getTypeSourceInfo()->getType());
328 Inherited::VisitValueDecl(D);
331 void VisitVarDecl(
const VarDecl *D) {
334 const bool HasInit = D->
hasInit();
339 Inherited::VisitVarDecl(D);
342 void VisitParmVarDecl(
const ParmVarDecl *D) {
344 Inherited::VisitParmVarDecl(D);
347 void VisitAccessSpecDecl(
const AccessSpecDecl *D) {
349 Inherited::VisitAccessSpecDecl(D);
352 void VisitStaticAssertDecl(
const StaticAssertDecl *D) {
356 Inherited::VisitStaticAssertDecl(D);
359 void VisitFieldDecl(
const FieldDecl *D) {
370 Inherited::VisitFieldDecl(D);
373 void VisitObjCIvarDecl(
const ObjCIvarDecl *D) {
375 Inherited::VisitObjCIvarDecl(D);
378 void VisitObjCPropertyDecl(
const ObjCPropertyDecl *D) {
384 Inherited::VisitObjCPropertyDecl(D);
387 void VisitFunctionDecl(
const FunctionDecl *D) {
391 Inherited::VisitFunctionDecl(D);
394 void VisitCXXMethodDecl(
const CXXMethodDecl *D) {
397 Inherited::VisitCXXMethodDecl(D);
400 void VisitObjCMethodDecl(
const ObjCMethodDecl *
Method) {
401 ID.AddInteger(
Method->getDeclKind());
410 ID.AddInteger(llvm::to_underlying(
Method->getImplementationControl()));
411 ID.AddInteger(
Method->getMethodFamily());
412 ImplicitParamDecl *Cmd =
Method->getCmdDecl();
417 ImplicitParamDecl *
Self =
Method->getSelfDecl();
420 ID.AddInteger(llvm::to_underlying(
Self->getParameterKind()));
424 if (
Method->getReturnTypeSourceInfo())
425 AddQualType(
Method->getReturnTypeSourceInfo()->getType());
427 ID.AddInteger(
Method->param_size());
428 for (
auto Param :
Method->parameters())
432 const bool IsDefinition =
Method->isThisDeclarationADefinition();
435 Stmt *Body =
Method->getBody();
442 llvm::SmallVector<const Decl *, 16> Decls;
443 for (Decl *SubDecl :
Method->decls())
445 Decls.push_back(SubDecl);
447 ID.AddInteger(Decls.size());
448 for (
auto SubDecl : Decls)
455 Inherited::VisitObjCMethodDecl(
Method);
458 void VisitTypedefNameDecl(
const TypedefNameDecl *D) {
461 Inherited::VisitTypedefNameDecl(D);
464 void VisitTypedefDecl(
const TypedefDecl *D) {
465 Inherited::VisitTypedefDecl(D);
468 void VisitTypeAliasDecl(
const TypeAliasDecl *D) {
469 Inherited::VisitTypeAliasDecl(D);
472 void VisitFriendDecl(
const FriendDecl *D) {
483 void VisitFriendTemplateDecl(
const FriendTemplateDecl *D) {
487 bool IsTemplateFriend =
489 FriendTemplateDecl::FriendTemplateEntityKind::Template;
491 if (!IsTemplateFriend) {
494 FriendTemplateDecl::FriendTemplateEntityKind::Type &&
503 void VisitTemplateTypeParmDecl(
const TemplateTypeParmDecl *D) {
505 const bool hasDefaultArgument =
508 if (hasDefaultArgument) {
518 Inherited::VisitTemplateTypeParmDecl(D);
521 void VisitNonTypeTemplateParmDecl(
const NonTypeTemplateParmDecl *D) {
523 const bool hasDefaultArgument =
526 if (hasDefaultArgument) {
531 Inherited::VisitNonTypeTemplateParmDecl(D);
534 void VisitTemplateTemplateParmDecl(
const TemplateTemplateParmDecl *D) {
536 const bool hasDefaultArgument =
539 if (hasDefaultArgument) {
544 Inherited::VisitTemplateTemplateParmDecl(D);
547 void VisitTemplateDecl(
const TemplateDecl *D) {
550 Inherited::VisitTemplateDecl(D);
553 void VisitRedeclarableTemplateDecl(
const RedeclarableTemplateDecl *D) {
555 Inherited::VisitRedeclarableTemplateDecl(D);
558 void VisitFunctionTemplateDecl(
const FunctionTemplateDecl *D) {
561 Inherited::VisitFunctionTemplateDecl(D);
564 void VisitEnumConstantDecl(
const EnumConstantDecl *D) {
566 Inherited::VisitEnumConstantDecl(D);
580 case Decl::AccessSpec:
581 case Decl::CXXConstructor:
582 case Decl::CXXDestructor:
583 case Decl::CXXMethod:
584 case Decl::EnumConstant:
587 case Decl::FriendTemplate:
588 case Decl::FunctionTemplate:
589 case Decl::StaticAssert:
590 case Decl::TypeAlias:
593 case Decl::ObjCMethod:
595 case Decl::ObjCProperty:
601 assert(D &&
"Expecting non-null pointer.");
603 ODRDeclVisitor(ID, *
this).Visit(D);
608 "Expected non-null record to be a definition.");
625 Decls.push_back(SubDecl);
626 if (
auto *
Function = dyn_cast<FunctionDecl>(SubDecl)) {
633 ID.AddInteger(Decls.size());
634 for (
auto SubDecl : Decls) {
644 ID.AddInteger(
Record->getNumBases());
645 auto Bases =
Record->bases();
646 for (
const auto &
Base : Bases) {
648 ID.AddInteger(
Base.isVirtual());
649 ID.AddInteger(
Base.getAccessSpecifierAsWritten());
655 "For CXXRecordDecl should call AddCXXRecordDecl.");
663 Decls.push_back(SubDecl);
666 ID.AddInteger(Decls.size());
667 for (
const Decl *SubDecl : Decls)
677 ID.AddInteger(SuperClass->getODRHash());
691 Decls.push_back(SubDecl);
693 ID.AddInteger(Decls.size());
694 for (
auto *SubDecl : Decls)
700 assert(
Function &&
"Expecting non-null pointer.");
706 if (
auto *F = dyn_cast<FunctionDecl>(DC)) {
707 if (F->isFunctionTemplateSpecialization()) {
712 if (F->getDependentSpecializationInfo())
721 ID.AddInteger(
Function->getDeclKind());
723 const auto *SpecializationArgs =
Function->getTemplateSpecializationArgs();
725 if (SpecializationArgs) {
726 ID.AddInteger(SpecializationArgs->size());
737 ID.AddInteger(
Function->getStorageClass());
748 ID.AddString(DeletedMessage->
getBytes());
754 ID.AddInteger(
Function->param_size());
755 for (
auto *Param :
Function->parameters())
763 const bool HasBody =
Function->isThisDeclarationADefinition() &&
781 Decls.push_back(SubDecl);
785 ID.AddInteger(Decls.size());
786 for (
auto SubDecl : Decls) {
796 if (
Enum->isScoped())
799 if (
Enum->getIntegerTypeSourceInfo())
805 for (
Decl *SubDecl :
Enum->decls()) {
808 Decls.push_back(SubDecl);
812 ID.AddInteger(Decls.size());
813 for (
auto SubDecl : Decls) {
834 Decls.push_back(SubDecl);
838 ID.AddInteger(Decls.size());
839 for (
auto *SubDecl : Decls) {
845 assert(D &&
"Expecting non-null pointer.");
848 const NamedDecl *ND = dyn_cast<NamedDecl>(D);
855 if (
auto *FD = dyn_cast<FunctionDecl>(D))
864 if (
auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D))
865 Args = CTSD->getTemplateArgs().asArray();
866 else if (
auto *VTSD = dyn_cast<VarTemplateSpecializationDecl>(D))
867 Args = VTSD->getTemplateArgs().asArray();
868 else if (
auto *FD = dyn_cast<FunctionDecl>(D))
869 if (FD->getTemplateSpecializationArgs())
870 Args = FD->getTemplateSpecializationArgs()->asArray();
872 for (
auto &TA : Args)
879class ODRTypeVisitor :
public TypeVisitor<ODRTypeVisitor> {
881 llvm::FoldingSetNodeID &ID;
885 ODRTypeVisitor(llvm::FoldingSetNodeID &ID,
ODRHash &Hash)
886 : ID(ID), Hash(Hash) {}
888 void AddStmt(
Stmt *S) {
895 void AddDecl(
const Decl *D) {
902 void AddQualType(QualType
T) {
906 void AddType(
const Type *
T) {
913 void AddNestedNameSpecifier(NestedNameSpecifier NNS) {
917 void AddIdentifierInfo(
const IdentifierInfo *II) {
924 void VisitQualifiers(Qualifiers Quals) {
929 bool handleTypedef(
const Type *
T) {
930 const auto *TypedefT = dyn_cast<TypedefType>(
T);
934 QualType UnderlyingType = TypedefT->desugar();
939 const auto *TagT = dyn_cast<TagType>(UnderlyingType);
940 if (!TagT || TagT->getQualifier())
943 if (TypedefT->getDecl()->getIdentifier() !=
944 TagT->getDecl()->getIdentifier())
947 ID.AddInteger(TagT->getTypeClass());
948 VisitTagType(TagT, TypedefT);
952 void Visit(
const Type *
T) {
953 if (handleTypedef(
T))
959 void VisitType(
const Type *
T) {}
961 void VisitAdjustedType(
const AdjustedType *
T) {
962 AddQualType(
T->getOriginalType());
967 void VisitDecayedType(
const DecayedType *
T) {
970 VisitAdjustedType(
T);
973 void VisitArrayType(
const ArrayType *
T) {
974 AddQualType(
T->getElementType());
975 ID.AddInteger(llvm::to_underlying(
T->getSizeModifier()));
976 VisitQualifiers(
T->getIndexTypeQualifiers());
979 void VisitConstantArrayType(
const ConstantArrayType *
T) {
984 void VisitArrayParameterType(
const ArrayParameterType *
T) {
985 VisitConstantArrayType(
T);
988 void VisitDependentSizedArrayType(
const DependentSizedArrayType *
T) {
989 AddStmt(
T->getSizeExpr());
993 void VisitIncompleteArrayType(
const IncompleteArrayType *
T) {
997 void VisitVariableArrayType(
const VariableArrayType *
T) {
998 AddStmt(
T->getSizeExpr());
1002 void VisitAttributedType(
const AttributedType *
T) {
1003 ID.AddInteger(
T->getAttrKind());
1004 AddQualType(
T->getModifiedType());
1009 void VisitBlockPointerType(
const BlockPointerType *
T) {
1014 void VisitBuiltinType(
const BuiltinType *
T) {
1015 ID.AddInteger(
T->getKind());
1019 void VisitComplexType(
const ComplexType *
T) {
1020 AddQualType(
T->getElementType());
1024 void VisitDecltypeType(
const DecltypeType *
T) {
1025 Hash.
AddStmt(
T->getUnderlyingExpr());
1029 void VisitDependentDecltypeType(
const DependentDecltypeType *
T) {
1030 VisitDecltypeType(
T);
1033 void VisitDeducedType(
const DeducedType *
T) {
1034 AddQualType(
T->getDeducedType());
1038 void VisitAutoType(
const AutoType *
T) {
1039 ID.AddInteger((
unsigned)
T->getKeyword());
1040 ID.AddInteger(
T->isConstrained());
1041 if (
T->isConstrained()) {
1042 AddDecl(
T->getTypeConstraintConcept());
1043 ID.AddInteger(
T->getTypeConstraintArguments().size());
1044 for (
const auto &TA :
T->getTypeConstraintArguments())
1047 VisitDeducedType(
T);
1050 void VisitDeducedTemplateSpecializationType(
1051 const DeducedTemplateSpecializationType *
T) {
1053 VisitDeducedType(
T);
1056 void VisitDependentAddressSpaceType(
const DependentAddressSpaceType *
T) {
1058 AddStmt(
T->getAddrSpaceExpr());
1062 void VisitDependentSizedExtVectorType(
const DependentSizedExtVectorType *
T) {
1063 AddQualType(
T->getElementType());
1064 AddStmt(
T->getSizeExpr());
1068 void VisitFunctionType(
const FunctionType *
T) {
1077 void VisitFunctionNoProtoType(
const FunctionNoProtoType *
T) {
1078 VisitFunctionType(
T);
1081 void VisitFunctionProtoType(
const FunctionProtoType *
T) {
1084 AddQualType(ParamType);
1086 VisitFunctionType(
T);
1089 void VisitInjectedClassNameType(
const InjectedClassNameType *
T) {
1090 AddDecl(
T->getDecl()->getDefinitionOrSelf());
1094 void VisitMemberPointerType(
const MemberPointerType *
T) {
1096 AddNestedNameSpecifier(
T->getQualifier());
1100 void VisitObjCObjectPointerType(
const ObjCObjectPointerType *
T) {
1105 void VisitObjCObjectType(
const ObjCObjectType *
T) {
1106 AddDecl(
T->getInterface());
1108 auto TypeArgs =
T->getTypeArgsAsWritten();
1109 ID.AddInteger(TypeArgs.size());
1110 for (
auto Arg : TypeArgs) {
1114 auto Protocols =
T->getProtocols();
1115 ID.AddInteger(Protocols.size());
1116 for (
auto *Protocol : Protocols) {
1125 void VisitObjCInterfaceType(
const ObjCInterfaceType *
T) {
1127 VisitObjCObjectType(
T);
1130 void VisitObjCTypeParamType(
const ObjCTypeParamType *
T) {
1131 AddDecl(
T->getDecl());
1132 auto Protocols =
T->getProtocols();
1133 ID.AddInteger(Protocols.size());
1134 for (
auto *Protocol : Protocols) {
1141 void VisitPackExpansionType(
const PackExpansionType *
T) {
1142 AddQualType(
T->getPattern());
1146 void VisitParenType(
const ParenType *
T) {
1147 AddQualType(
T->getInnerType());
1151 void VisitPipeType(
const PipeType *
T) {
1152 AddQualType(
T->getElementType());
1157 void VisitPointerType(
const PointerType *
T) {
1162 void VisitReferenceType(
const ReferenceType *
T) {
1163 AddQualType(
T->getPointeeTypeAsWritten());
1167 void VisitLValueReferenceType(
const LValueReferenceType *
T) {
1168 VisitReferenceType(
T);
1171 void VisitRValueReferenceType(
const RValueReferenceType *
T) {
1172 VisitReferenceType(
T);
1176 VisitSubstTemplateTypeParmPackType(
const SubstTemplateTypeParmPackType *
T) {
1177 AddDecl(
T->getAssociatedDecl());
1182 void VisitSubstTemplateTypeParmType(
const SubstTemplateTypeParmType *
T) {
1183 AddDecl(
T->getAssociatedDecl());
1184 AddQualType(
T->getReplacementType());
1188 void VisitTagType(
const TagType *
T,
1189 const TypedefType *ElaboratedOverride =
nullptr) {
1190 ID.AddInteger(llvm::to_underlying(
1191 ElaboratedOverride ? ElaboratedTypeKeyword::None :
T->getKeyword()));
1192 AddNestedNameSpecifier(ElaboratedOverride
1193 ? ElaboratedOverride->getQualifier()
1194 :
T->getQualifier());
1195 AddDecl(
T->getDecl()->getDefinitionOrSelf());
1199 void VisitTemplateSpecializationType(
const TemplateSpecializationType *
T) {
1200 ID.AddInteger(
T->template_arguments().size());
1201 for (
const auto &TA :
T->template_arguments()) {
1208 void VisitTemplateTypeParmType(
const TemplateTypeParmType *
T) {
1209 ID.AddInteger(
T->getDepth());
1210 ID.AddInteger(
T->getIndex());
1212 AddDecl(
T->getDecl());
1215 void VisitTypedefType(
const TypedefType *
T) {
1216 ID.AddInteger(llvm::to_underlying(
T->getKeyword()));
1217 AddNestedNameSpecifier(
T->getQualifier());
1218 AddDecl(
T->getDecl());
1222 void VisitTypeOfExprType(
const TypeOfExprType *
T) {
1223 AddStmt(
T->getUnderlyingExpr());
1228 void VisitTypeOfType(
const TypeOfType *
T) {
1229 AddQualType(
T->getUnmodifiedType());
1233 void VisitTypeWithKeyword(
const TypeWithKeyword *
T) {
1234 ID.AddInteger(llvm::to_underlying(
T->getKeyword()));
1238 void VisitDependentNameType(
const DependentNameType *
T) {
1239 AddNestedNameSpecifier(
T->getQualifier());
1240 AddIdentifierInfo(
T->getIdentifier());
1241 VisitTypeWithKeyword(
T);
1244 void VisitUnaryTransformType(
const UnaryTransformType *
T) {
1245 AddQualType(
T->getUnderlyingType());
1246 AddQualType(
T->getBaseType());
1250 void VisitUnresolvedUsingType(
const UnresolvedUsingType *
T) {
1251 AddDecl(
T->getDecl());
1255 void VisitVectorType(
const VectorType *
T) {
1256 AddQualType(
T->getElementType());
1257 ID.AddInteger(
T->getNumElements());
1258 ID.AddInteger(llvm::to_underlying(
T->getVectorKind()));
1262 void VisitExtVectorType(
const ExtVectorType *
T) {
1269 assert(
T &&
"Expecting non-null pointer.");
1270 ODRTypeVisitor(ID, *
this).Visit(
T);
1283 Bools.push_back(
Value);
1297 ID.AddInteger(
Value.getLValueOffset().getQuantity());
1303 ID.AddInteger(
Value.getLValueOffset().getQuantity());
1305 bool OnePastTheEnd =
Value.isLValueOnePastTheEnd();
1306 if (
Value.hasLValuePath()) {
1310 if (
const auto *CAT = dyn_cast<ConstantArrayType>(AT))
1311 OnePastTheEnd |= CAT->getSize() == E.getAsArrayIndex();
1312 TypeSoFar = AT->getElementType();
1314 const Decl *D = E.getAsBaseOrMember().getPointer();
1315 if (
const auto *FD = dyn_cast<FieldDecl>(D)) {
1316 if (FD->getParent()->isUnion())
1317 ID.AddInteger(FD->getFieldIndex());
1318 TypeSoFar = FD->getType();
1327 if (
Value.isNullPointer())
1331 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 (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.
@ 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...
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)