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())
437 const bool IsDefinition =
Method->isThisDeclarationADefinition();
440 AddStmt(
Method->getBody());
444 llvm::SmallVector<const Decl *, 16> Decls;
445 for (Decl *SubDecl :
Method->decls())
447 Decls.push_back(SubDecl);
449 ID.AddInteger(Decls.size());
450 for (
auto SubDecl : Decls)
454 Inherited::VisitObjCMethodDecl(
Method);
457 void VisitTypedefNameDecl(
const TypedefNameDecl *D) {
460 Inherited::VisitTypedefNameDecl(D);
463 void VisitTypedefDecl(
const TypedefDecl *D) {
464 Inherited::VisitTypedefDecl(D);
467 void VisitTypeAliasDecl(
const TypeAliasDecl *D) {
468 Inherited::VisitTypeAliasDecl(D);
471 void VisitFriendDecl(
const FriendDecl *D) {
482 void VisitFriendTemplateDecl(
const FriendTemplateDecl *D) {
486 bool IsTemplateFriend =
488 FriendTemplateDecl::FriendTemplateEntityKind::Template;
490 if (!IsTemplateFriend) {
493 FriendTemplateDecl::FriendTemplateEntityKind::Type &&
502 void VisitTemplateTypeParmDecl(
const TemplateTypeParmDecl *D) {
504 const bool hasDefaultArgument =
507 if (hasDefaultArgument) {
517 Inherited::VisitTemplateTypeParmDecl(D);
520 void VisitNonTypeTemplateParmDecl(
const NonTypeTemplateParmDecl *D) {
522 const bool hasDefaultArgument =
525 if (hasDefaultArgument) {
530 Inherited::VisitNonTypeTemplateParmDecl(D);
533 void VisitTemplateTemplateParmDecl(
const TemplateTemplateParmDecl *D) {
535 const bool hasDefaultArgument =
538 if (hasDefaultArgument) {
543 Inherited::VisitTemplateTemplateParmDecl(D);
546 void VisitTemplateDecl(
const TemplateDecl *D) {
549 Inherited::VisitTemplateDecl(D);
552 void VisitRedeclarableTemplateDecl(
const RedeclarableTemplateDecl *D) {
554 Inherited::VisitRedeclarableTemplateDecl(D);
557 void VisitFunctionTemplateDecl(
const FunctionTemplateDecl *D) {
560 Inherited::VisitFunctionTemplateDecl(D);
563 void VisitEnumConstantDecl(
const EnumConstantDecl *D) {
565 Inherited::VisitEnumConstantDecl(D);
579 case Decl::AccessSpec:
580 case Decl::CXXConstructor:
581 case Decl::CXXDestructor:
582 case Decl::CXXMethod:
583 case Decl::EnumConstant:
586 case Decl::FriendTemplate:
587 case Decl::FunctionTemplate:
588 case Decl::StaticAssert:
589 case Decl::TypeAlias:
592 case Decl::ObjCMethod:
594 case Decl::ObjCProperty:
600 assert(D &&
"Expecting non-null pointer.");
602 ODRDeclVisitor(ID, *
this).Visit(D);
607 "Expected non-null record to be a definition.");
624 Decls.push_back(SubDecl);
625 if (
auto *
Function = dyn_cast<FunctionDecl>(SubDecl)) {
632 ID.AddInteger(Decls.size());
633 for (
auto SubDecl : Decls) {
643 ID.AddInteger(
Record->getNumBases());
644 auto Bases =
Record->bases();
645 for (
const auto &
Base : Bases) {
647 ID.AddInteger(
Base.isVirtual());
648 ID.AddInteger(
Base.getAccessSpecifierAsWritten());
654 "For CXXRecordDecl should call AddCXXRecordDecl.");
662 Decls.push_back(SubDecl);
665 ID.AddInteger(Decls.size());
666 for (
const Decl *SubDecl : Decls)
676 ID.AddInteger(SuperClass->getODRHash());
690 Decls.push_back(SubDecl);
692 ID.AddInteger(Decls.size());
693 for (
auto *SubDecl : Decls)
699 assert(
Function &&
"Expecting non-null pointer.");
705 if (
auto *F = dyn_cast<FunctionDecl>(DC)) {
706 if (F->isFunctionTemplateSpecialization()) {
711 if (F->getDependentSpecializationInfo())
720 ID.AddInteger(
Function->getDeclKind());
722 const auto *SpecializationArgs =
Function->getTemplateSpecializationArgs();
724 if (SpecializationArgs) {
725 ID.AddInteger(SpecializationArgs->size());
736 ID.AddInteger(
Function->getStorageClass());
747 ID.AddString(DeletedMessage->
getBytes());
753 ID.AddInteger(
Function->param_size());
754 for (
auto *Param :
Function->parameters())
762 const bool HasBody =
Function->isThisDeclarationADefinition() &&
780 Decls.push_back(SubDecl);
784 ID.AddInteger(Decls.size());
785 for (
auto SubDecl : Decls) {
795 if (
Enum->isScoped())
798 if (
Enum->getIntegerTypeSourceInfo())
804 for (
Decl *SubDecl :
Enum->decls()) {
807 Decls.push_back(SubDecl);
811 ID.AddInteger(Decls.size());
812 for (
auto SubDecl : Decls) {
833 Decls.push_back(SubDecl);
837 ID.AddInteger(Decls.size());
838 for (
auto *SubDecl : Decls) {
844 assert(D &&
"Expecting non-null pointer.");
847 const NamedDecl *ND = dyn_cast<NamedDecl>(D);
854 if (
auto *FD = dyn_cast<FunctionDecl>(D))
863 if (
auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D))
864 Args = CTSD->getTemplateArgs().asArray();
865 else if (
auto *VTSD = dyn_cast<VarTemplateSpecializationDecl>(D))
866 Args = VTSD->getTemplateArgs().asArray();
867 else if (
auto *FD = dyn_cast<FunctionDecl>(D))
868 if (FD->getTemplateSpecializationArgs())
869 Args = FD->getTemplateSpecializationArgs()->asArray();
871 for (
auto &TA : Args)
878class ODRTypeVisitor :
public TypeVisitor<ODRTypeVisitor> {
880 llvm::FoldingSetNodeID &ID;
884 ODRTypeVisitor(llvm::FoldingSetNodeID &ID,
ODRHash &Hash)
885 : ID(ID), Hash(Hash) {}
887 void AddStmt(
Stmt *S) {
894 void AddDecl(
const Decl *D) {
901 void AddQualType(QualType
T) {
905 void AddType(
const Type *
T) {
912 void AddNestedNameSpecifier(NestedNameSpecifier NNS) {
916 void AddIdentifierInfo(
const IdentifierInfo *II) {
923 void VisitQualifiers(Qualifiers Quals) {
928 bool handleTypedef(
const Type *
T) {
929 const auto *TypedefT = dyn_cast<TypedefType>(
T);
933 QualType UnderlyingType = TypedefT->desugar();
938 const auto *TagT = dyn_cast<TagType>(UnderlyingType);
939 if (!TagT || TagT->getQualifier())
942 if (TypedefT->getDecl()->getIdentifier() !=
943 TagT->getDecl()->getIdentifier())
946 ID.AddInteger(TagT->getTypeClass());
947 VisitTagType(TagT, TypedefT);
951 void Visit(
const Type *
T) {
952 if (
const auto *UsingT = dyn_cast<UsingType>(
T)) {
957 .getTypeDeclType(UsingT->getKeyword(), UsingT->getQualifier(),
961 if (handleTypedef(
T))
967 void VisitType(
const Type *
T) {}
969 void VisitAdjustedType(
const AdjustedType *
T) {
970 AddQualType(
T->getOriginalType());
975 void VisitDecayedType(
const DecayedType *
T) {
978 VisitAdjustedType(
T);
981 void VisitArrayType(
const ArrayType *
T) {
982 AddQualType(
T->getElementType());
983 ID.AddInteger(llvm::to_underlying(
T->getSizeModifier()));
984 VisitQualifiers(
T->getIndexTypeQualifiers());
987 void VisitConstantArrayType(
const ConstantArrayType *
T) {
992 void VisitArrayParameterType(
const ArrayParameterType *
T) {
993 VisitConstantArrayType(
T);
996 void VisitDependentSizedArrayType(
const DependentSizedArrayType *
T) {
997 AddStmt(
T->getSizeExpr());
1001 void VisitIncompleteArrayType(
const IncompleteArrayType *
T) {
1005 void VisitVariableArrayType(
const VariableArrayType *
T) {
1006 AddStmt(
T->getSizeExpr());
1010 void VisitAttributedType(
const AttributedType *
T) {
1011 ID.AddInteger(
T->getAttrKind());
1012 AddQualType(
T->getModifiedType());
1017 void VisitBlockPointerType(
const BlockPointerType *
T) {
1022 void VisitBuiltinType(
const BuiltinType *
T) {
1023 ID.AddInteger(
T->getKind());
1027 void VisitComplexType(
const ComplexType *
T) {
1028 AddQualType(
T->getElementType());
1032 void VisitDecltypeType(
const DecltypeType *
T) {
1033 Hash.
AddStmt(
T->getUnderlyingExpr());
1037 void VisitDependentDecltypeType(
const DependentDecltypeType *
T) {
1038 VisitDecltypeType(
T);
1041 void VisitDeducedType(
const DeducedType *
T) {
1042 AddQualType(
T->getDeducedType());
1046 void VisitAutoType(
const AutoType *
T) {
1047 ID.AddInteger((
unsigned)
T->getKeyword());
1048 ID.AddInteger(
T->isConstrained());
1049 if (
T->isConstrained()) {
1051 ID.AddInteger(
T->getTypeConstraintArguments().size());
1052 for (
const auto &TA :
T->getTypeConstraintArguments())
1055 VisitDeducedType(
T);
1058 void VisitDeducedTemplateSpecializationType(
1059 const DeducedTemplateSpecializationType *
T) {
1061 VisitDeducedType(
T);
1064 void VisitDependentAddressSpaceType(
const DependentAddressSpaceType *
T) {
1066 AddStmt(
T->getAddrSpaceExpr());
1070 void VisitDependentSizedExtVectorType(
const DependentSizedExtVectorType *
T) {
1071 AddQualType(
T->getElementType());
1072 AddStmt(
T->getSizeExpr());
1076 void VisitFunctionType(
const FunctionType *
T) {
1085 void VisitFunctionNoProtoType(
const FunctionNoProtoType *
T) {
1086 VisitFunctionType(
T);
1089 void VisitFunctionProtoType(
const FunctionProtoType *
T) {
1092 AddQualType(ParamType);
1094 VisitFunctionType(
T);
1097 void VisitInjectedClassNameType(
const InjectedClassNameType *
T) {
1098 AddDecl(
T->getDecl()->getDefinitionOrSelf());
1102 void VisitMemberPointerType(
const MemberPointerType *
T) {
1104 AddNestedNameSpecifier(
T->getQualifier());
1108 void VisitObjCObjectPointerType(
const ObjCObjectPointerType *
T) {
1113 void VisitObjCObjectType(
const ObjCObjectType *
T) {
1114 AddDecl(
T->getInterface());
1116 auto TypeArgs =
T->getTypeArgsAsWritten();
1117 ID.AddInteger(TypeArgs.size());
1118 for (
auto Arg : TypeArgs) {
1122 auto Protocols =
T->getProtocols();
1123 ID.AddInteger(Protocols.size());
1124 for (
auto *Protocol : Protocols) {
1133 void VisitObjCInterfaceType(
const ObjCInterfaceType *
T) {
1135 VisitObjCObjectType(
T);
1138 void VisitObjCTypeParamType(
const ObjCTypeParamType *
T) {
1139 AddDecl(
T->getDecl());
1140 auto Protocols =
T->getProtocols();
1141 ID.AddInteger(Protocols.size());
1142 for (
auto *Protocol : Protocols) {
1149 void VisitPackExpansionType(
const PackExpansionType *
T) {
1150 AddQualType(
T->getPattern());
1154 void VisitParenType(
const ParenType *
T) {
1155 AddQualType(
T->getInnerType());
1159 void VisitPipeType(
const PipeType *
T) {
1160 AddQualType(
T->getElementType());
1165 void VisitPointerType(
const PointerType *
T) {
1170 void VisitReferenceType(
const ReferenceType *
T) {
1171 AddQualType(
T->getPointeeTypeAsWritten());
1175 void VisitLValueReferenceType(
const LValueReferenceType *
T) {
1176 VisitReferenceType(
T);
1179 void VisitRValueReferenceType(
const RValueReferenceType *
T) {
1180 VisitReferenceType(
T);
1184 VisitSubstTemplateTypeParmPackType(
const SubstTemplateTypeParmPackType *
T) {
1185 AddDecl(
T->getAssociatedDecl());
1190 void VisitSubstTemplateTypeParmType(
const SubstTemplateTypeParmType *
T) {
1191 AddDecl(
T->getAssociatedDecl());
1192 AddQualType(
T->getReplacementType());
1196 void VisitTagType(
const TagType *
T,
1197 const TypedefType *ElaboratedOverride =
nullptr) {
1198 ID.AddInteger(llvm::to_underlying(
1199 ElaboratedOverride ? ElaboratedTypeKeyword::None :
T->getKeyword()));
1200 AddNestedNameSpecifier(ElaboratedOverride
1201 ? ElaboratedOverride->getQualifier()
1202 :
T->getQualifier());
1203 AddDecl(
T->getDecl()->getDefinitionOrSelf());
1207 void VisitTemplateSpecializationType(
const TemplateSpecializationType *
T) {
1208 ID.AddInteger(
T->template_arguments().size());
1209 for (
const auto &TA :
T->template_arguments()) {
1216 void VisitTemplateTypeParmType(
const TemplateTypeParmType *
T) {
1217 ID.AddInteger(
T->getDepth());
1218 ID.AddInteger(
T->getIndex());
1220 AddDecl(
T->getDecl());
1223 void VisitTypedefType(
const TypedefType *
T) {
1224 ID.AddInteger(llvm::to_underlying(
T->getKeyword()));
1225 AddNestedNameSpecifier(
T->getQualifier());
1226 AddDecl(
T->getDecl());
1230 void VisitTypeOfExprType(
const TypeOfExprType *
T) {
1231 AddStmt(
T->getUnderlyingExpr());
1236 void VisitTypeOfType(
const TypeOfType *
T) {
1237 AddQualType(
T->getUnmodifiedType());
1241 void VisitTypeWithKeyword(
const TypeWithKeyword *
T) {
1242 ID.AddInteger(llvm::to_underlying(
T->getKeyword()));
1246 void VisitDependentNameType(
const DependentNameType *
T) {
1247 AddNestedNameSpecifier(
T->getQualifier());
1248 AddIdentifierInfo(
T->getIdentifier());
1249 VisitTypeWithKeyword(
T);
1252 void VisitUnaryTransformType(
const UnaryTransformType *
T) {
1253 AddQualType(
T->getUnderlyingType());
1254 AddQualType(
T->getBaseType());
1258 void VisitUnresolvedUsingType(
const UnresolvedUsingType *
T) {
1259 AddDecl(
T->getDecl());
1263 void VisitVectorType(
const VectorType *
T) {
1264 AddQualType(
T->getElementType());
1265 ID.AddInteger(
T->getNumElements());
1266 ID.AddInteger(llvm::to_underlying(
T->getVectorKind()));
1270 void VisitExtVectorType(
const ExtVectorType *
T) {
1277 assert(
T &&
"Expecting non-null pointer.");
1278 ODRTypeVisitor(ID, *
this).Visit(
T);
1291 Bools.push_back(
Value);
1305 ID.AddInteger(
Value.getLValueOffset().getQuantity());
1311 ID.AddInteger(
Value.getLValueOffset().getQuantity());
1313 bool OnePastTheEnd =
Value.isLValueOnePastTheEnd();
1314 if (
Value.hasLValuePath()) {
1318 if (
const auto *CAT = dyn_cast<ConstantArrayType>(AT))
1319 OnePastTheEnd |= CAT->getSize() == E.getAsArrayIndex();
1320 TypeSoFar = AT->getElementType();
1322 const Decl *D = E.getAsBaseOrMember().getPointer();
1323 if (
const auto *FD = dyn_cast<FieldDecl>(D)) {
1324 if (FD->getParent()->isUnion())
1325 ID.AddInteger(FD->getFieldIndex());
1326 TypeSoFar = FD->getType();
1335 if (
Value.isNullPointer())
1339 if (
Value.hasLValuePath())
llvm::MachO::Target Target
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)