Go to the documentation of this file.
14 #ifndef LLVM_CLANG_AST_ASTCONTEXT_H
15 #define LLVM_CLANG_AST_ASTCONTEXT_H
36 #include "llvm/ADT/DenseMap.h"
37 #include "llvm/ADT/DenseSet.h"
38 #include "llvm/ADT/FoldingSet.h"
39 #include "llvm/ADT/IntrusiveRefCntPtr.h"
40 #include "llvm/ADT/MapVector.h"
41 #include "llvm/ADT/PointerIntPair.h"
42 #include "llvm/ADT/PointerUnion.h"
43 #include "llvm/ADT/SmallVector.h"
44 #include "llvm/ADT/StringMap.h"
45 #include "llvm/ADT/StringRef.h"
46 #include "llvm/ADT/TinyPtrVector.h"
47 #include "llvm/Support/TypeSize.h"
53 class FixedPointSemantics;
62 class ASTMutationListener;
63 class ASTRecordLayout;
66 class BuiltinTemplateDecl;
70 class CXXConstructorDecl;
73 class DiagnosticsEngine;
74 class ParentMapContext;
75 class DynTypedNodeList;
80 class MangleNumberingContext;
81 class MemberSpecializationInfo;
83 struct MSGuidDeclParts;
84 class ObjCCategoryDecl;
85 class ObjCCategoryImplDecl;
86 class ObjCContainerDecl;
88 class ObjCImplementationDecl;
89 class ObjCInterfaceDecl;
92 class ObjCPropertyDecl;
93 class ObjCPropertyImplDecl;
94 class ObjCProtocolDecl;
95 class ObjCTypeParamDecl;
97 struct ParsedTargetAttr;
103 class TemplateParameterList;
104 class TemplateTemplateParmDecl;
105 class TemplateTypeParmDecl;
106 class TypeConstraint;
107 class UnresolvedSetIterator;
108 class UsingShadowDecl;
109 class VarTemplateDecl;
110 class VTableContextBase;
111 struct BlockVarCopyInit;
134 namespace 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::FoldingSet<DependentSizedArrayType> DependentSizedArrayTypes;
199 mutable llvm::FoldingSet<DependentSizedExtVectorType>
200 DependentSizedExtVectorTypes;
201 mutable llvm::FoldingSet<DependentAddressSpaceType>
202 DependentAddressSpaceTypes;
203 mutable llvm::FoldingSet<VectorType> VectorTypes;
204 mutable llvm::FoldingSet<DependentVectorType> DependentVectorTypes;
205 mutable llvm::FoldingSet<ConstantMatrixType> MatrixTypes;
206 mutable llvm::FoldingSet<DependentSizedMatrixType> DependentSizedMatrixTypes;
207 mutable llvm::FoldingSet<FunctionNoProtoType> FunctionNoProtoTypes;
208 mutable llvm::ContextualFoldingSet<FunctionProtoType, ASTContext&>
210 mutable llvm::FoldingSet<DependentTypeOfExprType> DependentTypeOfExprTypes;
211 mutable llvm::FoldingSet<DependentDecltypeType> DependentDecltypeTypes;
212 mutable llvm::FoldingSet<TemplateTypeParmType> TemplateTypeParmTypes;
213 mutable llvm::FoldingSet<ObjCTypeParamType> ObjCTypeParamTypes;
214 mutable llvm::FoldingSet<SubstTemplateTypeParmType>
215 SubstTemplateTypeParmTypes;
216 mutable llvm::FoldingSet<SubstTemplateTypeParmPackType>
217 SubstTemplateTypeParmPackTypes;
218 mutable llvm::ContextualFoldingSet<TemplateSpecializationType, ASTContext&>
219 TemplateSpecializationTypes;
220 mutable llvm::FoldingSet<ParenType> ParenTypes{GeneralTypesLog2InitSize};
221 mutable llvm::FoldingSet<UsingType> UsingTypes;
222 mutable llvm::FoldingSet<TypedefType> TypedefTypes;
223 mutable llvm::FoldingSet<ElaboratedType> ElaboratedTypes{
224 GeneralTypesLog2InitSize};
225 mutable llvm::FoldingSet<DependentNameType> DependentNameTypes;
226 mutable llvm::ContextualFoldingSet<DependentTemplateSpecializationType,
228 DependentTemplateSpecializationTypes;
229 llvm::FoldingSet<PackExpansionType> PackExpansionTypes;
230 mutable llvm::FoldingSet<ObjCObjectTypeImpl> ObjCObjectTypes;
231 mutable llvm::FoldingSet<ObjCObjectPointerType> ObjCObjectPointerTypes;
232 mutable llvm::FoldingSet<DependentUnaryTransformType>
233 DependentUnaryTransformTypes;
234 mutable llvm::ContextualFoldingSet<AutoType, ASTContext&> AutoTypes;
235 mutable llvm::FoldingSet<DeducedTemplateSpecializationType>
236 DeducedTemplateSpecializationTypes;
237 mutable llvm::FoldingSet<AtomicType> AtomicTypes;
238 mutable llvm::FoldingSet<AttributedType> AttributedTypes;
239 mutable llvm::FoldingSet<PipeType> PipeTypes;
240 mutable llvm::FoldingSet<BitIntType> BitIntTypes;
241 mutable llvm::FoldingSet<DependentBitIntType> DependentBitIntTypes;
242 llvm::FoldingSet<BTFTagAttributedType> BTFTagAttributedTypes;
244 mutable llvm::FoldingSet<QualifiedTemplateName> QualifiedTemplateNames;
245 mutable llvm::FoldingSet<DependentTemplateName> DependentTemplateNames;
246 mutable llvm::FoldingSet<SubstTemplateTemplateParmStorage>
247 SubstTemplateTemplateParms;
248 mutable llvm::ContextualFoldingSet<SubstTemplateTemplateParmPackStorage,
250 SubstTemplateTemplateParmPacks;
255 mutable llvm::FoldingSet<NestedNameSpecifier> NestedNameSpecifiers;
261 mutable llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*>
263 mutable llvm::DenseMap<const ObjCContainerDecl*, const ASTRecordLayout*>
267 using TypeInfoMap = llvm::DenseMap<const Type *, struct TypeInfo>;
268 mutable TypeInfoMap MemoizedTypeInfo;
273 using UnadjustedAlignMap = llvm::DenseMap<const Type *, unsigned>;
274 mutable UnadjustedAlignMap MemoizedUnadjustedAlign;
277 llvm::DenseMap<const CXXRecordDecl*, LazyDeclPtr> KeyFunctions;
280 llvm::DenseMap<ObjCContainerDecl*, ObjCImplDecl*> ObjCImpls;
284 llvm::DenseMap<const ObjCMethodDecl*,const ObjCMethodDecl*> ObjCMethodRedecls;
287 llvm::DenseMap<const VarDecl *, BlockVarCopyInit> BlockVarCopyInits;
290 mutable llvm::FoldingSet<MSGuidDecl> MSGuidDecls;
293 mutable llvm::FoldingSet<UnnamedGlobalConstantDecl>
294 UnnamedGlobalConstantDecls;
297 mutable llvm::FoldingSet<TemplateParamObjectDecl> TemplateParamObjectDecls;
303 mutable llvm::StringMap<StringLiteral *> StringLiteralCache;
311 class CanonicalTemplateTemplateParm :
public llvm::FoldingSetNode {
312 TemplateTemplateParmDecl *Parm;
315 CanonicalTemplateTemplateParm(TemplateTemplateParmDecl *Parm)
318 TemplateTemplateParmDecl *getParam()
const {
return Parm; }
320 void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &C) {
321 Profile(
ID, C, Parm);
324 static void Profile(llvm::FoldingSetNodeID &
ID,
326 TemplateTemplateParmDecl *Parm);
328 mutable llvm::ContextualFoldingSet<CanonicalTemplateTemplateParm,
330 CanonTemplateTemplateParms;
332 TemplateTemplateParmDecl *
333 getCanonicalTemplateTemplateParmDecl(TemplateTemplateParmDecl *TTP)
const;
336 mutable TypedefDecl *Int128Decl =
nullptr;
339 mutable TypedefDecl *UInt128Decl =
nullptr;
343 mutable TypedefDecl *BuiltinVaListDecl =
nullptr;
346 mutable TypedefDecl *BuiltinMSVaListDecl =
nullptr;
349 mutable TypedefDecl *ObjCIdDecl =
nullptr;
352 mutable TypedefDecl *ObjCSelDecl =
nullptr;
355 mutable TypedefDecl *ObjCClassDecl =
nullptr;
358 mutable ObjCInterfaceDecl *ObjCProtocolClassDecl =
nullptr;
361 mutable TypedefDecl *BOOLDecl =
nullptr;
365 QualType ObjCIdRedefinitionType;
366 QualType ObjCClassRedefinitionType;
367 QualType ObjCSelRedefinitionType;
370 mutable IdentifierInfo *BoolName =
nullptr;
373 mutable IdentifierInfo *NSObjectName =
nullptr;
376 IdentifierInfo *NSCopyingName =
nullptr;
379 mutable IdentifierInfo *MakeIntegerSeqName =
nullptr;
382 mutable IdentifierInfo *TypePackElementName =
nullptr;
384 QualType ObjCConstantStringType;
385 mutable RecordDecl *CFConstantStringTagDecl =
nullptr;
386 mutable TypedefDecl *CFConstantStringTypeDecl =
nullptr;
388 mutable QualType ObjCSuperType;
390 QualType ObjCNSStringType;
393 TypedefDecl *ObjCInstanceTypeDecl =
nullptr;
396 TypeDecl *FILEDecl =
nullptr;
399 TypeDecl *jmp_bufDecl =
nullptr;
402 TypeDecl *sigjmp_bufDecl =
nullptr;
405 TypeDecl *ucontext_tDecl =
nullptr;
411 mutable RecordDecl *BlockDescriptorType =
nullptr;
417 mutable RecordDecl *BlockDescriptorExtendedType =
nullptr;
420 FunctionDecl *cudaConfigureCallDecl =
nullptr;
426 llvm::DenseMap<const Decl*, AttrVec*> DeclAttrs;
431 llvm::DenseMap<Decl*, Decl*> MergedDecls;
436 llvm::DenseMap<NamedDecl*, llvm::TinyPtrVector<Module*>> MergedDefModules;
442 struct PerModuleInitializers {
448 llvm::DenseMap<Module*, PerModuleInitializers*> ModuleInitializers;
451 Module *TopLevelModule =
nullptr;
453 static constexpr
unsigned ConstantArrayTypesLog2InitSize = 8;
454 static constexpr
unsigned GeneralTypesLog2InitSize = 9;
455 static constexpr
unsigned FunctionProtoTypesLog2InitSize = 12;
462 llvm::PointerUnion<VarTemplateDecl *, MemberSpecializationInfo *>;
502 llvm::DenseMap<const VarDecl *, TemplateOrSpecializationInfo>
503 TemplateOrInstantiation;
528 llvm::DenseMap<NamedDecl *, NamedDecl *> InstantiatedFromUsingDecl;
537 llvm::DenseMap<UsingEnumDecl *, UsingEnumDecl *>
538 InstantiatedFromUsingEnumDecl;
541 llvm::DenseMap<UsingShadowDecl*, UsingShadowDecl*>
542 InstantiatedFromUsingShadowDecl;
544 llvm::DenseMap<FieldDecl *, FieldDecl *> InstantiatedFromUnnamedFieldDecl;
552 using CXXMethodVector = llvm::TinyPtrVector<const CXXMethodDecl *>;
553 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector> OverriddenMethods;
558 llvm::DenseMap<const DeclContext *, std::unique_ptr<MangleNumberingContext>>
559 MangleNumberingContexts;
560 llvm::DenseMap<const Decl *, std::unique_ptr<MangleNumberingContext>>
561 ExtraMangleNumberingContexts;
565 llvm::MapVector<const NamedDecl *, unsigned> MangleNumbers;
566 llvm::MapVector<const VarDecl *, unsigned> StaticLocalNumbers;
568 mutable llvm::DenseMap<const CXXRecordDecl *, unsigned>
569 DeviceLambdaManglingNumbers;
573 using ParameterIndexTable = llvm::DenseMap<const VarDecl *, unsigned>;
574 ParameterIndexTable ParamIndices;
593 std::unique_ptr<NoSanitizeList> NoSanitizeL;
597 std::unique_ptr<XRayFunctionFilter> XRayFilter;
601 std::unique_ptr<ProfileList> ProfList;
607 mutable llvm::BumpPtrAllocator BumpAlloc;
613 std::unique_ptr<CXXABI> ABI;
618 bool AddrSpaceMapMangling;
623 std::unique_ptr<interp::Context> InterpContext;
624 std::unique_ptr<ParentMapContext> ParentMapCtx;
704 void *
Allocate(
size_t Size,
unsigned Align = 8)
const {
705 return BumpAlloc.Allocate(Size, Align);
707 template <
typename T> T *
Allocate(
size_t Num = 1)
const {
708 return static_cast<T *
>(
Allocate(Num *
sizeof(T),
alignof(T)));
716 ListNodeFreeList = Alloc->Rest.dyn_cast<
DeclListNode*>();
718 Alloc->Rest =
nullptr;
726 N->Rest = ListNodeFreeList;
727 ListNodeFreeList = N;
733 return BumpAlloc.getTotalMemory();
740 return DiagAllocator;
751 unsigned Signed)
const;
768 return LangOpts.CPlusPlus || LangOpts.RecoveryAST;
837 const std::map<unsigned, RawComment *> &CommentsInFile)
const;
853 const Decl **OriginalDecl =
nullptr)
const;
879 const Decl *D)
const;
885 class import_iterator {
892 using difference_type =
int;
893 using iterator_category = std::forward_iterator_tag;
895 import_iterator() =
default;
896 explicit import_iterator(
ImportDecl *Import) : Import(Import) {}
898 reference
operator*()
const {
return Import; }
899 pointer operator->()
const {
return Import; }
901 import_iterator &operator++() {
906 import_iterator operator++(
int) {
907 import_iterator
Other(*
this);
912 friend bool operator==(import_iterator
X, import_iterator Y) {
913 return X.Import == Y.Import;
916 friend bool operator!=(import_iterator
X, import_iterator Y) {
917 return X.Import != Y.Import;
923 return CommentCommandTraits;
987 llvm::iterator_range<overridden_cxx_method_iterator>;
1012 return Import->getNextLocalImport();
1018 return import_range(import_iterator(FirstLocalImport), import_iterator());
1022 Decl *Result = MergedDecls.lookup(D);
1023 return Result ? Result : D;
1026 MergedDecls[D] = Primary;
1032 bool NotifyListeners =
true);
1065 if (TraversalScope.empty() || TraversalScope.back() == TUDecl)
1066 TraversalScope = {NewTUDecl};
1110 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
1111 CanQualType SingletonId;
1112 #include "clang/Basic/OpenCLImageTypes.def"
1117 #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
1119 #include "clang/Basic/OpenCLExtensionTypes.def"
1120 #define SVE_TYPE(Name, Id, SingletonId) \
1121 CanQualType SingletonId;
1122 #include "clang/Basic/AArch64SVEACLETypes.def"
1123 #define PPC_VECTOR_TYPE(Name, Id, Size) \
1125 #include "clang/Basic/PPCTypes.def"
1126 #define RVV_TYPE(Name, Id, SingletonId) \
1127 CanQualType SingletonId;
1128 #include "clang/Basic/RISCVVTypes.def"
1235 bool allowOnPointerType =
false)
const;
1300 bool AsWritten =
false);
1387 cudaConfigureCallDecl = FD;
1391 return cudaConfigureCallDecl;
1402 bool &HasByrefExtendedLayout)
const;
1423 unsigned IndexTypeQuals,
1433 unsigned IndexTypeQuals,
1440 unsigned IndexTypeQuals)
const;
1445 const Expr *SizeExpr,
1447 unsigned IndexTypeQuals)
const;
1468 BuiltinVectorTypeInfo
1510 unsigned NumColumns)
const;
1519 Expr *AddrSpaceExpr,
1533 return getFunctionTypeInternal(ResultTy, Args, EPI,
false);
1542 bool OnlyWantCanonical)
const;
1545 bool IsDependent,
bool IsPack =
false,
1548 bool IsCanon =
false)
const;
1554 const TypeDecl *PrevDecl =
nullptr)
const {
1555 assert(
Decl &&
"Passed null for Decl param");
1559 assert(PrevDecl->TypeForDecl &&
"previous decl has no TypeForDecl");
1560 Decl->TypeForDecl = PrevDecl->TypeForDecl;
1561 return QualType(PrevDecl->TypeForDecl, 0);
1564 return getTypeDeclTypeSlow(
Decl);
1593 std::optional<unsigned> PackIndex)
const;
1595 unsigned Index,
bool Final,
1627 TagDecl *OwnedTagDecl =
nullptr)
const;
1656 std::optional<unsigned> NumExpansions,
1657 bool ExpectPackInType =
true);
1665 unsigned NumProtocols)
const;
1670 bool isKindOf)
const;
1703 bool IsDependent,
bool IsPack =
false,
1715 QualType DeducedType,
1716 bool IsDependent)
const;
1794 if (CFConstantStringTypeDecl)
1805 return ObjCConstantStringType;
1809 return ObjCNSStringType;
1813 ObjCNSStringType = T;
1819 if (ObjCIdRedefinitionType.isNull())
1821 return ObjCIdRedefinitionType;
1826 ObjCIdRedefinitionType = RedefType;
1832 if (ObjCClassRedefinitionType.isNull())
1834 return ObjCClassRedefinitionType;
1839 ObjCClassRedefinitionType = RedefType;
1845 if (ObjCSelRedefinitionType.isNull())
1847 return ObjCSelRedefinitionType;
1852 ObjCSelRedefinitionType = RedefType;
1857 if (!NSObjectName) {
1861 return NSObjectName;
1866 if (!NSCopyingName) {
1867 NSCopyingName = &
Idents.
get(
"NSCopying");
1870 return NSCopyingName;
1885 if (!MakeIntegerSeqName)
1886 MakeIntegerSeqName = &
Idents.
get(
"__make_integer_seq");
1887 return MakeIntegerSeqName;
1891 if (!TypePackElementName)
1892 TypePackElementName = &
Idents.
get(
"__type_pack_element");
1893 return TypePackElementName;
1918 this->jmp_bufDecl = jmp_bufDecl;
1930 this->sigjmp_bufDecl = sigjmp_bufDecl;
1942 this->ucontext_tDecl = ucontext_tDecl;
1963 QualType *NotEncodedT=
nullptr)
const;
1986 bool Extended =
false)
const;
1996 const Decl *Container)
const;
2003 const Decl *Container)
const;
2095 assert(
MSGuidTagDecl &&
"asked for GUID type but MS extensions disabled");
2120 return getExtQualType(Ptr, Qc);
2127 return getExtQualType(T, Qs);
2146 if (!
type.getTypePtr()->isObjCObjectPointerType() ||
2147 !
type.getQualifiers().hasObjCLifetime())
2168 bool TemplateKeyword,
2178 std::optional<unsigned> PackIndex)
const;
2180 Decl *AssociatedDecl,
2203 bool &RequireICE,
bool AllowTypeModifiers)
const;
2211 unsigned *IntegerConstantArgs =
nullptr)
const;
2294 return std::nullopt;
2323 bool NeedsPreferredAlignment =
false)
const;
2409 bool Simple =
false)
const;
2548 bool IsParam)
const {
2551 if (SubTnullability.has_value() == SuperTnullability.has_value()) {
2553 if (!SubTnullability)
2556 if (*SubTnullability == *SuperTnullability ||
2579 bool AllowPiMismatch =
true);
2581 bool AllowPiMismatch =
true);
2624 bool IsBuiltin =
false)
const;
2708 return dyn_cast_or_null<DependentSizedArrayType>(
getAsArrayType(T));
2803 bool AcceptDependent);
2811 bool Unqualified =
false);
2815 unsigned getIntegerRank(
const Type *T)
const;
2824 bool CompareUnqualified =
false);
2830 if (
const auto *ET = dyn_cast<ElaboratedType>(T))
2831 T = ET->getNamedType();
2836 if (
const auto *ET = dyn_cast<ElaboratedType>(T))
2837 T = ET->getNamedType();
2842 if (
const auto *ET = dyn_cast<ElaboratedType>(T))
2843 T = ET->getNamedType();
2862 bool BlockReturnType);
2870 bool Unqualified =
false,
bool BlockReturnType =
false,
2871 bool IsConditionalOperator =
false);
2873 bool Unqualified =
false,
bool AllowCXX =
false,
2874 bool IsConditionalOperator =
false);
2876 bool OfBlockPointer =
false,
2877 bool Unqualified =
false);
2879 bool OfBlockPointer=
false,
2880 bool Unqualified =
false);
2906 bool &CanUseFirst,
bool &CanUseSecond,
2957 if (Width != Res.getBitWidth())
2958 return Res.extOrTrunc(Width);
2974 return !ObjCImpls.empty();
3038 if (!std::is_trivially_destructible<T>::value) {
3039 auto DestroyPtr = [](
void *
V) {
static_cast<T *
>(
V)->~T(); };
3077 bool ForAuxTarget =
false)
const;
3122 std::vector<std::string>
3189 class ObjCEncOptions {
3192 ObjCEncOptions(
unsigned Bits) : Bits(Bits) {}
3195 ObjCEncOptions() : Bits(0) {}
3196 ObjCEncOptions(
const ObjCEncOptions &RHS) : Bits(RHS.Bits) {}
3198 #define OPT_LIST(V) \
3199 V(ExpandPointedToStructures, 0) \
3200 V(ExpandStructures, 1) \
3201 V(IsOutermostType, 2) \
3202 V(EncodingProperty, 3) \
3203 V(IsStructField, 4) \
3204 V(EncodeBlockParameters, 5) \
3205 V(EncodeClassNames, 6) \
3207 #define V(N,I) ObjCEncOptions& set##N() { Bits |= 1 << I; return *this; }
3211 #define V(N,I) bool N() const { return Bits & 1 << I; }
3217 [[nodiscard]] ObjCEncOptions keepingOnly(ObjCEncOptions Mask)
const {
3218 return Bits & Mask.Bits;
3221 [[nodiscard]] ObjCEncOptions forComponentType()
const {
3222 ObjCEncOptions Mask = ObjCEncOptions()
3223 .setIsOutermostType()
3224 .setIsStructField();
3225 return Bits & ~Mask.Bits;
3230 void getObjCEncodingForTypeImpl(QualType t,
std::string &S,
3231 ObjCEncOptions Options,
3232 const FieldDecl *Field,
3233 QualType *NotEncodedT =
nullptr)
const;
3236 void getObjCEncodingForStructureImpl(RecordDecl *RD,
std::string &S,
3237 const FieldDecl *Field,
3238 bool includeVBases =
true,
3239 QualType *NotEncodedT=
nullptr)
const;
3245 bool Extended)
const;
3296 llvm::PointerIntPair<StoredDeclsMap *, 1> LastSDM;
3298 std::vector<Decl *> TraversalScope;
3300 std::unique_ptr<VTableContextBase> VTContext;
3302 void ReleaseDeclContextMaps();
3395 size_t Alignment ) {
3396 return C.Allocate(Bytes, Alignment);
3433 size_t Alignment ) {
3434 return C.Allocate(Bytes, Alignment);
3448 template <
typename Owner,
typename T,
3461 #endif // LLVM_CLANG_AST_ASTCONTEXT_H
const Type * strip(QualType type)
Collect any qualifiers on the given type and return an unqualified type.
bool FriendsDifferByConstraints(const FunctionDecl *X, const FunctionDecl *Y) const
Determine whether two Friend functions are different because constraints that refer to an enclosing t...
This class is used for builtin types like 'int'.
QualType areCommonBaseCompatible(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
bool operator!=(CanQual< T > x, CanQual< U > y)
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
TemplateArgument getInjectedTemplateArg(NamedDecl *ParamDecl)
QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent, bool IsPack=false, ConceptDecl *TypeConstraintConcept=nullptr, ArrayRef< TemplateArgument > TypeConstraintArgs={}) const
C++11 deduced auto type.
void setObjCImplementation(ObjCInterfaceDecl *IFaceD, ObjCImplementationDecl *ImplD)
Set the implementation of ObjCInterfaceDecl.
TypedefDecl * getBuiltinVaListDecl() const
Retrieve the C type declaration corresponding to the predefined __builtin_va_list type.
Represents an ObjC class declaration.
void adjustDeducedFunctionResultType(FunctionDecl *FD, QualType ResultType)
Change the result type of a function type once it is deduced.
CanQualType SatUnsignedLongFractTy
CharUnits getTypeSizeInChars(QualType T) const
Return the size of the specified (complete) type T, in characters.
bool isTargetAddressSpace(LangAS AS)
std::string getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD, const Decl *Container) const
getObjCEncodingForPropertyDecl - Return the encoded type for this method declaration.
unsigned NumImplicitDestructorsDeclared
The number of implicitly-declared destructors for which declarations were built.
RecordDecl * getCFConstantStringTagDecl() const
RawComment * getRawCommentForDeclNoCacheImpl(const Decl *D, const SourceLocation RepresentativeLocForDecl, const std::map< unsigned, RawComment * > &CommentsInFile) const
IdentifierInfo * getTypePackElementName() const
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
QualType getTypedefType(const TypedefNameDecl *Decl, QualType Underlying=QualType()) const
Return the unique reference to the type for the specified typedef-name decl.
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
unsigned NumImplicitMoveConstructorsDeclared
The number of implicitly-declared move constructors for which declarations were built.
const ASTRecordLayout & getASTObjCImplementationLayout(const ObjCImplementationDecl *D) const
Get or compute information about the layout of the specified Objective-C implementation.
bool areLaxCompatibleSveTypes(QualType FirstType, QualType SecondType)
Return true if the given vector types are lax-compatible SVE vector types, false otherwise.
ASTMutationListener * getASTMutationListener() const
Retrieve a pointer to the AST mutation listener associated with this AST context, if any.
DeclaratorDecl * getDeclaratorForUnnamedTagDecl(const TagDecl *TD)
int getIntegerTypeOrder(QualType LHS, QualType RHS) const
Return the highest ranked integer type, see C99 6.3.1.8p1.
GVALinkage GetGVALinkageForVariable(const VarDecl *VD)
QualType getPackExpansionType(QualType Pattern, std::optional< unsigned > NumExpansions, bool ExpectPackInType=true)
Form a pack expansion type with the given pattern.
Container for either a single DynTypedNode or for an ArrayRef to DynTypedNode.
TypedefDecl * getObjCInstanceTypeDecl()
Retrieve the typedef declaration corresponding to the Objective-C "instancetype" type.
friend class NestedNameSpecifier
CanQualType IncompleteMatrixIdxTy
bool isAlignmentRequired(const Type *T) const
Determine if the alignment the type has was required using an alignment attribute.
QualType getBlockDescriptorExtendedType() const
Gets the struct used to keep track of the extended descriptor for pointer to blocks.
YAML serialization mapping.
Represents a C++ constructor within a class.
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
unsigned getOpenMPDefaultSimdAlign(QualType T) const
Get default simd alignment of the specified complete type in bits.
TypedefDecl * getInt128Decl() const
Retrieve the declaration for the 128-bit signed integer type.
AlignRequirementKind AlignRequirement
QualType getBOOLType() const
type of 'BOOL' type.
QualType getFILEType() const
Retrieve the C FILE type.
Declaration context for names declared as extern "C" in C++.
bool hasDirectOwnershipQualifier(QualType Ty) const
Return true if the type has been explicitly qualified with ObjC ownership.
const internal::VariadicDynCastAllOfMatcher< Stmt, BlockExpr > blockExpr
Matches a reference to a block.
Parts of a decomposed MSGuidDecl.
CanQualType getNSIntegerType() const
CanQualType OCLReserveIDTy
TemplateParamObjectDecl * getTemplateParamObjectDecl(QualType T, const APValue &V) const
Return the template parameter object of the given type with the given value.
bool canAssignObjCInterfacesInBlockPointer(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT, bool BlockReturnType)
canAssignObjCInterfacesInBlockPointer - This routine is specifically written for providing type-safet...
uint64_t getCharWidth() const
Return the size of the character type, in bits.
CanQualType UnsignedShortTy
GVALinkage GetGVALinkageForFunction(const FunctionDecl *FD) const
QualType getObjCInstanceType()
Retrieve the Objective-C "instancetype" type, if already known; otherwise, returns a NULL type;.
void ResetObjCLayout(const ObjCContainerDecl *CD)
IdentifierInfo * getNSObjectName() const
Retrieve the identifier 'NSObject'.
bool hasSameType(const Type *T1, const Type *T2) const
Provides information a specialization of a member of a class template, which may be a member function...
QualType getBitIntType(bool Unsigned, unsigned NumBits) const
Return a bit-precise integer type with the specified signedness and bit count.
A SourceLocation and its associated SourceManager.
RecordDecl * buildImplicitRecord(StringRef Name, RecordDecl::TagKind TK=TTK_Struct) const
Create a new implicit TU-level CXXRecordDecl or RecordDecl declaration.
TypeSourceInfo * getTemplateSpecializationTypeInfo(TemplateName T, SourceLocation TLoc, const TemplateArgumentListInfo &Args, QualType Canon=QualType()) const
@ GE_Missing_setjmp
Missing a type from <setjmp.h>
A trivial tuple used to represent a source range.
bool hasSameExpr(const Expr *X, const Expr *Y) const
Determine whether the given expressions X and Y are equivalent.
unsigned CountNonClassIvars(const ObjCInterfaceDecl *OI) const
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
void getFunctionFeatureMap(llvm::StringMap< bool > &FeatureMap, const FunctionDecl *) const
QualType getDependentNameType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, QualType Canon=QualType()) const
QualType GetBuiltinType(unsigned ID, GetBuiltinTypeError &Error, unsigned *IntegerConstantArgs=nullptr) const
Return the type for the specified builtin.
std::unique_ptr< MangleNumberingContext > createMangleNumberingContext() const
static Qualifiers fromCVRMask(unsigned CVR)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
@ Strong
Strong definition.
Represents the canonical version of C arrays with a specified constant size.
RawComment * getRawCommentForDeclNoCache(const Decl *D) const
Return the documentation comment attached to a given declaration, without looking into cache.
unsigned NumImplicitDefaultConstructors
The number of implicitly-declared default constructors.
IntrusiveRefCntPtr< ExternalASTSource > ExternalSource
DynTypedNodeList getParents(const NodeT &Node)
Forwards to get node parents from the ParentMapContext.
QualType getMacroQualifiedType(QualType UnderlyingTy, const IdentifierInfo *MacroII) const
CanQualType UnsignedAccumTy
void setcudaConfigureCallDecl(FunctionDecl *FD)
std::optional< CharUnits > getTypeSizeInCharsIfKnown(const Type *Ty) const
ASTContext & operator=(const ASTContext &)=delete
unsigned getParameterIndex(const ParmVarDecl *D) const
Used by ParmVarDecl to retrieve on the side the index of the parameter when it exceeds the size of th...
QualType getAtomicType(QualType T) const
Return the uniqued reference to the atomic type for the specified type.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
void setModuleForCodeGen(Module *M)
Set the (C++20) module we are building.
Encodes a location in the source.
MangleNumberingContext & getManglingNumberContext(const DeclContext *DC)
Retrieve the context for computing mangling numbers in the given DeclContext.
QualType getTemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args, QualType Canon=QualType()) const
QualType getQualifiedType(QualType T, Qualifiers Qs) const
Return a type with additional qualifiers.
QualType getObjCNSStringType() const
unsigned getIntWidth(QualType T) const
void DeallocateDeclListNode(DeclListNode *N)
Deallcates a DeclListNode by returning it to the ListNodeFreeList pool.
QualType getVariableArrayDecayedType(QualType Ty) const
Returns a vla type where known sizes are replaced with [*].
@ TTK_Struct
The "struct" keyword.
void addObjCLifetime(ObjCLifetime type)
This represents a decl that may have a name.
QualType getWritePipeType(QualType T) const
Return a write_only pipe type for the specified type.
CanQualType OMPArraySectionTy
Builtin::Context & BuiltinInfo
Qualifiers::ObjCLifetime getInnerObjCOwnership(QualType T) const
Recurses in pointer/array types until it finds an Objective-C retainable type and returns its ownersh...
llvm::DenseSet< const VarDecl * > CUDADeviceVarODRUsedByHost
Keep track of CUDA/HIP device-side variables ODR-used by host code.
void setFILEDecl(TypeDecl *FILEDecl)
Set the type for the C FILE type.
QualType getAdjustedParameterType(QualType T) const
Perform adjustment on the parameter type of a function.
Contains information gathered from parsing the contents of TargetAttr.
CanQualType PseudoObjectTy
@ GE_Missing_ucontext
Missing a type from <ucontext.h>
DeclarationNameTable DeclarationNames
TypedefDecl * getObjCClassDecl() const
Retrieve the typedef declaration corresponding to the predefined Objective-C 'Class' type.
bool AnyObjCImplementation()
Return true if there is at least one @implementation in the TU.
QualType getObjCSelRedefinitionType() const
Retrieve the type that 'SEL' has been defined to, which may be different from the built-in 'SEL' if '...
std::string getObjCEncodingForFunctionDecl(const FunctionDecl *Decl) const
Emit the encoded type for the function Decl into S.
A cache of the value of this pointer, in the most recent generation in which we queried it.
FullSourceLoc getFullLoc(SourceLocation Loc) 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...
Helper data structure representing the traits in a match clause of an declare variant or metadirectiv...
A (possibly-)qualified type.
ArraySizeModifier
Capture whether this is a normal array (e.g.
llvm::DenseMap< const Decl *, const Decl * > CommentlessRedeclChains
Keeps track of redeclaration chains that don't have any comment attached.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
QualType getWCharType() const
Return the unique wchar_t type available in C++ (and available as __wchar_t as a Microsoft extension)...
CanQualType SatLongAccumTy
TemplateName getDependentTemplateName(NestedNameSpecifier *NNS, const IdentifierInfo *Name) const
Retrieve the template name that represents a dependent template name such as MetaFun::template apply.
comments::FullComment * getCommentForDecl(const Decl *D, const Preprocessor *PP) const
Return parsed documentation comment attached to a given declaration.
GVALinkage
A more specific kind of linkage than enum Linkage.
RawCommentList Comments
All comments in this translation unit.
const llvm::fltSemantics & getFloatTypeSemantics(QualType T) const
Return the APFloat 'semantics' for the specified scalar floating point type.
The iterator over UnresolvedSets.
QualType getUnresolvedUsingType(const UnresolvedUsingTypenameDecl *Decl) const
QualType getCanonicalType() const
CanQualType SatShortAccumTy
Represents a member of a struct/union/class.
Concrete class used by the front-end to report problems and issues.
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
The collection of all-type qualifiers we support.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
Represents a parameter to a function.
const TranslationUnitKind TUKind
Exposes information about the current target.
static CanQual< Type > CreateUnsafe(QualType Other)
Builds a canonical type from a QualType.
const TargetInfo * getAuxTargetInfo() const
QualType getUnsignedWCharType() const
Return the type of "unsigned wchar_t".
bool BlockRequiresCopying(QualType Ty, const VarDecl *D)
Returns true iff we need copy/dispose helpers for the given type.
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
void addComment(const RawComment &RC)
@ RequiredByEnum
The alignment comes from an alignment attribute on a enum type.
TypedefDecl * getBOOLDecl() const
Retrieve declaration of 'BOOL' typedef.
void eraseDeclAttrs(const Decl *D)
Erase the attributes corresponding to the given declaration.
UsingEnumDecl * getInstantiatedFromUsingEnumDecl(UsingEnumDecl *Inst)
If the given using-enum decl Inst is an instantiation of another using-enum decl, return it.
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
CharUnits getObjCEncodingTypeSize(QualType T) const
Return the size of type T for Objective-C encoding purpose, in characters.
void setObjCNSStringType(QualType T)
QualType getCorrespondingSignedFixedPointType(QualType Ty) const
MangleContext * createMangleContext(const TargetInfo *T=nullptr)
If T is null pointer, assume the target in ASTContext.
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
unsigned NumImplicitCopyConstructorsDeclared
The number of implicitly-declared copy constructors for which declarations were built.
QualType withFastQualifiers(unsigned TQs) const
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists.
std::vector< std::string > filterFunctionTargetVersionAttrs(const TargetVersionAttr *TV) const
QualType getScalableVectorType(QualType EltTy, unsigned NumElts) const
Return the unique reference to a scalable vector type of the specified element type and scalable numb...
QualType getUnqualifiedObjCPointerType(QualType type) const
getUnqualifiedObjCPointerType - Returns version of Objective-C pointer type with lifetime qualifier r...
Holds all information required to evaluate constexpr code in a module.
bool canBindObjCObjectType(QualType To, QualType From)
comments::FullComment * cloneFullComment(comments::FullComment *FC, const Decl *D) const
QualType getWIntType() const
In C99, this returns a type compatible with the type defined in <stddef.h> as defined by the target.
unsigned getTargetDefaultAlignForAttributeAligned() const
Return the default alignment for attribute((aligned)) on this target, to be used if no alignment valu...
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 ...
QualType mergeTransparentUnionType(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
mergeTransparentUnionType - if T is a transparent union type and a member of T is compatible with Sub...
QualType getObjCIdRedefinitionType() const
Retrieve the type that id has been defined to, which may be different from the built-in id if id has ...
Describes how types, statements, expressions, and declarations should be printed.
QualType getSubstTemplateTypeParmPackType(Decl *AssociatedDecl, unsigned Index, bool Final, const TemplateArgument &ArgPack)
Retrieve a.
Represents a loop initializing the elements of an array.
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...
QualType getUnsignedPointerDiffType() const
Return the unique unsigned counterpart of "ptrdiff_t" integer type.
llvm::APFixedPoint getFixedPointMax(QualType Ty) const
FunctionType - C99 6.7.5.3 - Function Declarators.
QualType getUsingType(const UsingShadowDecl *Found, QualType Underlying) const
QualType applyObjCProtocolQualifiers(QualType type, ArrayRef< ObjCProtocolDecl * > protocols, bool &hasError, bool allowOnPointerType=false) const
Apply Objective-C protocol qualifiers to the given type.
IdentifierInfo * getNSCopyingName()
Retrieve the identifier 'NSCopying'.
comments::FullComment * getLocalCommentForDeclUncached(const Decl *D) const
Return parsed documentation comment attached to a given declaration.
void setCFConstantStringType(QualType T)
QualType getDependentBitIntType(bool Unsigned, Expr *BitsExpr) const
Return a dependent bit-precise integer type with the specified signedness and bit count.
TemplateName getSubstTemplateTemplateParmPack(const TemplateArgument &ArgPack, Decl *AssociatedDecl, unsigned Index, bool Final) const
int64_t toBits(CharUnits CharSize) const
Convert a size in characters to a size in bits.
QualType getAutoRRefDeductType() const
C++11 deduction pattern for 'auto &&' type.
The name of a declaration.
QualType getDeducedTemplateSpecializationType(TemplateName Template, QualType DeducedType, bool IsDependent) const
C++17 deduced class template specialization type.
SourceManager & getSourceManager()
QualType getDecayedType(QualType T) const
Return the uniqued reference to the decayed version of the given type.
TranslationUnitDecl * getTranslationUnitDecl() const
QualType getBTFTagAttributedType(const BTFTypeTagAttr *BTFAttr, QualType Wrapped)
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...
Kind
The basic C++ ABI kind.
bool AtomicUsesUnsupportedLibcall(const AtomicExpr *E) const
FunctionDecl * getcudaConfigureCallDecl()
unsigned char getFixedPointScale(QualType Ty) const
unsigned NumImplicitCopyConstructors
The number of implicitly-declared copy constructors.
AlignRequirementKind AlignRequirement
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 CommentsLoaded
True if comments are already loaded from ExternalASTSource.
This class handles loading and caching of source files into memory.
bool hasSameTemplateName(const TemplateName &X, const TemplateName &Y) const
Determine whether the given template names refer to the same template.
@ WeakUnknown
Weak for now, might become strong later in this TU.
QualType getRawCFConstantStringType() const
Get the structure type used to representation CFStrings, or NULL if it hasn't yet been built.
CanQualType getCanonicalFunctionResultType(QualType ResultType) const
Adjust the given function result type.
std::string getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, bool Extended=false) const
Emit the encoded type for the method declaration Decl into S.
CanQualType OMPIteratorTy
The base class of the type hierarchy.
CanQualType ARCUnbridgedCastTy
Represents a class type in Objective C.
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...
SectionInfo(NamedDecl *Decl, SourceLocation PragmaSectionLocation, int SectionFlags)
QualType getObjCGCQualType(QualType T, Qualifiers::GC gcAttr) const
Return the uniqued reference to the type for an Objective-C gc-qualified type.
TypedefDecl * getObjCSelDecl() const
Retrieve the typedef corresponding to the predefined 'SEL' type in Objective-C.
const DependentSizedArrayType * getAsDependentSizedArrayType(QualType T) const
GlobalDecl - represents a global declaration.
import_range local_imports() const
unsigned getAlignOfGlobalVar(QualType T) const
Return the alignment in bits that should be given to a global variable with type T.
bool typesAreCompatible(QualType T1, QualType T2, bool CompareUnqualified=false)
Compatibility predicates used to check assignment expressions.
QualType getBlockPointerType(QualType T) const
Return the uniqued reference to the type for a block of the specified type.
CanQualType BoundMemberTy
TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateName Template) const
Retrieve the template name that represents a qualified template name such as std::vector.
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
CanQualType ObjCBuiltinBoolTy
CanQualType UnsignedShortFractTy
llvm::APFixedPoint getFixedPointMin(QualType Ty) const
CharUnits getTypeAlignInChars(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in characters.
const T * getTypePtr() const
Retrieve the underlying type pointer, which refers to a canonical type.
TemplateName getAssumedTemplateName(DeclarationName Name) const
Retrieve a template name representing an unqualified-id that has been assumed to name a template for ...
void setPreviousDecl(decl_type *PrevDecl)
Set the previous declaration.
void * Allocate(size_t Size, unsigned Align=8) const
bool isPromotableIntegerType(QualType T) const
More type predicates useful for type checking/promotion.
Represents a dependent using declaration which was marked with typename.
CanQualType UnsignedShortAccumTy
bool hasNonFastQualifiers() const
Return true if the set contains any qualifiers which require an ExtQuals node to be allocated.
QualType getReferenceQualifiedType(const Expr *e) const
getReferenceQualifiedType - Given an expr, will return the type for that expression,...
void setTraversalScope(const std::vector< Decl * > &)
bool ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto, ObjCProtocolDecl *rProto) const
ProtocolCompatibleWithProtocol - return 'true' if 'lProto' is in the inheritance hierarchy of 'rProto...
QualType getObjCIdType() const
Represents the Objective-CC id type.
void setNonKeyFunction(const CXXMethodDecl *method)
Observe that the given method cannot be a key function.
QualType getUIntPtrType() const
Return a type compatible with "uintptr_t" (C99 7.18.1.4), as defined by the target.
CanQualType getIntMaxType() const
Return the unique type for "intmax_t" (C99 7.18.1.5), defined in <stdint.h>.
void CollectInheritedProtocols(const Decl *CDecl, llvm::SmallPtrSet< ObjCProtocolDecl *, 8 > &Protocols)
CollectInheritedProtocols - Collect all protocols in current class and those inherited by it.
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any.
TypedefDecl * getObjCIdDecl() const
Retrieve the typedef corresponding to the predefined id type in Objective-C.
The top declaration context.
QualType getExtVectorType(QualType VectorType, unsigned NumElts) const
Return the unique reference to an extended vector type of the specified element type and size.
QualType mergeFunctionTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false, bool AllowCXX=false, bool IsConditionalOperator=false)
CharUnits getExnObjectAlignment() const
Return the alignment (in bytes) of the thrown exception object.
CanQualType SatLongFractTy
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangl...
Describes a module or submodule.
bool isSignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is signed or an enumeration types whose underlying ty...
QualType removeAddrSpaceQualType(QualType T) const
Remove any existing address space on the type and returns the type with qualifiers intact (or that's ...
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...
CharUnits getOffsetOfBaseWithVBPtr(const CXXRecordDecl *RD) const
Loading virtual member pointers using the virtual inheritance model always results in an adjustment u...
unsigned NumImplicitMoveAssignmentOperators
The number of implicitly-declared move assignment operators.
A convenient class for passing around template argument information.
Describes a module import declaration, which makes the contents of the named module visible in the cu...
const ConstantArrayType * getAsConstantArrayType(QualType T) const
QualType getDependentVectorType(QualType VectorType, Expr *SizeExpr, SourceLocation AttrLoc, VectorType::VectorKind VecKind) const
Return the unique reference to the type for a dependently sized vector of the specified element type.
DeclarationNameInfo getNameForTemplate(TemplateName Name, SourceLocation NameLoc) const
TagTypeKind
The kind of a tag type.
unsigned NumImplicitCopyAssignmentOperators
The number of implicitly-declared copy assignment operators.
const IncompleteArrayType * getAsIncompleteArrayType(QualType T) const
ObjCImplementationDecl * getObjCImplementation(ObjCInterfaceDecl *D)
Get the implementation of the ObjCInterfaceDecl D, or nullptr if none exists.
CallingConv getDefaultCallingConvention(bool IsVariadic, bool IsCXXMethod, bool IsBuiltin=false) const
Retrieves the default calling convention for the current target.
Holds information about the various types of exception specification.
QualType getReadPipeType(QualType T) const
Return a read_only pipe type for the specified type.
TypedefDecl * getUInt128Decl() const
Retrieve the declaration for the 128-bit unsigned integer type.
QualType getSubstTemplateTypeParmType(QualType Replacement, Decl *AssociatedDecl, unsigned Index, std::optional< unsigned > PackIndex) const
Retrieve a substitution-result type.
Declaration of a C++20 concept.
Selector getSelector(unsigned NumArgs, IdentifierInfo **IIV)
Can create any sort of selector.
SelectorTable & Selectors
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
BlockVarCopyInit getBlockVarCopyInit(const VarDecl *VD) const
Get the copy initialization expression of the VarDecl VD, or nullptr if none exists.
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
Decl * getPrimaryMergedDecl(Decl *D)
Represents a GCC generic vector type.
uint64_t getTargetNullPointerValue(QualType QT) const
Get target-dependent integer value for null pointer which is used for constant folding.
TypeInfoChars getTypeInfoDataSizeInChars(QualType T) const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
@ TU_Incremental
The translation unit is a is a complete translation unit that we might incrementally extend later.
Selector GetUnarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing an unary selector.
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
void addOverriddenMethod(const CXXMethodDecl *Method, const CXXMethodDecl *Overridden)
Note that the given C++ Method overrides the given Overridden method.
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...
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.
QualType getUnaryTransformType(QualType BaseType, QualType UnderlyingType, UnaryTransformType::UTTKind UKind) const
Unary type transforms.
Represents an array type, per C99 6.7.5.2 - Array Declarators.
int getFloatingTypeOrder(QualType LHS, QualType RHS) const
Compare the rank of the two specified floating point types, ignoring the domain of the type (i....
SourceLocation PragmaSectionLocation
QualType getDependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, ArrayRef< TemplateArgumentLoc > Args) const
QualType getCFConstantStringType() const
Return the C structure type used to represent constant CFStrings.
void DeepCollectObjCIvars(const ObjCInterfaceDecl *OI, bool leafClass, SmallVectorImpl< const ObjCIvarDecl * > &Ivars) const
DeepCollectObjCIvars - This routine first collects all declared, but not synthesized,...
llvm::iterator_range< overridden_cxx_method_iterator > overridden_method_range
uint64_t getConstantArrayElementCount(const ConstantArrayType *CA) const
Return number of constant array elements.
QualType getRValueReferenceType(QualType T) const
Return the uniqued reference to the type for an rvalue reference to the specified type.
QualType getObjCSuperType() const
Returns the C struct type for objc_super.
const VariableArrayType * getAsVariableArrayType(QualType T) const
AttrVec & getDeclAttrs(const Decl *D)
Retrieve the attributes for the given declaration.
Represents a template argument.
CanQualType UnsignedFractTy
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
QualType getSignatureParameterType(QualType T) const
Retrieve the parameter type as adjusted for use in the signature of a function, decaying array and fu...
A lazy value (of type T) that is within an AST node of type Owner, where the value might change in la...
ParsedTargetAttr filterFunctionTargetAttrs(const TargetAttr *TD) const
Parses the target attributes passed in, and returns only the ones that are valid feature names.
void setInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst, UsingShadowDecl *Pattern)
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
void setExternalSource(IntrusiveRefCntPtr< ExternalASTSource > Source)
Attach an external AST source to the AST context.
unsigned NumImplicitDefaultConstructorsDeclared
The number of implicitly-declared default constructors for which declarations were built.
bool isSameEntity(const NamedDecl *X, const NamedDecl *Y) const
Determine whether the two declarations refer to the same entity.
QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl=nullptr) const
getObjCInterfaceType - Return the unique reference to the type for the specified ObjC interface decl.
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...
llvm::DenseMap< const Decl *, comments::FullComment * > ParsedComments
Mapping from declarations to parsed comments attached to any redeclaration.
BuiltinVectorTypeInfo getBuiltinVectorTypeInfo(const BuiltinType *VecTy) const
Returns the element type, element count and number of vectors (in case of tuple) for a builtin vector...
unsigned getManglingNumber(const NamedDecl *ND, bool ForAuxTarget=false) const
TypeInfo getTypeInfo(QualType T) const
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
bool hasUniqueObjectRepresentations(QualType Ty) const
Return true if the specified type has unique object representations according to (C++17 [meta....
QualType getAutoDeductType() const
C++11 deduction pattern for 'auto' type.
const XRayFunctionFilter & getXRayFilter() const
bool UnwrapSimilarTypes(QualType &T1, QualType &T2, bool AllowPiMismatch=true)
Attempt to unwrap two types that may be similar (C++ [conv.qual]).
CanQualType ObjCBuiltinSelTy
std::string getObjCEncodingForBlock(const BlockExpr *blockExpr) const
Return the encoded type for this block declaration.
This table allows us to fully hide how we implement multi-keyword caching.
void adjustExceptionSpec(FunctionDecl *FD, const FunctionProtoType::ExceptionSpecInfo &ESI, bool AsWritten=false)
Change the exception specification on a function once it is delay-parsed, instantiated,...
QualType getRecordType(const RecordDecl *Decl) const
@ RequiredByTypedef
The alignment comes from an alignment attribute on a typedef.
ComparisonCategories CompCategories
Types and expressions required to build C++2a three-way comparisons using operator<=>,...
const Type * getCanonicalType(const Type *T) const
QualType getIntTypeForBitwidth(unsigned DestWidth, unsigned Signed) const
getIntTypeForBitwidth - sets integer QualTy according to specified details: bitwidth,...
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 ...
CallingConv
CallingConv - Specifies the calling convention that a function uses.
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...
QualType getCommonSugaredType(QualType X, QualType Y, bool Unqualified=false)
Represents a variable declaration or definition.
bool canAssignObjCInterfaces(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
canAssignObjCInterfaces - Return true if the two interface types are compatible for assignment from R...
void setObjCClassRedefinitionType(QualType RedefType)
Set the user-written type that redefines 'SEL'.
QualType getObjCClassType() const
Represents the Objective-C Class type.
CanQualType UnsignedLongAccumTy
Represents the declaration of a struct/union/class/enum.
QualType getRealTypeForBitwidth(unsigned DestWidth, FloatModeKind ExplicitType) const
getRealTypeForBitwidth - sets floating point QualTy according to specified bitwidth.
QualType getCanonicalTypeInternal() const
IdentifierInfo * getBoolName() const
Retrieve the identifier 'bool'.
Stores a list of template parameters for a TemplateDecl and its derived classes.
StringLiteral - This represents a string literal expression, e.g.
LangAS getDefaultOpenCLPointeeAddrSpace()
Returns default address space based on OpenCL version and enabled features.
interp::Context & getInterpContext()
Returns the clang bytecode interpreter context.
QualType isPromotableBitField(Expr *E) const
Whether this is a promotable bitfield reference according to C99 6.3.1.1p2, bullet 2 (and GCC extensi...
QualType getLifetimeQualifiedType(QualType type, Qualifiers::ObjCLifetime lifetime)
Return a type with the given lifetime qualifier.
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
Implements C++ ABI-specific semantic analysis functions.
void setObjCMethodRedeclaration(const ObjCMethodDecl *MD, const ObjCMethodDecl *Redecl)
Represents a declaration of a type.
const Type * Ty
The locally-unqualified type.
QualType getObjCObjectType(QualType Base, ObjCProtocolDecl *const *Protocols, unsigned NumProtocols) const
Legacy interface: cannot provide type arguments or __kindof.
DeclListNode * AllocateDeclListNode(clang::NamedDecl *ND)
Allocates a DeclListNode or returns one from the ListNodeFreeList pool.
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 ...
comments::CommandTraits & getCommentCommandTraits() const
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 addDestruction(T *Ptr) const
If T isn't trivially destructible, calls AddDeallocation to register it for destruction.
void getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT, std::string &S) const
Put the string version of the type qualifiers QT into S.
QualType getComplexType(QualType T) const
Return the uniqued reference to the type for a complex number with the specified element type.
#define CXXABI(Name, Str)
QualType getConstantMatrixType(QualType ElementType, unsigned NumRows, unsigned NumColumns) const
Return the unique reference to the matrix type of the specified element type and size.
A qualifier set is used to build a set of qualifiers.
QualType getVolatileType(QualType T) const
Return the uniqued reference to the type for a volatile qualified type.
QualType getPromotedIntegerType(QualType PromotableType) const
Return the type that PromotableType will promote to: C99 6.3.1.1p2, assuming that PromotableType is a...
bool isNearlyEmpty(const CXXRecordDecl *RD) const
Copy initialization expr of a __block variable and a boolean flag that indicates whether the expressi...
Writes an AST file containing the contents of a translation unit.
CanQualType getPointerType(CanQualType T) const
void DumpRecordLayout(const RecordDecl *RD, raw_ostream &OS, bool Simple=false) const
Decl * getVaListTagDecl() const
Retrieve the C type declaration corresponding to the predefined __va_list_tag type used to help defin...
ObjCInterfaceDecl * getObjCProtocolDecl() const
Retrieve the Objective-C class declaration corresponding to the predefined Protocol class.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
InlineVariableDefinitionKind
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
ASTContext(LangOptions &LOpts, SourceManager &SM, IdentifierTable &idents, SelectorTable &sels, Builtin::Context &builtins, TranslationUnitKind TUKind)
void deduplicateMergedDefinitonsFor(NamedDecl *ND)
Clean up the merged definition list.
CanQualType getSignedSizeType() const
Return the unique signed counterpart of the integer type corresponding to size_t.
llvm::DenseMap< const Decl *, const Decl * > RedeclChainComments
Mapping from canonical declaration to the first redeclaration in chain that has a comment attached.
void getOverriddenMethods(const NamedDecl *Method, SmallVectorImpl< const NamedDecl * > &Overridden) const
Return C++ or ObjC overridden methods for the given Method.
void setObjCSelRedefinitionType(QualType RedefType)
Set the user-written type that redefines 'SEL'.
Declaration of a template type parameter.
Provides support for incremental compilation.
bool ObjCObjectAdoptsQTypeProtocols(QualType QT, ObjCInterfaceDecl *Decl)
ObjCObjectAdoptsQTypeProtocols - Checks that protocols in IC's protocol list adopt all protocols in Q...
TypeOfKind
The kind of 'typeof' expression we're after.
A template parameter object.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
NamedDecl * getInstantiatedFromUsingDecl(NamedDecl *Inst)
If the given using decl Inst is an instantiation of another (possibly unresolved) using decl,...
size_t getASTAllocatedMemory() const
Return the total amount of physical memory allocated for representing AST nodes and type information.
QualType getDecltypeType(Expr *e, QualType UnderlyingType) const
C++11 decltype.
void Deallocate(void *Ptr) const
Represents a C array with an unspecified size.
QualType getFunctionNoProtoType(QualType ResultTy, const FunctionType::ExtInfo &Info) const
Return a K&R style C function type like 'int()'.
void setManglingNumber(const NamedDecl *ND, unsigned Number)
QualType getObjCTypeParamType(const ObjCTypeParamDecl *Decl, ArrayRef< ObjCProtocolDecl * > protocols) const
unsigned getTargetAddressSpace(LangAS AS) const
CanQualType UnsignedLongLongTy
OpenCLTypeKind getOpenCLTypeKind(const Type *T) const
Map an AST Type to an OpenCLTypeKind enum value.
void setObjCConstantStringInterface(ObjCInterfaceDecl *Decl)
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...
bool hasSameFunctionTypeIgnoringPtrSizes(QualType T, QualType U)
Determine whether two function types are the same, ignoring pointer sizes in the return type and para...
bool ObjCQualifiedClassTypesAreCompatible(const ObjCObjectPointerType *LHS, const ObjCObjectPointerType *RHS)
ObjCQualifiedClassTypesAreCompatible - compare Class<pr,...> and Class<pr1, ...>.
ObjCCategoryDecl - Represents a category declaration.
QualType getCorrespondingUnsignedType(QualType T) const
QualType getWideCharType() const
Return the type of wide characters.
QualType adjustStringLiteralBaseType(QualType StrLTy) const
QualType getMSGuidType() const
Retrieve the implicitly-predeclared 'struct _GUID' type.
CanQualType UnsignedCharTy
QualType getExceptionObjectType(QualType T) const
LangAS
Defines the address space values used by the address space qualifier of QualType.
TypeInfoChars(CharUnits Width, CharUnits Align, AlignRequirementKind AlignRequirement)
CanQualType getCanonicalParamType(QualType T) const
Return the canonical parameter type corresponding to the specific potentially non-canonical one.
clang::CharUnits operator*(clang::CharUnits::QuantityType Scale, const clang::CharUnits &CU)
QualType getFunctionTypeWithoutPtrSizes(QualType T)
Get a function type and produce the equivalent function type where pointer size address spaces in the...
CanQualType UnsignedLongTy
QualType getConstType(QualType T) const
Return the uniqued reference to the type for a const qualified type.
Represents a pointer to an Objective C object.
overridden_cxx_method_iterator overridden_methods_end(const CXXMethodDecl *Method) const
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
CanQualType getDecayedType(CanQualType T) const
Represents a C++ using-enum-declaration.
QualType getAdjustedType(QualType Orig, QualType New) const
Return the uniqued reference to a type adjusted from the original type to a new type.
static TranslationUnitDecl * Create(ASTContext &C)
Represents a C++ struct/union/class.
unsigned getPreferredTypeAlign(QualType T) const
Return the "preferred" alignment of the specified type T for the current target, in bits.
StringRef getCUIDHash() const
QualType getLogicalOperationType() const
The result type of logical operations, '<', '>', '!=', etc.
static CGCXXABI * createCXXABI(CodeGenModule &CGM)
OMPTraitInfo & getNewOMPTraitInfo()
Return a new OMPTraitInfo object owned by this context.
const FunctionType * adjustFunctionType(const FunctionType *Fn, FunctionType::ExtInfo EInfo)
Change the ExtInfo on a function type.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
const RawComment * getRawCommentForAnyRedecl(const Decl *D, const Decl **OriginalDecl=nullptr) const
Return the documentation comment attached to a given declaration.
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
unsigned char getFixedPointIBits(QualType Ty) const
QualType AutoRRefDeductTy
QualType getVectorType(QualType VectorType, unsigned NumElts, VectorType::VectorKind VecKind) const
Return the unique reference to a vector type of the specified element type and size.
Represents an array type in C++ whose size is a value-dependent expression.
void addLazyModuleInitializers(Module *M, ArrayRef< uint32_t > IDs)
CanQualType UnsignedIntTy
Represents a C array with a specified size that is not an integer-constant-expression.
TargetCXXABI::Kind getCXXABIKind() const
Return the C++ ABI kind that should be used.
bool ObjCQualifiedIdTypesAreCompatible(const ObjCObjectPointerType *LHS, const ObjCObjectPointerType *RHS, bool ForCompare)
ObjCQualifiedIdTypesAreCompatible - We know that one of lhs/rhs is an ObjCQualifiedIDType.
MemberSpecializationInfo * getInstantiatedFromStaticDataMember(const VarDecl *Var)
If this variable is an instantiated static data member of a class template specialization,...
const SourceManager & getSourceManager() const
TypedefDecl * getCFConstantStringDecl() const
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...
@ Weak
Weak definition of inline variable.
ParentMapContext & getParentMapContext()
Returns the dynamic AST node parent map context.
bool isObjCIdType(QualType T) const
void setObjCSuperType(QualType ST)
bool canBuiltinBeRedeclared(const FunctionDecl *) const
Return whether a declaration to a builtin is allowed to be overloaded/redeclared.
CharUnits getDeclAlign(const Decl *D, bool ForAlignof=false) const
Return a conservative estimate of the alignment of the specified decl D.
QualType getAttributedType(attr::Kind attrKind, QualType modifiedType, QualType equivalentType) const
overridden_method_range overridden_methods(const CXXMethodDecl *Method) const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
QualType getUnqualifiedArrayType(QualType T, Qualifiers &Quals)
Return this type as a completely-unqualified array type, capturing the qualifiers in Quals.
CXXMethodVector::const_iterator overridden_cxx_method_iterator
void addModuleInitializer(Module *M, Decl *Init)
Add a declaration to the list of declarations that are initialized for a module.
@ GE_Missing_stdio
Missing a type from <stdio.h>
@ Unspecified
Whether values of this type can be null is (explicitly) unspecified.
QualType getEnumType(const EnumDecl *Decl) const
CanQualType getUIntMaxType() const
Return the unique type for "uintmax_t" (C99 7.18.1.5), defined in <stdint.h>.
LangAS getOpenCLTypeAddrSpace(const Type *T) const
Get address space for OpenCL type.
Represents a C++ template name within the type system.
bool isObjCClassType(QualType T) const
CharUnits getPreferredTypeAlignInChars(QualType T) const
Return the PreferredAlignment of a (complete) type T, in characters.
void setBlockVarCopyInit(const VarDecl *VD, Expr *CopyExpr, bool CanThrow)
Set the copy initialization expression of a block var decl.
QualType getTagDeclType(const TagDecl *Decl) const
Return the unique reference to the type for the specified TagDecl (struct/union/class/enum) decl.
BuiltinTemplateDecl * getMakeIntegerSeqDecl() const
Represents a prototype with parameter type info, e.g.
uint64_t getFieldOffset(const ValueDecl *FD) const
Get the offset of a FieldDecl or IndirectFieldDecl, in bits.
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...
const clang::PrintingPolicy & getPrintingPolicy() const
QualType getIntPtrType() const
Return a type compatible with "intptr_t" (C99 7.18.1.4), as defined by the target.
bool NoWrongSidedVars
Do not allow wrong-sided variables in constant expressions.
struct clang::ASTContext::CUDAConstantEvalContext CUDAConstantEvalCtx
@ GE_Missing_type
Missing a type.
QualType getObjCProtoType() const
Retrieve the type of the Objective-C Protocol class.
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
unsigned overridden_methods_size(const CXXMethodDecl *Method) const
Decl - This represents one declaration (or definition), e.g.
Represents a ValueDecl that came out of a declarator.
Represents one property declaration in an Objective-C interface.
uint64_t getArrayInitLoopExprElementCount(const ArrayInitLoopExpr *AILE) const
Return number of elements initialized in an ArrayInitLoopExpr.
QualType getSignedWCharType() const
Return the type of "signed wchar_t".
MangleContext * createDeviceMangleContext(const TargetInfo &T)
Creates a device mangle context to correctly mangle lambdas in a mixed architecture compile by settin...
void setPrimaryMergedDecl(Decl *D, Decl *Primary)
TemplateName getCanonicalTemplateName(const TemplateName &Name) const
Retrieves the "canonical" template name that refers to a given template.
QualType mergeFunctionParameterTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
mergeFunctionParameterTypes - merge two types which appear as function parameter types
PartialDiagnostic::DiagStorageAllocator & getDiagAllocator()
void attachCommentsToJustParsedDecls(ArrayRef< Decl * > Decls, const Preprocessor *PP)
Searches existing comments for doc comments that should be attached to Decls.
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.
unsigned getTypeAlign(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in bits.
InlineVariableDefinitionKind getInlineVariableDefinitionKind(const VarDecl *VD) const
Determine whether a definition of this inline variable should be treated as a weak or strong definiti...
void setPrintingPolicy(const clang::PrintingPolicy &Policy)
llvm::PointerUnion< VarTemplateDecl *, MemberSpecializationInfo * > TemplateOrSpecializationInfo
A type synonym for the TemplateOrInstantiation mapping.
IdentifierInfo * getMakeIntegerSeqName() const
QualType getObjCSelType() const
Retrieve the type that corresponds to the predefined Objective-C 'SEL' type.
TypedefNameDecl * getTypedefNameForUnnamedTagDecl(const TagDecl *TD)
void forEachMultiversionedFunctionVersion(const FunctionDecl *FD, llvm::function_ref< void(FunctionDecl *)> Pred) const
Visits all versions of a multiversioned function with the passed predicate.
std::optional< CharUnits > getTypeSizeInCharsIfKnown(QualType Ty) const
QualType getucontext_tType() const
Retrieve the C ucontext_t type.
A class which abstracts out some details necessary for making a call.
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
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 setInstantiatedFromUsingEnumDecl(UsingEnumDecl *Inst, UsingEnumDecl *Pattern)
Remember that the using enum decl Inst is an instantiation of the using enum decl Pattern of a class ...
CanQualType SatUnsignedShortFractTy
One of these records is kept for each identifier that is lexed.
llvm::PointerUnion< T, LazyData * > ValueType
CanQualType ObjCBuiltinIdTy
Represents the declaration of a typedef-name via the 'typedef' type specifier.
CanQualType SatUnsignedShortAccumTy
const TargetInfo & getTargetInfo() const
QualType getInjectedClassNameType(CXXRecordDecl *Decl, QualType TST) const
getInjectedClassNameType - Return the unique reference to the injected class name type for the specif...
llvm::DenseSet< const ValueDecl * > CUDAExternalDeviceDeclODRUsedByHost
Keep track of CUDA/HIP external kernels or device variables ODR-used by host code.
QualType getTypeOfType(QualType QT, TypeOfKind Kind) const
getTypeOfType - Unlike many "get<Type>" functions, we don't unique TypeOfType nodes.
static ImportDecl * getNextLocalImport(ImportDecl *Import)
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
void getObjCEncodingForPropertyType(QualType T, std::string &S) const
Emit the Objective-C property type encoding for the given type T into S.
QualType getElaboratedType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType, TagDecl *OwnedTagDecl=nullptr) const
void getLegacyIntegralTypeEncoding(QualType &t) const
getLegacyIntegralTypeEncoding - Another legacy compatibility encoding: 32-bit longs are encoded as 'l...
QualType getCorrespondingSignedType(QualType T) const
ASTMutationListener * Listener
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type.
Represents the declaration of an Objective-C type parameter.
bool hasSameFunctionTypeIgnoringExceptionSpec(QualType T, QualType U) const
Determine whether two function types are the same, ignoring exception specifications in cases where t...
static bool isObjCNSObjectType(QualType Ty)
Return true if this is an NSObject object with its NSObject attribute set.
Reads an AST files chain containing the contents of a translation unit.
Keeps track of the mangled names of lambda expressions and block literals within a particular context...
void adjustObjCTypeParamBoundType(const ObjCTypeParamDecl *Orig, ObjCTypeParamDecl *New) const
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...
@ RequiredByRecord
The alignment comes from an alignment attribute on a record type.
void setInstantiatedFromUsingDecl(NamedDecl *Inst, NamedDecl *Pattern)
Remember that the using decl Inst is an instantiation of the using decl Pattern of a class template.
ArrayRef< Module * > getModulesWithMergedDefinition(const NamedDecl *Def)
Get the additional modules in which the definition Def has been merged.
void setjmp_bufDecl(TypeDecl *jmp_bufDecl)
Set the type for the C jmp_buf type.
@ None
The alignment was not explicit in code.
TranslationUnitKind
Describes the kind of translation unit being processed.
ObjCMethodDecl - Represents an instance or class method declaration.
bool shouldExternalize(const Decl *D) const
Whether a C++ static variable or CUDA/HIP kernel should be externalized.
TypedefDecl * buildImplicitTypedef(QualType T, StringRef Name) const
Create a new implicit TU-level typedef declaration.
bool areComparableObjCPointerTypes(QualType LHS, QualType RHS)
CanQualType getComplexType(CanQualType T) const
llvm::StringMap< SectionInfo > SectionInfos
unsigned getTypeUnadjustedAlign(QualType T) const
Return the ABI-specified natural alignment of a (complete) type T, before alignment adjustments,...
QualType getBuiltinVaListType() const
Retrieve the type of the __builtin_va_list type.
@ OCL_None
There is no lifetime qualification on this type.
CanQualType OMPArrayShapingTy
void setInstantiatedFromUnnamedFieldDecl(FieldDecl *Inst, FieldDecl *Tmpl)
TemplateName getSubstTemplateTemplateParm(TemplateName replacement, Decl *AssociatedDecl, unsigned Index, std::optional< unsigned > PackIndex) const
QualType getjmp_bufType() const
Retrieve the C jmp_buf type.
Module * getModuleForCodeGen() const
Get module under construction, nullptr if this is not a C++20 module.
QualType getParenType(QualType NamedType) const
bool mayExternalize(const Decl *D) const
Whether a C++ static variable or CUDA/HIP kernel may be externalized.
OpenCLTypeKind
OpenCL type kinds.
StringLiteral * getPredefinedStringLiteralFromCache(StringRef Key) const
Return a string representing the human readable name for the specified function declaration or file n...
QualType getAddrSpaceQualType(QualType T, LangAS AddressSpace) const
Return the uniqued reference to the type for an address space qualified type with the specified type ...
Extra information about a function prototype.
A list storing NamedDecls in the lookup tables.
void addedLocalImportDecl(ImportDecl *Import)
Notify the AST context that a new import declaration has been parsed or implicitly created within thi...
bool ObjCMethodsAreEqual(const ObjCMethodDecl *MethodDecl, const ObjCMethodDecl *MethodImp)
TemplateOrSpecializationInfo getTemplateOrSpecializationInfo(const VarDecl *Var)
Smart pointer class that efficiently represents Objective-C method names.
CharUnits toCharUnitsFromBits(int64_t BitSize) const
Convert a size in bits to a size in characters.
LangAS getLangASForBuiltinAddressSpace(unsigned AS) const
CanQualType SatUnsignedFractTy
Holds information about both target-independent and target-specific builtins, allowing easy queries b...
QualType getObjCClassRedefinitionType() const
Retrieve the type that Class has been defined to, which may be different from the built-in Class if C...
Selector GetNullarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing a nullary selector.
ObjCIvarDecl - Represents an ObjC instance variable.
bool getByrefLifetime(QualType Ty, Qualifiers::ObjCLifetime &Lifetime, bool &HasByrefExtendedLayout) const
Returns true, if given type has a known lifetime.
QualType withConst() const
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.
CanQualType ObjCBuiltinClassTy
bool isSentinelNullExpr(const Expr *E)
CharUnits getTypeUnadjustedAlignInChars(QualType T) const
getTypeUnadjustedAlignInChars - Return the ABI-specified alignment of a type, in characters,...
CanQualType getAdjustedType(CanQualType Orig, CanQualType New) const
llvm::iterator_range< import_iterator > import_range
void addCopyConstructorForExceptionObject(CXXRecordDecl *RD, CXXConstructorDecl *CD)
QualType getCorrespondingSaturatedType(QualType Ty) const
TypedefDecl * getBuiltinMSVaListDecl() const
Retrieve the C type declaration corresponding to the predefined __builtin_ms_va_list type.
llvm::FixedPointSemantics getFixedPointSemantics(QualType Ty) const
Qualifiers::GC getObjCGCAttrKind(QualType Ty) const
Return one of the GCNone, Weak or Strong Objective-C garbage collection attributes.
void AddDeallocation(void(*Callback)(void *), void *Data) const
Add a deallocation callback that will be invoked when the ASTContext is destroyed.