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/SmallPtrSet.h"
40 #include "llvm/ADT/TinyPtrVector.h"
41 #include "llvm/Support/Allocator.h"
52 class ASTRecordLayout;
55 class DiagnosticsEngine;
57 class ASTMutationListener;
58 class IdentifierTable;
59 class MaterializeTemporaryExpr;
63 class MangleNumberingContext;
67 class ObjCPropertyDecl;
68 class UnresolvedSetIterator;
70 class UsingShadowDecl;
71 class VTableContextBase;
86 : Width(Width), Align(Align), AlignIsRequired(AlignIsRequired) {}
95 mutable llvm::FoldingSet<ExtQuals> ExtQualNodes;
96 mutable llvm::FoldingSet<ComplexType> ComplexTypes;
97 mutable llvm::FoldingSet<PointerType> PointerTypes;
98 mutable llvm::FoldingSet<AdjustedType> AdjustedTypes;
99 mutable llvm::FoldingSet<BlockPointerType> BlockPointerTypes;
100 mutable llvm::FoldingSet<LValueReferenceType> LValueReferenceTypes;
101 mutable llvm::FoldingSet<RValueReferenceType> RValueReferenceTypes;
102 mutable llvm::FoldingSet<MemberPointerType> MemberPointerTypes;
103 mutable llvm::FoldingSet<ConstantArrayType> ConstantArrayTypes;
104 mutable llvm::FoldingSet<IncompleteArrayType> IncompleteArrayTypes;
105 mutable std::vector<VariableArrayType*> VariableArrayTypes;
106 mutable llvm::FoldingSet<DependentSizedArrayType> DependentSizedArrayTypes;
107 mutable llvm::FoldingSet<DependentSizedExtVectorType>
108 DependentSizedExtVectorTypes;
109 mutable llvm::FoldingSet<VectorType> VectorTypes;
110 mutable llvm::FoldingSet<FunctionNoProtoType> FunctionNoProtoTypes;
111 mutable llvm::ContextualFoldingSet<FunctionProtoType, ASTContext&>
113 mutable llvm::FoldingSet<DependentTypeOfExprType> DependentTypeOfExprTypes;
114 mutable llvm::FoldingSet<DependentDecltypeType> DependentDecltypeTypes;
115 mutable llvm::FoldingSet<TemplateTypeParmType> TemplateTypeParmTypes;
116 mutable llvm::FoldingSet<SubstTemplateTypeParmType>
117 SubstTemplateTypeParmTypes;
118 mutable llvm::FoldingSet<SubstTemplateTypeParmPackType>
119 SubstTemplateTypeParmPackTypes;
120 mutable llvm::ContextualFoldingSet<TemplateSpecializationType, ASTContext&>
121 TemplateSpecializationTypes;
122 mutable llvm::FoldingSet<ParenType> ParenTypes;
123 mutable llvm::FoldingSet<ElaboratedType> ElaboratedTypes;
124 mutable llvm::FoldingSet<DependentNameType> DependentNameTypes;
127 DependentTemplateSpecializationTypes;
128 llvm::FoldingSet<PackExpansionType> PackExpansionTypes;
129 mutable llvm::FoldingSet<ObjCObjectTypeImpl> ObjCObjectTypes;
130 mutable llvm::FoldingSet<ObjCObjectPointerType> ObjCObjectPointerTypes;
131 mutable llvm::FoldingSet<AutoType> AutoTypes;
132 mutable llvm::FoldingSet<AtomicType> AtomicTypes;
133 llvm::FoldingSet<AttributedType> AttributedTypes;
134 mutable llvm::FoldingSet<PipeType> PipeTypes;
136 mutable llvm::FoldingSet<QualifiedTemplateName> QualifiedTemplateNames;
137 mutable llvm::FoldingSet<DependentTemplateName> DependentTemplateNames;
138 mutable llvm::FoldingSet<SubstTemplateTemplateParmStorage>
139 SubstTemplateTemplateParms;
142 SubstTemplateTemplateParmPacks;
147 mutable llvm::FoldingSet<NestedNameSpecifier> NestedNameSpecifiers;
154 mutable llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*>
156 mutable llvm::DenseMap<const ObjCContainerDecl*, const ASTRecordLayout*>
160 typedef llvm::DenseMap<const Type *, struct TypeInfo> TypeInfoMap;
161 mutable TypeInfoMap MemoizedTypeInfo;
164 llvm::DenseMap<const CXXRecordDecl*, LazyDeclPtr> KeyFunctions;
167 llvm::DenseMap<ObjCContainerDecl*, ObjCImplDecl*> ObjCImpls;
171 llvm::DenseMap<const ObjCMethodDecl*,const ObjCMethodDecl*> ObjCMethodRedecls;
174 llvm::DenseMap<const VarDecl*, Expr*> BlockVarCopyInits;
178 llvm::DenseMap<const FunctionDecl*, FunctionDecl*>
179 ClassScopeSpecializationPattern;
184 llvm::DenseMap<const MaterializeTemporaryExpr *, APValue *>
185 MaterializedTemporaryValues;
189 class CanonicalTemplateTemplateParm :
public llvm::FoldingSetNode {
200 static void Profile(llvm::FoldingSetNodeID &
ID,
201 TemplateTemplateParmDecl *Parm);
203 mutable llvm::FoldingSet<CanonicalTemplateTemplateParm>
204 CanonTemplateTemplateParms;
206 TemplateTemplateParmDecl *
207 getCanonicalTemplateTemplateParmDecl(TemplateTemplateParmDecl *TTP)
const;
210 mutable TypedefDecl *Int128Decl;
213 mutable TypedefDecl *UInt128Decl;
216 mutable TypeDecl *Float128StubDecl;
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 IdentifierInfo *NSObjectName =
nullptr;
250 IdentifierInfo *NSCopyingName =
nullptr;
253 mutable IdentifierInfo *MakeIntegerSeqName =
nullptr;
255 QualType ObjCConstantStringType;
256 mutable RecordDecl *CFConstantStringTypeDecl;
258 mutable QualType ObjCSuperType;
260 QualType ObjCNSStringType;
263 TypedefDecl *ObjCInstanceTypeDecl;
269 TypeDecl *jmp_bufDecl;
272 TypeDecl *sigjmp_bufDecl;
275 TypeDecl *ucontext_tDecl;
281 mutable RecordDecl *BlockDescriptorType;
287 mutable RecordDecl *BlockDescriptorExtendedType;
290 FunctionDecl *cudaConfigureCallDecl;
296 llvm::DenseMap<const Decl*, AttrVec*> DeclAttrs;
301 llvm::DenseMap<Decl*, Decl*> MergedDecls;
306 llvm::DenseMap<NamedDecl*, llvm::TinyPtrVector<Module*>> MergedDefModules;
310 typedef llvm::PointerUnion<VarTemplateDecl *, MemberSpecializationInfo *>
345 llvm::DenseMap<const VarDecl *, TemplateOrSpecializationInfo>
346 TemplateOrInstantiation;
371 llvm::DenseMap<UsingDecl *, NamedDecl *> InstantiatedFromUsingDecl;
373 llvm::DenseMap<UsingShadowDecl*, UsingShadowDecl*>
374 InstantiatedFromUsingShadowDecl;
376 llvm::DenseMap<FieldDecl *, FieldDecl *> InstantiatedFromUnnamedFieldDecl;
384 typedef llvm::TinyPtrVector<const CXXMethodDecl*> CXXMethodVector;
385 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector> OverriddenMethods;
390 llvm::DenseMap<const DeclContext *, MangleNumberingContext *>
391 MangleNumberingContexts;
395 llvm::DenseMap<const NamedDecl *, unsigned> MangleNumbers;
396 llvm::DenseMap<const VarDecl *, unsigned> StaticLocalNumbers;
400 typedef llvm::DenseMap<const VarDecl *, unsigned> ParameterIndexTable;
401 ParameterIndexTable ParamIndices;
419 std::unique_ptr<SanitizerBlacklist> SanitizerBL;
425 mutable llvm::BumpPtrAllocator BumpAlloc;
431 std::unique_ptr<CXXABI> ABI;
439 bool AddrSpaceMapMangling;
464 typedef llvm::DenseMap<
const void *,
465 llvm::PointerUnion4<
const Decl *,
const Stmt *,
471 typedef llvm::DenseMap<
473 llvm::PointerUnion4<
const Decl *,
const Stmt *,
497 return reinterpret_cast<const DynTypedNode *
>(Storage.buffer);
504 return reinterpret_cast<const DynTypedNode *
>(Storage.buffer) + 1;
510 assert(N <
size() &&
"Out of bounds!");
511 return *(
begin() + N);
560 void *
Allocate(
size_t Size,
unsigned Align = 8)
const {
561 return BumpAlloc.Allocate(Size, Align);
563 template <
typename T> T *
Allocate(
size_t Num = 1)
const {
564 return static_cast<T *
>(
Allocate(Num *
sizeof(T), llvm::alignOf<T>()));
571 return BumpAlloc.getTotalMemory();
577 return DiagAllocator;
588 unsigned Signed)
const;
640 return Data.getInt();
648 return Data.getPointer();
664 llvm::PointerIntPair<const RawComment *, 2, Kind> Data;
665 const Decl *OriginalDecl;
689 assert(LangOpts.RetainCommentsFromSystemHeaders ||
701 const Decl **OriginalDecl =
nullptr)
const;
717 const Decl *D)
const;
723 class import_iterator {
730 typedef int difference_type;
731 typedef std::forward_iterator_tag iterator_category;
733 import_iterator() : Import() {}
734 explicit import_iterator(ImportDecl *Import) : Import(Import) {}
736 reference
operator*()
const {
return Import; }
737 pointer operator->()
const {
return Import; }
739 import_iterator &operator++() {
744 import_iterator operator++(
int) {
745 import_iterator Other(*
this);
750 friend bool operator==(import_iterator
X, import_iterator Y) {
751 return X.Import == Y.Import;
754 friend bool operator!=(import_iterator
X, import_iterator Y) {
755 return X.Import != Y.Import;
761 return CommentCommandTraits;
842 return Import->NextLocalImport;
847 return import_range(import_iterator(FirstLocalImport), import_iterator());
852 return Result ? Result : D;
855 MergedDecls[D] = Primary;
861 bool NotifyListeners =
true);
869 auto MergedIt = MergedDefModules.find(Def);
870 if (MergedIt == MergedDefModules.end())
872 return MergedIt->second;
1039 bool AsWritten =
false);
1091 cudaConfigureCallDecl = FD;
1094 return cudaConfigureCallDecl;
1106 bool &HasByrefExtendedLayout)
const;
1127 unsigned IndexTypeQuals,
1137 unsigned IndexTypeQuals,
1144 unsigned IndexTypeQuals)
const;
1150 unsigned IndexTypeQuals)
const;
1192 const TypeDecl *PrevDecl =
nullptr)
const {
1193 assert(Decl &&
"Passed null for Decl param");
1194 if (Decl->TypeForDecl)
return QualType(Decl->TypeForDecl, 0);
1197 assert(PrevDecl->TypeForDecl &&
"previous decl has no TypeForDecl");
1198 Decl->TypeForDecl = PrevDecl->TypeForDecl;
1199 return QualType(PrevDecl->TypeForDecl, 0);
1202 return getTypeDeclTypeSlow(Decl);
1238 unsigned NumArgs)
const;
1278 unsigned NumProtocols)
const;
1283 bool isKindOf)
const;
1308 bool IsDependent)
const;
1383 if (CFConstantStringTypeDecl)
1392 return ObjCConstantStringType;
1396 return ObjCNSStringType;
1400 ObjCNSStringType = T;
1406 if (ObjCIdRedefinitionType.
isNull())
1408 return ObjCIdRedefinitionType;
1413 ObjCIdRedefinitionType = RedefType;
1419 if (ObjCClassRedefinitionType.
isNull())
1421 return ObjCClassRedefinitionType;
1426 ObjCClassRedefinitionType = RedefType;
1432 if (ObjCSelRedefinitionType.
isNull())
1434 return ObjCSelRedefinitionType;
1440 ObjCSelRedefinitionType = RedefType;
1445 if (!NSObjectName) {
1449 return NSObjectName;
1454 if (!NSCopyingName) {
1455 NSCopyingName = &
Idents.
get(
"NSCopying");
1458 return NSCopyingName;
1462 if (!MakeIntegerSeqName)
1463 MakeIntegerSeqName = &
Idents.
get(
"__make_integer_seq");
1464 return MakeIntegerSeqName;
1489 this->jmp_bufDecl = jmp_bufDecl;
1501 this->sigjmp_bufDecl = sigjmp_bufDecl;
1513 this->ucontext_tDecl = ucontext_tDecl;
1534 QualType *NotEncodedT=
nullptr)
const;
1544 std::string &
S)
const;
1560 bool Extended =
false)
1571 const Decl *Container,
1572 std::string &
S)
const;
1579 const Decl *Container)
const;
1683 return getExtQualType(Ptr, Qc);
1690 return getExtQualType(T, Qs);
1724 bool TemplateKeyword,
1749 unsigned *IntegerConstantArgs =
nullptr)
const;
1876 bool Simple =
false)
const;
1932 llvm::SmallPtrSet<ObjCProtocolDecl*, 8> &Protocols);
1993 bool IsParam)
const {
1996 if (SubTnullability.hasValue() == SuperTnullability.hasValue()) {
1998 if (!SubTnullability)
2001 if (*SubTnullability == *SuperTnullability ||
2055 bool IsCXXMethod)
const;
2105 return dyn_cast_or_null<DependentSizedArrayType>(
getAsArrayType(T));
2196 return AddrSpaceMapMangling ||
2203 unsigned getIntegerRank(
const Type *T)
const;
2213 bool CompareUnqualified =
false);
2240 bool BlockReturnType);
2248 bool Unqualified =
false,
bool BlockReturnType =
false);
2250 bool Unqualified =
false);
2252 bool OfBlockPointer =
false,
2253 bool Unqualified =
false);
2255 bool OfBlockPointer=
false,
2256 bool Unqualified =
false);
2291 if (Width != Res.getBitWidth())
2292 return Res.extOrTrunc(Width);
2307 return !ObjCImpls.empty();
2383 unsigned ParmIdx,
Expr *DAE);
2485 void getObjCEncodingForTypeImpl(
QualType t, std::string &
S,
2486 bool ExpandPointedToStructures,
2487 bool ExpandStructures,
2489 bool OutermostType =
false,
2490 bool EncodingProperty =
false,
2491 bool StructField =
false,
2492 bool EncodeBlockParameters =
false,
2493 bool EncodeClassNames =
false,
2494 bool EncodePointerToObjCTypedef =
false,
2495 QualType *NotEncodedT=
nullptr)
const;
2498 void getObjCEncodingForStructureImpl(
RecordDecl *RD, std::string &
S,
2500 bool includeVBases =
true,
2501 QualType *NotEncodedT=
nullptr)
const;
2506 bool Extended)
const;
2532 llvm::PointerIntPair<StoredDeclsMap*,1> LastSDM;
2536 void ReleaseDeclContextMaps();
2537 void ReleaseParentMapEntries();
2539 std::unique_ptr<ParentMapPointers> PointerParents;
2540 std::unique_ptr<ParentMapOtherNodes> OtherParents;
2542 std::unique_ptr<VTableContextBase> VTContext;
2563 PragmaSectionLocation(PragmaSectionLocation),
2564 SectionFlags(SectionFlags) {}
2616 return C.Allocate(Bytes, Alignment);
2652 size_t Alignment = 8) {
2653 return C.Allocate(Bytes, Alignment);
2667 template <
typename Owner,
typename T,
2676 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.
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
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)
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.
CanQualType OCLImage2dMSAADepthTy
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.
Decl - This represents one declaration (or definition), e.g.
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
DependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, unsigned NumArgs, const TemplateArgument *Args, QualType Canon)
QualType getRecordType(const RecordDecl *Decl) const
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. ...
bool FunctionTypesMatchOnNSConsumedAttrs(const FunctionProtoType *FromFunctionType, const FunctionProtoType *ToFunctionType)
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.
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.
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. ...
CanQualType OCLImage2dArrayMSAADepthTy
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.
CanQualType OCLImage2dArrayTy
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.
const ast_type_traits::DynTypedNode * end() const
DynTypedNodeList(ArrayRef< DynTypedNode > A)
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.
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.
QualType getTemplateSpecializationType(TemplateName T, const TemplateArgument *Args, unsigned NumArgs, QualType Canon=QualType()) const
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.
ID
Defines the set of possible language-specific address spaces.
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.
CanQualType OCLImage2dArrayMSAATy
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.
CanQualType OCLImage2dMSAATy
PartialDiagnostic::StorageAllocator & getDiagAllocator()
Qualifiers Quals
The local qualifiers.
CanQualType OCLImage2dArrayDepthTy
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.
class LLVM_ALIGNAS(8) TemplateSpecializationType unsigned NumArgs
Represents a type template specialization; the template must be a class template, a type alias templa...
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 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...
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 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.
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)
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)
CanQualType OCLImage2dDepthTy
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()
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...
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
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
Represents a C array with an unspecified size.
VTableContextBase * getVTableContext()
Missing a type from <stdio.h>
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
Return the total amount of physical memory allocated for representing AST nodes and type information...
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
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)
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...
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.
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.
static unsigned NumImplicitDestructors
The number of implicitly-declared destructors.
QualType getCFConstantStringType() const
Return the C structure type used to represent constant CFStrings.