14#ifndef LLVM_CLANG_AST_ASTCONTEXT_H
15#define LLVM_CLANG_AST_ASTCONTEXT_H
30#include "llvm/ADT/DenseMap.h"
31#include "llvm/ADT/DenseSet.h"
32#include "llvm/ADT/FoldingSet.h"
33#include "llvm/ADT/IntrusiveRefCntPtr.h"
34#include "llvm/ADT/MapVector.h"
35#include "llvm/ADT/PointerIntPair.h"
36#include "llvm/ADT/PointerUnion.h"
37#include "llvm/ADT/SmallVector.h"
38#include "llvm/ADT/StringMap.h"
39#include "llvm/ADT/StringRef.h"
40#include "llvm/ADT/TinyPtrVector.h"
41#include "llvm/Support/TypeSize.h"
47class FixedPointSemantics;
56class ASTMutationListener;
60struct BlockVarCopyInit;
61class BuiltinTemplateDecl;
65class CXXConstructorDecl;
68class DiagnosticsEngine;
69class DynTypedNodeList;
76class MangleNumberingContext;
77class MemberSpecializationInfo;
79struct MSGuidDeclParts;
80class NestedNameSpecifier;
82class ObjCCategoryDecl;
83class ObjCCategoryImplDecl;
84class ObjCContainerDecl;
86class ObjCImplementationDecl;
87class ObjCInterfaceDecl;
90class ObjCPropertyDecl;
91class ObjCPropertyImplDecl;
92class ObjCProtocolDecl;
93class ObjCTypeParamDecl;
95class ParentMapContext;
96struct ParsedTargetAttr;
103class TemplateParameterList;
104class TemplateTemplateParmDecl;
105class TemplateTypeParmDecl;
107class UnresolvedSetIterator;
108class UsingShadowDecl;
109class VarTemplateDecl;
110class VTableContextBase;
111class XRayFunctionFilter;
134namespace serialization {
186 mutable llvm::FoldingSet<ExtQuals> ExtQualNodes;
187 mutable llvm::FoldingSet<ComplexType> ComplexTypes;
188 mutable llvm::FoldingSet<PointerType> PointerTypes{GeneralTypesLog2InitSize};
189 mutable llvm::FoldingSet<AdjustedType> AdjustedTypes;
190 mutable llvm::FoldingSet<BlockPointerType> BlockPointerTypes;
191 mutable llvm::FoldingSet<LValueReferenceType> LValueReferenceTypes;
192 mutable llvm::FoldingSet<RValueReferenceType> RValueReferenceTypes;
193 mutable llvm::FoldingSet<MemberPointerType> MemberPointerTypes;
194 mutable llvm::ContextualFoldingSet<ConstantArrayType, ASTContext &>
196 mutable llvm::FoldingSet<IncompleteArrayType> IncompleteArrayTypes;
197 mutable std::vector<VariableArrayType*> VariableArrayTypes;
198 mutable llvm::ContextualFoldingSet<DependentSizedArrayType, ASTContext &>
199 DependentSizedArrayTypes;
200 mutable llvm::ContextualFoldingSet<DependentSizedExtVectorType, ASTContext &>
201 DependentSizedExtVectorTypes;
202 mutable llvm::ContextualFoldingSet<DependentAddressSpaceType, ASTContext &>
203 DependentAddressSpaceTypes;
204 mutable llvm::FoldingSet<VectorType> VectorTypes;
205 mutable llvm::ContextualFoldingSet<DependentVectorType, ASTContext &>
206 DependentVectorTypes;
207 mutable llvm::FoldingSet<ConstantMatrixType> MatrixTypes;
208 mutable llvm::ContextualFoldingSet<DependentSizedMatrixType, ASTContext &>
209 DependentSizedMatrixTypes;
210 mutable llvm::FoldingSet<FunctionNoProtoType> FunctionNoProtoTypes;
211 mutable llvm::ContextualFoldingSet<FunctionProtoType, ASTContext&>
213 mutable llvm::ContextualFoldingSet<DependentTypeOfExprType, ASTContext &>
214 DependentTypeOfExprTypes;
215 mutable llvm::ContextualFoldingSet<DependentDecltypeType, ASTContext &>
216 DependentDecltypeTypes;
217 mutable llvm::FoldingSet<TemplateTypeParmType> TemplateTypeParmTypes;
218 mutable llvm::FoldingSet<ObjCTypeParamType> ObjCTypeParamTypes;
219 mutable llvm::FoldingSet<SubstTemplateTypeParmType>
220 SubstTemplateTypeParmTypes;
221 mutable llvm::FoldingSet<SubstTemplateTypeParmPackType>
222 SubstTemplateTypeParmPackTypes;
223 mutable llvm::ContextualFoldingSet<TemplateSpecializationType, ASTContext&>
224 TemplateSpecializationTypes;
225 mutable llvm::FoldingSet<ParenType> ParenTypes{GeneralTypesLog2InitSize};
226 mutable llvm::FoldingSet<UsingType> UsingTypes;
227 mutable llvm::FoldingSet<TypedefType> TypedefTypes;
228 mutable llvm::FoldingSet<ElaboratedType> ElaboratedTypes{
229 GeneralTypesLog2InitSize};
230 mutable llvm::FoldingSet<DependentNameType> DependentNameTypes;
231 mutable llvm::ContextualFoldingSet<DependentTemplateSpecializationType,
233 DependentTemplateSpecializationTypes;
234 llvm::FoldingSet<PackExpansionType> PackExpansionTypes;
235 mutable llvm::FoldingSet<ObjCObjectTypeImpl> ObjCObjectTypes;
236 mutable llvm::FoldingSet<ObjCObjectPointerType> ObjCObjectPointerTypes;
237 mutable llvm::FoldingSet<DependentUnaryTransformType>
238 DependentUnaryTransformTypes;
239 mutable llvm::ContextualFoldingSet<AutoType, ASTContext&> AutoTypes;
240 mutable llvm::FoldingSet<DeducedTemplateSpecializationType>
241 DeducedTemplateSpecializationTypes;
242 mutable llvm::FoldingSet<AtomicType> AtomicTypes;
243 mutable llvm::FoldingSet<AttributedType> AttributedTypes;
244 mutable llvm::FoldingSet<PipeType> PipeTypes;
245 mutable llvm::FoldingSet<BitIntType> BitIntTypes;
246 mutable llvm::ContextualFoldingSet<DependentBitIntType, ASTContext &>
247 DependentBitIntTypes;
248 llvm::FoldingSet<BTFTagAttributedType> BTFTagAttributedTypes;
250 mutable llvm::FoldingSet<QualifiedTemplateName> QualifiedTemplateNames;
251 mutable llvm::FoldingSet<DependentTemplateName> DependentTemplateNames;
252 mutable llvm::FoldingSet<SubstTemplateTemplateParmStorage>
253 SubstTemplateTemplateParms;
254 mutable llvm::ContextualFoldingSet<SubstTemplateTemplateParmPackStorage,
256 SubstTemplateTemplateParmPacks;
261 mutable llvm::FoldingSet<NestedNameSpecifier> NestedNameSpecifiers;
267 mutable llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*>
269 mutable llvm::DenseMap<const ObjCContainerDecl*, const ASTRecordLayout*>
273 using TypeInfoMap = llvm::DenseMap<const Type *, struct TypeInfo>;
274 mutable TypeInfoMap MemoizedTypeInfo;
279 using UnadjustedAlignMap = llvm::DenseMap<const Type *, unsigned>;
280 mutable UnadjustedAlignMap MemoizedUnadjustedAlign;
283 llvm::DenseMap<const CXXRecordDecl*, LazyDeclPtr> KeyFunctions;
286 llvm::DenseMap<ObjCContainerDecl*, ObjCImplDecl*> ObjCImpls;
290 llvm::DenseMap<const ObjCMethodDecl*,const ObjCMethodDecl*> ObjCMethodRedecls;
293 llvm::DenseMap<const VarDecl *, BlockVarCopyInit> BlockVarCopyInits;
296 mutable llvm::FoldingSet<MSGuidDecl> MSGuidDecls;
299 mutable llvm::FoldingSet<UnnamedGlobalConstantDecl>
300 UnnamedGlobalConstantDecls;
303 mutable llvm::FoldingSet<TemplateParamObjectDecl> TemplateParamObjectDecls;
309 mutable llvm::StringMap<StringLiteral *> StringLiteralCache;
313 mutable std::string CUIDHash;
317 class CanonicalTemplateTemplateParm :
public llvm::FoldingSetNode {
318 TemplateTemplateParmDecl *Parm;
321 CanonicalTemplateTemplateParm(TemplateTemplateParmDecl *Parm)
324 TemplateTemplateParmDecl *getParam()
const {
return Parm; }
326 void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &
C) {
327 Profile(
ID,
C, Parm);
330 static void Profile(llvm::FoldingSetNodeID &
ID,
332 TemplateTemplateParmDecl *Parm);
334 mutable llvm::ContextualFoldingSet<CanonicalTemplateTemplateParm,
336 CanonTemplateTemplateParms;
338 TemplateTemplateParmDecl *
339 getCanonicalTemplateTemplateParmDecl(TemplateTemplateParmDecl *TTP)
const;
342 mutable TypedefDecl *Int128Decl =
nullptr;
345 mutable TypedefDecl *UInt128Decl =
nullptr;
349 mutable TypedefDecl *BuiltinVaListDecl =
nullptr;
352 mutable TypedefDecl *BuiltinMSVaListDecl =
nullptr;
355 mutable TypedefDecl *ObjCIdDecl =
nullptr;
358 mutable TypedefDecl *ObjCSelDecl =
nullptr;
361 mutable TypedefDecl *ObjCClassDecl =
nullptr;
364 mutable ObjCInterfaceDecl *ObjCProtocolClassDecl =
nullptr;
367 mutable TypedefDecl *BOOLDecl =
nullptr;
371 QualType ObjCIdRedefinitionType;
372 QualType ObjCClassRedefinitionType;
373 QualType ObjCSelRedefinitionType;
376 mutable IdentifierInfo *BoolName =
nullptr;
379 mutable IdentifierInfo *NSObjectName =
nullptr;
382 IdentifierInfo *NSCopyingName =
nullptr;
385 mutable IdentifierInfo *MakeIntegerSeqName =
nullptr;
388 mutable IdentifierInfo *TypePackElementName =
nullptr;
390 QualType ObjCConstantStringType;
391 mutable RecordDecl *CFConstantStringTagDecl =
nullptr;
392 mutable TypedefDecl *CFConstantStringTypeDecl =
nullptr;
394 mutable QualType ObjCSuperType;
396 QualType ObjCNSStringType;
399 TypedefDecl *ObjCInstanceTypeDecl =
nullptr;
402 TypeDecl *FILEDecl =
nullptr;
405 TypeDecl *jmp_bufDecl =
nullptr;
408 TypeDecl *sigjmp_bufDecl =
nullptr;
411 TypeDecl *ucontext_tDecl =
nullptr;
417 mutable RecordDecl *BlockDescriptorType =
nullptr;
423 mutable RecordDecl *BlockDescriptorExtendedType =
nullptr;
426 FunctionDecl *cudaConfigureCallDecl =
nullptr;
432 llvm::DenseMap<const Decl*, AttrVec*> DeclAttrs;
437 llvm::DenseMap<Decl*, Decl*> MergedDecls;
442 llvm::DenseMap<NamedDecl*, llvm::TinyPtrVector<Module*>> MergedDefModules;
448 struct PerModuleInitializers {
452 void resolve(ASTContext &Ctx);
454 llvm::DenseMap<Module*, PerModuleInitializers*> ModuleInitializers;
457 Module *CurrentCXXNamedModule =
nullptr;
459 static constexpr unsigned ConstantArrayTypesLog2InitSize = 8;
460 static constexpr unsigned GeneralTypesLog2InitSize = 9;
461 static constexpr unsigned FunctionProtoTypesLog2InitSize = 12;
468 llvm::PointerUnion<VarTemplateDecl *, MemberSpecializationInfo *>;
508 llvm::DenseMap<const VarDecl *, TemplateOrSpecializationInfo>
509 TemplateOrInstantiation;
534 llvm::DenseMap<NamedDecl *, NamedDecl *> InstantiatedFromUsingDecl;
543 llvm::DenseMap<UsingEnumDecl *, UsingEnumDecl *>
544 InstantiatedFromUsingEnumDecl;
547 llvm::DenseMap<UsingShadowDecl*, UsingShadowDecl*>
548 InstantiatedFromUsingShadowDecl;
550 llvm::DenseMap<FieldDecl *, FieldDecl *> InstantiatedFromUnnamedFieldDecl;
558 using CXXMethodVector = llvm::TinyPtrVector<const CXXMethodDecl *>;
559 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector> OverriddenMethods;
564 llvm::DenseMap<const DeclContext *, std::unique_ptr<MangleNumberingContext>>
565 MangleNumberingContexts;
566 llvm::DenseMap<const Decl *, std::unique_ptr<MangleNumberingContext>>
567 ExtraMangleNumberingContexts;
571 llvm::MapVector<const NamedDecl *, unsigned> MangleNumbers;
572 llvm::MapVector<const VarDecl *, unsigned> StaticLocalNumbers;
574 mutable llvm::DenseMap<const CXXRecordDecl *, unsigned>
575 DeviceLambdaManglingNumbers;
579 using ParameterIndexTable = llvm::DenseMap<const VarDecl *, unsigned>;
580 ParameterIndexTable ParamIndices;
599 std::unique_ptr<NoSanitizeList> NoSanitizeL;
603 std::unique_ptr<XRayFunctionFilter> XRayFilter;
607 std::unique_ptr<ProfileList> ProfList;
613 mutable llvm::BumpPtrAllocator BumpAlloc;
619 std::unique_ptr<CXXABI> ABI;
624 bool AddrSpaceMapMangling;
629 std::unique_ptr<interp::Context> InterpContext;
630 std::unique_ptr<ParentMapContext> ParentMapCtx;
710 void *
Allocate(
size_t Size,
unsigned Align = 8)
const {
711 return BumpAlloc.Allocate(Size, Align);
713 template <
typename T> T *
Allocate(
size_t Num = 1)
const {
714 return static_cast<T *
>(
Allocate(Num *
sizeof(T),
alignof(T)));
722 ListNodeFreeList = Alloc->Rest.dyn_cast<
DeclListNode*>();
724 Alloc->Rest =
nullptr;
732 N->Rest = ListNodeFreeList;
733 ListNodeFreeList = N;
739 return BumpAlloc.getTotalMemory();
746 return DiagAllocator;
774 return LangOpts.CPlusPlus || LangOpts.RecoveryAST;
843 const std::map<unsigned, RawComment *> &CommentsInFile)
const;
859 const Decl **OriginalDecl =
nullptr)
const;
885 const Decl *D)
const;
891 class import_iterator {
898 using difference_type =
int;
899 using iterator_category = std::forward_iterator_tag;
901 import_iterator() =
default;
902 explicit import_iterator(
ImportDecl *Import) : Import(Import) {}
904 reference
operator*()
const {
return Import; }
905 pointer operator->()
const {
return Import; }
907 import_iterator &operator++() {
912 import_iterator operator++(
int) {
913 import_iterator
Other(*
this);
918 friend bool operator==(import_iterator
X, import_iterator Y) {
919 return X.Import == Y.Import;
922 friend bool operator!=(import_iterator
X, import_iterator Y) {
923 return X.Import != Y.Import;
929 return CommentCommandTraits;
993 llvm::iterator_range<overridden_cxx_method_iterator>;
1018 return Import->getNextLocalImport();
1024 return import_range(import_iterator(FirstLocalImport), import_iterator());
1032 MergedDecls[D] = Primary;
1038 bool NotifyListeners =
true);
1071 if (TraversalScope.empty() || TraversalScope.back() == TUDecl)
1072 TraversalScope = {NewTUDecl};
1116#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
1117 CanQualType SingletonId;
1118#include "clang/Basic/OpenCLImageTypes.def"
1123#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
1125#include "clang/Basic/OpenCLExtensionTypes.def"
1126#define SVE_TYPE(Name, Id, SingletonId) \
1127 CanQualType SingletonId;
1128#include "clang/Basic/AArch64SVEACLETypes.def"
1129#define PPC_VECTOR_TYPE(Name, Id, Size) \
1131#include "clang/Basic/PPCTypes.def"
1132#define RVV_TYPE(Name, Id, SingletonId) \
1133 CanQualType SingletonId;
1134#include "clang/Basic/RISCVVTypes.def"
1135#define WASM_TYPE(Name, Id, SingletonId) CanQualType SingletonId;
1136#include "clang/Basic/WebAssemblyReferenceTypes.def"
1251 bool allowOnPointerType =
false)
const;
1316 bool AsWritten =
false);
1403 cudaConfigureCallDecl = FD;
1407 return cudaConfigureCallDecl;
1418 bool &HasByrefExtendedLayout)
const;
1448 unsigned IndexTypeQuals,
1454 unsigned IndexTypeQuals)
const;
1460 unsigned IndexTypeQuals)
const;
1481 BuiltinVectorTypeInfo
1491 unsigned NumFields = 1)
const;
1529 unsigned NumColumns)
const;
1538 Expr *AddrSpaceExpr,
1552 return getFunctionTypeInternal(ResultTy, Args, EPI,
false);
1561 bool OnlyWantCanonical)
const;
1564 bool IsDependent,
bool IsPack =
false,
1567 bool IsCanon =
false)
const;
1573 const TypeDecl *PrevDecl =
nullptr)
const {
1574 assert(
Decl &&
"Passed null for Decl param");
1578 assert(PrevDecl->TypeForDecl &&
"previous decl has no TypeForDecl");
1579 Decl->TypeForDecl = PrevDecl->TypeForDecl;
1580 return QualType(PrevDecl->TypeForDecl, 0);
1583 return getTypeDeclTypeSlow(
Decl);
1612 std::optional<unsigned> PackIndex)
const;
1614 unsigned Index,
bool Final,
1646 TagDecl *OwnedTagDecl =
nullptr)
const;
1675 std::optional<unsigned> NumExpansions,
1676 bool ExpectPackInType =
true);
1684 unsigned NumProtocols)
const;
1689 bool isKindOf)
const;
1722 bool IsDependent,
bool IsPack =
false,
1738 QualType DeducedType,
1739 bool IsDependent)
const;
1817 if (CFConstantStringTypeDecl)
1828 return ObjCConstantStringType;
1832 return ObjCNSStringType;
1836 ObjCNSStringType = T;
1842 if (ObjCIdRedefinitionType.isNull())
1844 return ObjCIdRedefinitionType;
1849 ObjCIdRedefinitionType = RedefType;
1855 if (ObjCClassRedefinitionType.isNull())
1857 return ObjCClassRedefinitionType;
1862 ObjCClassRedefinitionType = RedefType;
1868 if (ObjCSelRedefinitionType.isNull())
1870 return ObjCSelRedefinitionType;
1875 ObjCSelRedefinitionType = RedefType;
1880 if (!NSObjectName) {
1884 return NSObjectName;
1889 if (!NSCopyingName) {
1890 NSCopyingName = &
Idents.
get(
"NSCopying");
1893 return NSCopyingName;
1908 if (!MakeIntegerSeqName)
1909 MakeIntegerSeqName = &
Idents.
get(
"__make_integer_seq");
1910 return MakeIntegerSeqName;
1914 if (!TypePackElementName)
1915 TypePackElementName = &
Idents.
get(
"__type_pack_element");
1916 return TypePackElementName;
1941 this->jmp_bufDecl = jmp_bufDecl;
1953 this->sigjmp_bufDecl = sigjmp_bufDecl;
1965 this->ucontext_tDecl = ucontext_tDecl;
1986 QualType *NotEncodedT=
nullptr)
const;
1996 std::string &S)
const;
2009 bool Extended =
false)
const;
2019 const Decl *Container)
const;
2026 const Decl *Container)
const;
2118 assert(
MSGuidTagDecl &&
"asked for GUID type but MS extensions disabled");
2143 return getExtQualType(Ptr, Qc);
2150 return getExtQualType(T, Qs);
2169 if (!
type.getTypePtr()->isObjCObjectPointerType() ||
2170 !
type.getQualifiers().hasObjCLifetime())
2191 bool TemplateKeyword,
2201 std::optional<unsigned> PackIndex)
const;
2203 Decl *AssociatedDecl,
2226 bool &RequireICE,
bool AllowTypeModifiers)
const;
2234 unsigned *IntegerConstantArgs =
nullptr)
const;
2328 return std::nullopt;
2357 bool NeedsPreferredAlignment =
false)
const;
2443 bool Simple =
false)
const;
2521 bool CheckIfTriviallyCopyable =
true)
const;
2584 bool IsParam)
const {
2587 if (SubTnullability.has_value() == SuperTnullability.has_value()) {
2589 if (!SubTnullability)
2592 if (*SubTnullability == *SuperTnullability ||
2615 bool AllowPiMismatch =
true);
2617 bool AllowPiMismatch =
true);
2660 bool IsBuiltin =
false)
const;
2739 return dyn_cast_or_null<DependentSizedArrayType>(
getAsArrayType(T));
2834 bool AcceptDependent);
2846 unsigned getIntegerRank(
const Type *T)
const;
2855 bool CompareUnqualified =
false);
2861 if (
const auto *ET = dyn_cast<ElaboratedType>(T))
2862 T = ET->getNamedType();
2867 if (
const auto *ET = dyn_cast<ElaboratedType>(T))
2868 T = ET->getNamedType();
2873 if (
const auto *ET = dyn_cast<ElaboratedType>(T))
2874 T = ET->getNamedType();
2893 bool BlockReturnType);
2901 bool Unqualified =
false,
bool BlockReturnType =
false,
2902 bool IsConditionalOperator =
false);
2905 bool IsConditionalOperator =
false);
2907 bool OfBlockPointer =
false,
2910 bool OfBlockPointer=
false,
2937 bool &CanUseFirst,
bool &CanUseSecond,
2988 if (Width != Res.getBitWidth())
2989 return Res.extOrTrunc(Width);
3005 return !ObjCImpls.empty();
3069 if (!std::is_trivially_destructible<T>::value) {
3070 auto DestroyPtr = [](
void *
V) {
static_cast<T *
>(
V)->~T(); };
3108 bool ForAuxTarget =
false)
const;
3153 std::vector<std::string>
3220 class ObjCEncOptions {
3223 ObjCEncOptions(
unsigned Bits) : Bits(Bits) {}
3226 ObjCEncOptions() : Bits(0) {}
3228#define OPT_LIST(V) \
3229 V(ExpandPointedToStructures, 0) \
3230 V(ExpandStructures, 1) \
3231 V(IsOutermostType, 2) \
3232 V(EncodingProperty, 3) \
3233 V(IsStructField, 4) \
3234 V(EncodeBlockParameters, 5) \
3235 V(EncodeClassNames, 6) \
3237#define V(N,I) ObjCEncOptions& set##N() { Bits |= 1 << I; return *this; }
3241#define V(N,I) bool N() const { return Bits & 1 << I; }
3247 [[nodiscard]] ObjCEncOptions keepingOnly(ObjCEncOptions Mask)
const {
3248 return Bits & Mask.Bits;
3251 [[nodiscard]] ObjCEncOptions forComponentType()
const {
3252 ObjCEncOptions Mask = ObjCEncOptions()
3253 .setIsOutermostType()
3254 .setIsStructField();
3255 return Bits & ~Mask.Bits;
3260 void getObjCEncodingForTypeImpl(QualType t, std::string &S,
3261 ObjCEncOptions Options,
3262 const FieldDecl *Field,
3263 QualType *NotEncodedT =
nullptr)
const;
3266 void getObjCEncodingForStructureImpl(RecordDecl *RD, std::string &S,
3267 const FieldDecl *Field,
3268 bool includeVBases =
true,
3269 QualType *NotEncodedT=
nullptr)
const;
3274 QualType T, std::string& S,
3275 bool Extended)
const;
3326 llvm::PointerIntPair<StoredDeclsMap *, 1> LastSDM;
3328 std::vector<Decl *> TraversalScope;
3330 std::unique_ptr<VTableContextBase> VTContext;
3332 void ReleaseDeclContextMaps();
3425 size_t Alignment ) {
3426 return C.Allocate(Bytes, Alignment);
3463 size_t Alignment ) {
3464 return C.Allocate(Bytes, Alignment);
3478template <
typename Owner,
typename T,
Forward declaration of all AST node types.
static bool CanThrow(Expr *E, ASTContext &Ctx)
clang::CharUnits operator*(clang::CharUnits::QuantityType Scale, const clang::CharUnits &CU)
static CGCXXABI * createCXXABI(CodeGenModule &CGM)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream.
Defines the clang::SourceLocation class and associated facilities.
#define CXXABI(Name, Str)
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
bool getByrefLifetime(QualType Ty, Qualifiers::ObjCLifetime &Lifetime, bool &HasByrefExtendedLayout) const
Returns true, if given type has a known lifetime.
MSGuidDecl * getMSGuidDecl(MSGuidDeclParts Parts) const
Return a declaration for the global GUID object representing the given GUID value.
QualType getUsingType(const UsingShadowDecl *Found, QualType Underlying) const
BuiltinVectorTypeInfo getBuiltinVectorTypeInfo(const BuiltinType *VecTy) const
Returns the element type, element count and number of vectors (in case of tuple) for a builtin vector...
bool ObjCMethodsAreEqual(const ObjCMethodDecl *MethodDecl, const ObjCMethodDecl *MethodImp)
CanQualType ObjCBuiltinSelTy
SourceManager & getSourceManager()
TranslationUnitDecl * getTranslationUnitDecl() const
const ConstantArrayType * getAsConstantArrayType(QualType T) const
CanQualType getCanonicalFunctionResultType(QualType ResultType) const
Adjust the given function result type.
QualType getAtomicType(QualType T) const
Return the uniqued reference to the atomic type for the specified type.
bool areLaxCompatibleSveTypes(QualType FirstType, QualType SecondType)
Return true if the given vector types are lax-compatible SVE vector types, false otherwise.
llvm::PointerUnion< VarTemplateDecl *, MemberSpecializationInfo * > TemplateOrSpecializationInfo
A type synonym for the TemplateOrInstantiation mapping.
LangAS getOpenCLTypeAddrSpace(const Type *T) const
Get address space for OpenCL type.
CharUnits getTypeAlignInChars(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in characters.
void InitBuiltinTypes(const TargetInfo &Target, const TargetInfo *AuxTarget=nullptr)
Initialize built-in types.
ParentMapContext & getParentMapContext()
Returns the dynamic AST node parent map context.
QualType getParenType(QualType NamedType) const
size_t getSideTableAllocatedMemory() const
Return the total memory used for various side tables.
MemberSpecializationInfo * getInstantiatedFromStaticDataMember(const VarDecl *Var)
If this variable is an instantiated static data member of a class template specialization,...
QualType getRValueReferenceType(QualType T) const
Return the uniqued reference to the type for an rvalue reference to the specified type.
CanQualType ARCUnbridgedCastTy
uint64_t getTypeSize(const Type *T) const
unsigned getAlignOfGlobalVar(QualType T) const
Return the alignment in bits that should be given to a global variable with type T.
QualType getDependentSizedMatrixType(QualType ElementType, Expr *RowExpr, Expr *ColumnExpr, SourceLocation AttrLoc) const
Return the unique reference to the matrix type of the specified element type and size.
llvm::DenseMap< const Decl *, comments::FullComment * > ParsedComments
Mapping from declarations to parsed comments attached to any redeclaration.
unsigned getManglingNumber(const NamedDecl *ND, bool ForAuxTarget=false) const
void UnwrapSimilarArrayTypes(QualType &T1, QualType &T2, bool AllowPiMismatch=true)
Attempt to unwrap two types that may both be array types with the same bound (or both be array types ...
const SmallVectorImpl< Type * > & getTypes() const
unsigned getIntWidth(QualType T) const
CanQualType getCanonicalParamType(QualType T) const
Return the canonical parameter type corresponding to the specific potentially non-canonical one.
QualType getBTFTagAttributedType(const BTFTypeTagAttr *BTFAttr, QualType Wrapped)
const FunctionType * adjustFunctionType(const FunctionType *Fn, FunctionType::ExtInfo EInfo)
Change the ExtInfo on a function type.
TemplateOrSpecializationInfo getTemplateOrSpecializationInfo(const VarDecl *Var)
QualType getAttributedType(attr::Kind attrKind, QualType modifiedType, QualType equivalentType) const
InlineVariableDefinitionKind
@ None
Not an inline variable.
@ Weak
Weak definition of inline variable.
@ Strong
Strong definition.
@ WeakUnknown
Weak for now, might become strong later in this TU.
const ProfileList & getProfileList() const
void setObjCConstantStringInterface(ObjCInterfaceDecl *Decl)
TypedefDecl * getObjCClassDecl() const
Retrieve the typedef declaration corresponding to the predefined Objective-C 'Class' type.
TypedefNameDecl * getTypedefNameForUnnamedTagDecl(const TagDecl *TD)
TypedefDecl * getCFConstantStringDecl() const
CanQualType SatUnsignedFractTy
CanQualType getAdjustedType(CanQualType Orig, CanQualType New) const
BuiltinTemplateDecl * getMakeIntegerSeqDecl() const
void setInstantiatedFromUsingDecl(NamedDecl *Inst, NamedDecl *Pattern)
Remember that the using decl Inst is an instantiation of the using decl Pattern of a class template.
bool areCompatibleRVVTypes(QualType FirstType, QualType SecondType)
Return true if the given types are an RISC-V vector builtin type and a VectorType that is a fixed-len...
ExternCContextDecl * getExternCContextDecl() const
const llvm::fltSemantics & getFloatTypeSemantics(QualType T) const
Return the APFloat 'semantics' for the specified scalar floating point type.
ParsedTargetAttr filterFunctionTargetAttrs(const TargetAttr *TD) const
Parses the target attributes passed in, and returns only the ones that are valid feature names.
QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent, bool IsPack=false, ConceptDecl *TypeConstraintConcept=nullptr, ArrayRef< TemplateArgument > TypeConstraintArgs={}) const
C++11 deduced auto type.
QualType areCommonBaseCompatible(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
TypedefDecl * getObjCSelDecl() const
Retrieve the typedef corresponding to the predefined 'SEL' type in Objective-C.
llvm::iterator_range< import_iterator > import_range
bool AnyObjCImplementation()
Return true if there is at least one @implementation in the TU.
CanQualType UnsignedShortAccumTy
TypedefDecl * getObjCInstanceTypeDecl()
Retrieve the typedef declaration corresponding to the Objective-C "instancetype" type.
uint64_t getFieldOffset(const ValueDecl *FD) const
Get the offset of a FieldDecl or IndirectFieldDecl, in bits.
void DeallocateDeclListNode(DeclListNode *N)
Deallcates a DeclListNode by returning it to the ListNodeFreeList pool.
DeclListNode * AllocateDeclListNode(clang::NamedDecl *ND)
Allocates a DeclListNode or returns one from the ListNodeFreeList pool.
QualType getDependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, ArrayRef< TemplateArgumentLoc > Args) const
void setTemplateOrSpecializationInfo(VarDecl *Inst, TemplateOrSpecializationInfo TSI)
bool ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto, ObjCProtocolDecl *rProto) const
ProtocolCompatibleWithProtocol - return 'true' if 'lProto' is in the inheritance hierarchy of 'rProto...
bool hasSimilarType(QualType T1, QualType T2)
Determine if two types are similar, according to the C++ rules.
TypedefDecl * buildImplicitTypedef(QualType T, StringRef Name) const
Create a new implicit TU-level typedef declaration.
unsigned getTypeAlign(const Type *T) const
QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl=nullptr) const
getObjCInterfaceType - Return the unique reference to the type for the specified ObjC interface decl.
void adjustObjCTypeParamBoundType(const ObjCTypeParamDecl *Orig, ObjCTypeParamDecl *New) const
llvm::StringMap< SectionInfo > SectionInfos
QualType getBlockPointerType(QualType T) const
Return the uniqued reference to the type for a block of the specified type.
TemplateArgument getCanonicalTemplateArgument(const TemplateArgument &Arg) const
Retrieve the "canonical" template argument.
QualType getAutoRRefDeductType() const
C++11 deduction pattern for 'auto &&' type.
TypedefDecl * getBuiltinMSVaListDecl() const
Retrieve the C type declaration corresponding to the predefined __builtin_ms_va_list type.
bool ObjCQualifiedIdTypesAreCompatible(const ObjCObjectPointerType *LHS, const ObjCObjectPointerType *RHS, bool ForCompare)
ObjCQualifiedIdTypesAreCompatible - We know that one of lhs/rhs is an ObjCQualifiedIDType.
void addLazyModuleInitializers(Module *M, ArrayRef< uint32_t > IDs)
QualType getTagDeclType(const TagDecl *Decl) const
Return the unique reference to the type for the specified TagDecl (struct/union/class/enum) decl.
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 ...
QualType getBuiltinVaListType() const
Retrieve the type of the __builtin_va_list type.
QualType mergeFunctionTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false, bool AllowCXX=false, bool IsConditionalOperator=false)
NamedDecl * getInstantiatedFromUsingDecl(NamedDecl *Inst)
If the given using decl Inst is an instantiation of another (possibly unresolved) using decl,...
DeclarationNameTable DeclarationNames
comments::FullComment * cloneFullComment(comments::FullComment *FC, const Decl *D) const
TemplateName getCanonicalTemplateName(const TemplateName &Name) const
Retrieves the "canonical" template name that refers to a given template.
QualType getUnresolvedUsingType(const UnresolvedUsingTypenameDecl *Decl) const
CharUnits getObjCEncodingTypeSize(QualType T) const
Return the size of type T for Objective-C encoding purpose, in characters.
int getIntegerTypeOrder(QualType LHS, QualType RHS) const
Return the highest ranked integer type, see C99 6.3.1.8p1.
QualType getObjCClassType() const
Represents the Objective-C Class type.
TypedefDecl * getObjCIdDecl() const
Retrieve the typedef corresponding to the predefined id type in Objective-C.
void setCurrentNamedModule(Module *M)
Set the (C++20) module we are building.
QualType getRawCFConstantStringType() const
Get the structure type used to representation CFStrings, or NULL if it hasn't yet been built.
QualType getProcessIDType() const
Return the unique type for "pid_t" defined in <sys/types.h>.
CharUnits getMemberPointerPathAdjustment(const APValue &MP) const
Find the 'this' offset for the member path in a pointer-to-member APValue.
bool mayExternalize(const Decl *D) const
Whether a C++ static variable or CUDA/HIP kernel may be externalized.
QualType getTemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args, QualType Canon=QualType()) const
std::unique_ptr< MangleNumberingContext > createMangleNumberingContext() const
QualType getUnsignedPointerDiffType() const
Return the unique unsigned counterpart of "ptrdiff_t" integer type.
QualType getucontext_tType() const
Retrieve the C ucontext_t type.
QualType getRecordType(const RecordDecl *Decl) const
std::optional< CharUnits > getTypeSizeInCharsIfKnown(const Type *Ty) const
QualType getScalableVectorType(QualType EltTy, unsigned NumElts, unsigned NumFields=1) const
Return the unique reference to a scalable vector type of the specified element type and scalable numb...
bool hasSameExpr(const Expr *X, const Expr *Y) const
Determine whether the given expressions X and Y are equivalent.
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.
QualType getBuiltinMSVaListType() const
Retrieve the type of the __builtin_ms_va_list type.
MangleContext * createMangleContext(const TargetInfo *T=nullptr)
If T is null pointer, assume the target in ASTContext.
QualType getRealTypeForBitwidth(unsigned DestWidth, FloatModeKind ExplicitType) const
getRealTypeForBitwidth - sets floating point QualTy according to specified bitwidth.
QualType getInjectedClassNameType(CXXRecordDecl *Decl, QualType TST) const
getInjectedClassNameType - Return the unique reference to the injected class name type for the specif...
QualType getVariableArrayType(QualType EltTy, Expr *NumElts, 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 getFunctionNoProtoType(QualType ResultTy, const FunctionType::ExtInfo &Info) const
Return a K&R style C function type like 'int()'.
ASTMutationListener * getASTMutationListener() const
Retrieve a pointer to the AST mutation listener associated with this AST context, if any.
unsigned NumImplicitCopyAssignmentOperatorsDeclared
The number of implicitly-declared copy assignment operators for which declarations were built.
uint64_t getTargetNullPointerValue(QualType QT) const
Get target-dependent integer value for null pointer which is used for constant folding.
unsigned getTypeUnadjustedAlign(QualType T) const
Return the ABI-specified natural alignment of a (complete) type T, before alignment adjustments,...
unsigned char getFixedPointIBits(QualType Ty) const
QualType getCorrespondingSignedFixedPointType(QualType Ty) const
IntrusiveRefCntPtr< ExternalASTSource > ExternalSource
void setObjCIdRedefinitionType(QualType RedefType)
Set the user-written type that redefines id.
bool isObjCIdType(QualType T) const
QualType getPackExpansionType(QualType Pattern, std::optional< unsigned > NumExpansions, bool ExpectPackInType=true)
Form a pack expansion type with the given pattern.
const ASTRecordLayout & getASTRecordLayout(const RecordDecl *D) const
Get or compute information about the layout of the specified record (struct/union/class) D,...
DynTypedNodeList getParents(const NodeT &Node)
Forwards to get node parents from the ParentMapContext.
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
unsigned NumImplicitDestructorsDeclared
The number of implicitly-declared destructors for which declarations were built.
bool isObjCClassType(QualType T) const
void setObjCNSStringType(QualType T)
bool mergeExtParameterInfo(const FunctionProtoType *FirstFnType, const FunctionProtoType *SecondFnType, bool &CanUseFirst, bool &CanUseSecond, SmallVectorImpl< FunctionProtoType::ExtParameterInfo > &NewParamInfos)
This function merges the ExtParameterInfo lists of two functions.
bool ObjCQualifiedClassTypesAreCompatible(const ObjCObjectPointerType *LHS, const ObjCObjectPointerType *RHS)
ObjCQualifiedClassTypesAreCompatible - compare Class<pr,...> and Class<pr1, ...>.
bool shouldExternalize(const Decl *D) const
Whether a C++ static variable or CUDA/HIP kernel should be externalized.
FullSourceLoc getFullLoc(SourceLocation Loc) const
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
bool propertyTypesAreCompatible(QualType, QualType)
void setInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst, UsingShadowDecl *Pattern)
TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateName Template) const
Retrieve the template name that represents a qualified template name such as std::vector.
QualType getDependentVectorType(QualType VectorType, Expr *SizeExpr, SourceLocation AttrLoc, VectorKind VecKind) const
Return the unique reference to the type for a dependently sized vector of the specified element type.
comments::CommandTraits & getCommentCommandTraits() const
CanQualType SatLongAccumTy
const XRayFunctionFilter & getXRayFilter() const
CanQualType getIntMaxType() const
Return the unique type for "intmax_t" (C99 7.18.1.5), defined in <stdint.h>.
QualType getVectorType(QualType VectorType, unsigned NumElts, VectorKind VecKind) const
Return the unique reference to a vector type of the specified element type and size.
std::vector< std::string > filterFunctionTargetVersionAttrs(const TargetVersionAttr *TV) const
OpenCLTypeKind getOpenCLTypeKind(const Type *T) const
Map an AST Type to an OpenCLTypeKind enum value.
QualType getFILEType() const
Retrieve the C FILE type.
ArrayRef< Decl * > getModuleInitializers(Module *M)
Get the initializations to perform when importing a module, if any.
void getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT, std::string &S) const
Put the string version of the type qualifiers QT into S.
unsigned getPreferredTypeAlign(QualType T) const
Return the "preferred" alignment of the specified type T for the current target, in bits.
void getInjectedTemplateArgs(const TemplateParameterList *Params, SmallVectorImpl< TemplateArgument > &Args)
Get a template argument list with one argument per template parameter in a template parameter list,...
void setsigjmp_bufDecl(TypeDecl *sigjmp_bufDecl)
Set the type for the C sigjmp_buf type.
std::string getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, bool Extended=false) const
Emit the encoded type for the method declaration Decl into S.
void DumpRecordLayout(const RecordDecl *RD, raw_ostream &OS, bool Simple=false) const
bool DeclMustBeEmitted(const Decl *D)
Determines if the decl can be CodeGen'ed or deserialized from PCH lazily, only when used; this is onl...
CanQualType OMPArrayShapingTy
ASTContext(LangOptions &LOpts, SourceManager &SM, IdentifierTable &idents, SelectorTable &sels, Builtin::Context &builtins, TranslationUnitKind TUKind)
QualType getReadPipeType(QualType T) const
Return a read_only pipe type for the specified type.
std::string getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD, const Decl *Container) const
getObjCEncodingForPropertyDecl - Return the encoded type for this method declaration.
unsigned getStaticLocalNumber(const VarDecl *VD) const
QualType getObjCSelRedefinitionType() const
Retrieve the type that 'SEL' has been defined to, which may be different from the built-in 'SEL' if '...
void addComment(const RawComment &RC)
void getLegacyIntegralTypeEncoding(QualType &t) const
getLegacyIntegralTypeEncoding - Another legacy compatibility encoding: 32-bit longs are encoded as 'l...
bool isSameTypeConstraint(const TypeConstraint *XTC, const TypeConstraint *YTC) const
Determine whether two type contraint are similar enough that they could used in declarations of the s...
CallingConv getDefaultCallingConvention(bool IsVariadic, bool IsCXXMethod, bool IsBuiltin=false) const
Retrieves the default calling convention for the current target.
RecordDecl * buildImplicitRecord(StringRef Name, RecordDecl::TagKind TK=RecordDecl::TagKind::Struct) const
Create a new implicit TU-level CXXRecordDecl or RecordDecl declaration.
void setObjCSelRedefinitionType(QualType RedefType)
Set the user-written type that redefines 'SEL'.
void setFILEDecl(TypeDecl *FILEDecl)
Set the type for the C FILE type.
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
const IncompleteArrayType * getAsIncompleteArrayType(QualType T) const
QualType getMSGuidType() const
Retrieve the implicitly-predeclared 'struct _GUID' type.
const CXXMethodDecl * getCurrentKeyFunction(const CXXRecordDecl *RD)
Get our current best idea for the key function of the given record decl, or nullptr if there isn't on...
const ASTRecordLayout & getASTObjCImplementationLayout(const ObjCImplementationDecl *D) const
Get or compute information about the layout of the specified Objective-C implementation.
CanQualType UnsignedLongFractTy
QualType getEnumType(const EnumDecl *Decl) const
overridden_method_range overridden_methods(const CXXMethodDecl *Method) const
QualType getDependentBitIntType(bool Unsigned, Expr *BitsExpr) const
Return a dependent bit-precise integer type with the specified signedness and bit count.
void setObjCImplementation(ObjCInterfaceDecl *IFaceD, ObjCImplementationDecl *ImplD)
Set the implementation of ObjCInterfaceDecl.
StringRef getCUIDHash() 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...
bool canAssignObjCInterfaces(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
canAssignObjCInterfaces - Return true if the two interface types are compatible for assignment from R...
QualType getReferenceQualifiedType(const Expr *e) const
getReferenceQualifiedType - Given an expr, will return the type for that expression,...
bool hasSameFunctionTypeIgnoringExceptionSpec(QualType T, QualType U) const
Determine whether two function types are the same, ignoring exception specifications in cases where t...
bool isObjCSelType(QualType T) const
QualType getBlockDescriptorExtendedType() const
Gets the struct used to keep track of the extended descriptor for pointer to blocks.
void Deallocate(void *Ptr) const
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type.
IdentifierInfo * getMakeIntegerSeqName() const
bool QIdProtocolsAdoptObjCObjectProtocols(QualType QT, ObjCInterfaceDecl *IDecl)
QIdProtocolsAdoptObjCObjectProtocols - Checks that protocols in QT's qualified-id protocol list adopt...
bool isSameConstraintExpr(const Expr *XCE, const Expr *YCE) const
Determine whether two 'requires' expressions are similar enough that they may be used in re-declarati...
IdentifierInfo * getTypePackElementName() const
bool BlockRequiresCopying(QualType Ty, const VarDecl *D)
Returns true iff we need copy/dispose helpers for the given type.
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
CanQualType OMPIteratorTy
std::vector< Decl * > getTraversalScope() const
TemplateName getSubstTemplateTemplateParm(TemplateName replacement, Decl *AssociatedDecl, unsigned Index, std::optional< unsigned > PackIndex) const
Builtin::Context & BuiltinInfo
QualType getConstantArrayType(QualType EltTy, const llvm::APInt &ArySize, const Expr *SizeExpr, ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return the unique reference to the type for a constant array of the specified element type.
void addModuleInitializer(Module *M, Decl *Init)
Add a declaration to the list of declarations that are initialized for a module.
const LangOptions & getLangOpts() const
QualType getConstType(QualType T) const
Return the uniqued reference to the type for a const qualified type.
TemplateArgument getInjectedTemplateArg(NamedDecl *ParamDecl)
QualType getFunctionTypeWithoutPtrSizes(QualType T)
Get a function type and produce the equivalent function type where pointer size address spaces in the...
llvm::iterator_range< overridden_cxx_method_iterator > overridden_method_range
SelectorTable & Selectors
RawCommentList Comments
All comments in this translation unit.
bool isSameDefaultTemplateArgument(const NamedDecl *X, const NamedDecl *Y) const
Determine whether two default template arguments are similar enough that they may be used in declarat...
QualType applyObjCProtocolQualifiers(QualType type, ArrayRef< ObjCProtocolDecl * > protocols, bool &hasError, bool allowOnPointerType=false) const
Apply Objective-C protocol qualifiers to the given type.
QualType getMacroQualifiedType(QualType UnderlyingTy, const IdentifierInfo *MacroII) const
QualType removePtrSizeAddrSpace(QualType T) const
Remove the existing address space on the type if it is a pointer size address space and return the ty...
bool areLaxCompatibleRVVTypes(QualType FirstType, QualType SecondType)
Return true if the given vector types are lax-compatible RISC-V vector types as defined by -flax-vect...
void setObjCSuperType(QualType ST)
TypedefDecl * getBOOLDecl() const
Retrieve declaration of 'BOOL' typedef.
CanQualType SatShortFractTy
QualType getDecayedType(QualType T) const
Return the uniqued reference to the decayed version of the given type.
bool canBindObjCObjectType(QualType To, QualType From)
int getFloatingTypeSemanticOrder(QualType LHS, QualType RHS) const
Compare the rank of two floating point types as above, but compare equal if both types have the same ...
QualType getUIntPtrType() const
Return a type compatible with "uintptr_t" (C99 7.18.1.4), as defined by the target.
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...
QualType getFunctionTypeWithExceptionSpec(QualType Orig, const FunctionProtoType::ExceptionSpecInfo &ESI) const
Get a function type and produce the equivalent function type with the specified exception specificati...
bool hasSameType(const Type *T1, const Type *T2) const
QualType getObjCInstanceType()
Retrieve the Objective-C "instancetype" type, if already known; otherwise, returns a NULL type;.
Qualifiers::GC getObjCGCAttrKind(QualType Ty) const
Return one of the GCNone, Weak or Strong Objective-C garbage collection attributes.
PartialDiagnostic::DiagStorageAllocator & getDiagAllocator()
void setASTMutationListener(ASTMutationListener *Listener)
Attach an AST mutation listener to the AST context.
bool hasUniqueObjectRepresentations(QualType Ty, bool CheckIfTriviallyCopyable=true) const
Return true if the specified type has unique object representations according to (C++17 [meta....
bool typesAreBlockPointerCompatible(QualType, QualType)
CanQualType SatUnsignedAccumTy
const ASTRecordLayout & getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D) const
Get or compute information about the layout of the specified Objective-C interface.
QualType getObjCProtoType() const
Retrieve the type of the Objective-C Protocol class.
void forEachMultiversionedFunctionVersion(const FunctionDecl *FD, llvm::function_ref< void(FunctionDecl *)> Pred) const
Visits all versions of a multiversioned function with the passed predicate.
void setInstantiatedFromUsingEnumDecl(UsingEnumDecl *Inst, UsingEnumDecl *Pattern)
Remember that the using enum decl Inst is an instantiation of the using enum decl Pattern of a class ...
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
QualType getPointerDiffType() const
Return the unique type for "ptrdiff_t" (C99 7.17) defined in <stddef.h>.
Decl * getPrimaryMergedDecl(Decl *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 getCanonicalTemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args) const
CanQualType ObjCBuiltinIdTy
overridden_cxx_method_iterator overridden_methods_end(const CXXMethodDecl *Method) const
VTableContextBase * getVTableContext()
void setBOOLDecl(TypedefDecl *TD)
Save declaration of 'BOOL' typedef.
ComparisonCategories CompCategories
Types and expressions required to build C++2a three-way comparisons using operator<=>,...
int getFloatingTypeOrder(QualType LHS, QualType RHS) const
Compare the rank of the two specified floating point types, ignoring the domain of the type (i....
unsigned CountNonClassIvars(const ObjCInterfaceDecl *OI) const
ASTContext(const ASTContext &)=delete
ObjCPropertyImplDecl * getObjCPropertyImplDeclForPropertyDecl(const ObjCPropertyDecl *PD, const Decl *Container) const
bool isNearlyEmpty(const CXXRecordDecl *RD) const
void cacheRawCommentForDecl(const Decl &OriginalD, const RawComment &Comment) const
Attaches Comment to OriginalD and to its redeclaration chain and removes the redeclaration chain from...
void attachCommentsToJustParsedDecls(ArrayRef< Decl * > Decls, const Preprocessor *PP)
Searches existing comments for doc comments that should be attached to Decls.
QualType getIntTypeForBitwidth(unsigned DestWidth, unsigned Signed) const
getIntTypeForBitwidth - sets integer QualTy according to specified details: bitwidth,...
llvm::BumpPtrAllocator & getAllocator() const
void setStaticLocalNumber(const VarDecl *VD, unsigned Number)
QualType getCFConstantStringType() const
Return the C structure type used to represent constant CFStrings.
FieldDecl * getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field)
void eraseDeclAttrs(const Decl *D)
Erase the attributes corresponding to the given declaration.
const NoSanitizeList & getNoSanitizeList() const
struct clang::ASTContext::CUDAConstantEvalContext CUDAConstantEvalCtx
IdentifierInfo * getNSObjectName() const
Retrieve the identifier 'NSObject'.
UsingEnumDecl * getInstantiatedFromUsingEnumDecl(UsingEnumDecl *Inst)
If the given using-enum decl Inst is an instantiation of another using-enum decl, return it.
RecordDecl * getCFConstantStringTagDecl() const
QualType getObjCSelType() const
Retrieve the type that corresponds to the predefined Objective-C 'SEL' type.
QualType getDeducedTemplateSpecializationType(TemplateName Template, QualType DeducedType, bool IsDependent) const
C++17 deduced class template specialization type.
std::string getObjCEncodingForFunctionDecl(const FunctionDecl *Decl) const
Emit the encoded type for the function Decl into S.
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...
bool addressSpaceMapManglingFor(LangAS AS) const
CanQualType UnsignedFractTy
QualType getjmp_bufType() const
Retrieve the C jmp_buf type.
GVALinkage GetGVALinkageForFunction(const FunctionDecl *FD) const
QualType mergeFunctionParameterTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
mergeFunctionParameterTypes - merge two types which appear as function parameter types
QualType getsigjmp_bufType() const
Retrieve the C sigjmp_buf type.
void addOverriddenMethod(const CXXMethodDecl *Method, const CXXMethodDecl *Overridden)
Note that the given C++ Method overrides the given Overridden method.
const TargetInfo * getAuxTargetInfo() const
CanQualType ObjCBuiltinClassTy
unsigned NumImplicitDefaultConstructorsDeclared
The number of implicitly-declared default constructors for which declarations were built.
void setucontext_tDecl(TypeDecl *ucontext_tDecl)
Set the type for the C ucontext_t type.
OMPTraitInfo & getNewOMPTraitInfo()
Return a new OMPTraitInfo object owned by this context.
CanQualType UnsignedLongTy
bool hasSameTemplateName(const TemplateName &X, const TemplateName &Y) const
Determine whether the given template names refer to the same template.
llvm::DenseSet< const FunctionDecl * > CUDAImplicitHostDeviceFunUsedByDevice
Keep track of CUDA/HIP implicit host device functions used on device side in device compilation.
void DeepCollectObjCIvars(const ObjCInterfaceDecl *OI, bool leafClass, SmallVectorImpl< const ObjCIvarDecl * > &Ivars) const
DeepCollectObjCIvars - This routine first collects all declared, but not synthesized,...
llvm::APFixedPoint getFixedPointMin(QualType Ty) const
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location,...
void addedLocalImportDecl(ImportDecl *Import)
Notify the AST context that a new import declaration has been parsed or implicitly created within thi...
const TranslationUnitKind TUKind
QualType getQualifiedType(const Type *T, Qualifiers Qs) const
Return a type with additional qualifiers.
CanQualType UnsignedLongAccumTy
QualType AutoRRefDeductTy
QualType getRestrictType(QualType T) const
Return the uniqued reference to the type for a restrict qualified type.
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
TypeInfo getTypeInfo(const Type *T) const
Get the size and alignment of the specified complete type in bits.
QualType getStringLiteralArrayType(QualType EltTy, unsigned Length) const
Return a type for a constant array for a string literal of the specified element type and length.
QualType getCorrespondingSaturatedType(QualType Ty) const
bool isSameEntity(const NamedDecl *X, const NamedDecl *Y) const
Determine whether the two declarations refer to the same entity.
QualType getBOOLType() const
type of 'BOOL' type.
TypeSourceInfo * getTemplateSpecializationTypeInfo(TemplateName T, SourceLocation TLoc, const TemplateArgumentListInfo &Args, QualType Canon=QualType()) const
QualType getSubstTemplateTypeParmPackType(Decl *AssociatedDecl, unsigned Index, bool Final, const TemplateArgument &ArgPack)
Retrieve a.
CanQualType BoundMemberTy
CanQualType SatUnsignedShortFractTy
QualType removeAddrSpaceQualType(QualType T) const
Remove any existing address space on the type and returns the type with qualifiers intact (or that's ...
TypedefDecl * getInt128Decl() const
Retrieve the declaration for the 128-bit signed integer type.
unsigned getOpenMPDefaultSimdAlign(QualType T) const
Get default simd alignment of the specified complete type in bits.
QualType getObjCSuperType() const
Returns the C struct type for objc_super.
QualType getBlockDescriptorType() const
Gets the struct used to keep track of the descriptor for pointer to blocks.
bool CommentsLoaded
True if comments are already loaded from ExternalASTSource.
BlockVarCopyInit getBlockVarCopyInit(const VarDecl *VD) const
Get the copy initialization expression of the VarDecl VD, or nullptr if none exists.
unsigned NumImplicitMoveConstructorsDeclared
The number of implicitly-declared move constructors for which declarations were built.
unsigned NumImplicitCopyConstructorsDeclared
The number of implicitly-declared copy constructors for which declarations were built.
llvm::DenseSet< const VarDecl * > CUDADeviceVarODRUsedByHost
Keep track of CUDA/HIP device-side variables ODR-used by host code.
CanQualType PseudoObjectTy
QualType getWebAssemblyExternrefType() const
Return a WebAssembly externref type.
void setTraversalScope(const std::vector< Decl * > &)
CharUnits getTypeUnadjustedAlignInChars(QualType T) const
getTypeUnadjustedAlignInChars - Return the ABI-specified alignment of a type, in characters,...
QualType getAdjustedType(QualType Orig, QualType New) const
Return the uniqued reference to a type adjusted from the original type to a new type.
CanQualType getComplexType(CanQualType T) const
friend class NestedNameSpecifier
TypeInfoChars getTypeInfoDataSizeInChars(QualType T) const
MangleNumberingContext & getManglingNumberContext(const DeclContext *DC)
Retrieve the context for computing mangling numbers in the given DeclContext.
comments::FullComment * getLocalCommentForDeclUncached(const Decl *D) const
Return parsed documentation comment attached to a given declaration.
unsigned NumImplicitDestructors
The number of implicitly-declared destructors.
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
QualType getElaboratedType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType, TagDecl *OwnedTagDecl=nullptr) const
bool isAlignmentRequired(const Type *T) const
Determine if the alignment the type has was required using an alignment attribute.
bool areComparableObjCPointerTypes(QualType LHS, QualType RHS)
MangleContext * createDeviceMangleContext(const TargetInfo &T)
Creates a device mangle context to correctly mangle lambdas in a mixed architecture compile by settin...
CharUnits getExnObjectAlignment() const
Return the alignment (in bytes) of the thrown exception object.
QualType getUnqualifiedArrayType(QualType T, Qualifiers &Quals)
Return this type as a completely-unqualified array type, capturing the qualifiers in Quals.
QualType getObjCObjectPointerType(QualType OIT) const
Return a ObjCObjectPointerType type for the given ObjCObjectType.
ASTMutationListener * Listener
void setNonKeyFunction(const CXXMethodDecl *method)
Observe that the given method cannot be a key function.
CanQualType ObjCBuiltinBoolTy
TypeInfoChars getTypeInfoInChars(const Type *T) const
QualType getObjCObjectType(QualType Base, ObjCProtocolDecl *const *Protocols, unsigned NumProtocols) const
Legacy interface: cannot provide type arguments or __kindof.
LangAS getDefaultOpenCLPointeeAddrSpace()
Returns default address space based on OpenCL version and enabled features.
TemplateParamObjectDecl * getTemplateParamObjectDecl(QualType T, const APValue &V) const
Return the template parameter object of the given type with the given value.
const SourceManager & getSourceManager() const
CharUnits getDeclAlign(const Decl *D, bool ForAlignof=false) const
Return a conservative estimate of the alignment of the specified decl D.
int64_t toBits(CharUnits CharSize) const
Convert a size in characters to a size in bits.
CanQualType OCLClkEventTy
void adjustExceptionSpec(FunctionDecl *FD, const FunctionProtoType::ExceptionSpecInfo &ESI, bool AsWritten=false)
Change the exception specification on a function once it is delay-parsed, instantiated,...
TypedefDecl * getUInt128Decl() const
Retrieve the declaration for the 128-bit unsigned integer type.
CharUnits getPreferredTypeAlignInChars(QualType T) const
Return the PreferredAlignment of a (complete) type T, in characters.
const clang::PrintingPolicy & getPrintingPolicy() const
ArrayRef< Module * > getModulesWithMergedDefinition(const NamedDecl *Def)
Get the additional modules in which the definition Def has been merged.
static ImportDecl * getNextLocalImport(ImportDecl *Import)
llvm::FixedPointSemantics getFixedPointSemantics(QualType Ty) const
QualType getDependentSizedArrayType(QualType EltTy, Expr *NumElts, 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...
uint64_t lookupFieldBitOffset(const ObjCInterfaceDecl *OID, const ObjCImplementationDecl *ID, const ObjCIvarDecl *Ivar) const
Get the offset of an ObjCIvarDecl in bits.
CanQualType SatUnsignedShortAccumTy
QualType mergeTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false, bool BlockReturnType=false, bool IsConditionalOperator=false)
const RawComment * getRawCommentForAnyRedecl(const Decl *D, const Decl **OriginalDecl=nullptr) const
Return the documentation comment attached to a given declaration.
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists.
static bool isObjCNSObjectType(QualType Ty)
Return true if this is an NSObject object with its NSObject attribute set.
CharUnits getAlignOfGlobalVarInChars(QualType T) const
Return the alignment in characters that should be given to a global variable with type T.
GVALinkage GetGVALinkageForVariable(const VarDecl *VD) const
UsingShadowDecl * getInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst)
QualType getWCharType() const
Return the unique wchar_t type available in C++ (and available as __wchar_t as a Microsoft extension)...
QualType getObjCIdType() const
Represents the Objective-CC id type.
Decl * getVaListTagDecl() const
Retrieve the C type declaration corresponding to the predefined __va_list_tag type used to help defin...
QualType getUnsignedWCharType() const
Return the type of "unsigned wchar_t".
llvm::DenseSet< const ValueDecl * > CUDAExternalDeviceDeclODRUsedByHost
Keep track of CUDA/HIP external kernels or device variables ODR-used by host code.
bool hasSameUnqualifiedType(QualType T1, QualType T2) const
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
comments::FullComment * getCommentForDecl(const Decl *D, const Preprocessor *PP) const
Return parsed documentation comment attached to a given declaration.
FunctionProtoType::ExceptionSpecInfo mergeExceptionSpecs(FunctionProtoType::ExceptionSpecInfo ESI1, FunctionProtoType::ExceptionSpecInfo ESI2, SmallVectorImpl< QualType > &ExceptionTypeStorage, bool AcceptDependent)
unsigned getTargetDefaultAlignForAttributeAligned() const
Return the default alignment for attribute((aligned)) on this target, to be used if no alignment valu...
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
bool isSameTemplateParameterList(const TemplateParameterList *X, const TemplateParameterList *Y) const
Determine whether two template parameter lists are similar enough that they may be used in declaratio...
QualType getWritePipeType(QualType T) const
Return a write_only pipe type for the specified type.
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
CanQualType UnsignedInt128Ty
ObjCInterfaceDecl * getObjCProtocolDecl() const
Retrieve the Objective-C class declaration corresponding to the predefined Protocol class.
unsigned NumImplicitDefaultConstructors
The number of implicitly-declared default constructors.
CharUnits getTypeSizeInChars(QualType T) const
Return the size of the specified (complete) type T, in characters.
unsigned NumImplicitMoveAssignmentOperatorsDeclared
The number of implicitly-declared move assignment operators for which declarations were built.
void setManglingNumber(const NamedDecl *ND, unsigned Number)
llvm::DenseMap< const Decl *, const RawComment * > DeclRawComments
Mapping from declaration to directly attached comment.
TypedefDecl * getBuiltinVaListDecl() const
Retrieve the C type declaration corresponding to the predefined __builtin_va_list type.
TypeInfo getTypeInfo(QualType T) const
CanQualType UnsignedCharTy
CanQualType UnsignedShortFractTy
BuiltinTemplateDecl * buildBuiltinTemplateDecl(BuiltinTemplateKind BTK, const IdentifierInfo *II) const
void * Allocate(size_t Size, unsigned Align=8) const
bool canBuiltinBeRedeclared(const FunctionDecl *) const
Return whether a declaration to a builtin is allowed to be overloaded/redeclared.
CanQualType UnsignedIntTy
TemplateName getDependentTemplateName(NestedNameSpecifier *NNS, const IdentifierInfo *Name) const
Retrieve the template name that represents a dependent template name such as MetaFun::template apply.
unsigned NumImplicitMoveConstructors
The number of implicitly-declared move constructors.
QualType getObjCTypeParamType(const ObjCTypeParamDecl *Decl, ArrayRef< ObjCProtocolDecl * > protocols) const
QualType getVolatileType(QualType T) const
Return the uniqued reference to the type for a volatile qualified type.
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...
void addDeclaratorForUnnamedTagDecl(TagDecl *TD, DeclaratorDecl *DD)
unsigned overridden_methods_size(const CXXMethodDecl *Method) const
std::string getObjCEncodingForBlock(const BlockExpr *blockExpr) const
Return the encoded type for this block declaration.
TypeSourceInfo * CreateTypeSourceInfo(QualType T, unsigned Size=0) const
Allocate an uninitialized TypeSourceInfo.
QualType getObjCClassRedefinitionType() const
Retrieve the type that Class has been defined to, which may be different from the built-in Class if C...
TagDecl * getMSGuidTagDecl() const
Retrieve the implicitly-predeclared 'struct _GUID' declaration.
QualType getExceptionObjectType(QualType T) const
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 ...
DeclaratorDecl * getDeclaratorForUnnamedTagDecl(const TagDecl *TD)
bool ObjCObjectAdoptsQTypeProtocols(QualType QT, ObjCInterfaceDecl *Decl)
ObjCObjectAdoptsQTypeProtocols - Checks that protocols in IC's protocol list adopt all protocols in Q...
QualType getFunctionNoProtoType(QualType ResultTy) const
CanQualType UnsignedLongLongTy
QualType GetBuiltinType(unsigned ID, GetBuiltinTypeError &Error, unsigned *IntegerConstantArgs=nullptr) const
Return the type for the specified builtin.
QualType getCommonSugaredType(QualType X, QualType Y, bool Unqualified=false)
CanQualType OCLReserveIDTy
bool isSameTemplateParameter(const NamedDecl *X, const NamedDecl *Y) const
Determine whether two template parameters are similar enough that they may be used in declarations of...
size_t getASTAllocatedMemory() const
Return the total amount of physical memory allocated for representing AST nodes and type information.
QualType getArrayDecayedType(QualType T) const
Return the properly qualified result of decaying the specified array type to a pointer.
overridden_cxx_method_iterator overridden_methods_begin(const CXXMethodDecl *Method) const
CanQualType UnsignedShortTy
unsigned getTypeAlignIfKnown(QualType T, bool NeedsPreferredAlignment=false) const
Return the alignment of a type, in bits, or 0 if the type is incomplete and we cannot determine the a...
QualType getObjCConstantStringInterface() const
bool AtomicUsesUnsupportedLibcall(const AtomicExpr *E) const
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
QualType getDependentNameType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, QualType Canon=QualType()) const
bool canAssignObjCInterfacesInBlockPointer(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT, bool BlockReturnType)
canAssignObjCInterfacesInBlockPointer - This routine is specifically written for providing type-safet...
CanQualType SatUnsignedLongFractTy
void setcudaConfigureCallDecl(FunctionDecl *FD)
CanQualType getDecayedType(CanQualType T) const
QualType getObjCIdRedefinitionType() const
Retrieve the type that id has been defined to, which may be different from the built-in id if id has ...
const CXXConstructorDecl * getCopyConstructorForExceptionObject(CXXRecordDecl *RD)
QualType getDependentAddressSpaceType(QualType PointeeType, Expr *AddrSpaceExpr, SourceLocation AttrLoc) const
RawComment * getRawCommentForDeclNoCache(const Decl *D) const
Return the documentation comment attached to a given declaration, without looking into cache.
QualType getPromotedIntegerType(QualType PromotableType) const
Return the type that PromotableType will promote to: C99 6.3.1.1p2, assuming that PromotableType is a...
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.
const VariableArrayType * getAsVariableArrayType(QualType T) const
QualType getUnaryTransformType(QualType BaseType, QualType UnderlyingType, UnaryTransformType::UTTKind UKind) const
Unary type transforms.
const Type * getCanonicalType(const Type *T) const
void setExternalSource(IntrusiveRefCntPtr< ExternalASTSource > Source)
Attach an external AST source to the AST context.
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...
StringLiteral * getPredefinedStringLiteralFromCache(StringRef Key) const
Return a string representing the human readable name for the specified function declaration or file n...
bool UnwrapSimilarTypes(QualType &T1, QualType &T2, bool AllowPiMismatch=true)
Attempt to unwrap two types that may be similar (C++ [conv.qual]).
llvm::APFixedPoint getFixedPointMax(QualType Ty) const
QualType getComplexType(QualType T) const
Return the uniqued reference to the type for a complex number with the specified element type.
bool areCompatibleSveTypes(QualType FirstType, QualType SecondType)
Return true if the given types are an SVE builtin and a VectorType that is a fixed-length representat...
void setObjCClassRedefinitionType(QualType RedefType)
Set the user-written type that redefines 'SEL'.
bool hasDirectOwnershipQualifier(QualType Ty) const
Return true if the type has been explicitly qualified with ObjC ownership.
Qualifiers::ObjCLifetime getInnerObjCOwnership(QualType T) const
Recurses in pointer/array types until it finds an Objective-C retainable type and returns its ownersh...
void addCopyConstructorForExceptionObject(CXXRecordDecl *RD, CXXConstructorDecl *CD)
FunctionDecl * getcudaConfigureCallDecl()
DiagnosticsEngine & getDiagnostics() const
QualType getAdjustedParameterType(QualType T) const
Perform adjustment on the parameter type of a function.
QualType getUnqualifiedObjCPointerType(QualType type) const
getUnqualifiedObjCPointerType - Returns version of Objective-C pointer type with lifetime qualifier r...
void ResetObjCLayout(const ObjCContainerDecl *CD)
interp::Context & getInterpContext()
Returns the clang bytecode interpreter context.
QualType getCVRQualifiedType(QualType T, unsigned CVR) const
Return a type with additional const, volatile, or restrict qualifiers.
UnnamedGlobalConstantDecl * getUnnamedGlobalConstantDecl(QualType Ty, const APValue &Value) const
Return a declaration for a uniquified anonymous global constant corresponding to a given APValue.
QualType getExtVectorType(QualType VectorType, unsigned NumElts) const
Return the unique reference to an extended vector type of the specified element type and size.
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...
void getOverriddenMethods(const NamedDecl *Method, SmallVectorImpl< const NamedDecl * > &Overridden) const
Return C++ or ObjC overridden methods for the given Method.
DeclarationNameInfo getNameForTemplate(TemplateName Name, SourceLocation NameLoc) const
CanQualType SatLongFractTy
const TargetInfo & getTargetInfo() const
void setInstantiatedFromUnnamedFieldDecl(FieldDecl *Inst, FieldDecl *Tmpl)
CanQualType SatShortAccumTy
QualType getAutoDeductType() const
C++11 deduction pattern for 'auto' type.
unsigned NumImplicitCopyConstructors
The number of implicitly-declared copy constructors.
CharUnits toCharUnitsFromBits(int64_t BitSize) const
Convert a size in bits to a size in characters.
CanQualType IncompleteMatrixIdxTy
std::optional< CharUnits > getTypeSizeInCharsIfKnown(QualType Ty) const
void getFunctionFeatureMap(llvm::StringMap< bool > &FeatureMap, const FunctionDecl *) const
CanQualType getNSIntegerType() const
QualType getCorrespondingUnsignedType(QualType T) const
void setBlockVarCopyInit(const VarDecl *VD, Expr *CopyExpr, bool CanThrow)
Set the copy initialization expression of a block var decl.
QualType getLifetimeQualifiedType(QualType type, Qualifiers::ObjCLifetime lifetime)
Return a type with the given lifetime qualifier.
TemplateName getOverloadedTemplateName(UnresolvedSetIterator Begin, UnresolvedSetIterator End) const
Retrieve the template name that corresponds to a non-empty lookup.
bool typesAreCompatible(QualType T1, QualType T2, bool CompareUnqualified=false)
Compatibility predicates used to check assignment expressions.
TemplateName getSubstTemplateTemplateParmPack(const TemplateArgument &ArgPack, Decl *AssociatedDecl, unsigned Index, bool Final) const
QualType getObjCNSStringType() const
TargetCXXABI::Kind getCXXABIKind() const
Return the C++ ABI kind that should be used.
void setjmp_bufDecl(TypeDecl *jmp_bufDecl)
Set the type for the C jmp_buf type.
void addDestruction(T *Ptr) const
If T isn't trivially destructible, calls AddDeallocation to register it for destruction.
QualType getAddrSpaceQualType(QualType T, LangAS AddressSpace) const
Return the uniqued reference to the type for an address space qualified type with the specified type ...
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any.
uint64_t getConstantArrayElementCount(const ConstantArrayType *CA) const
Return number of constant array elements.
BuiltinTemplateDecl * getTypePackElementDecl() const
CanQualType SatUnsignedLongAccumTy
QualType getUnconstrainedType(QualType T) const
Remove any type constraints from a template parameter type, for equivalence comparison of template pa...
QualType getTypeOfType(QualType QT, TypeOfKind Kind) const
getTypeOfType - Unlike many "get<Type>" functions, we don't unique TypeOfType nodes.
QualType getCorrespondingSignedType(QualType T) const
QualType mergeObjCGCQualifiers(QualType, QualType)
mergeObjCGCQualifiers - This routine merges ObjC's GC attribute of 'LHS' and 'RHS' attributes and ret...
QualType getQualifiedType(QualType T, Qualifiers Qs) const
Return a type with additional qualifiers.
llvm::DenseMap< const Decl *, const Decl * > CommentlessRedeclChains
Keeps track of redeclaration chains that don't have any comment attached.
uint64_t getArrayInitLoopExprElementCount(const ArrayInitLoopExpr *AILE) const
Return number of elements initialized in an ArrayInitLoopExpr.
void deduplicateMergedDefinitonsFor(NamedDecl *ND)
Clean up the merged definition list.
unsigned getTargetAddressSpace(LangAS AS) const
QualType getWideCharType() const
Return the type of wide characters.
QualType getIntPtrType() const
Return a type compatible with "intptr_t" (C99 7.18.1.4), as defined by the target.
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...
void addTranslationUnitDecl()
bool hasSameNullabilityTypeQualifier(QualType SubT, QualType SuperT, bool IsParam) const
void getObjCEncodingForPropertyType(QualType T, std::string &S) const
Emit the Objective-C property type encoding for the given type T into S.
unsigned NumImplicitCopyAssignmentOperators
The number of implicitly-declared copy assignment operators.
void CollectInheritedProtocols(const Decl *CDecl, llvm::SmallPtrSet< ObjCProtocolDecl *, 8 > &Protocols)
CollectInheritedProtocols - Collect all protocols in current class and those inherited by it.
bool isPromotableIntegerType(QualType T) const
More type predicates useful for type checking/promotion.
T * Allocate(size_t Num=1) const
llvm::DenseMap< const Decl *, const Decl * > RedeclChainComments
Mapping from canonical declaration to the first redeclaration in chain that has a comment attached.
CanQualType getSignedSizeType() const
Return the unique signed counterpart of the integer type corresponding to size_t.
void adjustDeducedFunctionResultType(FunctionDecl *FD, QualType ResultType)
Change the result type of a function type once it is deduced.
QualType getObjCGCQualType(QualType T, Qualifiers::GC gcAttr) const
Return the uniqued reference to the type for an Objective-C gc-qualified type.
QualType getDecltypeType(Expr *e, QualType UnderlyingType) const
C++11 decltype.
QualType getLogicalOperationType() const
The result type of logical operations, '<', '>', '!=', etc.
NestedNameSpecifier * getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const
Retrieves the "canonical" nested name specifier for a given nested name specifier.
QualType getTypedefType(const TypedefNameDecl *Decl, QualType Underlying=QualType()) const
Return the unique reference to the type for the specified typedef-name decl.
InlineVariableDefinitionKind getInlineVariableDefinitionKind(const VarDecl *VD) const
Determine whether a definition of this inline variable should be treated as a weak or strong definiti...
void setPrimaryMergedDecl(Decl *D, Decl *Primary)
CanQualType getUIntMaxType() const
Return the unique type for "uintmax_t" (C99 7.18.1.5), defined in <stdint.h>.
IdentifierInfo * getBoolName() const
Retrieve the identifier 'bool'.
QualType getSubstTemplateTypeParmType(QualType Replacement, Decl *AssociatedDecl, unsigned Index, std::optional< unsigned > PackIndex) const
Retrieve a substitution-result type.
CharUnits getOffsetOfBaseWith