15 #ifndef LLVM_CLANG_AST_ASTCONTEXT_H
16 #define LLVM_CLANG_AST_ASTCONTEXT_H
35 #include "llvm/ADT/DenseMap.h"
36 #include "llvm/ADT/FoldingSet.h"
37 #include "llvm/ADT/IntrusiveRefCntPtr.h"
38 #include "llvm/ADT/SmallPtrSet.h"
39 #include "llvm/ADT/TinyPtrVector.h"
40 #include "llvm/Support/Allocator.h"
51 class ASTRecordLayout;
54 class DiagnosticsEngine;
56 class ASTMutationListener;
57 class IdentifierTable;
58 class MaterializeTemporaryExpr;
62 class MangleNumberingContext;
66 class ObjCPropertyDecl;
67 class UnresolvedSetIterator;
69 class UsingShadowDecl;
70 class VTableContextBase;
84 : Width(Width), Align(Align), AlignIsRequired(AlignIsRequired) {}
93 mutable llvm::FoldingSet<ExtQuals> ExtQualNodes;
94 mutable llvm::FoldingSet<ComplexType> ComplexTypes;
95 mutable llvm::FoldingSet<PointerType> PointerTypes;
96 mutable llvm::FoldingSet<AdjustedType> AdjustedTypes;
97 mutable llvm::FoldingSet<BlockPointerType> BlockPointerTypes;
98 mutable llvm::FoldingSet<LValueReferenceType> LValueReferenceTypes;
99 mutable llvm::FoldingSet<RValueReferenceType> RValueReferenceTypes;
100 mutable llvm::FoldingSet<MemberPointerType> MemberPointerTypes;
101 mutable llvm::FoldingSet<ConstantArrayType> ConstantArrayTypes;
102 mutable llvm::FoldingSet<IncompleteArrayType> IncompleteArrayTypes;
103 mutable std::vector<VariableArrayType*> VariableArrayTypes;
104 mutable llvm::FoldingSet<DependentSizedArrayType> DependentSizedArrayTypes;
105 mutable llvm::FoldingSet<DependentSizedExtVectorType>
106 DependentSizedExtVectorTypes;
107 mutable llvm::FoldingSet<VectorType> VectorTypes;
108 mutable llvm::FoldingSet<FunctionNoProtoType> FunctionNoProtoTypes;
109 mutable llvm::ContextualFoldingSet<FunctionProtoType, ASTContext&>
111 mutable llvm::FoldingSet<DependentTypeOfExprType> DependentTypeOfExprTypes;
112 mutable llvm::FoldingSet<DependentDecltypeType> DependentDecltypeTypes;
113 mutable llvm::FoldingSet<TemplateTypeParmType> TemplateTypeParmTypes;
114 mutable llvm::FoldingSet<SubstTemplateTypeParmType>
115 SubstTemplateTypeParmTypes;
116 mutable llvm::FoldingSet<SubstTemplateTypeParmPackType>
117 SubstTemplateTypeParmPackTypes;
118 mutable llvm::ContextualFoldingSet<TemplateSpecializationType, ASTContext&>
119 TemplateSpecializationTypes;
120 mutable llvm::FoldingSet<ParenType> ParenTypes;
121 mutable llvm::FoldingSet<ElaboratedType> ElaboratedTypes;
122 mutable llvm::FoldingSet<DependentNameType> DependentNameTypes;
125 DependentTemplateSpecializationTypes;
126 llvm::FoldingSet<PackExpansionType> PackExpansionTypes;
127 mutable llvm::FoldingSet<ObjCObjectTypeImpl> ObjCObjectTypes;
128 mutable llvm::FoldingSet<ObjCObjectPointerType> ObjCObjectPointerTypes;
129 mutable llvm::FoldingSet<AutoType> AutoTypes;
130 mutable llvm::FoldingSet<AtomicType> AtomicTypes;
131 llvm::FoldingSet<AttributedType> AttributedTypes;
133 mutable llvm::FoldingSet<QualifiedTemplateName> QualifiedTemplateNames;
134 mutable llvm::FoldingSet<DependentTemplateName> DependentTemplateNames;
135 mutable llvm::FoldingSet<SubstTemplateTemplateParmStorage>
136 SubstTemplateTemplateParms;
139 SubstTemplateTemplateParmPacks;
144 mutable llvm::FoldingSet<NestedNameSpecifier> NestedNameSpecifiers;
151 mutable llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*>
153 mutable llvm::DenseMap<const ObjCContainerDecl*, const ASTRecordLayout*>
157 typedef llvm::DenseMap<const Type *, struct TypeInfo> TypeInfoMap;
158 mutable TypeInfoMap MemoizedTypeInfo;
161 llvm::DenseMap<const CXXRecordDecl*, LazyDeclPtr> KeyFunctions;
164 llvm::DenseMap<ObjCContainerDecl*, ObjCImplDecl*> ObjCImpls;
168 llvm::DenseMap<const ObjCMethodDecl*,const ObjCMethodDecl*> ObjCMethodRedecls;
171 llvm::DenseMap<const VarDecl*, Expr*> BlockVarCopyInits;
175 llvm::DenseMap<const FunctionDecl*, FunctionDecl*>
176 ClassScopeSpecializationPattern;
180 llvm::DenseMap<const MaterializeTemporaryExpr*, APValue>
181 MaterializedTemporaryValues;
185 class CanonicalTemplateTemplateParm :
public llvm::FoldingSetNode {
194 void Profile(llvm::FoldingSetNodeID &
ID) { Profile(ID, Parm); }
196 static void Profile(llvm::FoldingSetNodeID &
ID,
197 TemplateTemplateParmDecl *Parm);
199 mutable llvm::FoldingSet<CanonicalTemplateTemplateParm>
200 CanonTemplateTemplateParms;
202 TemplateTemplateParmDecl *
203 getCanonicalTemplateTemplateParmDecl(TemplateTemplateParmDecl *TTP)
const;
206 mutable TypedefDecl *Int128Decl;
209 mutable TypedefDecl *UInt128Decl;
212 mutable TypeDecl *Float128StubDecl;
216 mutable TypedefDecl *BuiltinVaListDecl;
219 mutable TypedefDecl *ObjCIdDecl;
222 mutable TypedefDecl *ObjCSelDecl;
225 mutable TypedefDecl *ObjCClassDecl;
228 mutable ObjCInterfaceDecl *ObjCProtocolClassDecl;
231 mutable TypedefDecl *BOOLDecl;
235 QualType ObjCIdRedefinitionType;
236 QualType ObjCClassRedefinitionType;
237 QualType ObjCSelRedefinitionType;
240 IdentifierInfo *NSObjectName =
nullptr;
243 IdentifierInfo *NSCopyingName =
nullptr;
245 QualType ObjCConstantStringType;
246 mutable RecordDecl *CFConstantStringTypeDecl;
248 mutable QualType ObjCSuperType;
250 QualType ObjCNSStringType;
253 TypedefDecl *ObjCInstanceTypeDecl;
259 TypeDecl *jmp_bufDecl;
262 TypeDecl *sigjmp_bufDecl;
265 TypeDecl *ucontext_tDecl;
271 mutable RecordDecl *BlockDescriptorType;
277 mutable RecordDecl *BlockDescriptorExtendedType;
280 FunctionDecl *cudaConfigureCallDecl;
286 llvm::DenseMap<const Decl*, AttrVec*> DeclAttrs;
291 llvm::DenseMap<Decl*, Decl*> MergedDecls;
296 llvm::DenseMap<NamedDecl*, llvm::TinyPtrVector<Module*>> MergedDefModules;
300 typedef llvm::PointerUnion<VarTemplateDecl *, MemberSpecializationInfo *>
335 llvm::DenseMap<const VarDecl *, TemplateOrSpecializationInfo>
336 TemplateOrInstantiation;
361 llvm::DenseMap<UsingDecl *, NamedDecl *> InstantiatedFromUsingDecl;
363 llvm::DenseMap<UsingShadowDecl*, UsingShadowDecl*>
364 InstantiatedFromUsingShadowDecl;
366 llvm::DenseMap<FieldDecl *, FieldDecl *> InstantiatedFromUnnamedFieldDecl;
374 typedef llvm::TinyPtrVector<const CXXMethodDecl*> CXXMethodVector;
375 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector> OverriddenMethods;
380 llvm::DenseMap<const DeclContext *, MangleNumberingContext *>
381 MangleNumberingContexts;
385 llvm::DenseMap<const NamedDecl *, unsigned> MangleNumbers;
386 llvm::DenseMap<const VarDecl *, unsigned> StaticLocalNumbers;
390 typedef llvm::DenseMap<const VarDecl *, unsigned> ParameterIndexTable;
391 ParameterIndexTable ParamIndices;
408 std::unique_ptr<SanitizerBlacklist> SanitizerBL;
414 mutable llvm::BumpPtrAllocator BumpAlloc;
420 std::unique_ptr<CXXABI> ABI;
428 bool AddrSpaceMapMangling;
450 typedef llvm::DenseMap<
const void *,
478 template <
typename NodeT>
501 void *
Allocate(
size_t Size,
unsigned Align = 8)
const {
502 return BumpAlloc.Allocate(Size, Align);
509 return BumpAlloc.getTotalMemory();
515 return DiagAllocator;
525 unsigned Signed)
const;
577 return Data.getInt();
585 return Data.getPointer();
601 llvm::PointerIntPair<const RawComment *, 2, Kind> Data;
602 const Decl *OriginalDecl;
626 assert(LangOpts.RetainCommentsFromSystemHeaders ||
638 const Decl **OriginalDecl =
nullptr)
const;
654 const Decl *D)
const;
660 class import_iterator {
667 typedef int difference_type;
668 typedef std::forward_iterator_tag iterator_category;
670 import_iterator() : Import() {}
671 explicit import_iterator(ImportDecl *Import) : Import(Import) {}
673 reference
operator*()
const {
return Import; }
674 pointer operator->()
const {
return Import; }
676 import_iterator &operator++() {
681 import_iterator operator++(
int) {
682 import_iterator Other(*
this);
687 friend bool operator==(import_iterator
X, import_iterator Y) {
688 return X.Import == Y.Import;
691 friend bool operator!=(import_iterator
X, import_iterator Y) {
692 return X.Import != Y.Import;
698 return CommentCommandTraits;
779 return Import->NextLocalImport;
784 return import_range(import_iterator(FirstLocalImport), import_iterator());
789 return Result ? Result : D;
792 MergedDecls[D] = Primary;
798 bool NotifyListeners =
true);
806 auto MergedIt = MergedDefModules.find(Def);
807 if (MergedIt == MergedDefModules.end())
809 return MergedIt->second;
965 bool AsWritten =
false);
1014 cudaConfigureCallDecl = FD;
1017 return cudaConfigureCallDecl;
1029 bool &HasByrefExtendedLayout)
const;
1050 unsigned IndexTypeQuals,
1060 unsigned IndexTypeQuals,
1067 unsigned IndexTypeQuals)
const;
1073 unsigned IndexTypeQuals)
const;
1115 const TypeDecl *PrevDecl =
nullptr)
const {
1116 assert(Decl &&
"Passed null for Decl param");
1117 if (Decl->TypeForDecl)
return QualType(Decl->TypeForDecl, 0);
1120 assert(PrevDecl->TypeForDecl &&
"previous decl has no TypeForDecl");
1121 Decl->TypeForDecl = PrevDecl->TypeForDecl;
1122 return QualType(PrevDecl->TypeForDecl, 0);
1125 return getTypeDeclTypeSlow(Decl);
1161 unsigned NumArgs)
const;
1201 unsigned NumProtocols)
const;
1206 bool isKindOf)
const;
1231 bool IsDependent)
const;
1306 if (CFConstantStringTypeDecl)
1315 return ObjCConstantStringType;
1319 return ObjCNSStringType;
1323 ObjCNSStringType = T;
1329 if (ObjCIdRedefinitionType.
isNull())
1331 return ObjCIdRedefinitionType;
1336 ObjCIdRedefinitionType = RedefType;
1342 if (ObjCClassRedefinitionType.
isNull())
1344 return ObjCClassRedefinitionType;
1349 ObjCClassRedefinitionType = RedefType;
1355 if (ObjCSelRedefinitionType.
isNull())
1357 return ObjCSelRedefinitionType;
1363 ObjCSelRedefinitionType = RedefType;
1368 if (!NSObjectName) {
1372 return NSObjectName;
1377 if (!NSCopyingName) {
1378 NSCopyingName = &
Idents.
get(
"NSCopying");
1381 return NSCopyingName;
1406 this->jmp_bufDecl = jmp_bufDecl;
1418 this->sigjmp_bufDecl = sigjmp_bufDecl;
1430 this->ucontext_tDecl = ucontext_tDecl;
1451 QualType *NotEncodedT=
nullptr)
const;
1461 std::string &
S)
const;
1477 bool Extended =
false)
1488 const Decl *Container,
1489 std::string &
S)
const;
1496 const Decl *Container)
const;
1591 return getExtQualType(Ptr, Qc);
1598 return getExtQualType(T, Qs);
1632 bool TemplateKeyword,
1657 unsigned *IntegerConstantArgs =
nullptr)
const;
1785 bool Simple =
false)
const;
1841 llvm::SmallPtrSet<ObjCProtocolDecl*, 8> &Protocols);
1902 bool IsParam)
const {
1905 if (SubTnullability.hasValue() == SuperTnullability.hasValue()) {
1907 if (!SubTnullability)
1910 if (*SubTnullability == *SuperTnullability ||
1964 bool IsCXXMethod)
const;
2014 return dyn_cast_or_null<DependentSizedArrayType>(
getAsArrayType(T));
2105 return AddrSpaceMapMangling ||
2112 unsigned getIntegerRank(
const Type *T)
const;
2122 bool CompareUnqualified =
false);
2149 bool BlockReturnType);
2157 bool Unqualified =
false,
bool BlockReturnType =
false);
2159 bool Unqualified =
false);
2161 bool OfBlockPointer =
false,
2162 bool Unqualified =
false);
2164 bool OfBlockPointer=
false,
2165 bool Unqualified =
false);
2174 ObjCLayouts[CD] =
nullptr;
2193 typedef llvm::iterator_range<SmallVectorImpl<Type *>::const_iterator>
2224 return !ObjCImpls.empty();
2238 return ObjCMethodRedecls.lookup(MD);
2244 ObjCMethodRedecls[MD] = Redecl;
2305 unsigned ParmIdx,
Expr *DAE);
2398 void getObjCEncodingForTypeImpl(
QualType t, std::string &
S,
2399 bool ExpandPointedToStructures,
2400 bool ExpandStructures,
2402 bool OutermostType =
false,
2403 bool EncodingProperty =
false,
2404 bool StructField =
false,
2405 bool EncodeBlockParameters =
false,
2406 bool EncodeClassNames =
false,
2407 bool EncodePointerToObjCTypedef =
false,
2408 QualType *NotEncodedT=
nullptr)
const;
2411 void getObjCEncodingForStructureImpl(
RecordDecl *RD, std::string &
S,
2413 bool includeVBases =
true,
2414 QualType *NotEncodedT=
nullptr)
const;
2419 bool Extended)
const;
2432 typedef llvm::SmallDenseMap<void(*)(void*), llvm::SmallVector<void*, 16> >
2434 DeallocationMap Deallocations;
2439 llvm::PointerIntPair<StoredDeclsMap*,1> LastSDM;
2443 void ReleaseDeclContextMaps();
2444 void ReleaseParentMapEntries();
2446 std::unique_ptr<ParentMap> AllParents;
2448 std::unique_ptr<VTableContextBase> VTContext;
2469 PragmaSectionLocation(PragmaSectionLocation),
2470 SectionFlags(SectionFlags) {}
2522 return C.Allocate(Bytes, Alignment);
2558 size_t Alignment = 8) {
2559 return C.Allocate(Bytes, Alignment);
2573 template <
typename Owner,
typename T,
2582 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.
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)
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.
CanQualType OCLImage1dBufferTy
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
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)
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
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
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.
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
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
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
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...
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.
QualType getBlockPointerType(QualType T) const
Return the uniqued reference to the type for a block of the specified type.
QualType getVaListTagType() const
Retrieve the C type declaration corresponding to the predefined __va_list_tag type used to help defin...
QualType getVariableArrayDecayedType(QualType Ty) const
Returns a vla type where known sizes are replaced with [*].
const RawComment * getRaw() const LLVM_READONLY
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
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...
ExtProtoInfo - Extra information about a function prototype.
Declaration context for names declared as extern "C" in C++. This is neither the semantic nor lexical...
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.
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. ...
bool FunctionTypesMatchOnNSConsumedAttrs(const FunctionProtoType *FromFunctionType, const FunctionProtoType *ToFunctionType)
ParmVarDecl - Represents a parameter to a function.
QualType getRawCFConstantStringType() const
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()'.
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists...
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
ObjCInterfaceDecl * getObjCProtocolDecl() const
Retrieve the Objective-C class declaration corresponding to the predefined Protocol class...
CharUnits getOffsetOfBaseWithVBPtr(const CXXRecordDecl *RD) const
CanQualType getIntMaxType() const
Return the unique type for "intmax_t" (C99 7.18.1.5), defined in <stdint.h>.
comments::CommandTraits & getCommentCommandTraits() const
This table allows us to fully hide how we implement multi-keyword caching.
void getOverriddenMethods(const NamedDecl *Method, SmallVectorImpl< const NamedDecl * > &Overridden) const
Return C++ or ObjC overridden methods for the given Method.
QualType getAutoType(QualType DeducedType, bool IsDecltypeAuto, bool IsDependent) const
C++11 deduced auto type.
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.
CanQualType OCLImage2dArrayTy
void setObjCConstantStringInterface(ObjCInterfaceDecl *Decl)
void setInstantiatedFromUnnamedFieldDecl(FieldDecl *Inst, FieldDecl *Tmpl)
Missing a type from <ucontext.h>
const ASTRecordLayout * BuildMicrosoftASTRecordLayout(const RecordDecl *D) const
Get or compute information about the layout of the specified record (struct/union/class), which indicates its size and field position information.
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...
void setBOOLDecl(TypedefDecl *TD)
Save declaration of 'BOOL' typedef.
void DeepCollectObjCIvars(const ObjCInterfaceDecl *OI, bool leafClass, SmallVectorImpl< const ObjCIvarDecl * > &Ivars) const
void Deallocate(void *Ptr) const
QualType getBlockDescriptorType() const
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
void setStaticLocalNumber(const VarDecl *VD, unsigned Number)
QualType getTypeOfType(QualType t) const
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...
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)
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)
QualType getObjCNSStringType() const
Represents a C++ using-declaration.
bool hasNonFastQualifiers() const
QualType getParenType(QualType NamedType) const
const TargetInfo & getTargetInfo() const
bool UnwrapSimilarPointerTypes(QualType &T1, QualType &T2)
const LangOptions & getLangOpts() const
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.
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
bool getByrefLifetime(QualType Ty, Qualifiers::ObjCLifetime &Lifetime, bool &HasByrefExtendedLayout) const
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.
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.
QualType mergeTransparentUnionType(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
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
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.
QualType getTemplateSpecializationType(TemplateName T, const TemplateArgument *Args, unsigned NumArgs, QualType Canon=QualType()) const
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
Qualifiers::ObjCLifetime getObjCLifetime() const
getObjCLifetime - 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. Contains type source information through TypeSo...
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.
overridden_cxx_method_iterator overridden_methods_end(const CXXMethodDecl *Method) const
llvm::iterator_range< SmallVectorImpl< Type * >::const_iterator > type_const_range
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.
ID
Defines the set of possible language-specific address spaces.
QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl=nullptr) const
bool ObjCMethodsAreEqual(const ObjCMethodDecl *MethodDecl, const ObjCMethodDecl *MethodImp)
std::pair< CharUnits, CharUnits > getTypeInfoDataSizeInChars(QualType T) const
Exposes information about the current target.
QualType getDependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, const TemplateArgumentListInfo &Args) const
bool isSignedIntegerOrEnumerationType() const
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.
Defines the clang::LangOptions interface.
QualType getBlockDescriptorExtendedType() const
void setInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst, UsingShadowDecl *Pattern)
MatchFinder::MatchCallback * Callback
Declaration of a template type parameter.
Implements an efficient mapping from strings to IdentifierInfo nodes.
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
void setObjCMethodRedeclaration(const ObjCMethodDecl *MD, const ObjCMethodDecl *Redecl)
TemplateName getOverloadedTemplateName(UnresolvedSetIterator Begin, UnresolvedSetIterator End) const
Retrieve the template name that corresponds to a non-empty lookup.
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 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
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...
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
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
NamedDecl * getInstantiatedFromUsingDecl(UsingDecl *Inst)
If the given using decl Inst is an instantiation of a (possibly unresolved) using decl from a templat...
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. Call this if you might have added duplicates into the list...
bool isObjCClassType(QualType T) const
void CollectInheritedProtocols(const Decl *CDecl, llvm::SmallPtrSet< ObjCProtocolDecl *, 8 > &Protocols)
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)
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. In C++, this returns the unique wchar_t type. In C99...
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.
SelectorTable & Selectors
DeclarationNameInfo getNameForTemplate(TemplateName Name, SourceLocation NameLoc) const
bool QIdProtocolsAdoptObjCObjectProtocols(QualType QT, ObjCInterfaceDecl *IDecl)
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. The SourceManager can decode this to get at the full include stack...
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
bool hasSameTemplateName(TemplateName X, TemplateName Y)
Determine whether the given template names refer to the same template.
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
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...
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 getConstType(QualType T) const
Return the uniqued reference to the type for a const qualified type.
Represents a static or instance method of a struct/union/class.
CanQualType getCanonicalParamType(QualType T) const
Return the canonical parameter type corresponding to the specific potentially non-canonical one...
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 ResetObjCLayout(const ObjCContainerDecl *CD)
QualType getObjCGCQualType(QualType T, Qualifiers::GC gcAttr) const
Return the uniqued reference to the type for an Objective-C gc-qualified type.
Represents one property declaration in an Objective-C interface.
bool canBindObjCObjectType(QualType To, QualType From)
SourceLocation getBegin() const
QualType getAttributedType(AttributedType::Kind attrKind, QualType modifiedType, QualType equivalentType)
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
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
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 getCanonicalTemplateSpecializationType(TemplateName T, const TemplateArgument *Args, unsigned NumArgs) const
QualType getDecayedType(QualType T) const
Return the uniqued reference to the decayed version of the given type. Can only be called on array an...
A qualifier set is used to build a set of qualifiers.
QualType mergeTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false, bool BlockReturnType=false)
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)
ArrayRef< ast_type_traits::DynTypedNode > getParents(const NodeT &Node)
Returns the parents of the given node.
comments::FullComment * getCommentForDecl(const Decl *D, const Preprocessor *PP) const
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
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)
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...
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)
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 ...
QualType getCorrespondingUnsignedType(QualType T) const
bool areComparableObjCPointerTypes(QualType LHS, QualType RHS)
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
CanQualType ObjCBuiltinBoolTy
const RawComment * getRawCommentForAnyRedecl(const Decl *D, const Decl **OriginalDecl=nullptr) const
Return the documentation comment attached to a given declaration. Returns NULL if no comment is attac...
unsigned getAlignOfGlobalVar(QualType T) const
Return the alignment in bits that should be given to a global variable with type T.
QualType getPointerDiffType() const
Return the unique type for "ptrdiff_t" (C99 7.17) defined in <stddef.h>. Pointer - pointer requires t...
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. Checks the key-function cache for the method'...
CanQualType ObjCBuiltinClassTy
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)
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...
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()
TypeDecl * getFloat128StubType() const
Retrieve the declaration for a 128-bit float stub type.
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...
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
VTableContextBase * getVTableContext()
Missing a type from <stdio.h>
type_const_range types() const
CanQualType OCLImage1dArrayTy
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
bool isObjCSelType(QualType T) const
size_t getSideTableAllocatedMemory() const
Return the total memory used for various side tables.
static unsigned NumImplicitCopyConstructorsDeclared
The number of implicitly-declared copy constructors for which declarations were built.
Builtin::Context & BuiltinInfo
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.
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)
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...
TypedefDecl * getObjCSelDecl() const
Retrieve the typedef corresponding to the predefined 'SEL' type in Objective-C.
bool isObjCIdType(QualType T) const
void InitBuiltinTypes(const TargetInfo &Target)
Initialize built-in types.
llvm::DenseMap< const void *, llvm::PointerUnion< ast_type_traits::DynTypedNode *, ParentVector * > > ParentMap
Maps from a node to its parents.
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.
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
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)
CharUnits getAlignOfGlobalVarInChars(QualType T) const
Return the alignment in characters that should be given to a global variable with type T...
bool isNull() const
isNull - 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
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.
QualType getBOOLType() const
type of 'BOOL' type.
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...
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>. We need this to compute the correct type...
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
static unsigned NumImplicitDestructors
The number of implicitly-declared destructors.
QualType getCFConstantStringType() const
Return the C structure type used to represent constant CFStrings.