15 #ifndef LLVM_CLANG_AST_ASTCONTEXT_H
16 #define LLVM_CLANG_AST_ASTCONTEXT_H
36 #include "llvm/ADT/DenseMap.h"
37 #include "llvm/ADT/FoldingSet.h"
38 #include "llvm/ADT/IntrusiveRefCntPtr.h"
39 #include "llvm/ADT/MapVector.h"
40 #include "llvm/ADT/SmallPtrSet.h"
41 #include "llvm/ADT/TinyPtrVector.h"
42 #include "llvm/Support/Allocator.h"
53 class ASTRecordLayout;
56 class DiagnosticsEngine;
58 class ASTMutationListener;
59 class IdentifierTable;
60 class MaterializeTemporaryExpr;
64 class MangleNumberingContext;
68 class ObjCPropertyDecl;
69 class UnresolvedSetIterator;
71 class UsingShadowDecl;
72 class VTableContextBase;
87 : Width(Width), Align(Align), AlignIsRequired(AlignIsRequired) {}
96 mutable llvm::FoldingSet<ExtQuals> ExtQualNodes;
97 mutable llvm::FoldingSet<ComplexType> ComplexTypes;
98 mutable llvm::FoldingSet<PointerType> PointerTypes;
99 mutable llvm::FoldingSet<AdjustedType> AdjustedTypes;
100 mutable llvm::FoldingSet<BlockPointerType> BlockPointerTypes;
101 mutable llvm::FoldingSet<LValueReferenceType> LValueReferenceTypes;
102 mutable llvm::FoldingSet<RValueReferenceType> RValueReferenceTypes;
103 mutable llvm::FoldingSet<MemberPointerType> MemberPointerTypes;
104 mutable llvm::FoldingSet<ConstantArrayType> ConstantArrayTypes;
105 mutable llvm::FoldingSet<IncompleteArrayType> IncompleteArrayTypes;
106 mutable std::vector<VariableArrayType*> VariableArrayTypes;
107 mutable llvm::FoldingSet<DependentSizedArrayType> DependentSizedArrayTypes;
108 mutable llvm::FoldingSet<DependentSizedExtVectorType>
109 DependentSizedExtVectorTypes;
110 mutable llvm::FoldingSet<VectorType> VectorTypes;
111 mutable llvm::FoldingSet<FunctionNoProtoType> FunctionNoProtoTypes;
112 mutable llvm::ContextualFoldingSet<FunctionProtoType, ASTContext&>
114 mutable llvm::FoldingSet<DependentTypeOfExprType> DependentTypeOfExprTypes;
115 mutable llvm::FoldingSet<DependentDecltypeType> DependentDecltypeTypes;
116 mutable llvm::FoldingSet<TemplateTypeParmType> TemplateTypeParmTypes;
117 mutable llvm::FoldingSet<SubstTemplateTypeParmType>
118 SubstTemplateTypeParmTypes;
119 mutable llvm::FoldingSet<SubstTemplateTypeParmPackType>
120 SubstTemplateTypeParmPackTypes;
121 mutable llvm::ContextualFoldingSet<TemplateSpecializationType, ASTContext&>
122 TemplateSpecializationTypes;
123 mutable llvm::FoldingSet<ParenType> ParenTypes;
124 mutable llvm::FoldingSet<ElaboratedType> ElaboratedTypes;
125 mutable llvm::FoldingSet<DependentNameType> DependentNameTypes;
128 DependentTemplateSpecializationTypes;
129 llvm::FoldingSet<PackExpansionType> PackExpansionTypes;
130 mutable llvm::FoldingSet<ObjCObjectTypeImpl> ObjCObjectTypes;
131 mutable llvm::FoldingSet<ObjCObjectPointerType> ObjCObjectPointerTypes;
132 mutable llvm::FoldingSet<DependentUnaryTransformType>
133 DependentUnaryTransformTypes;
134 mutable llvm::FoldingSet<AutoType> AutoTypes;
135 mutable llvm::FoldingSet<AtomicType> AtomicTypes;
136 llvm::FoldingSet<AttributedType> AttributedTypes;
137 mutable llvm::FoldingSet<PipeType> PipeTypes;
139 mutable llvm::FoldingSet<QualifiedTemplateName> QualifiedTemplateNames;
140 mutable llvm::FoldingSet<DependentTemplateName> DependentTemplateNames;
141 mutable llvm::FoldingSet<SubstTemplateTemplateParmStorage>
142 SubstTemplateTemplateParms;
145 SubstTemplateTemplateParmPacks;
150 mutable llvm::FoldingSet<NestedNameSpecifier> NestedNameSpecifiers;
157 mutable llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*>
159 mutable llvm::DenseMap<const ObjCContainerDecl*, const ASTRecordLayout*>
163 typedef llvm::DenseMap<const Type *, struct TypeInfo> TypeInfoMap;
164 mutable TypeInfoMap MemoizedTypeInfo;
167 llvm::DenseMap<const CXXRecordDecl*, LazyDeclPtr> KeyFunctions;
170 llvm::DenseMap<ObjCContainerDecl*, ObjCImplDecl*> ObjCImpls;
174 llvm::DenseMap<const ObjCMethodDecl*,const ObjCMethodDecl*> ObjCMethodRedecls;
177 llvm::DenseMap<const VarDecl*, Expr*> BlockVarCopyInits;
181 llvm::DenseMap<const FunctionDecl*, FunctionDecl*>
182 ClassScopeSpecializationPattern;
187 llvm::DenseMap<const MaterializeTemporaryExpr *, APValue *>
188 MaterializedTemporaryValues;
192 class CanonicalTemplateTemplateParm :
public llvm::FoldingSetNode {
203 static void Profile(llvm::FoldingSetNodeID &
ID,
204 TemplateTemplateParmDecl *Parm);
206 mutable llvm::FoldingSet<CanonicalTemplateTemplateParm>
207 CanonTemplateTemplateParms;
209 TemplateTemplateParmDecl *
210 getCanonicalTemplateTemplateParmDecl(TemplateTemplateParmDecl *TTP)
const;
213 mutable TypedefDecl *Int128Decl;
216 mutable TypedefDecl *UInt128Decl;
220 mutable TypedefDecl *BuiltinVaListDecl;
223 mutable TypedefDecl *BuiltinMSVaListDecl;
226 mutable TypedefDecl *ObjCIdDecl;
229 mutable TypedefDecl *ObjCSelDecl;
232 mutable TypedefDecl *ObjCClassDecl;
235 mutable ObjCInterfaceDecl *ObjCProtocolClassDecl;
238 mutable TypedefDecl *BOOLDecl;
242 QualType ObjCIdRedefinitionType;
243 QualType ObjCClassRedefinitionType;
244 QualType ObjCSelRedefinitionType;
247 mutable IdentifierInfo *BoolName =
nullptr;
250 IdentifierInfo *NSObjectName =
nullptr;
253 IdentifierInfo *NSCopyingName =
nullptr;
256 mutable IdentifierInfo *MakeIntegerSeqName =
nullptr;
259 mutable IdentifierInfo *TypePackElementName =
nullptr;
261 QualType ObjCConstantStringType;
262 mutable RecordDecl *CFConstantStringTagDecl;
263 mutable TypedefDecl *CFConstantStringTypeDecl;
265 mutable QualType ObjCSuperType;
267 QualType ObjCNSStringType;
270 TypedefDecl *ObjCInstanceTypeDecl;
276 TypeDecl *jmp_bufDecl;
279 TypeDecl *sigjmp_bufDecl;
282 TypeDecl *ucontext_tDecl;
288 mutable RecordDecl *BlockDescriptorType;
294 mutable RecordDecl *BlockDescriptorExtendedType;
297 FunctionDecl *cudaConfigureCallDecl;
303 llvm::DenseMap<const Decl*, AttrVec*> DeclAttrs;
308 llvm::DenseMap<Decl*, Decl*> MergedDecls;
313 llvm::DenseMap<NamedDecl*, llvm::TinyPtrVector<Module*>> MergedDefModules;
317 typedef llvm::PointerUnion<VarTemplateDecl *, MemberSpecializationInfo *>
352 llvm::DenseMap<const VarDecl *, TemplateOrSpecializationInfo>
353 TemplateOrInstantiation;
378 llvm::DenseMap<UsingDecl *, NamedDecl *> InstantiatedFromUsingDecl;
380 llvm::DenseMap<UsingShadowDecl*, UsingShadowDecl*>
381 InstantiatedFromUsingShadowDecl;
383 llvm::DenseMap<FieldDecl *, FieldDecl *> InstantiatedFromUnnamedFieldDecl;
391 typedef llvm::TinyPtrVector<const CXXMethodDecl*> CXXMethodVector;
392 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector> OverriddenMethods;
397 llvm::DenseMap<const DeclContext *, MangleNumberingContext *>
398 MangleNumberingContexts;
402 llvm::MapVector<const NamedDecl *, unsigned> MangleNumbers;
403 llvm::MapVector<const VarDecl *, unsigned> StaticLocalNumbers;
407 typedef llvm::DenseMap<const VarDecl *, unsigned> ParameterIndexTable;
408 ParameterIndexTable ParamIndices;
427 std::unique_ptr<SanitizerBlacklist> SanitizerBL;
433 mutable llvm::BumpPtrAllocator BumpAlloc;
439 std::unique_ptr<CXXABI> ABI;
447 bool AddrSpaceMapMangling;
472 typedef llvm::DenseMap<
const void *,
473 llvm::PointerUnion4<
const Decl *,
const Stmt *,
479 typedef llvm::DenseMap<
481 llvm::PointerUnion4<
const Decl *,
const Stmt *,
505 return reinterpret_cast<const DynTypedNode *
>(Storage.buffer);
512 return reinterpret_cast<const DynTypedNode *
>(Storage.buffer) + 1;
518 assert(N <
size() &&
"Out of bounds!");
519 return *(
begin() + N);
568 void *
Allocate(
size_t Size,
unsigned Align = 8)
const {
569 return BumpAlloc.Allocate(Size, Align);
571 template <
typename T> T *
Allocate(
size_t Num = 1)
const {
572 return static_cast<T *
>(
Allocate(Num *
sizeof(T), llvm::alignOf<T>()));
579 return BumpAlloc.getTotalMemory();
585 return DiagAllocator;
596 unsigned Signed)
const;
648 return Data.getInt();
656 return Data.getPointer();
672 llvm::PointerIntPair<const RawComment *, 2, Kind> Data;
673 const Decl *OriginalDecl;
697 assert(LangOpts.RetainCommentsFromSystemHeaders ||
709 const Decl **OriginalDecl =
nullptr)
const;
725 const Decl *D)
const;
731 class import_iterator {
738 typedef int difference_type;
739 typedef std::forward_iterator_tag iterator_category;
741 import_iterator() : Import() {}
742 explicit import_iterator(ImportDecl *Import) : Import(Import) {}
744 reference
operator*()
const {
return Import; }
745 pointer operator->()
const {
return Import; }
747 import_iterator &operator++() {
752 import_iterator operator++(
int) {
753 import_iterator Other(*
this);
758 friend bool operator==(import_iterator
X, import_iterator Y) {
759 return X.Import == Y.Import;
762 friend bool operator!=(import_iterator
X, import_iterator Y) {
763 return X.Import != Y.Import;
769 return CommentCommandTraits;
828 typedef llvm::iterator_range<overridden_cxx_method_iterator>
853 return Import->NextLocalImport;
858 return import_range(import_iterator(FirstLocalImport), import_iterator());
863 return Result ? Result : D;
866 MergedDecls[D] = Primary;
872 bool NotifyListeners =
true);
880 auto MergedIt = MergedDefModules.find(Def);
881 if (MergedIt == MergedDefModules.end())
883 return MergedIt->second;
914 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
915 CanQualType SingletonId;
916 #include "clang/Basic/OpenCLImageTypes.def"
1047 bool AsWritten =
false);
1099 cudaConfigureCallDecl = FD;
1102 return cudaConfigureCallDecl;
1114 bool &HasByrefExtendedLayout)
const;
1135 unsigned IndexTypeQuals,
1145 unsigned IndexTypeQuals,
1152 unsigned IndexTypeQuals)
const;
1158 unsigned IndexTypeQuals)
const;
1200 const TypeDecl *PrevDecl =
nullptr)
const {
1201 assert(Decl &&
"Passed null for Decl param");
1202 if (Decl->TypeForDecl)
return QualType(Decl->TypeForDecl, 0);
1205 assert(PrevDecl->TypeForDecl &&
"previous decl has no TypeForDecl");
1206 Decl->TypeForDecl = PrevDecl->TypeForDecl;
1207 return QualType(PrevDecl->TypeForDecl, 0);
1210 return getTypeDeclTypeSlow(Decl);
1283 unsigned NumProtocols)
const;
1288 bool isKindOf)
const;
1313 bool IsDependent)
const;
1388 if (CFConstantStringTypeDecl)
1399 return ObjCConstantStringType;
1403 return ObjCNSStringType;
1407 ObjCNSStringType = T;
1413 if (ObjCIdRedefinitionType.
isNull())
1415 return ObjCIdRedefinitionType;
1420 ObjCIdRedefinitionType = RedefType;
1426 if (ObjCClassRedefinitionType.
isNull())
1428 return ObjCClassRedefinitionType;
1433 ObjCClassRedefinitionType = RedefType;
1439 if (ObjCSelRedefinitionType.
isNull())
1441 return ObjCSelRedefinitionType;
1447 ObjCSelRedefinitionType = RedefType;
1452 if (!NSObjectName) {
1456 return NSObjectName;
1461 if (!NSCopyingName) {
1462 NSCopyingName = &
Idents.
get(
"NSCopying");
1465 return NSCopyingName;
1476 if (!MakeIntegerSeqName)
1477 MakeIntegerSeqName = &
Idents.
get(
"__make_integer_seq");
1478 return MakeIntegerSeqName;
1482 if (!TypePackElementName)
1483 TypePackElementName = &
Idents.
get(
"__type_pack_element");
1484 return TypePackElementName;
1509 this->jmp_bufDecl = jmp_bufDecl;
1521 this->sigjmp_bufDecl = sigjmp_bufDecl;
1533 this->ucontext_tDecl = ucontext_tDecl;
1554 QualType *NotEncodedT=
nullptr)
const;
1564 std::string &
S)
const;
1580 bool Extended =
false)
1591 const Decl *Container,
1592 std::string &
S)
const;
1599 const Decl *Container)
const;
1703 return getExtQualType(Ptr, Qc);
1710 return getExtQualType(T, Qs);
1744 bool TemplateKeyword,
1769 unsigned *IntegerConstantArgs =
nullptr)
const;
1896 bool Simple =
false)
const;
1952 llvm::SmallPtrSet<ObjCProtocolDecl*, 8> &Protocols);
2013 bool IsParam)
const {
2016 if (SubTnullability.hasValue() == SuperTnullability.hasValue()) {
2018 if (!SubTnullability)
2021 if (*SubTnullability == *SuperTnullability ||
2075 bool IsCXXMethod)
const;
2125 return dyn_cast_or_null<DependentSizedArrayType>(
getAsArrayType(T));
2216 return AddrSpaceMapMangling ||
2223 unsigned getIntegerRank(
const Type *T)
const;
2233 bool CompareUnqualified =
false);
2260 bool BlockReturnType);
2268 bool Unqualified =
false,
bool BlockReturnType =
false);
2270 bool Unqualified =
false);
2272 bool OfBlockPointer =
false,
2273 bool Unqualified =
false);
2275 bool OfBlockPointer=
false,
2276 bool Unqualified =
false);
2311 if (Width != Res.getBitWidth())
2312 return Res.extOrTrunc(Width);
2327 return !ObjCImpls.empty();
2403 unsigned ParmIdx,
Expr *DAE);
2505 void getObjCEncodingForTypeImpl(
QualType t, std::string &
S,
2506 bool ExpandPointedToStructures,
2507 bool ExpandStructures,
2509 bool OutermostType =
false,
2510 bool EncodingProperty =
false,
2511 bool StructField =
false,
2512 bool EncodeBlockParameters =
false,
2513 bool EncodeClassNames =
false,
2514 bool EncodePointerToObjCTypedef =
false,
2515 QualType *NotEncodedT=
nullptr)
const;
2518 void getObjCEncodingForStructureImpl(
RecordDecl *RD, std::string &
S,
2520 bool includeVBases =
true,
2521 QualType *NotEncodedT=
nullptr)
const;
2526 bool Extended)
const;
2560 DeallocationFunctionsAndArguments;
2561 DeallocationFunctionsAndArguments Deallocations;
2566 llvm::PointerIntPair<StoredDeclsMap*,1> LastSDM;
2570 void ReleaseDeclContextMaps();
2571 void ReleaseParentMapEntries();
2573 std::unique_ptr<ParentMapPointers> PointerParents;
2574 std::unique_ptr<ParentMapOtherNodes> OtherParents;
2576 std::unique_ptr<VTableContextBase> VTContext;
2597 PragmaSectionLocation(PragmaSectionLocation),
2598 SectionFlags(SectionFlags) {}
2650 return C.Allocate(Bytes, Alignment);
2686 size_t Alignment = 8) {
2687 return C.Allocate(Bytes, Alignment);
2701 template <
typename Owner,
typename T,
2710 return new (Ctx)
LazyData(Source, Value);
static CanQual< Type > CreateUnsafe(QualType Other)
Builds a canonical type from a QualType.
void setExternalSource(IntrusiveRefCntPtr< ExternalASTSource > Source)
Attach an external AST source to the AST context.
MemberSpecializationInfo * getInstantiatedFromStaticDataMember(const VarDecl *Var)
If this variable is an instantiated static data member of a class template specialization, returns the templated static data member from which it was instantiated.
TypedefDecl * getObjCInstanceTypeDecl()
Retrieve the typedef declaration corresponding to the Objective-C "instancetype" type.
void setPrimaryMergedDecl(Decl *D, Decl *Primary)
int getFloatingTypeOrder(QualType LHS, QualType RHS) const
Compare the rank of the two specified floating point types, ignoring the domain of the type (i...
QualType getElaboratedType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType) const
void setTemplateOrSpecializationInfo(VarDecl *Inst, TemplateOrSpecializationInfo TSI)
ASTMutationListener * Listener
const Type * Ty
The locally-unqualified type.
static Selector GetNullarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing a nullary selector.
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
void setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl, TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
Note that the static data member Inst is an instantiation of the static data member template Tmpl of ...
llvm::PointerUnion< VarTemplateDecl *, MemberSpecializationInfo * > TemplateOrSpecializationInfo
A type synonym for the TemplateOrInstantiation mapping.
AttrVec & getDeclAttrs(const Decl *D)
Retrieve the attributes for the given declaration.
QualType getPromotedIntegerType(QualType PromotableType) const
Return the type that PromotableType will promote to: C99 6.3.1.1p2, assuming that PromotableType is a...
void setjmp_bufDecl(TypeDecl *jmp_bufDecl)
Set the type for the C jmp_buf type.
ObjCPropertyImplDecl * getObjCPropertyImplDeclForPropertyDecl(const ObjCPropertyDecl *PD, const Decl *Container) const
Smart pointer class that efficiently represents Objective-C method names.
Holds information about both target-independent and target-specific builtins, allowing easy queries b...
CanQualType LongDoubleComplexTy
GVALinkage GetGVALinkageForFunction(const FunctionDecl *FD) const
QualType mergeFunctionTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
A (possibly-)qualified type.
unsigned overridden_methods_size(const CXXMethodDecl *Method) const
QualType areCommonBaseCompatible(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
TypedefDecl * getUInt128Decl() const
Retrieve the declaration for the 128-bit unsigned integer type.
unsigned getTypeAlign(const Type *T) const
void getObjCEncodingForPropertyType(QualType T, std::string &S) const
Emit the Objective-C property type encoding for the given type T into S.
bool ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto, ObjCProtocolDecl *rProto) const
ProtocolCompatibleWithProtocol - return 'true' if 'lProto' is in the inheritance hierarchy of 'rProto...
NestedNameSpecifier * getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const
Retrieves the "canonical" nested name specifier for a given nested name specifier.
CharUnits getDeclAlign(const Decl *D, bool ForAlignof=false) const
Return a conservative estimate of the alignment of the specified decl D.
ASTContext(LangOptions &LOpts, SourceManager &SM, IdentifierTable &idents, SelectorTable &sels, Builtin::Context &builtins)
static Selector GetUnarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing an unary selector.
QualType getAdjustedType(QualType Orig, QualType New) const
Return the uniqued reference to a type adjusted from the original type to a new type.
bool operator==(CanQual< T > x, CanQual< U > y)
InlineVariableDefinitionKind
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
static unsigned NumImplicitMoveAssignmentOperatorsDeclared
The number of implicitly-declared move assignment operators for which declarations were built...
QualType getComplexType(QualType T) const
Return the uniqued reference to the type for a complex number with the specified element type...
RecordDecl * buildImplicitRecord(StringRef Name, RecordDecl::TagKind TK=TTK_Struct) const
Create a new implicit TU-level CXXRecordDecl or RecordDecl declaration.
void getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT, std::string &S) const
Put the string version of the type qualifiers QT into S.
unsigned getFastQualifiers() const
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
static unsigned NumImplicitDefaultConstructors
The number of implicitly-declared default constructors.
uint64_t getTypeSize(const Type *T) const
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
FunctionType - C99 6.7.5.3 - Function Declarators.
CanQualType getComplexType(CanQualType T) const
QualType getRValueReferenceType(QualType T) const
Return the uniqued reference to the type for an rvalue reference to the specified type...
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
bool CommentsLoaded
True if comments are already loaded from ExternalASTSource.
unsigned getIntWidth(QualType T) const
QualType getIntTypeForBitwidth(unsigned DestWidth, unsigned Signed) const
getIntTypeForBitwidth - sets integer QualTy according to specified details: bitwidth, signed/unsigned.
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
C Language Family Type Representation.
void setObjCClassRedefinitionType(QualType RedefType)
Set the user-written type that redefines 'SEL'.
QualType getWCharType() const
Return the unique wchar_t type available in C++ (and available as __wchar_t as a Microsoft extension)...
static unsigned NumImplicitMoveAssignmentOperators
The number of implicitly-declared move assignment operators.
void setucontext_tDecl(TypeDecl *ucontext_tDecl)
Set the type for the C ucontext_t type.
QualType getUnaryTransformType(QualType BaseType, QualType UnderlyingType, UnaryTransformType::UTTKind UKind) const
Unary type transforms.
CanQualType FloatComplexTy
RawCommentList Comments
All comments in this translation unit.
Defines the clang::Module class, which describes a module in the source code.
CanQualType ObjCBuiltinSelTy
void addDefaultArgExprForConstructor(const CXXConstructorDecl *CD, unsigned ParmIdx, Expr *DAE)
QualType getVolatileType(QualType T) const
Return the uniqued reference to the type for a volatile qualified type.
std::string getObjCEncodingForBlock(const BlockExpr *blockExpr) const
Return the encoded type for this block declaration.
bool isAlignmentRequired(const Type *T) const
Determine if the alignment the type has was required using an alignment attribute.
llvm::iterator_range< import_iterator > import_range
const DynTypedNode & operator[](size_t N) const
FullSourceLoc getFullLoc(SourceLocation Loc) const
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type...
CanQualType ARCUnbridgedCastTy
The base class of the type hierarchy.
void setParameterIndex(const ParmVarDecl *D, unsigned index)
Used by ParmVarDecl to store on the side the index of the parameter when it exceeds the size of the n...
const IncompleteArrayType * getAsIncompleteArrayType(QualType T) const
QualType getRecordType(const RecordDecl *Decl) const
DependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, ArrayRef< TemplateArgument > Args, QualType Canon)
Represents an array type, per C99 6.7.5.2 - Array Declarators.
QualType getObjCClassRedefinitionType() const
Retrieve the type that Class has been defined to, which may be different from the built-in Class if C...
A container of type source information.
FieldDecl * getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field)
Represents a C++ constructor within a class.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
QualType getPipeType(QualType T) const
Return pipe type for the specified type.
void setInstantiatedFromUsingDecl(UsingDecl *Inst, NamedDecl *Pattern)
Remember that the using decl Inst is an instantiation of the using decl Pattern of a class template...
const ASTRecordLayout & getASTObjCImplementationLayout(const ObjCImplementationDecl *D) const
Get or compute information about the layout of the specified Objective-C implementation.
const ast_type_traits::DynTypedNode * begin() const
QualType getBlockPointerType(QualType T) const
Return the uniqued reference to the type for a block of the specified type.
QualType getVariableArrayDecayedType(QualType Ty) const
Returns a vla type where known sizes are replaced with [*].
const RawComment * getRaw() const LLVM_READONLY
VarDecl - An instance of this class is created to represent a variable declaration or definition...
QualType getRestrictType(QualType T) const
Return the uniqued reference to the type for a restrict qualified type.
QualType getFloatingTypeOfSizeWithinDomain(QualType typeSize, QualType typeDomain) const
Return a real floating point or a complex type (based on typeDomain/typeSize).
TypedefDecl * getBuiltinVaListDecl() const
Retrieve the C type declaration corresponding to the predefined __builtin_va_list type...
void removeObjCLifetime()
comments::FullComment * getLocalCommentForDeclUncached(const Decl *D) const
Return parsed documentation comment attached to a given declaration.
void setClassScopeSpecializationPattern(FunctionDecl *FD, FunctionDecl *Pattern)
MangleContext * createMangleContext()
QualType isPromotableBitField(Expr *E) const
Whether this is a promotable bitfield reference according to C99 6.3.1.1p2, bullet 2 (and GCC extensi...
Extra information about a function prototype.
Declaration context for names declared as extern "C" in C++.
QualType getObjCClassType() const
Represents the Objective-C Class type.
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
QualType getucontext_tType() const
Retrieve the C ucontext_t type.
ObjCMethodDecl - Represents an instance or class method declaration.
ObjCImplementationDecl * getObjCImplementation(ObjCInterfaceDecl *D)
Get the implementation of the ObjCInterfaceDecl D, or NULL if none exists.
void setRaw(const RawComment *RC)
Describes how types, statements, expressions, and declarations should be printed. ...
ParmVarDecl - Represents a parameter to a function.
QualType getRawCFConstantStringType() const
Get the structure type used to representation CFStrings, or NULL if it hasn't yet been built...
TemplateArgument getCanonicalTemplateArgument(const TemplateArgument &Arg) const
Retrieve the "canonical" template argument.
QualType getFunctionNoProtoType(QualType ResultTy, const FunctionType::ExtInfo &Info) const
Return a K&R style C function type like 'int()'.
Represents the builtin template declaration which is used to implement __make_integer_seq and other b...
The collection of all-type qualifiers we support.
QualType getArrayDecayedType(QualType T) const
Return the properly qualified result of decaying the specified array type to a pointer.
unsigned getStaticLocalNumber(const VarDecl *VD) const
const SmallVectorImpl< Type * > & getTypes() const
RecordDecl - Represents a struct/union/class.
bool doFunctionTypesMatchOnExtParameterInfos(const FunctionProtoType *FromFunctionType, const FunctionProtoType *ToFunctionType)
ObjCInterfaceDecl * getObjCProtocolDecl() const
Retrieve the Objective-C class declaration corresponding to the predefined Protocol class...
CharUnits getOffsetOfBaseWithVBPtr(const CXXRecordDecl *RD) const
Loading virtual member pointers using the virtual inheritance model always results in an adjustment u...
CanQualType getIntMaxType() const
Return the unique type for "intmax_t" (C99 7.18.1.5), defined in <stdint.h>.
One of these records is kept for each identifier that is lexed.
comments::CommandTraits & getCommentCommandTraits() const
This table allows us to fully hide how we implement multi-keyword caching.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
void getOverriddenMethods(const NamedDecl *Method, SmallVectorImpl< const NamedDecl * > &Overridden) const
Return C++ or ObjC overridden methods for the given Method.
Represents a class type in Objective C.
void setManglingNumber(const NamedDecl *ND, unsigned Number)
QualType getUnsignedWCharType() const
Return the type of "unsigned wchar_t".
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
static unsigned NumImplicitMoveConstructorsDeclared
The number of implicitly-declared move constructors for which declarations were built.
void setObjCConstantStringInterface(ObjCInterfaceDecl *Decl)
void setInstantiatedFromUnnamedFieldDecl(FieldDecl *Inst, FieldDecl *Tmpl)
Missing a type from <ucontext.h>
QualType getAddrSpaceQualType(QualType T, unsigned AddressSpace) const
Return the uniqued reference to the type for an address space qualified type with the specified type ...
QualType getLifetimeQualifiedType(QualType type, Qualifiers::ObjCLifetime lifetime)
Return a type with the given lifetime qualifier.
QualType getExtVectorType(QualType VectorType, unsigned NumElts) const
Return the unique reference to an extended vector type of the specified element type and size...
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
DynTypedNodeList getParents(const NodeT &Node)
Returns the parents of the given node.
void setBOOLDecl(TypedefDecl *TD)
Save declaration of 'BOOL' typedef.
void DeepCollectObjCIvars(const ObjCInterfaceDecl *OI, bool leafClass, SmallVectorImpl< const ObjCIvarDecl * > &Ivars) const
DeepCollectObjCIvars - This routine first collects all declared, but not synthesized, ivars in super class and then collects all ivars, including those synthesized for current class.
InlineVariableDefinitionKind getInlineVariableDefinitionKind(const VarDecl *VD) const
Determine whether a definition of this inline variable should be treated as a weak or strong definiti...
const ast_type_traits::DynTypedNode * end() const
DynTypedNodeList(ArrayRef< DynTypedNode > A)
QualType getCanonicalTemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args) const
void Deallocate(void *Ptr) const
QualType getBlockDescriptorType() const
Gets the struct used to keep track of the descriptor for pointer to blocks.
The iterator over UnresolvedSets.
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
void getObjCEncodingForMethodParameter(Decl::ObjCDeclQualifier QT, QualType T, std::string &S, bool Extended) const
getObjCEncodingForMethodParameter - Return the encoded type for a single method parameter or return t...
Container for either a single DynTypedNode or for an ArrayRef to DynTypedNode.
void setStaticLocalNumber(const VarDecl *VD, unsigned Number)
QualType getTypeOfType(QualType t) const
getTypeOfType - Unlike many "get<Type>" functions, we don't unique TypeOfType nodes...
clang::CharUnits operator*(clang::CharUnits::QuantityType Scale, const clang::CharUnits &CU)
void setPrintingPolicy(const clang::PrintingPolicy &Policy)
unsigned getTargetDefaultAlignForAttributeAligned(void) const
Return the default alignment for attribute((aligned)) on this target, to be used if no alignment valu...
CanQualType OCLReserveIDTy
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
llvm::BumpPtrAllocator & getAllocator() const
bool hasSameUnqualifiedType(QualType T1, QualType T2) const
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
Describes a module or submodule.
bool ObjCObjectAdoptsQTypeProtocols(QualType QT, ObjCInterfaceDecl *Decl)
ObjCObjectAdoptsQTypeProtocols - Checks that protocols in IC's protocol list adopt all protocols in Q...
RawCommentList & getRawCommentList()
Values of this type can be null.
bool isNearlyEmpty(const CXXRecordDecl *RD) const
unsigned CountNonClassIvars(const ObjCInterfaceDecl *OI) const
QualType mergeObjCGCQualifiers(QualType, QualType)
mergeObjCGCQualifiers - This routine merges ObjC's GC attribute of 'LHS' and 'RHS' attributes and ret...
QualType getObjCNSStringType() const
Represents a C++ using-declaration.
bool hasNonFastQualifiers() const
Return true if the set contains any qualifiers which require an ExtQuals node to be allocated...
QualType getParenType(QualType NamedType) const
const TargetInfo & getTargetInfo() const
bool UnwrapSimilarPointerTypes(QualType &T1, QualType &T2)
UnwrapSimilarPointerTypes - If T1 and T2 are pointer types that may be similar (C++ 4...
ObjCContainerDecl - Represents a container for method declarations.
const LangOptions & getLangOpts() const
CharUnits - This is an opaque type for sizes expressed in character units.
A convenient class for passing around template argument information.
void setcudaConfigureCallDecl(FunctionDecl *FD)
Keeps track of the mangled names of lambda expressions and block literals within a particular context...
QualType GetBuiltinType(unsigned ID, GetBuiltinTypeError &Error, unsigned *IntegerConstantArgs=nullptr) const
Return the type for the specified builtin.
IdentifierInfo * getTypePackElementName() const
Whether values of this type can be null is (explicitly) unspecified.
Qualifiers::ObjCLifetime getInnerObjCOwnership(QualType T) const
Recurses in pointer/array types until it finds an Objective-C retainable type and returns its ownersh...
TemplateName getSubstTemplateTemplateParm(TemplateTemplateParmDecl *param, TemplateName replacement) const
Concrete class used by the front-end to report problems and issues.
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
TypeDecl - Represents a declaration of a type.
bool getByrefLifetime(QualType Ty, Qualifiers::ObjCLifetime &Lifetime, bool &HasByrefExtendedLayout) const
Returns true, if given type has a known lifetime.
unsigned getOpenMPDefaultSimdAlign(QualType T) const
Get default simd alignment of the specified complete type in bits.
CanQualType PseudoObjectTy
QualType getIntPtrType() const
Return a type compatible with "intptr_t" (C99 7.18.1.4), as defined by the target.
Decl * getVaListTagDecl() const
Retrieve the C type declaration corresponding to the predefined __va_list_tag type used to help defin...
TypedefDecl * getObjCIdDecl() const
Retrieve the typedef corresponding to the predefined id type in Objective-C.
const SanitizerBlacklist & getSanitizerBlacklist() const
Values of this type can never be null.
const ASTRecordLayout & getASTRecordLayout(const RecordDecl *D) const
Get or compute information about the layout of the specified record (struct/union/class) D...
QualType getSignatureParameterType(QualType T) const
Retrieve the parameter type as adjusted for use in the signature of a function, decaying array and fu...
QualType getsigjmp_bufType() const
Retrieve the C sigjmp_buf type.
void eraseDeclAttrs(const Decl *D)
Erase the attributes corresponding to the given declaration.
CanQualType getAdjustedType(CanQualType Orig, CanQualType New) const
static unsigned NumImplicitDefaultConstructorsDeclared
The number of implicitly-declared default constructors for which declarations were built...
Represents an Objective-C protocol declaration.
A cache of the value of this pointer, in the most recent generation in which we queried it...
QualType mergeTransparentUnionType(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
mergeTransparentUnionType - if T is a transparent union type and a member of T is compatible with Sub...
CharUnits getTypeSizeInChars(QualType T) const
Return the size of the specified (complete) type T, in characters.
Represents an ObjC class declaration.
Decl * getPrimaryMergedDecl(Decl *D)
const DependentSizedArrayType * getAsDependentSizedArrayType(QualType T) const
TypedefDecl * getObjCClassDecl() const
Retrieve the typedef declaration corresponding to the predefined Objective-C 'Class' type...
QualType getCanonicalTypeInternal() const
QualType getInjectedClassNameType(CXXRecordDecl *Decl, QualType TST) const
getInjectedClassNameType - Return the unique reference to the injected class name type for the specif...
std::pair< CharUnits, CharUnits > getTypeInfoInChars(const Type *T) const
IntrusiveRefCntPtr< ExternalASTSource > ExternalSource
CanQualType UnsignedCharTy
DiagnosticsEngine & getDiagnostics() const
unsigned getPreferredTypeAlign(const Type *T) const
Return the "preferred" alignment of the specified type T for the current target, in bits...
bool addressSpaceMapManglingFor(unsigned AS) const
QualType getAutoRRefDeductType() const
C++11 deduction pattern for 'auto &&' type.
CanQualType Float128ComplexTy
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Provides definitions for the various language-specific address spaces.
void adjustDeducedFunctionResultType(FunctionDecl *FD, QualType ResultType)
Change the result type of a function type once it is deduced.
llvm::StringMap< SectionInfo > SectionInfos
QualType getObjCObjectType(QualType Base, ObjCProtocolDecl *const *Protocols, unsigned NumProtocols) const
Legacy interface: cannot provide type arguments or __kindof.
bool AtomicUsesUnsupportedLibcall(const AtomicExpr *E) const
Represents a prototype with parameter type info, e.g.
T * Allocate(size_t Num=1) const
Qualifiers::ObjCLifetime getObjCLifetime() const
Returns lifetime attribute of this type.
static unsigned NumImplicitCopyConstructors
The number of implicitly-declared copy constructors.
Represents a ValueDecl that came out of a declarator.
ArrayRef< Module * > getModulesWithMergedDefinition(NamedDecl *Def)
Get the additional modules in which the definition Def has been merged.
DeclarationNameTable DeclarationNames
QualType getLogicalOperationType() const
The result type of logical operations, '<', '>', '!=', etc.
void getObjCEncodingForType(QualType T, std::string &S, const FieldDecl *Field=nullptr, QualType *NotEncodedT=nullptr) const
Emit the Objective-CC type encoding for the given type T into S.
ArraySizeModifier
Capture whether this is a normal array (e.g.
overridden_cxx_method_iterator overridden_methods_end(const CXXMethodDecl *Method) const
void addObjCLifetime(ObjCLifetime type)
void setCFConstantStringType(QualType T)
QualType getAtomicType(QualType T) const
Return the uniqued reference to the atomic type for the specified type.
bool AnyObjCImplementation()
Return true if there is at least one @implementation in the TU.
QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl=nullptr) const
getObjCInterfaceType - Return the unique reference to the type for the specified ObjC interface decl...
bool ObjCMethodsAreEqual(const ObjCMethodDecl *MethodDecl, const ObjCMethodDecl *MethodImp)
std::pair< CharUnits, CharUnits > getTypeInfoDataSizeInChars(QualType T) const
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
Exposes information about the current target.
QualType getDependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, const TemplateArgumentListInfo &Args) const
Represents an array type in C++ whose size is a value-dependent expression.
bool isSignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is signed or an enumeration types whose underlying ty...
bool hasSameType(const Type *T1, const Type *T2) const
bool isMSStaticDataMemberInlineDefinition(const VarDecl *VD) const
Returns true if this is an inline-initialized static data member which is treated as a definition for...
QualType getAutoDeductType() const
C++11 deduction pattern for 'auto' type.
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
Defines the clang::LangOptions interface.
CanQualType getCanonicalFunctionResultType(QualType ResultType) const
Adjust the given function result type.
QualType getBlockDescriptorExtendedType() const
Gets the struct used to keep track of the extended descriptor for pointer to blocks.
void setInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst, UsingShadowDecl *Pattern)
void addTypedefNameForUnnamedTagDecl(TagDecl *TD, TypedefNameDecl *TND)
void ResetObjCLayout(const ObjCContainerDecl *CD)
MatchFinder::MatchCallback * Callback
Declaration of a template type parameter.
Implements an efficient mapping from strings to IdentifierInfo nodes.
void setObjCMethodRedeclaration(const ObjCMethodDecl *MD, const ObjCMethodDecl *Redecl)
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
TemplateName getOverloadedTemplateName(UnresolvedSetIterator Begin, UnresolvedSetIterator End) const
Retrieve the template name that corresponds to a non-empty lookup.
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
unsigned getParameterIndex(const ParmVarDecl *D) const
Used by ParmVarDecl to retrieve on the side the index of the parameter when it exceeds the size of th...
QualType getWIntType() const
In C99, this returns a type compatible with the type defined in <stddef.h> as defined by the target...
CanQualType OMPArraySectionTy
CanQualType getUIntMaxType() const
Return the unique type for "uintmax_t" (C99 7.18.1.5), defined in <stdint.h>.
TranslationUnitDecl * getTranslationUnitDecl() const
static unsigned NumImplicitMoveConstructors
The number of implicitly-declared move constructors.
QualType getUnqualifiedObjCPointerType(QualType type) const
getUnqualifiedObjCPointerType - Returns version of Objective-C pointer type with lifetime qualifier r...
Defines an enumeration for C++ overloaded operators.
overridden_cxx_method_iterator overridden_methods_begin(const CXXMethodDecl *Method) const
static ImportDecl * getNextLocalImport(ImportDecl *Import)
void setObjCIdRedefinitionType(QualType RedefType)
Set the user-written type that redefines id.
UsingShadowDecl * getInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst)
An allocator for Storage objects, which uses a small cache to objects, used to reduce malloc()/free()...
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
DynTypedNodeList(const DynTypedNode &N)
QualType getObjCSuperType() const
Returns the C struct type for objc_super.
Represents a C++ template name within the type system.
bool isInSystemHeader(SourceLocation Loc) const
Returns if a SourceLocation is in a system header.
MangleNumberingContext * createMangleNumberingContext() const
TypeSourceInfo * getTemplateSpecializationTypeInfo(TemplateName T, SourceLocation TLoc, const TemplateArgumentListInfo &Args, QualType Canon=QualType()) const
TemplateOrSpecializationInfo getTemplateOrSpecializationInfo(const VarDecl *Var)
void setObjCImplementation(ObjCInterfaceDecl *IFaceD, ObjCImplementationDecl *ImplD)
Set the implementation of ObjCInterfaceDecl.
CharUnits toCharUnitsFromBits(int64_t BitSize) const
Convert a size in bits to a size in characters.
CanQualType UnsignedInt128Ty
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
QualType getFILEType() const
Retrieve the C FILE type.
QualType getAdjustedParameterType(QualType T) const
Perform adjustment on the parameter type of a function.
PartialDiagnostic::StorageAllocator & getDiagAllocator()
Qualifiers Quals
The local qualifiers.
QualType getObjCIdType() const
Represents the Objective-CC id type.
QualType withFastQualifiers(unsigned TQs) const
Represents a GCC generic vector type.
NamedDecl * getInstantiatedFromUsingDecl(UsingDecl *Inst)
If the given using decl Inst is an instantiation of a (possibly unresolved) using decl from a templat...
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
void addDeclaratorForUnnamedTagDecl(TagDecl *TD, DeclaratorDecl *DD)
QualType getSubstTemplateTypeParmPackType(const TemplateTypeParmType *Replaced, const TemplateArgument &ArgPack)
Retrieve a.
Implements C++ ABI-specific semantic analysis functions.
void deduplicateMergedDefinitonsFor(NamedDecl *ND)
Clean up the merged definition list.
bool isObjCClassType(QualType T) const
void CollectInheritedProtocols(const Decl *CDecl, llvm::SmallPtrSet< ObjCProtocolDecl *, 8 > &Protocols)
CollectInheritedProtocols - Collect all protocols in current class and those inherited by it...
BuiltinTemplateDecl * getMakeIntegerSeqDecl() const
QualType getCVRQualifiedType(QualType T, unsigned CVR) const
Return a type with additional const, volatile, or restrict qualifiers.
The result type of a method or function.
bool ObjCQualifiedClassTypesAreCompatible(QualType LHS, QualType RHS)
ObjCQualifiedClassTypesAreCompatible - compare Class<pr,...> and Class<pr1, ...>. ...
IdentifierInfo * getNSObjectName()
Retrieve the identifier 'NSObject'.
bool getObjCEncodingForFunctionDecl(const FunctionDecl *Decl, std::string &S)
Emit the encoded type for the function Decl into S.
QualType getObjCConstantStringInterface() const
void setOriginalDecl(const Decl *Orig)
CallingConv
CallingConv - Specifies the calling convention that a function uses.
QualType getWideCharType() const
Return the type of wide characters.
const clang::PrintingPolicy & getPrintingPolicy() const
TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateDecl *Template) const
Retrieve the template name that represents a qualified template name such as std::vector.
bool hasObjCLifetime() const
IdentifierInfo * getNSCopyingName()
Retrieve the identifier 'NSCopying'.
uint64_t getFieldOffset(const ValueDecl *FD) const
Get the offset of a FieldDecl or IndirectFieldDecl, in bits.
QualType getPackExpansionType(QualType Pattern, Optional< unsigned > NumExpansions)
QualType getFunctionNoProtoType(QualType ResultTy) const
Abstract interface for external sources of AST nodes.
SourceLocation PragmaSectionLocation
llvm::SmallVector< ast_type_traits::DynTypedNode, 2 > ParentVector
Contains parents of a node.
TypeSourceInfo * CreateTypeSourceInfo(QualType T, unsigned Size=0) const
Allocate an uninitialized TypeSourceInfo.
There is no lifetime qualification on this type.
static unsigned NumImplicitDestructorsDeclared
The number of implicitly-declared destructors for which declarations were built.
unsigned getTypeAlign(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in bits.
int getIntegerTypeOrder(QualType LHS, QualType RHS) const
Return the highest ranked integer type, see C99 6.3.1.8p1.
TypeInfo getTypeInfo(const Type *T) const
Get the size and alignment of the specified complete type in bits.
CharUnits getTypeAlignInChars(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in characters.
This declaration does not have an attached comment, and we have searched the redeclaration chain...
SelectorTable & Selectors
DeclarationNameInfo getNameForTemplate(TemplateName Name, SourceLocation NameLoc) const
bool QIdProtocolsAdoptObjCObjectProtocols(QualType QT, ObjCInterfaceDecl *IDecl)
QIdProtocolsAdoptObjCObjectProtocols - Checks that protocols in QT's qualified-id protocol list adopt...
Expr * getBlockVarCopyInits(const VarDecl *VD)
Get the copy initialization expression of the VarDecl VD, or NULL if none exists. ...
void AddDeallocation(void(*Callback)(void *), void *Data)
Add a deallocation callback that will be invoked when the ASTContext is destroyed.
ExternCContextDecl * getExternCContextDecl() const
Encodes a location in the source.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any...
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
bool hasSameTemplateName(TemplateName X, TemplateName Y)
Determine whether the given template names refer to the same template.
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists...
RawComment * getRawCommentForDeclNoCache(const Decl *D) const
Return the documentation comment attached to a given declaration, without looking into cache...
A structure for storing an already-substituted template template parameter pack.
CharUnits getObjCEncodingTypeSize(QualType T) const
Return the size of type T for Objective-C encoding purpose, in characters.
static unsigned NumImplicitCopyAssignmentOperatorsDeclared
The number of implicitly-declared copy assignment operators for which declarations were built...
Kind getKind() const LLVM_READONLY
void getLegacyIntegralTypeEncoding(QualType &t) const
getLegacyIntegralTypeEncoding - Another legacy compatibility encoding: 32-bit longs are encoded as 'l...
TagDecl - Represents the declaration of a struct/union/class/enum.
TemplateName getDependentTemplateName(NestedNameSpecifier *NNS, const IdentifierInfo *Name) const
Retrieve the template name that represents a dependent template name such as MetaFun::template apply...
IdentifierInfo * getMakeIntegerSeqName() const
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location, which defaults to the empty location.
QualType getDependentSizedArrayType(QualType EltTy, Expr *NumElts, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals, SourceRange Brackets) const
Return a non-unique reference to the type for a dependently-sized array of the specified element type...
CanQualType getPointerType(CanQualType T) const
QualType withConst() const
QualType getTemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args, QualType Canon=QualType()) const
QualType getConstType(QualType T) const
Return the uniqued reference to the type for a const qualified type.
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangl...
Represents a static or instance method of a struct/union/class.
TypedefNameDecl * getTypedefNameForUnnamedTagDecl(const TagDecl *TD)
CanQualType getCanonicalParamType(QualType T) const
Return the canonical parameter type corresponding to the specific potentially non-canonical one...
Weak for now, might become strong later in this TU.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
QualType getQualifiedType(QualType T, Qualifiers Qs) const
Return a type with additional qualifiers.
QualType getIncompleteArrayType(QualType EltTy, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return a unique reference to the type for an incomplete array of the specified element type...
QualType getObjCSelRedefinitionType() const
Retrieve the type that 'SEL' has been defined to, which may be different from the built-in 'SEL' if '...
const ConstantArrayType * getAsConstantArrayType(QualType T) const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx)
ObjCCategoryDecl - Represents a category declaration.
BuiltinTemplateKind
Kinds of BuiltinTemplateDecl.
QualType getObjCGCQualType(QualType T, Qualifiers::GC gcAttr) const
Return the uniqued reference to the type for an Objective-C gc-qualified type.
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>.
Represents one property declaration in an Objective-C interface.
bool canBindObjCObjectType(QualType To, QualType From)
We have found a comment attached to this particular declaration.
void InitBuiltinTypes(const TargetInfo &Target, const TargetInfo *AuxTarget=nullptr)
Initialize built-in types.
SourceLocation getBegin() const
QualType getAttributedType(AttributedType::Kind attrKind, QualType modifiedType, QualType equivalentType)
QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent) const
C++11 deduced auto type.
bool typesAreBlockPointerCompatible(QualType, QualType)
FunctionDecl * getcudaConfigureCallDecl()
TypedefDecl * getInt128Decl() const
Retrieve the declaration for the 128-bit signed integer type.
FunctionDecl * getClassScopeSpecializationPattern(const FunctionDecl *FD)
QualType getRealTypeForBitwidth(unsigned DestWidth) const
getRealTypeForBitwidth - sets floating point QualTy according to specified bitwidth.
TypeInfo getTypeInfo(QualType T) const
void setObjCSuperType(QualType ST)
llvm::DenseMap< const Decl *, RawCommentAndCacheFlags > RedeclComments
Mapping from declarations to comments attached to any redeclaration.
static DynTypedNode create(const T &Node)
Creates a DynTypedNode from Node.
Describes a module import declaration, which makes the contents of the named module visible in the cu...
unsigned getManglingNumber(const NamedDecl *ND) const
QualType getObjCInstanceType()
Retrieve the Objective-C "instancetype" type, if already known; otherwise, returns a NULL type;...
void getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD, const Decl *Container, std::string &S) const
getObjCEncodingForPropertyDecl - Return the encoded type for this method declaration.
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
QualType getDependentNameType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, QualType Canon=QualType()) const
const SourceManager & getSourceManager() const
QualType getObjCSelType() const
Retrieve the type that corresponds to the predefined Objective-C 'SEL' type.
CanQualType UnsignedShortTy
Base class for declarations which introduce a typedef-name.
ast_type_traits::DynTypedNode Node
bool propertyTypesAreCompatible(QualType, QualType)
Represents a template argument.
TypedefDecl * buildImplicitTypedef(QualType T, StringRef Name) const
Create a new implicit TU-level typedef declaration.
QualType getMemberPointerType(QualType T, const Type *Cls) const
Return the uniqued reference to the type for a member pointer to the specified type in the specified ...
TagTypeKind
The kind of a tag type.
TemplateName getSubstTemplateTemplateParmPack(TemplateTemplateParmDecl *Param, const TemplateArgument &ArgPack) const
CanQualType ObjCBuiltinIdTy
SectionInfo(DeclaratorDecl *Decl, SourceLocation PragmaSectionLocation, int SectionFlags)
QualType getDecayedType(QualType T) const
Return the uniqued reference to the decayed version of the given type.
A qualifier set is used to build a set of qualifiers.
QualType mergeTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false, bool BlockReturnType=false)
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
TypedefDecl * getBOOLDecl() const
Retrieve declaration of 'BOOL' typedef.
unsigned getTargetAddressSpace(Qualifiers Q) const
bool isSentinelNullExpr(const Expr *E)
The base class of all kinds of template declarations (e.g., class, function, etc.).
CanQualType DoubleComplexTy
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
void addCopyConstructorForExceptionObject(CXXRecordDecl *RD, CXXConstructorDecl *CD)
comments::FullComment * getCommentForDecl(const Decl *D, const Preprocessor *PP) const
Return parsed documentation comment attached to a given declaration.
TemplateName getCanonicalTemplateName(TemplateName Name) const
Retrieves the "canonical" template name that refers to a given template.
Reads an AST files chain containing the contents of a translation unit.
CanQualType UnsignedLongLongTy
QualType getEnumType(const EnumDecl *Decl) const
const TargetInfo * getAuxTargetInfo() const
QualType getExceptionObjectType(QualType T) const
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
QualType getObjCProtoType() const
Retrieve the type of the Objective-C Protocol class.
void setASTMutationListener(ASTMutationListener *Listener)
Attach an AST mutation listener to the AST context.
const Type * strip(QualType type)
Collect any qualifiers on the given type and return an unqualified type.
QualType getObjCObjectPointerType(QualType OIT) const
Return a ObjCObjectPointerType type for the given ObjCObjectType.
MangleNumberingContext & getManglingNumberContext(const DeclContext *DC)
Retrieve the context for computing mangling numbers in the given DeclContext.
QualType getTemplateTypeParmType(unsigned Depth, unsigned Index, bool ParameterPack, TemplateTypeParmDecl *ParmDecl=nullptr) const
Retrieve the template type parameter type for a template parameter or parameter pack with the given d...
EnumDecl - Represents an enum.
detail::InMemoryDirectory::const_iterator E
const FunctionType * adjustFunctionType(const FunctionType *Fn, FunctionType::ExtInfo EInfo)
Change the ExtInfo on a function type.
bool canAssignObjCInterfacesInBlockPointer(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT, bool BlockReturnType)
canAssignObjCInterfacesInBlockPointer - This routine is specifically written for providing type-safet...
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
QualType AutoRRefDeductTy
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
QualType getCorrespondingUnsignedType(QualType T) const
unsigned Map[Count]
The type of a lookup table which maps from language-specific address spaces to target-specific ones...
bool areComparableObjCPointerTypes(QualType LHS, QualType RHS)
BuiltinTemplateDecl * getTypePackElementDecl() const
QualType getBuiltinVaListType() const
Retrieve the type of the __builtin_va_list type.
static unsigned NumImplicitCopyAssignmentOperators
The number of implicitly-declared copy assignment operators.
const VariableArrayType * getAsVariableArrayType(QualType T) const
GVALinkage GetGVALinkageForVariable(const VarDecl *VD)
A dynamically typed AST node container.
const Decl * getOriginalDecl() const LLVM_READONLY
QualType getDependentSizedExtVectorType(QualType VectorType, Expr *SizeExpr, SourceLocation AttrLoc) const
Represents a pointer to an Objective C object.
QualType getBuiltinMSVaListType() const
Retrieve the type of the __builtin_ms_va_list type.
CanQualType ObjCBuiltinBoolTy
const RawComment * getRawCommentForAnyRedecl(const Decl *D, const Decl **OriginalDecl=nullptr) const
Return the documentation comment attached to a given declaration.
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
unsigned getAlignOfGlobalVar(QualType T) const
Return the alignment in bits that should be given to a global variable with type T.
BuiltinTemplateDecl * buildBuiltinTemplateDecl(BuiltinTemplateKind BTK, const IdentifierInfo *II) const
QualType getPointerDiffType() const
Return the unique type for "ptrdiff_t" (C99 7.17) defined in <stddef.h>.
bool isObjCNSObjectType() const
comments::FullComment * cloneFullComment(comments::FullComment *FC, const Decl *D) const
QualType getCanonicalType() const
CanQualType UnsignedLongTy
bool areCompatibleVectorTypes(QualType FirstVec, QualType SecondVec)
Return true if the given vector types are of the same unqualified type or if they are equivalent to t...
Selector getSelector(unsigned NumArgs, IdentifierInfo **IIV)
Can create any sort of selector.
unsigned getTargetAddressSpace(unsigned AS) const
void setNonKeyFunction(const CXXMethodDecl *method)
Observe that the given method cannot be a key function.
CanQualType ObjCBuiltinClassTy
DeclaratorDecl * getDeclaratorForUnnamedTagDecl(const TagDecl *TD)
QualType getQualifiedType(const Type *T, Qualifiers Qs) const
Return a type with additional qualifiers.
CanQualType BoundMemberTy
unsigned getAddressSpace() const
void addComment(const RawComment &RC)
uint64_t getCharWidth() const
Return the size of the character type, in bits.
llvm::DenseMap< const Decl *, comments::FullComment * > ParsedComments
Mapping from declarations to parsed comments attached to any redeclaration.
QualType getObjCIdRedefinitionType() const
Retrieve the type that id has been defined to, which may be different from the built-in id if id has ...
import_range local_imports() const
bool canAssignObjCInterfaces(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
canAssignObjCInterfaces - Return true if the two interface types are compatible for assignment from R...
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream...
void setBlockVarCopyInits(VarDecl *VD, Expr *Init)
Set the copy inialization expression of a block var decl.
QualType getTagDeclType(const TagDecl *Decl) const
Return the unique reference to the type for the specified TagDecl (struct/union/class/enum) decl...
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
bool getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, std::string &S, bool Extended=false) const
Emit the encoded type for the method declaration Decl into S.
ASTMutationListener * getASTMutationListener() const
Retrieve a pointer to the AST mutation listener associated with this AST context, if any...
const Type * getCanonicalType(const Type *T) const
SourceManager & getSourceManager()
void mergeDefinitionIntoModule(NamedDecl *ND, Module *M, bool NotifyListeners=true)
Note that the definition ND has been merged into module M, and should be visible whenever M is visibl...
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
QualType getTypedefType(const TypedefNameDecl *Decl, QualType Canon=QualType()) const
Return the unique reference to the type for the specified typedef-name decl.
void setObjCNSStringType(QualType T)
QualType getTypeOfExprType(Expr *e) const
GCC extension.
bool typesAreCompatible(QualType T1, QualType T2, bool CompareUnqualified=false)
Compatibility predicates used to check assignment expressions.
QualType getVariableArrayType(QualType EltTy, Expr *NumElts, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals, SourceRange Brackets) const
Return a non-unique reference to the type for a variable array of the specified element type...
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
CanQualType getDecayedType(CanQualType T) const
const CXXMethodDecl * getCurrentKeyFunction(const CXXRecordDecl *RD)
Get our current best idea for the key function of the given record decl, or NULL if there isn't one...
Represents a C++ struct/union/class.
bool isObjCObjectPointerType() const
Represents a C array with an unspecified size.
VTableContextBase * getVTableContext()
Missing a type from <stdio.h>
bool operator!=(CanQual< T > x, CanQual< U > y)
void * Allocate(size_t Size, unsigned Align=8) const
CallingConv getDefaultCallingConvention(bool isVariadic, bool IsCXXMethod) const
Retrieves the default calling convention for the current target.
Provides information a specialization of a member of a class template, which may be a member function...
void DumpRecordLayout(const RecordDecl *RD, raw_ostream &OS, bool Simple=false) const
size_t getASTAllocatedMemory() const
Return the total amount of physical memory allocated for representing AST nodes and type information...
overridden_method_range overridden_methods(const CXXMethodDecl *Method) const
bool isObjCSelType(QualType T) const
size_t getSideTableAllocatedMemory() const
Return the total memory used for various side tables.
We searched for a comment attached to the particular declaration, but didn't find any...
static unsigned NumImplicitCopyConstructorsDeclared
The number of implicitly-declared copy constructors for which declarations were built.
Builtin::Context & BuiltinInfo
Weak definition of inline variable.
llvm::APSInt MakeIntValue(uint64_t Value, QualType Type) const
Make an APSInt of the appropriate width and signedness for the given Value and integer Type...
QualType getVectorType(QualType VectorType, unsigned NumElts, VectorType::VectorKind VecKind) const
Return the unique reference to a vector type of the specified element type and size.
Writes an AST file containing the contents of a translation unit.
const T * getTypePtr() const
Retrieve the underlying type pointer, which refers to a canonical type.
TypedefDecl * getCFConstantStringDecl() const
A SourceLocation and its associated SourceManager.
Defines the clang::VersionTuple class, which represents a version in the form major[.minor[.subminor]].
static Qualifiers fromCVRMask(unsigned CVR)
void adjustExceptionSpec(FunctionDecl *FD, const FunctionProtoType::ExceptionSpecInfo &ESI, bool AsWritten=false)
Change the exception specification on a function once it is delay-parsed, instantiated, or computed.
CXXMethodVector::const_iterator overridden_cxx_method_iterator
void setObjCSelRedefinitionType(QualType RedefType)
Set the user-written type that redefines 'SEL'.
TranslationUnitDecl - The top declaration context.
unsigned getTargetAddressSpace(QualType T) const
QualType getDecltypeType(Expr *e, QualType UnderlyingType) const
C++11 decltype.
QualType getjmp_bufType() const
Retrieve the C jmp_buf type.
QualType getUIntPtrType() const
Return a type compatible with "uintptr_t" (C99 7.18.1.4), as defined by the target.
GVALinkage
A more specific kind of linkage than enum Linkage.
A lazy value (of type T) that is within an AST node of type Owner, where the value might change in la...
QualType getConstantArrayType(QualType EltTy, const llvm::APInt &ArySize, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return the unique reference to the type for a constant array of the specified element type...
uint64_t getConstantArrayElementCount(const ConstantArrayType *CA) const
Return number of constant array elements.
QualType mergeFunctionParameterTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
mergeFunctionParameterTypes - merge two types which appear as function parameter types ...
Expr * getDefaultArgExprForConstructor(const CXXConstructorDecl *CD, unsigned ParmIdx)
const ObjCInterfaceDecl * getObjContainingInterface(const NamedDecl *ND) const
Returns the Objective-C interface that ND belongs to if it is an Objective-C method/property/ivar etc...
RecordDecl * getCFConstantStringTagDecl() const
TypedefDecl * getObjCSelDecl() const
Retrieve the typedef corresponding to the predefined 'SEL' type in Objective-C.
bool isObjCIdType(QualType T) const
TypedefDecl * getBuiltinMSVaListDecl() const
Retrieve the C type declaration corresponding to the predefined __builtin_ms_va_list type...
Qualifiers::GC getObjCGCAttrKind(QualType Ty) const
Return one of the GCNone, Weak or Strong Objective-C garbage collection attributes.
int64_t toBits(CharUnits CharSize) const
Convert a size in characters to a size in bits.
const llvm::fltSemantics & getFloatTypeSemantics(QualType T) const
Return the APFloat 'semantics' for the specified scalar floating point type.
A trivial tuple used to represent a source range.
NamedDecl - This represents a decl with a name.
void setsigjmp_bufDecl(TypeDecl *sigjmp_bufDecl)
Set the type for the C sigjmp_buf type.
void setFILEDecl(TypeDecl *FILEDecl)
Set the type for the C FILE type.
QualType getSignedWCharType() const
Return the type of "signed wchar_t".
TypeInfo(uint64_t Width, unsigned Align, bool AlignIsRequired)
bool hasSameNullabilityTypeQualifier(QualType SubT, QualType SuperT, bool IsParam) const
Represents a C array with a specified size that is not an integer-constant-expression.
const ASTRecordLayout & getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D) const
Get or compute information about the layout of the specified Objective-C interface.
void addOverriddenMethod(const CXXMethodDecl *Method, const CXXMethodDecl *Overridden)
Note that the given C++ Method overrides the given Overridden method.
bool DeclMustBeEmitted(const Decl *D)
Determines if the decl can be CodeGen'ed or deserialized from PCH lazily, only when used; this is onl...
const CXXConstructorDecl * getCopyConstructorForExceptionObject(CXXRecordDecl *RD)
llvm::PointerUnion< T, LazyData * > ValueType
bool ObjCQualifiedIdTypesAreCompatible(QualType LHS, QualType RHS, bool ForCompare)
ObjCQualifiedIdTypesAreCompatible - We know that one of lhs/rhs is an ObjCQualifiedIDType.
llvm::DenseMap< const void *, llvm::PointerUnion4< const Decl *, const Stmt *, ast_type_traits::DynTypedNode *, ParentVector * > > ParentMapPointers
Maps from a node to its parents.
CharUnits getAlignOfGlobalVarInChars(QualType T) const
Return the alignment in characters that should be given to a global variable with type T...
bool isNull() const
Return true if this QualType doesn't point to a type yet.
static bool isObjCNSObjectType(QualType Ty)
Return true if this is an NSObject object with its NSObject attribute set.
void addedLocalImportDecl(ImportDecl *Import)
Notify the AST context that a new import declaration has been parsed or implicitly created within thi...
QualType getSubstTemplateTypeParmType(const TemplateTypeParmType *Replaced, QualType Replacement) const
Retrieve a substitution-result type.
Missing a type from <setjmp.h>
Optional< NullabilityKind > getNullability(const ASTContext &context) const
Determine the nullability of the given type.
llvm::iterator_range< overridden_cxx_method_iterator > overridden_method_range
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
Represents the canonical version of C arrays with a specified constant size.
This class handles loading and caching of source files into memory.
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
llvm::DenseMap< ast_type_traits::DynTypedNode, llvm::PointerUnion4< const Decl *, const Stmt *, ast_type_traits::DynTypedNode *, ParentVector * > > ParentMapOtherNodes
Parent map for nodes without pointer identity.
QualType getBOOLType() const
type of 'BOOL' type.
A class which abstracts out some details necessary for making a call.
QualType getUnqualifiedArrayType(QualType T, Qualifiers &Quals)
Return this type as a completely-unqualified array type, capturing the qualifiers in Quals...
bool BlockRequiresCopying(QualType Ty, const VarDecl *D)
Returns true iff we need copy/dispose helpers for the given type.
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
APValue * getMaterializedTemporaryValue(const MaterializeTemporaryExpr *E, bool MayCreate)
Get the storage for the constant value of a materialized temporary of static storage duration...
CanQualType OCLClkEventTy
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
CanQualType UnsignedIntTy
QualType getProcessIDType() const
Return the unique type for "pid_t" defined in <sys/types.h>.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
IdentifierInfo * getBoolName() const
Retrieve the identifier 'bool'.
static unsigned NumImplicitDestructors
The number of implicitly-declared destructors.
QualType getCFConstantStringType() const
Return the C structure type used to represent constant CFStrings.