14 #ifndef LLVM_CLANG_AST_ASTCONTEXT_H 15 #define LLVM_CLANG_AST_ASTCONTEXT_H 45 #include "llvm/ADT/APSInt.h" 46 #include "llvm/ADT/ArrayRef.h" 47 #include "llvm/ADT/DenseMap.h" 48 #include "llvm/ADT/FoldingSet.h" 49 #include "llvm/ADT/IntrusiveRefCntPtr.h" 50 #include "llvm/ADT/MapVector.h" 51 #include "llvm/ADT/None.h" 52 #include "llvm/ADT/Optional.h" 53 #include "llvm/ADT/PointerIntPair.h" 54 #include "llvm/ADT/PointerUnion.h" 55 #include "llvm/ADT/SmallVector.h" 56 #include "llvm/ADT/StringMap.h" 57 #include "llvm/ADT/StringRef.h" 58 #include "llvm/ADT/TinyPtrVector.h" 59 #include "llvm/ADT/Triple.h" 60 #include "llvm/ADT/iterator_range.h" 61 #include "llvm/Support/AlignOf.h" 62 #include "llvm/Support/Allocator.h" 63 #include "llvm/Support/Casting.h" 64 #include "llvm/Support/Compiler.h" 71 #include <type_traits> 85 class ASTMutationListener;
86 class ASTRecordLayout;
89 class BuiltinTemplateDecl;
93 class CXXConstructorDecl;
96 class DiagnosticsEngine;
98 class FixedPointSemantics;
101 class MangleNumberingContext;
102 class MaterializeTemporaryExpr;
103 class MemberSpecializationInfo;
105 class ObjCCategoryDecl;
106 class ObjCCategoryImplDecl;
107 class ObjCContainerDecl;
109 class ObjCImplementationDecl;
110 class ObjCInterfaceDecl;
112 class ObjCMethodDecl;
113 class ObjCPropertyDecl;
114 class ObjCPropertyImplDecl;
115 class ObjCProtocolDecl;
116 class ObjCTypeParamDecl;
117 struct ParsedTargetAttr;
120 class StoredDeclsMap;
123 class TemplateParameterList;
124 class TemplateTemplateParmDecl;
125 class TemplateTypeParmDecl;
126 class UnresolvedSetIterator;
127 class UsingShadowDecl;
128 class VarTemplateDecl;
129 class VTableContextBase;
130 struct BlockVarCopyInit;
152 namespace serialization {
162 TypeInfo(uint64_t Width,
unsigned Align,
bool AlignIsRequired)
163 : Width(Width), Align(Align), AlignIsRequired(AlignIsRequired) {}
172 mutable llvm::FoldingSet<ExtQuals> ExtQualNodes;
173 mutable llvm::FoldingSet<ComplexType> ComplexTypes;
174 mutable llvm::FoldingSet<PointerType> PointerTypes;
175 mutable llvm::FoldingSet<AdjustedType> AdjustedTypes;
176 mutable llvm::FoldingSet<BlockPointerType> BlockPointerTypes;
177 mutable llvm::FoldingSet<LValueReferenceType> LValueReferenceTypes;
178 mutable llvm::FoldingSet<RValueReferenceType> RValueReferenceTypes;
179 mutable llvm::FoldingSet<MemberPointerType> MemberPointerTypes;
180 mutable llvm::ContextualFoldingSet<ConstantArrayType, ASTContext &>
182 mutable llvm::FoldingSet<IncompleteArrayType> IncompleteArrayTypes;
183 mutable std::vector<VariableArrayType*> VariableArrayTypes;
184 mutable llvm::FoldingSet<DependentSizedArrayType> DependentSizedArrayTypes;
185 mutable llvm::FoldingSet<DependentSizedExtVectorType>
186 DependentSizedExtVectorTypes;
187 mutable llvm::FoldingSet<DependentAddressSpaceType>
188 DependentAddressSpaceTypes;
189 mutable llvm::FoldingSet<VectorType> VectorTypes;
190 mutable llvm::FoldingSet<DependentVectorType> DependentVectorTypes;
191 mutable llvm::FoldingSet<FunctionNoProtoType> FunctionNoProtoTypes;
192 mutable llvm::ContextualFoldingSet<FunctionProtoType, ASTContext&>
194 mutable llvm::FoldingSet<DependentTypeOfExprType> DependentTypeOfExprTypes;
195 mutable llvm::FoldingSet<DependentDecltypeType> DependentDecltypeTypes;
196 mutable llvm::FoldingSet<TemplateTypeParmType> TemplateTypeParmTypes;
197 mutable llvm::FoldingSet<ObjCTypeParamType> ObjCTypeParamTypes;
198 mutable llvm::FoldingSet<SubstTemplateTypeParmType>
199 SubstTemplateTypeParmTypes;
200 mutable llvm::FoldingSet<SubstTemplateTypeParmPackType>
201 SubstTemplateTypeParmPackTypes;
202 mutable llvm::ContextualFoldingSet<TemplateSpecializationType, ASTContext&>
203 TemplateSpecializationTypes;
204 mutable llvm::FoldingSet<ParenType> ParenTypes;
205 mutable llvm::FoldingSet<ElaboratedType> ElaboratedTypes;
206 mutable llvm::FoldingSet<DependentNameType> DependentNameTypes;
209 DependentTemplateSpecializationTypes;
210 llvm::FoldingSet<PackExpansionType> PackExpansionTypes;
211 mutable llvm::FoldingSet<ObjCObjectTypeImpl> ObjCObjectTypes;
212 mutable llvm::FoldingSet<ObjCObjectPointerType> ObjCObjectPointerTypes;
213 mutable llvm::FoldingSet<DependentUnaryTransformType>
214 DependentUnaryTransformTypes;
215 mutable llvm::ContextualFoldingSet<AutoType, ASTContext&> AutoTypes;
216 mutable llvm::FoldingSet<DeducedTemplateSpecializationType>
217 DeducedTemplateSpecializationTypes;
218 mutable llvm::FoldingSet<AtomicType> AtomicTypes;
219 llvm::FoldingSet<AttributedType> AttributedTypes;
220 mutable llvm::FoldingSet<PipeType> PipeTypes;
222 mutable llvm::FoldingSet<QualifiedTemplateName> QualifiedTemplateNames;
223 mutable llvm::FoldingSet<DependentTemplateName> DependentTemplateNames;
224 mutable llvm::FoldingSet<SubstTemplateTemplateParmStorage>
225 SubstTemplateTemplateParms;
228 SubstTemplateTemplateParmPacks;
233 mutable llvm::FoldingSet<NestedNameSpecifier> NestedNameSpecifiers;
239 mutable llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*>
241 mutable llvm::DenseMap<const ObjCContainerDecl*, const ASTRecordLayout*>
245 using TypeInfoMap = llvm::DenseMap<const Type *, struct TypeInfo>;
246 mutable TypeInfoMap MemoizedTypeInfo;
251 using UnadjustedAlignMap = llvm::DenseMap<const Type *, unsigned>;
252 mutable UnadjustedAlignMap MemoizedUnadjustedAlign;
255 llvm::DenseMap<const CXXRecordDecl*, LazyDeclPtr> KeyFunctions;
258 llvm::DenseMap<ObjCContainerDecl*, ObjCImplDecl*> ObjCImpls;
262 llvm::DenseMap<const ObjCMethodDecl*,const ObjCMethodDecl*> ObjCMethodRedecls;
265 llvm::DenseMap<const VarDecl *, BlockVarCopyInit> BlockVarCopyInits;
274 mutable llvm::StringMap<StringLiteral *> StringLiteralCache;
278 class CanonicalTemplateTemplateParm :
public llvm::FoldingSetNode {
287 void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &C) {
288 Profile(ID, C, Parm);
291 static void Profile(llvm::FoldingSetNodeID &
ID,
295 mutable llvm::ContextualFoldingSet<CanonicalTemplateTemplateParm,
297 CanonTemplateTemplateParms;
313 mutable TypedefDecl *BuiltinMSVaListDecl =
nullptr;
352 mutable RecordDecl *CFConstantStringTagDecl =
nullptr;
353 mutable TypedefDecl *CFConstantStringTypeDecl =
nullptr;
378 mutable RecordDecl *BlockDescriptorType =
nullptr;
384 mutable RecordDecl *BlockDescriptorExtendedType =
nullptr;
393 llvm::DenseMap<const Decl*, AttrVec*> DeclAttrs;
398 llvm::DenseMap<Decl*, Decl*> MergedDecls;
403 llvm::DenseMap<NamedDecl*, llvm::TinyPtrVector<Module*>> MergedDefModules;
409 struct PerModuleInitializers {
415 llvm::DenseMap<Module*, PerModuleInitializers*> ModuleInitializers;
422 llvm::PointerUnion<VarTemplateDecl *, MemberSpecializationInfo *>;
461 llvm::DenseMap<const VarDecl *, TemplateOrSpecializationInfo>
462 TemplateOrInstantiation;
487 llvm::DenseMap<NamedDecl *, NamedDecl *> InstantiatedFromUsingDecl;
489 llvm::DenseMap<UsingShadowDecl*, UsingShadowDecl*>
490 InstantiatedFromUsingShadowDecl;
492 llvm::DenseMap<FieldDecl *, FieldDecl *> InstantiatedFromUnnamedFieldDecl;
500 using CXXMethodVector = llvm::TinyPtrVector<const CXXMethodDecl *>;
501 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector> OverriddenMethods;
506 llvm::DenseMap<const DeclContext *, std::unique_ptr<MangleNumberingContext>>
507 MangleNumberingContexts;
508 llvm::DenseMap<const Decl *, std::unique_ptr<MangleNumberingContext>>
509 ExtraMangleNumberingContexts;
513 llvm::MapVector<const NamedDecl *, unsigned> MangleNumbers;
514 llvm::MapVector<const VarDecl *, unsigned> StaticLocalNumbers;
518 using ParameterIndexTable = llvm::DenseMap<const VarDecl *, unsigned>;
519 ParameterIndexTable ParamIndices;
538 std::unique_ptr<SanitizerBlacklist> SanitizerBL;
542 std::unique_ptr<XRayFunctionFilter> XRayFilter;
548 mutable llvm::BumpPtrAllocator BumpAlloc;
554 std::unique_ptr<CXXABI> ABI;
562 bool AddrSpaceMapMangling;
567 std::unique_ptr<interp::Context> InterpContext;
575 const Expr *traverseIgnored(
const Expr *E)
const;
576 Expr *traverseIgnored(
Expr *E)
const;
608 const ast_type_traits::DynTypedNode *
begin()
const {
612 return reinterpret_cast<const DynTypedNode *
>(Storage.buffer);
615 const ast_type_traits::DynTypedNode *
end()
const {
619 return reinterpret_cast<const DynTypedNode *
>(Storage.buffer) + 1;
622 size_t size()
const {
return end() - begin(); }
623 bool empty()
const {
return begin() == end(); }
626 assert(N < size() &&
"Out of bounds!");
627 return *(begin() + N);
639 void setTraversalScope(
const std::vector<Decl *> &);
672 return PrintingPolicy;
676 PrintingPolicy = Policy;
686 void *
Allocate(
size_t Size,
unsigned Align = 8)
const {
687 return BumpAlloc.Allocate(Size, Align);
689 template <
typename T> T *
Allocate(
size_t Num = 1)
const {
690 return static_cast<T *
>(Allocate(Num *
sizeof(T),
alignof(T)));
697 return BumpAlloc.getTotalMemory();
701 size_t getSideTableAllocatedMemory()
const;
704 return DiagAllocator;
714 QualType getIntTypeForBitwidth(
unsigned DestWidth,
715 unsigned Signed)
const;
720 QualType getRealTypeForBitwidth(
unsigned DestWidth)
const;
722 bool AtomicUsesUnsupportedLibcall(
const AtomicExpr *E)
const;
744 mutable bool CommentsLoaded =
false;
777 void cacheRawCommentForDecl(
const Decl &OriginalD,
787 const std::map<unsigned, RawComment *> &CommentsInFile)
const;
799 assert(LangOpts.RetainCommentsFromSystemHeaders ||
810 getRawCommentForAnyRedecl(
const Decl *D,
811 const Decl **OriginalDecl =
nullptr)
const;
837 const Decl *D)
const;
843 class import_iterator {
850 using difference_type = int;
851 using iterator_category = std::forward_iterator_tag;
853 import_iterator() =
default;
854 explicit import_iterator(
ImportDecl *Import) : Import(Import) {}
856 reference
operator*()
const {
return Import; }
857 pointer operator->()
const {
return Import; }
859 import_iterator &operator++() {
860 Import = ASTContext::getNextLocalImport(Import);
864 import_iterator operator++(
int) {
865 import_iterator Other(*
this);
870 friend bool operator==(import_iterator
X, import_iterator Y) {
871 return X.Import == Y.Import;
874 friend bool operator!=(import_iterator X, import_iterator Y) {
875 return X.Import != Y.Import;
881 return CommentCommandTraits;
888 void eraseDeclAttrs(
const Decl *D);
898 getTemplateOrSpecializationInfo(
const VarDecl *Var);
902 void setInstantiatedFromStaticDataMember(
VarDecl *Inst,
VarDecl *Tmpl,
906 void setTemplateOrSpecializationInfo(
VarDecl *Inst,
934 unsigned overridden_methods_size(
const CXXMethodDecl *Method)
const;
937 llvm::iterator_range<overridden_cxx_method_iterator>;
953 void getOverriddenMethods(
959 void addedLocalImportDecl(
ImportDecl *Import);
962 return Import->NextLocalImport;
968 return import_range(import_iterator(FirstLocalImport), import_iterator());
972 Decl *Result = MergedDecls.lookup(D);
973 return Result ? Result : D;
976 MergedDecls[D] = Primary;
982 bool NotifyListeners =
true);
986 void deduplicateMergedDefinitonsFor(
NamedDecl *ND);
993 if (MergedIt == MergedDefModules.end())
995 return MergedIt->second;
1002 void addModuleInitializer(
Module *M,
Decl *Init);
1036 SatUnsignedLongAccumTy;
1039 SatUnsignedLongFractTy;
1050 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ 1051 CanQualType SingletonId; 1052 #include "clang/Basic/OpenCLImageTypes.def" 1056 #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \ 1058 #include "clang/Basic/OpenCLExtensionTypes.def" 1059 #define SVE_TYPE(Name, Id, SingletonId) \ 1060 CanQualType SingletonId; 1061 #include "clang/Basic/AArch64SVEACLETypes.def" 1087 return ExternalSource.get();
1096 this->Listener = Listener;
1103 void PrintStats()
const;
1111 RecordDecl *buildImplicitRecord(StringRef Name,
1157 bool allowOnPointerType =
false)
const;
1211 QualType getFunctionTypeWithExceptionSpec(
1222 bool AsWritten =
false);
1244 return CanQualType::CreateUnsafe(getPointerType((
QualType) T));
1251 return CanQualType::CreateUnsafe(
1260 return CanQualType::CreateUnsafe(getDecayedType((
QualType) T));
1273 QualType getBlockDescriptorType()
const;
1283 QualType getBlockDescriptorExtendedType()
const;
1289 LangAS getOpenCLTypeAddrSpace(
const Type *T)
const;
1292 cudaConfigureCallDecl = FD;
1296 return cudaConfigureCallDecl;
1307 bool &HasByrefExtendedLayout)
const;
1328 unsigned IndexTypeQuals,
1338 unsigned IndexTypeQuals,
1345 unsigned IndexTypeQuals)
const;
1350 const Expr *SizeExpr,
1352 unsigned IndexTypeQuals)
const;
1389 Expr *AddrSpaceExpr,
1403 return getFunctionTypeInternal(ResultTy, Args, EPI,
false);
1412 bool OnlyWantCanonical)
const;
1418 const TypeDecl *PrevDecl =
nullptr)
const {
1419 assert(Decl &&
"Passed null for Decl param");
1420 if (Decl->TypeForDecl)
return QualType(Decl->TypeForDecl, 0);
1423 assert(PrevDecl->TypeForDecl &&
"previous decl has no TypeForDecl");
1424 Decl->TypeForDecl = PrevDecl->TypeForDecl;
1425 return QualType(PrevDecl->TypeForDecl, 0);
1428 return getTypeDeclTypeSlow(Decl);
1448 QualType getSubstTemplateTypeParmPackType(
1453 getTemplateTypeParmType(
unsigned Depth,
unsigned Index,
1481 TagDecl *OwnedTagDecl =
nullptr)
const;
1491 QualType getDependentTemplateSpecializationType(
1512 unsigned NumProtocols)
const;
1517 bool isKindOf)
const;
1527 bool QIdProtocolsAdoptObjCObjectProtocols(
QualType QT,
1546 bool IsDependent,
bool IsPack =
false,
1551 QualType getAutoDeductType()
const;
1554 QualType getAutoRRefDeductType()
const;
1559 bool IsDependent)
const;
1595 QualType getSignedWCharType()
const;
1600 QualType getUnsignedWCharType()
const;
1616 QualType getPointerDiffType()
const;
1621 QualType getUnsignedPointerDiffType()
const;
1628 QualType getCFConstantStringType()
const;
1637 if (CFConstantStringTypeDecl)
1638 return getTypedefType(CFConstantStringTypeDecl);
1641 void setCFConstantStringType(
QualType T);
1643 RecordDecl *getCFConstantStringTagDecl()
const;
1648 return ObjCConstantStringType;
1652 return ObjCNSStringType;
1656 ObjCNSStringType = T;
1662 if (ObjCIdRedefinitionType.
isNull())
1663 return getObjCIdType();
1664 return ObjCIdRedefinitionType;
1669 ObjCIdRedefinitionType = RedefType;
1675 if (ObjCClassRedefinitionType.
isNull())
1676 return getObjCClassType();
1677 return ObjCClassRedefinitionType;
1682 ObjCClassRedefinitionType = RedefType;
1688 if (ObjCSelRedefinitionType.
isNull())
1689 return getObjCSelType();
1690 return ObjCSelRedefinitionType;
1695 ObjCSelRedefinitionType = RedefType;
1700 if (!NSObjectName) {
1701 NSObjectName = &Idents.
get(
"NSObject");
1704 return NSObjectName;
1709 if (!NSCopyingName) {
1710 NSCopyingName = &Idents.
get(
"NSCopying");
1713 return NSCopyingName;
1717 assert(Target &&
"Expected target to be initialized");
1718 const llvm::Triple &T = Target->
getTriple();
1720 if (T.isOSWindows() && T.isArch64Bit())
1721 return UnsignedLongLongTy;
1722 return UnsignedLongTy;
1726 assert(Target &&
"Expected target to be initialized");
1727 const llvm::Triple &T = Target->
getTriple();
1729 if (T.isOSWindows() && T.isArch64Bit())
1737 BoolName = &Idents.
get(
"bool");
1742 if (!MakeIntegerSeqName)
1743 MakeIntegerSeqName = &Idents.
get(
"__make_integer_seq");
1744 return MakeIntegerSeqName;
1748 if (!TypePackElementName)
1749 TypePackElementName = &Idents.
get(
"__type_pack_element");
1750 return TypePackElementName;
1756 return getTypeDeclType(getObjCInstanceTypeDecl());
1769 return getTypeDeclType(FILEDecl);
1775 this->jmp_bufDecl = jmp_bufDecl;
1781 return getTypeDeclType(jmp_bufDecl);
1787 this->sigjmp_bufDecl = sigjmp_bufDecl;
1793 return getTypeDeclType(sigjmp_bufDecl);
1799 this->ucontext_tDecl = ucontext_tDecl;
1805 return getTypeDeclType(ucontext_tDecl);
1811 return getLangOpts().CPlusPlus ? BoolTy : IntTy;
1818 void getObjCEncodingForType(
QualType T, std::string &S,
1820 QualType *NotEncodedT=
nullptr)
const;
1824 void getObjCEncodingForPropertyType(
QualType T, std::string &S)
const;
1826 void getLegacyIntegralTypeEncoding(
QualType &t)
const;
1830 std::string &S)
const;
1838 std::string getObjCEncodingForFunctionDecl(
const FunctionDecl *Decl)
const;
1842 std::string getObjCEncodingForMethodDecl(
const ObjCMethodDecl *Decl,
1843 bool Extended =
false)
const;
1853 const Decl *Container)
const;
1860 const Decl *Container)
const;
1875 return getTypeDeclType(getObjCIdDecl());
1885 return getTypeDeclType(getObjCSelDecl());
1897 return getTypeDeclType(getObjCClassDecl());
1916 return getTypeDeclType(getBOOLDecl());
1921 return getObjCInterfaceType(getObjCProtocolDecl());
1930 return getTypeDeclType(getBuiltinVaListDecl());
1936 Decl *getVaListTagDecl()
const;
1944 return getTypeDeclType(getBuiltinMSVaListDecl());
1949 bool canBuiltinBeRedeclared(
const FunctionDecl *)
const;
1954 return getQualifiedType(T, Qualifiers::fromCVRMask(CVR));
1959 return getQualifiedType(split.
Ty, split.
Quals);
1968 return getExtQualType(Ptr, Qc);
1975 return getExtQualType(T, Qs);
1984 assert(lifetime != Qualifiers::OCL_None);
1988 return getQualifiedType(type, qs);
2002 unsigned char getFixedPointScale(
QualType Ty)
const;
2003 unsigned char getFixedPointIBits(
QualType Ty)
const;
2016 bool TemplateKeyword,
2051 unsigned *IntegerConstantArgs =
nullptr)
const;
2080 bool hasDirectOwnershipQualifier(
QualType Ty)
const;
2094 const llvm::fltSemantics &getFloatTypeSemantics(
QualType T)
const;
2101 unsigned getOpenMPDefaultSimdAlign(
QualType T)
const;
2109 return getTypeSize(CharTy);
2113 CharUnits toCharUnitsFromBits(int64_t BitSize)
const;
2116 int64_t toBits(
CharUnits CharSize)
const;
2126 return getTypeSizeInChars(Ty);
2130 return getTypeSizeInCharsIfKnown(
QualType(Ty, 0));
2144 return getTypeUnadjustedAlign(T.
getTypePtr());
2146 unsigned getTypeUnadjustedAlign(
const Type *T)
const;
2151 unsigned getTypeAlignIfKnown(
QualType T)
const;
2162 CharUnits getTypeUnadjustedAlignInChars(
const Type *T)
const;
2166 std::pair<CharUnits, CharUnits> getTypeInfoDataSizeInChars(
QualType T)
const;
2168 std::pair<CharUnits, CharUnits> getTypeInfoInChars(
const Type *T)
const;
2169 std::pair<CharUnits, CharUnits> getTypeInfoInChars(
QualType T)
const;
2173 bool isAlignmentRequired(
const Type *T)
const;
2174 bool isAlignmentRequired(
QualType T)
const;
2181 unsigned getPreferredTypeAlign(
const Type *T)
const;
2185 unsigned getTargetDefaultAlignForAttributeAligned()
const;
2189 unsigned getAlignOfGlobalVar(
QualType T)
const;
2225 bool Simple =
false)
const;
2286 void CollectInheritedProtocols(
const Decl *CDecl,
2287 llvm::SmallPtrSet<ObjCProtocolDecl*, 8> &Protocols);
2291 bool hasUniqueObjectRepresentations(
QualType Ty)
const;
2322 return getCanonicalType(T1) == getCanonicalType(T2);
2325 return getCanonicalType(T1) == getCanonicalType(T2);
2346 return getCanonicalType(T1).getTypePtr() ==
2347 getCanonicalType(T2).getTypePtr();
2351 bool IsParam)
const {
2354 if (SubTnullability.hasValue() == SuperTnullability.hasValue()) {
2356 if (!SubTnullability)
2359 if (*SubTnullability == *SuperTnullability ||
2360 *SubTnullability == NullabilityKind::Unspecified ||
2361 *SuperTnullability == NullabilityKind::Unspecified)
2367 return (*SuperTnullability == NullabilityKind::NonNull &&
2368 *SubTnullability == NullabilityKind::Nullable);
2373 return (*SuperTnullability == NullabilityKind::Nullable &&
2374 *SubTnullability == NullabilityKind::NonNull);
2425 CallingConv getDefaultCallingConvention(
bool IsVariadic,
2427 bool IsBuiltin =
false)
const;
2467 return dyn_cast_or_null<ConstantArrayType>(getAsArrayType(T));
2470 return dyn_cast_or_null<VariableArrayType>(getAsArrayType(T));
2473 return dyn_cast_or_null<IncompleteArrayType>(getAsArrayType(T));
2477 return dyn_cast_or_null<DependentSizedArrayType>(getAsArrayType(T));
2565 unsigned getTargetAddressSpace(
LangAS AS)
const;
2567 LangAS getLangASForBuiltinAddressSpace(
unsigned AS)
const;
2571 uint64_t getTargetNullPointerValue(
QualType QT)
const;
2579 unsigned getIntegerRank(
const Type *T)
const;
2588 bool CompareUnqualified =
false);
2594 return T == getObjCIdType();
2598 return T == getObjCClassType();
2602 return T == getObjCSelType();
2617 bool canAssignObjCInterfacesInBlockPointer(
2620 bool BlockReturnType);
2628 bool Unqualified =
false,
bool BlockReturnType =
false);
2630 bool Unqualified =
false);
2632 bool OfBlockPointer =
false,
2633 bool Unqualified =
false);
2635 bool OfBlockPointer=
false,
2636 bool Unqualified =
false);
2659 bool mergeExtParameterInfo(
2662 bool &CanUseFirst,
bool &CanUseSecond,
2673 unsigned getIntWidth(
QualType T)
const;
2704 unsigned Width = getIntWidth(Type);
2705 if (Width != Res.getBitWidth())
2706 return Res.extOrTrunc(Width);
2710 bool isSentinelNullExpr(
const Expr *E);
2722 return !ObjCImpls.empty();
2771 getTrivialTypeSourceInfo(
QualType T,
2781 void AddDeallocation(
void (*Callback)(
void *),
void *Data)
const;
2786 if (!std::is_trivially_destructible<T>::value) {
2787 auto DestroyPtr = [](
void *
V) {
static_cast<T *
>(
V)->~T(); };
2788 AddDeallocation(DestroyPtr, Ptr);
2801 bool DeclMustBeEmitted(
const Decl *D);
2805 void forEachMultiversionedFunctionVersion(
2812 void addCopyConstructorForExceptionObject(
CXXRecordDecl *RD,
2823 void setManglingNumber(
const NamedDecl *ND,
unsigned Number);
2824 unsigned getManglingNumber(
const NamedDecl *ND)
const;
2826 void setStaticLocalNumber(
const VarDecl *VD,
unsigned Number);
2827 unsigned getStaticLocalNumber(
const VarDecl *VD)
const;
2836 std::unique_ptr<MangleNumberingContext> createMangleNumberingContext()
const;
2840 void setParameterIndex(
const ParmVarDecl *D,
unsigned index);
2844 unsigned getParameterIndex(
const ParmVarDecl *D)
const;
2849 StringLiteral *getPredefinedStringLiteralFromCache(StringRef Key)
const;
2855 void getFunctionFeatureMap(llvm::StringMap<bool> &FeatureMap,
2857 void getFunctionFeatureMap(llvm::StringMap<bool> &FeatureMap,
2865 unsigned NumImplicitDefaultConstructors = 0;
2869 unsigned NumImplicitDefaultConstructorsDeclared = 0;
2872 unsigned NumImplicitCopyConstructors = 0;
2876 unsigned NumImplicitCopyConstructorsDeclared = 0;
2879 unsigned NumImplicitMoveConstructors = 0;
2883 unsigned NumImplicitMoveConstructorsDeclared = 0;
2886 unsigned NumImplicitCopyAssignmentOperators = 0;
2890 unsigned NumImplicitCopyAssignmentOperatorsDeclared = 0;
2893 unsigned NumImplicitMoveAssignmentOperators = 0;
2897 unsigned NumImplicitMoveAssignmentOperatorsDeclared = 0;
2900 unsigned NumImplicitDestructors = 0;
2904 unsigned NumImplicitDestructorsDeclared = 0;
2913 void InitBuiltinTypes(
const TargetInfo &Target,
2919 class ObjCEncOptions {
2922 ObjCEncOptions(
unsigned Bits) : Bits(Bits) {}
2925 ObjCEncOptions() : Bits(0) {}
2926 ObjCEncOptions(
const ObjCEncOptions &RHS) : Bits(RHS.Bits) {}
2928 #define OPT_LIST(V) \ 2929 V(ExpandPointedToStructures, 0) \ 2930 V(ExpandStructures, 1) \ 2931 V(IsOutermostType, 2) \ 2932 V(EncodingProperty, 3) \ 2933 V(IsStructField, 4) \ 2934 V(EncodeBlockParameters, 5) \ 2935 V(EncodeClassNames, 6) \ 2937 #define V(N,I) ObjCEncOptions& set##N() { Bits |= 1 << I; return *this; } 2941 #define V(N,I) bool N() const { return Bits & 1 << I; } 2947 LLVM_NODISCARD ObjCEncOptions keepingOnly(ObjCEncOptions Mask)
const {
2948 return Bits & Mask.Bits;
2951 LLVM_NODISCARD ObjCEncOptions forComponentType()
const {
2952 ObjCEncOptions Mask = ObjCEncOptions()
2953 .setIsOutermostType()
2954 .setIsStructField();
2955 return Bits & ~Mask.Bits;
2960 void getObjCEncodingForTypeImpl(QualType t, std::string &S,
2961 ObjCEncOptions Options,
2962 const FieldDecl *Field,
2963 QualType *NotEncodedT =
nullptr)
const;
2966 void getObjCEncodingForStructureImpl(RecordDecl *RD, std::string &S,
2967 const FieldDecl *Field,
2968 bool includeVBases =
true,
2969 QualType *NotEncodedT=
nullptr)
const;
2973 void getObjCEncodingForMethodParameter(Decl::ObjCDeclQualifier QT,
2974 QualType T, std::string& S,
2975 bool Extended)
const;
2979 bool isMSStaticDataMemberInlineDefinition(
const VarDecl *VD)
const;
3001 getInlineVariableDefinitionKind(
const VarDecl *VD)
const;
3026 llvm::PointerIntPair<StoredDeclsMap *, 1> LastSDM;
3028 std::vector<Decl *> TraversalScope;
3030 std::map<ast_type_traits::TraversalKind, std::unique_ptr<ParentMap>> Parents;
3032 std::unique_ptr<VTableContextBase> VTContext;
3034 void ReleaseDeclContextMaps();
3043 PSF_Invalid = 0x80000000U,
3055 : Decl(Decl), PragmaSectionLocation(PragmaSectionLocation),
3056 SectionFlags(SectionFlags) {}
3123 size_t Alignment ) {
3124 return C.Allocate(Bytes, Alignment);
3161 size_t Alignment ) {
3162 return C.Allocate(Bytes, Alignment);
3176 template <
typename Owner,
typename T,
3185 return new (Ctx)
LazyData(Source, Value);
3189 #endif // LLVM_CLANG_AST_ASTCONTEXT_H static uint64_t getFieldOffset(const ASTContext &C, const FieldDecl *FD)
const IncompleteArrayType * getAsIncompleteArrayType(QualType T) const
CanQualType SatShortAccumTy
void setPrimaryMergedDecl(Decl *D, Decl *Primary)
const Type * Ty
The locally-unqualified type.
Represents a function declaration or definition.
llvm::DenseMap< const Decl *, const Decl * > RedeclChainComments
Mapping from canonical declaration to the first redeclaration in chain that has a comment attached...
void setjmp_bufDecl(TypeDecl *jmp_bufDecl)
Set the type for the C jmp_buf type.
Smart pointer class that efficiently represents Objective-C method names.
QualType getObjCIdType() const
Represents the Objective-CC id type.
Holds information about both target-independent and target-specific builtins, allowing easy queries b...
CanQualType LongDoubleComplexTy
A (possibly-)qualified type.
static void DumpRecordLayout(raw_ostream &OS, const RecordDecl *RD, const ASTContext &C, CharUnits Offset, unsigned IndentLevel, const char *Description, bool PrintSizeInfo, bool IncludeVirtualBases)
QualType getBuiltinVaListType() const
Retrieve the type of the __builtin_va_list type.
bool operator==(CanQual< T > x, CanQual< U > y)
InlineVariableDefinitionKind
Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be placed into a PointerUnion...
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
FunctionType - C99 6.7.5.3 - Function Declarators.
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
The fixed point semantics work similarly to llvm::fltSemantics.
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'.
void setucontext_tDecl(TypeDecl *ucontext_tDecl)
Set the type for the C ucontext_t type.
RawCommentList Comments
All comments in this translation unit.
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
Decl - This represents one declaration (or definition), e.g.
CanQualType ObjCBuiltinSelTy
QualType getUnqualifiedObjCPointerType(QualType type) const
getUnqualifiedObjCPointerType - Returns version of Objective-C pointer type with lifetime qualifier r...
The base class of the type hierarchy.
QualType getsigjmp_bufType() const
Retrieve the C sigjmp_buf type.
CanQualType getNSUIntegerType() const
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Optional< CharUnits > getTypeSizeInCharsIfKnown(const Type *Ty) const
QualType withConst() const
const TargetInfo & getTargetInfo() const
A container of type source information.
QualType getLogicalOperationType() const
The result type of logical operations, '<', '>', '!=', etc.
QualType getWCharType() const
Return the unique wchar_t type available in C++ (and available as __wchar_t as a Microsoft extension)...
Represents a C++ constructor within a class.
QualType getConstType(QualType T) const
Return the uniqued reference to the type for a const qualified type.
unsigned getTypeAlign(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in bits.
QualType withFastQualifiers(unsigned TQs) const
Represents a variable declaration or definition.
const SourceManager & getSourceManager() const
void removeObjCLifetime()
QualType getRawCFConstantStringType() const
Get the structure type used to representation CFStrings, or NULL if it hasn't yet been built...
Extra information about a function prototype.
Declaration context for names declared as extern "C" in C++.
LangAS
Defines the address space values used by the address space qualifier of QualType. ...
ObjCMethodDecl - Represents an instance or class method declaration.
QualType getObjCClassType() const
Represents the Objective-C Class type.
Stores a list of template parameters for a TemplateDecl and its derived classes.
Describes how types, statements, expressions, and declarations should be printed. ...
const internal::VariadicDynCastAllOfMatcher< Stmt, BlockExpr > blockExpr
Matches a reference to a block.
Holds all information required to evaluate constexpr code in a module.
Represents a parameter to a function.
QualType getQualifiedType(QualType T, Qualifiers Qs) const
Return a type with additional qualifiers.
Represents the builtin template declaration which is used to implement __make_integer_seq and other b...
The collection of all-type qualifiers we support.
Represents a struct/union/class.
One of these records is kept for each identifier that is lexed.
bool isObjCClassType(QualType T) const
bool isObjCIdType(QualType T) const
This table allows us to fully hide how we implement multi-keyword caching.
Represents a class type in Objective C.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Will traverse all child nodes.
QualType getLifetimeQualifiedType(QualType type, Qualifiers::ObjCLifetime lifetime)
Return a type with the given lifetime qualifier.
Represents a member of a struct/union/class.
static CGCXXABI * createCXXABI(CodeGenModule &CGM)
DynTypedNodeList getParents(const NodeT &Node)
Returns the parents of the given node (within the traversal scope).
void setBOOLDecl(TypedefDecl *TD)
Save declaration of 'BOOL' typedef.
DynTypedNodeList(ArrayRef< DynTypedNode > A)
bool addressSpaceMapManglingFor(LangAS AS) const
The iterator over UnresolvedSets.
Container for either a single DynTypedNode or for an ArrayRef to DynTypedNode.
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
Defines the clang::attr::Kind enum.
clang::CharUnits operator*(clang::CharUnits::QuantityType Scale, const clang::CharUnits &CU)
void setPrintingPolicy(const clang::PrintingPolicy &Policy)
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...
CanQualType OCLReserveIDTy
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Describes a module or submodule.
RawCommentList & getRawCommentList()
CanQualType getComplexType(CanQualType T) const
ObjCContainerDecl - Represents a container for method declarations.
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)
CanQualType SatShortFractTy
QualType getVolatileType(QualType T) const
Return the uniqued reference to the type for a volatile qualified type.
CanQualType SatUnsignedShortAccumTy
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Keeps track of the mangled names of lambda expressions and block literals within a particular context...
QualType getObjCNSStringType() const
Concrete class used by the front-end to report problems and issues.
const clang::PrintingPolicy & getPrintingPolicy() const
Selector GetNullarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing a nullary selector.
Represents a declaration of a type.
CanQualType PseudoObjectTy
LangAS getAddressSpace() const
CXXMethodVector::const_iterator overridden_cxx_method_iterator
QualType getObjCClassRedefinitionType() const
Retrieve the type that Class has been defined to, which may be different from the built-in Class if C...
QualType getCVRQualifiedType(QualType T, unsigned CVR) const
Return a type with additional const, volatile, or restrict qualifiers.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
TypedefDecl * getBOOLDecl() const
Retrieve declaration of 'BOOL' typedef.
const DependentSizedArrayType * getAsDependentSizedArrayType(QualType T) const
Defines the Linkage enumeration and various utility functions.
import_range local_imports() const
virtual unsigned getExnObjectAlignment() const
Return the alignment (in bits) of the thrown exception object.
Represents an Objective-C protocol declaration.
unsigned getTypeAlign(const Type *T) const
TraversalKindScope(ASTContext &Ctx, llvm::Optional< ast_type_traits::TraversalKind > ScopeTK)
A cache of the value of this pointer, in the most recent generation in which we queried it...
unsigned getTypeUnadjustedAlign(QualType T) const
Return the ABI-specified natural alignment of a (complete) type T, before alignment adjustments...
Represents an ObjC class declaration.
QualType getObjCProtoType() const
Retrieve the type of the Objective-C Protocol class.
QualType getBOOLType() const
type of 'BOOL' type.
Decl * getPrimaryMergedDecl(Decl *D)
IntrusiveRefCntPtr< ExternalASTSource > ExternalSource
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
llvm::iterator_range< overridden_cxx_method_iterator > overridden_method_range
The APFixedPoint class works similarly to APInt/APSInt in that it is a functional replacement for a s...
CanQualType Float128ComplexTy
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Provides definitions for the various language-specific address spaces.
ast_type_traits::TraversalKind Traversal
const XRayFunctionFilter & getXRayFilter() const
llvm::StringMap< SectionInfo > SectionInfos
ArrayRef< Module * > getModulesWithMergedDefinition(const NamedDecl *Def)
Get the additional modules in which the definition Def has been merged.
Contains information gathered from parsing the contents of TargetAttr.
Represents a prototype with parameter type info, e.g.
llvm::iterator_range< import_iterator > import_range
Represents a ValueDecl that came out of a declarator.
DeclarationNameTable DeclarationNames
TypeInfo getTypeInfo(QualType T) const
IdentifierInfo * getNSObjectName() const
Retrieve the identifier 'NSObject'.
ArraySizeModifier
Capture whether this is a normal array (e.g.
bool hasSameType(const Type *T1, const Type *T2) const
bool isObjCSelType(QualType T) const
void addObjCLifetime(ObjCLifetime type)
bool AnyObjCImplementation()
Return true if there is at least one @implementation in the TU.
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
CanQualType UnsignedShortFractTy
Exposes information about the current target.
Represents an array type in C++ whose size is a value-dependent expression.
CommentOptions CommentOpts
Options for parsing comments.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
This represents one expression.
Defines the clang::LangOptions interface.
QualType getucontext_tType() const
Retrieve the C ucontext_t type.
bool isInSystemHeader(SourceLocation Loc) const
Returns if a SourceLocation is in a system header.
Declaration of a template type parameter.
llvm::DenseMap< const Decl *, const RawComment * > DeclRawComments
Mapping from declaration to directly attached comment.
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...
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
CanQualType OMPArraySectionTy
Defines an enumeration for C++ overloaded operators.
unsigned getFastQualifiers() const
Optional< CharUnits > getTypeSizeInCharsIfKnown(QualType Ty) const
comments::CommandTraits & getCommentCommandTraits() const
static ImportDecl * getNextLocalImport(ImportDecl *Import)
void setObjCIdRedefinitionType(QualType RedefType)
Set the user-written type that redefines id.
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)
Represents a C++ template name within the type system.
QualType getFILEType() const
Retrieve the C FILE type.
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
ast_type_traits::TraversalKind getTraversalKind() const
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
void addDestruction(T *Ptr) const
If T isn't trivially destructible, calls AddDeallocation to register it for destruction.
PartialDiagnostic::StorageAllocator & getDiagAllocator()
Qualifiers Quals
The local qualifiers.
bool hasSameNullabilityTypeQualifier(QualType SubT, QualType SuperT, bool IsParam) const
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
Represents a GCC generic vector type.
const Type * getCanonicalType(const Type *T) const
static bool CanThrow(Expr *E, ASTContext &Ctx)
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Common base class for placeholders for types that get replaced by placeholder type deduction: C++11 a...
Implements C++ ABI-specific semantic analysis functions.
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
CanQualType getNSIntegerType() const
CallingConv
CallingConv - Specifies the calling convention that a function uses.
const SanitizerBlacklist & getSanitizerBlacklist() const
GlobalDecl - represents a global declaration.
const ast_type_traits::DynTypedNode * begin() const
IdentifierInfo * getNSCopyingName()
Retrieve the identifier 'NSCopying'.
Abstract interface for external sources of AST nodes.
SourceLocation PragmaSectionLocation
QualType getWideCharType() const
Return the type of wide characters.
Copy initialization expr of a __block variable and a boolean flag that indicates whether the expressi...
QualType getBuiltinMSVaListType() const
Retrieve the type of the __builtin_ms_va_list type.
QualType getObjCIdRedefinitionType() const
Retrieve the type that id has been defined to, which may be different from the built-in id if id has ...
SelectorTable & Selectors
QualType getCanonicalType() const
llvm::PointerUnion< VarTemplateDecl *, MemberSpecializationInfo * > TemplateOrSpecializationInfo
A type synonym for the TemplateOrInstantiation mapping.
Encodes a location in the source.
CharUnits getExnObjectAlignment() const
Return the alignment (in bytes) of the thrown exception object.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
QualType getObjCSelRedefinitionType() const
Retrieve the type that 'SEL' has been defined to, which may be different from the built-in 'SEL' if '...
A structure for storing an already-substituted template template parameter pack.
Represents the declaration of a struct/union/class/enum.
QualType getFunctionNoProtoType(QualType ResultTy) const
QualType getObjCSelType() const
Retrieve the type that corresponds to the predefined Objective-C 'SEL' 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.
const ConstantArrayType * getAsConstantArrayType(QualType T) const
QualType getWIntType() const
In C99, this returns a type compatible with the type defined in <stddef.h> as defined by the target...
static const ComplexType * getComplexType(QualType type)
Return the complex type that we are meant to emit.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
ObjCCategoryDecl - Represents a category declaration.
BuiltinTemplateKind
Kinds of BuiltinTemplateDecl.
bool isSignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is signed or an enumeration types whose underlying ty...
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>, and corresponding __opencl_atomic_* for OpenCL 2.0.
bool isObjCObjectPointerType() const
Represents one property declaration in an Objective-C interface.
const SmallVectorImpl< Type * > & getTypes() const
FunctionDecl * getcudaConfigureCallDecl()
bool isTargetAddressSpace(LangAS AS)
void setObjCSuperType(QualType ST)
std::vector< Decl * > getTraversalScope() const
CanQualType SatUnsignedShortFractTy
bool hasSameUnqualifiedType(QualType T1, QualType T2) const
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
Describes a module import declaration, which makes the contents of the named module visible in the cu...
QualType getObjCInstanceType()
Retrieve the Objective-C "instancetype" type, if already known; otherwise, returns a NULL type;...
unsigned getTargetAddressSpace(Qualifiers Q) const
ast_type_traits::DynTypedNode DynTypedNode
Defines various enumerations that describe declaration and type specifiers.
void * Allocate(size_t Size, unsigned Align=8) const
const DynTypedNode & operator[](size_t N) const
CanQualType UnsignedShortTy
Base class for declarations which introduce a typedef-name.
ast_type_traits::DynTypedNode Node
Represents a template argument.
TagTypeKind
The kind of a tag type.
Dataflow Directional Tag Classes.
SectionInfo(DeclaratorDecl *Decl, SourceLocation PragmaSectionLocation, int SectionFlags)
A qualifier set is used to build a set of qualifiers.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
CanQualType getAdjustedType(CanQualType Orig, CanQualType New) const
The base class of all kinds of template declarations (e.g., class, function, etc.).
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
QualType getRestrictType(QualType T) const
Return the uniqued reference to the type for a restrict qualified type.
CanQualType UnsignedShortAccumTy
unsigned[(unsigned) LangAS::FirstTargetAddressSpace] LangASMap
The type of a lookup table which maps from language-specific address spaces to target-specific ones...
Reads an AST files chain containing the contents of a translation unit.
CanQualType getPointerType(CanQualType T) const
CanQualType getDecayedType(CanQualType T) const
CanQualType UnsignedLongLongTy
std::unique_ptr< DiagnosticConsumer > create(StringRef OutputFile, DiagnosticOptions *Diags, bool MergeChildRecords=false)
Returns a DiagnosticConsumer that serializes diagnostics to a bitcode file.
The name of a declaration.
Represents the declaration of an Objective-C type parameter.
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.
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
bool hasObjCLifetime() const
QualType AutoRRefDeductTy
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
llvm::BumpPtrAllocator & getAllocator() const
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any...
A dynamically typed AST node container.
Represents a pointer to an Objective C object.
CanQualType ObjCBuiltinBoolTy
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
QualType getCanonicalTypeInternal() const
Selector getSelector(unsigned NumArgs, IdentifierInfo **IIV)
Can create any sort of selector.
uint64_t getCharWidth() const
Return the size of the character type, in bits.
bool hasNonFastQualifiers() const
Return true if the set contains any qualifiers which require an ExtQuals node to be allocated...
TraversalKind
Defines how we descend a level in the AST when we pass through expressions.
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
void addComment(const RawComment &RC)
llvm::DenseMap< const Decl *, comments::FullComment * > ParsedComments
Mapping from declarations to parsed comments attached to any redeclaration.
Holds information about the various types of exception specification.
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream...
Optional< NullabilityKind > getNullability(const ASTContext &context) const
Determine the nullability of the given type.
QualType getObjCConstantStringInterface() const
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
QualType getQualifiedType(const Type *T, Qualifiers Qs) const
Return a type with additional qualifiers.
SourceManager & getSourceManager()
bool isIncompleteType(NamedDecl **Def=nullptr) const
Types are partitioned into 3 broad categories (C99 6.2.5p1): object types, function types...
ASTMutationListener * getASTMutationListener() const
Retrieve a pointer to the AST mutation listener associated with this AST context, if any...
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
void setObjCNSStringType(QualType T)
TranslationUnitDecl * getTranslationUnitDecl() const
void Deallocate(void *Ptr) const
Defines the clang::SourceLocation class and associated facilities.
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
static QualType getCanonicalParamType(ASTContext &C, QualType T)
Represents a C++ struct/union/class.
IdentifierInfo * getTypePackElementName() const
Represents a template specialization type whose template cannot be resolved, e.g. ...
Selector GetUnarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing an unary selector.
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
Represents a C array with an unspecified size.
Missing a type from <stdio.h>
IdentifierInfo * getMakeIntegerSeqName() const
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
ObjCIvarDecl - Represents an ObjC instance variable.
bool operator!=(CanQual< T > x, CanQual< U > y)
Provides information a specialization of a member of a class template, which may be a member function...
Builtin::Context & BuiltinInfo
Writes an AST file containing the contents of a translation unit.
StringLiteral - This represents a string literal expression, e.g.
Defines the clang::TargetInfo interface.
A SourceLocation and its associated SourceManager.
void setObjCSelRedefinitionType(QualType RedefType)
Set the user-written type that redefines 'SEL'.
const VariableArrayType * getAsVariableArrayType(QualType T) const
QualType getjmp_bufType() const
Retrieve the C jmp_buf type.
The top declaration context.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
llvm::PointerUnion< T, LazyData * > ValueType
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...
T * Allocate(size_t Num=1) const
llvm::DenseMap< const Decl *, const Decl * > CommentlessRedeclChains
Keeps track of redeclaration chains that don't have any comment attached.
void setTraversalKind(ast_type_traits::TraversalKind TK)
const ast_type_traits::DynTypedNode * end() const
A trivial tuple used to represent a source range.
This represents a decl that may have 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.
TypeInfo(uint64_t Width, unsigned Align, bool AlignIsRequired)
const TargetInfo * getAuxTargetInfo() const
Represents a C array with a specified size that is not an integer-constant-expression.
unsigned getTargetAddressSpace(QualType T) const
size_t getASTAllocatedMemory() const
Return the total amount of physical memory allocated for representing AST nodes and type information...
static bool isObjCNSObjectType(QualType Ty)
Return true if this is an NSObject object with its NSObject attribute set.
IdentifierInfo * getBoolName() const
Retrieve the identifier 'bool'.
Missing a type from <setjmp.h>
SourceLocation getBegin() const
const LangOptions & getLangOpts() const
FullSourceLoc getFullLoc(SourceLocation Loc) const
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.
uint64_t getTypeSize(const Type *T) const
bool isObjCNSObjectType() const
A class which abstracts out some details necessary for making a call.
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
static CharUnits getDeclAlign(Expr *E, CharUnits TypeAlign, ASTContext &Context)
A helper function to get the alignment of a Decl referred to by DeclRefExpr or MemberExpr.
Qualifiers::ObjCLifetime getObjCLifetime() const
Returns lifetime attribute of this type.
ComparisonCategories CompCategories
Types and expressions required to build C++2a three-way comparisons using operator<=>, including the values return by builtin <=> operators.