14#ifndef LLVM_CLANG_AST_ASTCONTEXT_H
15#define LLVM_CLANG_AST_ASTCONTEXT_H
34#include "llvm/ADT/DenseMap.h"
35#include "llvm/ADT/DenseMapInfo.h"
36#include "llvm/ADT/DenseSet.h"
37#include "llvm/ADT/FoldingSet.h"
38#include "llvm/ADT/IntrusiveRefCntPtr.h"
39#include "llvm/ADT/MapVector.h"
40#include "llvm/ADT/PointerIntPair.h"
41#include "llvm/ADT/PointerUnion.h"
42#include "llvm/ADT/SetVector.h"
43#include "llvm/ADT/SmallPtrSet.h"
44#include "llvm/ADT/SmallVector.h"
45#include "llvm/ADT/StringMap.h"
46#include "llvm/ADT/StringRef.h"
47#include "llvm/ADT/StringSet.h"
48#include "llvm/ADT/TinyPtrVector.h"
49#include "llvm/Support/TypeSize.h"
75 return hash_combine(DenseMapInfo<clang::QualType>::getHashValue(Val.
EltTy),
231 using KeyTy = std::pair<QualType, bool>;
233 template <
typename T>
static KeyTy getKey(
const T &N) {
return N.getKey(); }
236 return llvm::hash_combine(Key.first.getAsOpaquePtr(), Key.second);
239 template <
typename T>
static bool isEqual(
const KeyTy &Key,
const T &N) {
240 return Key == N.getKey();
250 mutable unsigned NumTypes[Type::TypeLast + 1] = {};
253 mutable llvm::FoldingSet<ExtQuals> ExtQualNodes;
254 mutable llvm::UniquingSet<ComplexType> ComplexTypes;
255 mutable llvm::UniquingSet<PointerType> PointerTypes{GeneralTypesLog2InitSize};
256 mutable llvm::UniquingSet<AdjustedType> AdjustedTypes;
257 mutable llvm::UniquingSet<BlockPointerType> BlockPointerTypes;
258 mutable llvm::UniquingSet<LValueReferenceType, QualTypeBoolInfo>
259 LValueReferenceTypes;
260 mutable llvm::UniquingSet<RValueReferenceType, QualTypeBoolInfo>
261 RValueReferenceTypes;
262 mutable llvm::FoldingSet<MemberPointerType> MemberPointerTypes;
263 mutable llvm::ContextualFoldingSet<ConstantArrayType, ASTContext &>
265 mutable llvm::FoldingSet<IncompleteArrayType> IncompleteArrayTypes;
266 mutable std::vector<VariableArrayType*> VariableArrayTypes;
267 mutable llvm::ContextualFoldingSet<DependentSizedArrayType, ASTContext &>
268 DependentSizedArrayTypes;
269 mutable llvm::ContextualFoldingSet<DependentSizedExtVectorType, ASTContext &>
270 DependentSizedExtVectorTypes;
271 mutable llvm::ContextualFoldingSet<DependentAddressSpaceType, ASTContext &>
272 DependentAddressSpaceTypes;
273 mutable llvm::FoldingSet<VectorType> VectorTypes;
274 mutable llvm::ContextualFoldingSet<DependentVectorType, ASTContext &>
275 DependentVectorTypes;
276 mutable llvm::FoldingSet<ConstantMatrixType> MatrixTypes;
277 mutable llvm::FoldingSet<CooperativeMatrixType> CooperativeMatrixTypes;
278 mutable llvm::ContextualFoldingSet<DependentSizedMatrixType, ASTContext &>
279 DependentSizedMatrixTypes;
280 mutable llvm::FoldingSet<FunctionNoProtoType> FunctionNoProtoTypes;
281 mutable llvm::ContextualFoldingSet<FunctionProtoType, ASTContext&>
283 mutable llvm::ContextualFoldingSet<DependentTypeOfExprType, ASTContext &>
284 DependentTypeOfExprTypes;
285 mutable llvm::ContextualFoldingSet<DependentDecltypeType, ASTContext &>
286 DependentDecltypeTypes;
288 mutable llvm::ContextualFoldingSet<PackIndexingType, ASTContext &>
289 DependentPackIndexingTypes;
291 mutable llvm::UniquingSet<TemplateTypeParmType> TemplateTypeParmTypes;
292 mutable llvm::UniquingSet<ObjCTypeParamType> ObjCTypeParamTypes;
293 mutable llvm::UniquingSet<SubstTemplateTypeParmType>
294 SubstTemplateTypeParmTypes;
295 mutable llvm::FoldingSet<SubstTemplateTypeParmPackType>
296 SubstTemplateTypeParmPackTypes;
297 mutable llvm::FoldingSet<SubstBuiltinTemplatePackType>
298 SubstBuiltinTemplatePackTypes;
299 mutable llvm::ContextualFoldingSet<TemplateSpecializationType, ASTContext&>
300 TemplateSpecializationTypes;
301 mutable llvm::UniquingSet<ParenType> ParenTypes{GeneralTypesLog2InitSize};
302 mutable llvm::FoldingSet<TagTypeFoldingSetPlaceholder> TagTypes;
303 mutable llvm::FoldingSet<FoldingSetPlaceholder<UnresolvedUsingType>>
304 UnresolvedUsingTypes;
305 mutable llvm::FoldingSet<UsingType> UsingTypes;
306 mutable llvm::FoldingSet<FoldingSetPlaceholder<TypedefType>> TypedefTypes;
307 mutable llvm::FoldingSet<DependentNameType> DependentNameTypes;
308 mutable llvm::UniquingSet<PackExpansionType> PackExpansionTypes;
309 mutable llvm::FoldingSet<ObjCObjectTypeImpl> ObjCObjectTypes;
310 mutable llvm::UniquingSet<ObjCObjectPointerType> ObjCObjectPointerTypes;
311 mutable llvm::UniquingSet<UnaryTransformType> UnaryTransformTypes;
318 mutable llvm::DenseMap<llvm::FoldingSetNodeIDRef, AutoType *> AutoTypes;
319 mutable llvm::FoldingSet<DeducedTemplateSpecializationType>
320 DeducedTemplateSpecializationTypes;
321 mutable llvm::UniquingSet<AtomicType> AtomicTypes;
322 mutable llvm::ContextualFoldingSet<AttributedType, ASTContext &>
324 mutable llvm::UniquingSet<PipeType, QualTypeBoolInfo> PipeTypes;
325 mutable llvm::UniquingSet<BitIntType> BitIntTypes;
326 mutable llvm::ContextualFoldingSet<DependentBitIntType, ASTContext &>
327 DependentBitIntTypes;
328 mutable llvm::FoldingSet<BTFTagAttributedType> BTFTagAttributedTypes;
329 mutable llvm::UniquingSet<OverflowBehaviorType> OverflowBehaviorTypes;
330 mutable llvm::ContextualFoldingSet<HLSLAttributedResourceType, ASTContext &>
331 HLSLAttributedResourceTypes;
332 llvm::FoldingSet<HLSLInlineSpirvType> HLSLInlineSpirvTypes;
334 mutable llvm::FoldingSet<CountAttributedType> CountAttributedTypes;
336 mutable llvm::FoldingSet<QualifiedTemplateName> QualifiedTemplateNames;
337 mutable llvm::FoldingSet<DependentTemplateName> DependentTemplateNames;
338 mutable llvm::FoldingSet<SubstTemplateTemplateParmStorage>
339 SubstTemplateTemplateParms;
340 mutable llvm::ContextualFoldingSet<SubstTemplateTemplateParmPackStorage,
342 SubstTemplateTemplateParmPacks;
343 mutable llvm::ContextualFoldingSet<DeducedTemplateStorage, ASTContext &>
345 mutable llvm::ContextualFoldingSet<PackIndexingTemplateStorage, ASTContext &>
346 PackIndexingTemplates;
348 mutable llvm::ContextualFoldingSet<ArrayParameterType, ASTContext &>
352 mutable std::array<
Type *,
354 PredefinedSugarTypes{};
359 mutable llvm::UniquingSet<NamespaceAndPrefixStorage>
360 NamespaceAndPrefixStorages;
365 mutable llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*>
367 mutable llvm::DenseMap<const ObjCInterfaceDecl *, const ASTRecordLayout *>
371 using TypeInfoMap = llvm::DenseMap<const Type *, struct TypeInfo>;
372 mutable TypeInfoMap MemoizedTypeInfo;
377 using UnadjustedAlignMap = llvm::DenseMap<const Type *, unsigned>;
378 mutable UnadjustedAlignMap MemoizedUnadjustedAlign;
381 llvm::DenseMap<const CXXRecordDecl*, LazyDeclPtr> KeyFunctions;
384 llvm::DenseMap<ObjCContainerDecl*, ObjCImplDecl*> ObjCImpls;
388 llvm::DenseMap<const ObjCMethodDecl*,const ObjCMethodDecl*> ObjCMethodRedecls;
391 llvm::DenseMap<const VarDecl *, BlockVarCopyInit> BlockVarCopyInits;
394 mutable llvm::FoldingSet<MSGuidDecl> MSGuidDecls;
397 mutable llvm::FoldingSet<UnnamedGlobalConstantDecl>
398 UnnamedGlobalConstantDecls;
401 mutable llvm::FoldingSet<TemplateParamObjectDecl> TemplateParamObjectDecls;
407 mutable llvm::StringMap<StringLiteral *> StringLiteralCache;
409 mutable llvm::DenseSet<const FunctionDecl *> DestroyingOperatorDeletes;
410 mutable llvm::DenseSet<const FunctionDecl *> TypeAwareOperatorNewAndDeletes;
415 mutable llvm::DenseMap<const CXXDestructorDecl *, FunctionDecl *>
416 OperatorDeletesForVirtualDtor;
417 mutable llvm::DenseMap<const CXXDestructorDecl *, FunctionDecl *>
418 GlobalOperatorDeletesForVirtualDtor;
419 mutable llvm::DenseMap<const CXXDestructorDecl *, FunctionDecl *>
420 ArrayOperatorDeletesForVirtualDtor;
421 mutable llvm::DenseMap<const CXXDestructorDecl *, FunctionDecl *>
422 GlobalArrayOperatorDeletesForVirtualDtor;
426 llvm::DenseSet<const CXXRecordDecl *> MaybeRequireVectorDeletingDtor;
434 unsigned NextStringLiteralVersion = 0;
438 mutable std::string CUIDHash;
442 class CanonicalTemplateTemplateParm :
public llvm::FoldingSetNode {
443 TemplateTemplateParmDecl *Parm;
446 CanonicalTemplateTemplateParm(TemplateTemplateParmDecl *Parm)
449 TemplateTemplateParmDecl *getParam()
const {
return Parm; }
451 void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &
C) {
452 Profile(ID,
C, Parm);
455 static void Profile(llvm::FoldingSetNodeID &ID,
457 TemplateTemplateParmDecl *Parm);
459 mutable llvm::ContextualFoldingSet<CanonicalTemplateTemplateParm,
461 CanonTemplateTemplateParms;
464 mutable TypedefDecl *Int128Decl =
nullptr;
467 mutable TypedefDecl *UInt128Decl =
nullptr;
471 mutable TypedefDecl *BuiltinVaListDecl =
nullptr;
474 mutable TypedefDecl *BuiltinMSVaListDecl =
nullptr;
477 mutable TypedefDecl *BuiltinZOSVaListDecl =
nullptr;
480 mutable TypedefDecl *ObjCIdDecl =
nullptr;
483 mutable TypedefDecl *ObjCSelDecl =
nullptr;
486 mutable TypedefDecl *ObjCClassDecl =
nullptr;
489 mutable ObjCInterfaceDecl *ObjCProtocolClassDecl =
nullptr;
492 mutable TypedefDecl *BOOLDecl =
nullptr;
496 QualType ObjCIdRedefinitionType;
497 QualType ObjCClassRedefinitionType;
498 QualType ObjCSelRedefinitionType;
501 mutable IdentifierInfo *BoolName =
nullptr;
504 mutable IdentifierInfo *NSObjectName =
nullptr;
507 IdentifierInfo *NSCopyingName =
nullptr;
509#define BuiltinTemplate(BTName) mutable IdentifierInfo *Name##BTName = nullptr;
510#include "clang/Basic/BuiltinTemplates.inc"
512 QualType ObjCConstantStringType;
513 mutable RecordDecl *CFConstantStringTagDecl =
nullptr;
514 mutable TypedefDecl *CFConstantStringTypeDecl =
nullptr;
516 mutable QualType ObjCSuperType;
518 QualType ObjCNSStringType;
521 TypedefDecl *ObjCInstanceTypeDecl =
nullptr;
524 TypeDecl *FILEDecl =
nullptr;
527 TypeDecl *jmp_bufDecl =
nullptr;
530 TypeDecl *sigjmp_bufDecl =
nullptr;
533 TypeDecl *ucontext_tDecl =
nullptr;
539 mutable RecordDecl *BlockDescriptorType =
nullptr;
545 mutable RecordDecl *BlockDescriptorExtendedType =
nullptr;
548 FunctionDecl *cudaConfigureCallDecl =
nullptr;
550 FunctionDecl *cudaGetParameterBufferDecl =
nullptr;
552 FunctionDecl *cudaLaunchDeviceDecl =
nullptr;
554 llvm::DenseMap<const CXXConstructorDecl *, ArrayRef<CXXDefaultArgExpr *>>
555 CtorClosureDefaultArgs;
561 llvm::SpecificBumpPtrAllocator<AttrVec> DeclAttrAllocator;
566 llvm::DenseMap<Decl*, Decl*> MergedDecls;
571 llvm::DenseMap<NamedDecl*, llvm::TinyPtrVector<Module*>> MergedDefModules;
577 struct PerModuleInitializers {
583 llvm::DenseMap<Module*, PerModuleInitializers*> ModuleInitializers;
586 Module *CurrentCXXNamedModule =
nullptr;
593 mutable llvm::StringMap<const Module *> PrimaryModuleNameMap;
594 mutable llvm::DenseMap<const Module *, const Module *> SameModuleLookupSet;
596 static constexpr unsigned ConstantArrayTypesLog2InitSize = 8;
597 static constexpr unsigned GeneralTypesLog2InitSize = 9;
598 static constexpr unsigned FunctionProtoTypesLog2InitSize = 12;
601 llvm::DenseMap<
const ObjCInterfaceDecl *,
602 SmallVector<const ObjCInterfaceDecl *, 4>>
606 mutable llvm::DenseMap<llvm::ScalableVecTyKey, QualType> ScalableVecTyMap;
613 llvm::PointerUnion<VarTemplateDecl *, MemberSpecializationInfo *>;
653 llvm::DenseMap<const VarDecl *, TemplateOrSpecializationInfo>
654 TemplateOrInstantiation;
679 llvm::DenseMap<NamedDecl *, NamedDecl *> InstantiatedFromUsingDecl;
688 llvm::DenseMap<UsingEnumDecl *, UsingEnumDecl *>
689 InstantiatedFromUsingEnumDecl;
692 llvm::DenseMap<UsingShadowDecl*, UsingShadowDecl*>
693 InstantiatedFromUsingShadowDecl;
695 llvm::DenseMap<FieldDecl *, FieldDecl *> InstantiatedFromUnnamedFieldDecl;
700 llvm::TinyPtrVector<ExplicitInstantiationDecl *>>
701 ExplicitInstantiations;
709 using CXXMethodVector = llvm::TinyPtrVector<const CXXMethodDecl *>;
710 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector> OverriddenMethods;
715 llvm::DenseMap<const DeclContext *, std::unique_ptr<MangleNumberingContext>>
716 MangleNumberingContexts;
717 llvm::DenseMap<const Decl *, std::unique_ptr<MangleNumberingContext>>
718 ExtraMangleNumberingContexts;
722 llvm::MapVector<const NamedDecl *, unsigned> MangleNumbers;
723 llvm::MapVector<const VarDecl *, unsigned> StaticLocalNumbers;
725 mutable llvm::DenseMap<const CXXRecordDecl *, unsigned>
726 DeviceLambdaManglingNumbers;
730 using ParameterIndexTable = llvm::DenseMap<const VarDecl *, unsigned>;
731 ParameterIndexTable ParamIndices;
736 llvm::DenseMap<std::pair<const Decl *, unsigned>,
CXXRecordDecl *>
737 LambdaDeclarationsForMerging;
743 std::optional<CXXRecordDeclRelocationInfo>
752 int IndexInContext) {
763 if (!isPointerAuthenticationAvailable())
765 return findPointerAuthContent(T) != PointerAuthContent::None;
774 if (!isPointerAuthenticationAvailable())
776 return findPointerAuthContent(T) != PointerAuthContent::None;
780 llvm::DenseMap<const CXXRecordDecl *, CXXRecordDeclRelocationInfo>
784 enum class PointerAuthContent :
uint8_t {
786 AddressDiscriminatedVTable,
787 AddressDiscriminatedData
791 bool isPointerAuthenticationAvailable()
const {
792 return LangOpts.PointerAuthCalls || LangOpts.PointerAuthIntrinsics;
794 PointerAuthContent findPointerAuthContent(QualType T)
const;
795 mutable llvm::DenseMap<const RecordDecl *, PointerAuthContent>
796 RecordContainsAddressDiscriminatedPointerAuth;
798 ImportDecl *FirstLocalImport =
nullptr;
799 ImportDecl *LastLocalImport =
nullptr;
801 TranslationUnitDecl *TUDecl =
nullptr;
802 mutable ExternCContextDecl *ExternCContext =
nullptr;
804#define BuiltinTemplate(BTName) \
805 mutable BuiltinTemplateDecl *Decl##BTName = nullptr;
806#include "clang/Basic/BuiltinTemplates.inc"
809 SourceManager &SourceMgr;
813 LangOptions &LangOpts;
817 std::unique_ptr<NoSanitizeList> NoSanitizeL;
821 std::unique_ptr<XRayFunctionFilter> XRayFilter;
825 std::unique_ptr<ProfileList> ProfList;
831 mutable llvm::BumpPtrAllocator BumpAlloc;
837 std::unique_ptr<CXXABI> ABI;
838 CXXABI *createCXXABI(
const TargetInfo &T);
842 bool AddrSpaceMapMangling;
845 mutable bool AnyFunctionEffects =
false;
847 const TargetInfo *Target =
nullptr;
848 const TargetInfo *AuxTarget =
nullptr;
849 mutable llvm::DenseMap<std::pair<llvm::StringRef, unsigned>,
850 std::unique_ptr<llvm::StringMap<bool>>>
852 clang::PrintingPolicy PrintingPolicy;
853 mutable std::unique_ptr<interp::Context> InterpContext;
854 std::unique_ptr<ParentMapContext> ParentMapCtx;
857 DeclListNode *ListNodeFreeList =
nullptr;
916 return PrintingPolicy;
920 PrintingPolicy = Policy;
936 void *
Allocate(
size_t Size,
unsigned Align = 8)
const {
937 return BumpAlloc.Allocate(Size, Align);
940 return static_cast<T *
>(
Allocate(
Num *
sizeof(T),
alignof(T)));
945 char *Buf =
new (*this)
char[S.size()];
947 return llvm::StringRef(Buf, S.size());
954 ListNodeFreeList = dyn_cast_if_present<DeclListNode *>(Alloc->Rest);
956 Alloc->Rest =
nullptr;
964 N->Rest = ListNodeFreeList;
965 ListNodeFreeList = N;
971 return BumpAlloc.getTotalMemory();
978 return DiagAllocator;
986 switch (CurrentBT->getKind()) {
987 case BuiltinType::Kind::Half:
988 case BuiltinType::Kind::Float16:
990 case BuiltinType::Kind::Float:
991 case BuiltinType::Kind::BFloat16:
993 case BuiltinType::Kind::Double:
1026 return LangOpts.CPlusPlus || LangOpts.RecoveryAST;
1061 llvm::PointerUnion<const Decl *, const MacroInfo *>;
1067 mutable llvm::DenseMap<RawCommentLookupKey, const RawComment *>
RawComments;
1105 const std::map<unsigned, RawComment *> &CommentsInFile)
const;
1123 const Decl **OriginalDecl =
nullptr)
const;
1147 std::optional<QualType>
1150 bool IsConditionalOperator);
1158 const Decl *D)
const;
1164 class import_iterator {
1171 using difference_type =
int;
1172 using iterator_category = std::forward_iterator_tag;
1174 import_iterator() =
default;
1175 explicit import_iterator(
ImportDecl *Import) : Import(Import) {}
1177 reference
operator*()
const {
return Import; }
1178 pointer operator->()
const {
return Import; }
1180 import_iterator &operator++() {
1185 import_iterator operator++(
int) {
1186 import_iterator
Other(*
this);
1191 friend bool operator==(import_iterator
X, import_iterator Y) {
1192 return X.Import == Y.Import;
1195 friend bool operator!=(import_iterator
X, import_iterator Y) {
1196 return X.Import != Y.Import;
1202 return CommentCommandTraits;
1269 llvm::iterator_range<overridden_cxx_method_iterator>;
1294 return Import->getNextLocalImport();
1300 return import_range(import_iterator(FirstLocalImport), import_iterator());
1308 MergedDecls[D] = Primary;
1314 bool NotifyListeners =
true);
1348 assert(TUDecl &&
"TUDecl might have been reset by 'cleanup' likely because "
1349 "'CodeGenOpts.ClearASTBeforeBackend' was set.");
1350 assert(TUDecl->getMostRecentDecl() == TUDecl &&
1351 "The active TU is not current one!");
1352 return TUDecl->getMostRecentDecl();
1357 if (TraversalScope.empty() || TraversalScope.back() == TUDecl)
1358 TraversalScope = {NewTUDecl};
1366#define BuiltinTemplate(BTName) BuiltinTemplateDecl *get##BTName##Decl() const;
1367#include "clang/Basic/BuiltinTemplates.inc"
1405#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
1406 CanQualType SingletonId;
1407#include "clang/Basic/OpenCLImageTypes.def"
1413#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
1415#include "clang/Basic/OpenCLExtensionTypes.def"
1416#define SVE_TYPE(Name, Id, SingletonId) \
1417 CanQualType SingletonId;
1418#include "clang/Basic/AArch64ACLETypes.def"
1419#define PPC_VECTOR_TYPE(Name, Id, Size) \
1421#include "clang/Basic/PPCTypes.def"
1422#define RVV_TYPE(Name, Id, SingletonId) \
1423 CanQualType SingletonId;
1424#include "clang/Basic/RISCVVTypes.def"
1425#define WASM_TYPE(Name, Id, SingletonId) CanQualType SingletonId;
1426#include "clang/Basic/WebAssemblyReferenceTypes.def"
1427#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) \
1428 CanQualType SingletonId;
1429#include "clang/Basic/AMDGPUTypes.def"
1430#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) CanQualType SingletonId;
1431#include "clang/Basic/HLSLIntangibleTypes.def"
1432#define HLSL_PACKED_TYPE(Name, Id, SingletonId) CanQualType SingletonId;
1433#include "clang/Basic/HLSLPackedTypes.def"
1434#define SPIRV_TYPE(Name, Id, SingletonId) CanQualType SingletonId;
1435#include "clang/Basic/SPIRVTypes.def"
1509 DeclVisibilityCallback = std::move(
Callback);
1592 bool allowOnPointerType =
false)
const;
1668 bool AsWritten =
false);
1796 cudaConfigureCallDecl = FD;
1800 return cudaConfigureCallDecl;
1804 cudaGetParameterBufferDecl = FD;
1808 return cudaGetParameterBufferDecl;
1823 bool &HasByrefExtendedLayout)
const;
1843 unsigned IndexTypeQuals)
const;
1852 unsigned IndexTypeQuals)
const;
1857 unsigned IndexTypeQuals)
const;
1863 unsigned IndexTypeQuals)
const;
1884 BuiltinVectorTypeInfo
1894 unsigned NumFields = 1)
const;
1932 QualType ElementType,
unsigned NumRows,
unsigned NumColumns,
1933 std::optional<MatrixType::LayoutKind> Layout = std::nullopt)
const;
1941 unsigned NumRows,
unsigned NumColumns,
1942 unsigned Use)
const;
1954 Expr *AddrSpaceExpr,
1968 return getFunctionTypeInternal(ResultTy, Args, EPI,
false);
1986 mutable llvm::DenseMap<QualType, llvm::SmallVector<BitInterval>>
1987 PaddingIntervalCache;
1992 bool OnlyWantCanonical)
const;
2022 std::optional<bool> TypeMatchesDeclOrNone = std::nullopt)
const;
2027 bool OwnsTag)
const;
2031 void addType(
Type *T)
const;
2036 const Type *CanonicalType)
const;
2040 bool OwnsTag,
bool IsInjected,
2041 const Type *CanonicalType,
2042 bool WithFoldingSetNode)
const;
2049 unsigned NumPositiveBits,
QualType &BestType,
2058 template <
typename RangeT>
2060 unsigned &NumPositiveBits) {
2061 NumNegativeBits = 0;
2062 NumPositiveBits = 0;
2063 bool MembersRepresentableByInt =
true;
2064 for (
auto *Elem : EnumConstants) {
2070 if (InitVal.isUnsigned() || InitVal.isNonNegative()) {
2073 unsigned ActiveBits = InitVal.getActiveBits();
2074 NumPositiveBits = std::max({NumPositiveBits, ActiveBits, 1u});
2077 std::max(NumNegativeBits, InitVal.getSignificantBits());
2087 if (!NumPositiveBits && !NumNegativeBits)
2088 NumPositiveBits = 1;
2090 return MembersRepresentableByInt;
2121 const HLSLAttributedResourceType::Attributes &Attrs);
2128 Decl *AssociatedDecl,
unsigned Index,
2132 unsigned Index,
bool Final,
2183 bool ExpectPackInType =
true)
const;
2191 unsigned NumProtocols)
const;
2196 bool isKindOf)
const;
2224 bool FullySubstituted =
false,
2230 UnaryTransformType::UTTKind UKind)
const;
2250 QualType DeducedAsType,
2328 if (CFConstantStringTypeDecl)
2331 CFConstantStringTypeDecl);
2341 return ObjCConstantStringType;
2345 return ObjCNSStringType;
2349 ObjCNSStringType = T;
2355 if (ObjCIdRedefinitionType.isNull())
2357 return ObjCIdRedefinitionType;
2362 ObjCIdRedefinitionType = RedefType;
2368 if (ObjCClassRedefinitionType.isNull())
2370 return ObjCClassRedefinitionType;
2375 ObjCClassRedefinitionType = RedefType;
2381 if (ObjCSelRedefinitionType.isNull())
2383 return ObjCSelRedefinitionType;
2388 ObjCSelRedefinitionType = RedefType;
2393 if (!NSObjectName) {
2394 NSObjectName = &
Idents.get(
"NSObject");
2397 return NSObjectName;
2402 if (!NSCopyingName) {
2403 NSCopyingName = &
Idents.get(
"NSCopying");
2406 return NSCopyingName;
2416 BoolName = &
Idents.get(
"bool");
2420#define BuiltinTemplate(BTName) \
2421 IdentifierInfo *get##BTName##Name() const { \
2422 if (!Name##BTName) \
2423 Name##BTName = &Idents.get(#BTName); \
2424 return Name##BTName; \
2426#include "clang/Basic/BuiltinTemplates.inc"
2446 std::nullopt, FILEDecl);
2452 this->jmp_bufDecl = jmp_bufDecl;
2459 std::nullopt, jmp_bufDecl);
2465 this->sigjmp_bufDecl = sigjmp_bufDecl;
2472 std::nullopt, sigjmp_bufDecl);
2478 this->ucontext_tDecl = ucontext_tDecl;
2485 std::nullopt, ucontext_tDecl);
2500 QualType *NotEncodedT=
nullptr)
const;
2510 std::string &S)
const;
2523 bool Extended =
false)
const;
2533 const Decl *Container)
const;
2540 const Decl *Container)
const;
2640 assert(
MSGuidTagDecl &&
"asked for GUID type but MS extensions disabled");
2684 return getExtQualType(Ptr, Qc);
2691 return getExtQualType(T, Qs);
2710 if (!
type.getTypePtr()->isObjCObjectPointerType() ||
2711 !
type.getQualifiers().hasObjCLifetime())
2721 assert(PointerAuth);
2742 bool TemplateKeyword,
2748 Decl *AssociatedDecl,
2753 Decl *AssociatedDecl,
2759 bool FullySubstituted =
false,
2769 DefaultArguments DefaultArgs)
const;
2790 bool &RequireICE,
bool AllowTypeModifiers)
const;
2798 unsigned *IntegerConstantArgs =
nullptr)
const;
2901 return std::nullopt;
2930 bool NeedsPreferredAlignment =
false)
const;
3033 bool Simple =
false)
const;
3105 bool CheckIfTriviallyCopyable =
true)
const;
3172 bool IsParam)
const {
3175 if (SubTnullability.has_value() == SuperTnullability.has_value()) {
3177 if (!SubTnullability)
3180 if (*SubTnullability == *SuperTnullability ||
3203 bool AllowPiMismatch =
true)
const;
3205 bool AllowPiMismatch =
true)
const;
3226 bool IsCXXMethod)
const;
3247 bool IgnoreDeduced =
false)
const;
3256 bool IgnoreDeduced =
false)
const;
3339 return dyn_cast_or_null<DependentSizedArrayType>(
getAsArrayType(T));
3438 bool AcceptDependent)
const;
3450 unsigned getIntegerRank(
const Type *T)
const;
3459 bool CompareUnqualified =
false);
3485 bool BlockReturnType);
3493 bool Unqualified =
false,
bool BlockReturnType =
false,
3494 bool IsConditionalOperator =
false);
3497 bool IsConditionalOperator =
false);
3499 bool OfBlockPointer =
false,
3502 bool OfBlockPointer=
false,
3530 bool &CanUseFirst,
bool &CanUseSecond,
3537 ObjCSubClasses[D].push_back(SubClass);
3590 if (Width != Res.getBitWidth())
3591 return Res.extOrTrunc(Width);
3607 return !ObjCImpls.empty();
3671 if (!std::is_trivially_destructible<T>::value) {
3672 auto DestroyPtr = [](
void *
V) {
static_cast<T *
>(
V)->~T(); };
3717 bool ForAuxTarget =
false)
const;
3726 return !TypeAwareOperatorNewAndDeletes.empty();
3790 const llvm::StringMap<bool> &
3876 class ObjCEncOptions {
3879 ObjCEncOptions(
unsigned Bits) : Bits(Bits) {}
3882 ObjCEncOptions() : Bits(0) {}
3884#define OPT_LIST(V) \
3885 V(ExpandPointedToStructures, 0) \
3886 V(ExpandStructures, 1) \
3887 V(IsOutermostType, 2) \
3888 V(EncodingProperty, 3) \
3889 V(IsStructField, 4) \
3890 V(EncodeBlockParameters, 5) \
3891 V(EncodeClassNames, 6) \
3893#define V(N,I) ObjCEncOptions& set##N() { Bits |= 1 << I; return *this; }
3897#define V(N,I) bool N() const { return Bits & 1 << I; }
3903 [[nodiscard]] ObjCEncOptions keepingOnly(ObjCEncOptions Mask)
const {
3904 return Bits & Mask.Bits;
3907 [[nodiscard]] ObjCEncOptions forComponentType()
const {
3908 ObjCEncOptions Mask = ObjCEncOptions()
3909 .setIsOutermostType()
3910 .setIsStructField();
3911 return Bits & ~Mask.Bits;
3916 void getObjCEncodingForTypeImpl(QualType t, std::string &S,
3917 ObjCEncOptions Options,
3918 const FieldDecl *Field,
3919 QualType *NotEncodedT =
nullptr)
const;
3922 void getObjCEncodingForStructureImpl(RecordDecl *RD, std::string &S,
3923 const FieldDecl *Field,
3924 bool includeVBases =
true,
3925 QualType *NotEncodedT=
nullptr)
const;
3930 QualType T, std::string& S,
3931 bool Extended)
const;
3973 using DeallocationFunctionsAndArguments =
3975 mutable DeallocationFunctionsAndArguments Deallocations;
3980 llvm::PointerIntPair<StoredDeclsMap *, 1> LastSDM;
3982 std::vector<Decl *> TraversalScope;
3984 std::unique_ptr<VTableContextBase> VTContext;
3986 void ReleaseDeclContextMaps();
4028 StringRef MangledName);
4055 llvm::DenseMap<GlobalDecl, llvm::StringSet<>> ThunksToBeAbbreviated;
4107 size_t Alignment ) {
4108 return C.Allocate(Bytes, Alignment);
4145 size_t Alignment ) {
4146 return C.Allocate(Bytes, Alignment);
4159template <>
struct llvm::DenseMapInfo<
llvm::FoldingSetNodeID> {
4161 return Val.computeHash();
4165 const FoldingSetNodeID &RHS) {
4169template <>
struct llvm::DenseMapInfo<
llvm::FoldingSetNodeIDRef> {
4171 return Val.computeHash();
4173 static bool isEqual(FoldingSetNodeIDRef LHS, FoldingSetNodeIDRef RHS) {
4177 return Val.computeHash();
4179 static bool isEqual(
const FoldingSetNodeID &LHS, FoldingSetNodeIDRef RHS) {
Forward declaration of all AST node types.
static bool CanThrow(Expr *E, ASTContext &Ctx)
clang::CharUnits operator*(clang::CharUnits::QuantityType Scale, clang::CharUnits CU)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Forward-declares types that need PointerLikeTypeTraits.
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream.
This file declares types used to describe SYCL kernels.
Defines the clang::SourceLocation class and associated facilities.
#define CXXABI(Name, Str)
Allows QualTypes to be sorted and hence used in maps and sets.
C Language Family Type Representation.
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
ASTContext(LangOptions &LOpts, SourceManager &SM, IdentifierTable &idents, SelectorTable &sels, Builtin::Context &builtins, TranslationUnitKind TUKind)
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.
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.
llvm::SmallPtrSet< const FunctionDecl *, 4 > CUDADeviceInvalidFuncs
Functions whose device body should be replaced with a trap stub.
QualType getBuiltinZOSVaListType() const
Retrieve the type of the __builtin_zos_va_list type.
LangAS getOpenCLTypeAddrSpace(const Type *T) const
Get address space for OpenCL type.
const llvm::StringMap< bool > & getFunctionFeatureMap(const FunctionDecl *FD) const
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.
QualType getParenType(QualType NamedType) const
size_t getSideTableAllocatedMemory() const
Return the total memory used for various side tables.
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
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.
QualType getBTFTagAttributedType(const BTFTypeTagAttr *BTFAttr, QualType Wrapped) const
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
static const Type * getCanonicalType(const Type *T)
unsigned getIntWidth(QualType T) const
CanQualType getCanonicalParamType(QualType T) const
Return the canonical parameter type corresponding to the specific potentially non-canonical one.
const FunctionType * adjustFunctionType(const FunctionType *Fn, FunctionType::ExtInfo EInfo)
Change the ExtInfo on a function type.
TemplateOrSpecializationInfo getTemplateOrSpecializationInfo(const VarDecl *Var)
InlineVariableDefinitionKind
@ Weak
Weak definition of inline variable.
@ Strong
Strong definition.
@ WeakUnknown
Weak for now, might become strong later in this TU.
bool dtorHasOperatorDelete(const CXXDestructorDecl *Dtor, OperatorDeleteKind K) const
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)
QualType getTypeDeclType(const UnresolvedUsingTypenameDecl *) const =delete
TypedefDecl * getCFConstantStringDecl() const
CanQualType SatUnsignedFractTy
CanQualType getAdjustedType(CanQualType Orig, CanQualType New) 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...
QualType getConstantMatrixType(QualType ElementType, unsigned NumRows, unsigned NumColumns, std::optional< MatrixType::LayoutKind > Layout=std::nullopt) const
Return the unique reference to the matrix type of the specified element type and size.
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 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)
Deallocates a DeclListNode by returning it to the ListNodeFreeList pool.
unsigned NumTopLevelStmtDecls
Ordinal for the next TopLevelStmtDecl; counts created and loaded ones.
DeclListNode * AllocateDeclListNode(clang::NamedDecl *ND)
Allocates a DeclListNode or returns one from the ListNodeFreeList pool.
QualType adjustFunctionResultType(QualType FunctionType, QualType NewResultType)
Change the result type of a function type, preserving sugar such as attributed types.
void setTemplateOrSpecializationInfo(VarDecl *Inst, TemplateOrSpecializationInfo TSI)
bool isTypeAwareOperatorNewOrDelete(const FunctionDecl *FD) const
bool ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto, ObjCProtocolDecl *rProto) const
ProtocolCompatibleWithProtocol - return 'true' if 'lProto' is in the inheritance hierarchy of 'rProto...
TypedefDecl * buildImplicitTypedef(QualType T, StringRef Name) const
Create a new implicit TU-level typedef declaration.
unsigned getTypeAlign(const Type *T) const
QualType getCanonicalTemplateSpecializationType(ElaboratedTypeKeyword Keyword, TemplateName T, ArrayRef< TemplateArgument > CanonicalArgs) 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 getAutoType(DeducedKind DK, QualType DeducedAsType, AutoTypeKeyword Keyword, TemplateName TypeConstraintConcept=TemplateName(), ArrayRef< TemplateArgument > TypeConstraintArgs={}) const
C++11 deduced auto type.
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.
static CanQualType getCanonicalType(QualType T)
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
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
bool containsNonRelocatablePointerAuth(QualType T)
Examines a given type, and returns whether the type itself or any data it transitively contains has a...
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.
const TemplateArgument * getDefaultTemplateArgumentOrNone(const NamedDecl *P) const
Return the default argument of a template parameter, if one exists.
QualType getAttributedType(attr::Kind attrKind, QualType modifiedType, QualType equivalentType, const Attr *attr=nullptr) const
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.
std::unique_ptr< MangleNumberingContext > createMangleNumberingContext() const
ArrayRef< CXXDefaultArgExpr * > getCtorClosureDefaultArgs(const CXXConstructorDecl *CD)
QualType getUnsignedPointerDiffType() const
Return the unique unsigned counterpart of "ptrdiff_t" integer type.
QualType getucontext_tType() const
Retrieve the C ucontext_t type.
void setDeclVisibilityCallback(std::function< bool(const NamedDecl *)> Callback)
Set the callback that isDeclVisible() uses for declarations that are not unconditionally visible.
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.
TemplateName getPackIndexingTemplateName(TemplateName Pattern, Expr *IndexExpr, bool FullySubstituted=false, ArrayRef< TemplateName > Expansions={}) const
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.
RawComment * getRawCommentNoCache(RawCommentLookupKey Key) const
Return the documentation comment attached to a given declaration or macro, without looking into cache...
QualType getRealTypeForBitwidth(unsigned DestWidth, FloatModeKind ExplicitType) const
getRealTypeForBitwidth - sets floating point QualTy according to specified bitwidth.
ArrayRef< Decl * > getTraversalScope() const
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 getSubstBuiltinTemplatePack(const TemplateArgument &ArgPack)
QualType getCorrespondingSignedFixedPointType(QualType Ty) const
IntrusiveRefCntPtr< ExternalASTSource > ExternalSource
QualType getArrayParameterType(QualType Ty) const
Return the uniqued reference to a specified array parameter type from the original array type.
QualType getCountAttributedType(QualType T, Expr *CountExpr, bool CountInBytes, bool OrNull, ArrayRef< TypeCoupledDeclRefInfo > DependentDecls) const
void setObjCIdRedefinitionType(QualType RedefType)
Set the user-written type that redefines id.
bool isObjCIdType(QualType T) const
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.
friend class IncrementalParser
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 propertyTypesAreCompatible(QualType, QualType)
void setInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst, UsingShadowDecl *Pattern)
QualType getCooperativeMatrixType(QualType ElementType, unsigned Scope, unsigned NumRows, unsigned NumColumns, unsigned Use) const
Return the unique reference to the cooperative matrix type of the specified element type and size.
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.
OpenCLTypeKind getOpenCLTypeKind(const Type *T) const
Map an AST Type to an OpenCLTypeKind enum value.
FunctionDecl * getcudaGetParameterBufferDecl()
TemplateName getDependentTemplateName(const DependentTemplateStorage &Name) const
Retrieve the template name that represents a dependent template name such as MetaFun::template operat...
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 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.
TemplateName getCanonicalTemplateName(TemplateName Name, bool IgnoreDeduced=false) const
Retrieves the "canonical" template name that refers to a given template.
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...
void setRelocationInfoForCXXRecord(const CXXRecordDecl *, CXXRecordDeclRelocationInfo)
QualType getSubstTemplateTypeParmType(QualType Replacement, Decl *AssociatedDecl, unsigned Index, UnsignedOrNone PackIndex, bool Final) const
Retrieve a substitution-result type.
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
bool defaultsToMsStruct() const
Return whether unannotated records are treated as if they have [[gnu::ms_struct]].
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...
void completeCountAttributedType(CountAttributedType *CATy, Expr *CountExpr, ArrayRef< TypeCoupledDeclRefInfo > DependentDecls) const
Supply the count expression and coupled declarations for a type created by getIncompleteCountAttribut...
CanQualType UnsignedLongFractTy
QualType mergeTagDefinitions(QualType, QualType)
void setClassMaybeNeedsVectorDeletingDestructor(const CXXRecordDecl *RD)
overridden_method_range overridden_methods(const CXXMethodDecl *Method) const
void setIsTypeAwareOperatorNewOrDelete(const FunctionDecl *FD, bool IsTypeAware)
bool hasSeenTypeAwareOperatorNewOrDelete() 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.
bool QIdProtocolsAdoptObjCObjectProtocols(QualType QT, ObjCInterfaceDecl *IDecl)
QIdProtocolsAdoptObjCObjectProtocols - Checks that protocols in QT's qualified-id protocol list adopt...
FunctionProtoType::ExceptionSpecInfo mergeExceptionSpecs(FunctionProtoType::ExceptionSpecInfo ESI1, FunctionProtoType::ExceptionSpecInfo ESI2, SmallVectorImpl< QualType > &ExceptionTypeStorage, bool AcceptDependent) const
llvm::PointerUnion< const Decl *, const MacroInfo * > RawCommentLookupKey
Key used to look up the raw comment attached to a declaration or macro.
void addLazyModuleInitializers(Module *M, ArrayRef< GlobalDeclID > IDs)
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...
bool BlockRequiresCopying(QualType Ty, const VarDecl *D)
Returns true iff we need copy/dispose helpers for the given type.
QualType getTypeDeclType(const TypeAliasDecl *) const =delete
QualType getUsingType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const UsingShadowDecl *D, QualType UnderlyingType=QualType()) const
std::optional< QualType > tryMergeOverflowBehaviorTypes(QualType LHS, QualType RHS, bool OfBlockPointer, bool Unqualified, bool BlockReturnType, bool IsConditionalOperator)
Attempts to merge two types that may be OverflowBehaviorTypes.
CanQualType OMPIteratorTy
Builtin::Context & BuiltinInfo
bool computeEnumBits(RangeT EnumConstants, unsigned &NumNegativeBits, unsigned &NumPositiveBits)
Compute NumNegativeBits and NumPositiveBits for an enum based on the constant values of its enumerato...
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.
bool containsAddressDiscriminatedPointerAuth(QualType T) const
Examines a given type, and returns whether the type itself is address discriminated,...
QualType getFunctionTypeWithoutPtrSizes(QualType T)
Get a function type and produce the equivalent function type where pointer size address spaces in the...
uint64_t lookupFieldBitOffset(const ObjCInterfaceDecl *OID, const ObjCIvarDecl *Ivar) const
Get the offset of an ObjCIvarDecl in bits.
CanQualType getLogicalOperationType() const
The result type of logical operations, '<', '>', '!=', etc.
SelectorTable & Selectors
bool isTypeIgnoredBySanitizer(const SanitizerMask &Mask, const QualType &Ty) const
Check if a type can have its sanitizer instrumentation elided based on its presence within an ignorel...
unsigned getMinGlobalAlignOfVar(uint64_t Size, const VarDecl *VD) const
Return the minimum alignment as specified by the target.
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 getLateParsedAttrType(QualType Wrapped, LateParsedTypeAttribute *LateParsedAttr) const
Return a placeholder type for a late-parsed type attribute.
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...
llvm::ArrayRef< BitInterval > getPaddingIntervals(QualType Ty) const
void setObjCSuperType(QualType ST)
TagDecl * MSTypeInfoTagDecl
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.
CallingConv getDefaultCallingConvention(bool IsVariadic, bool IsCXXMethod) const
Retrieves the default calling convention for the current context.
bool canBindObjCObjectType(QualType To, QualType From)
unsigned getNextStringLiteralVersion()
Return the next version number to be used for a string literal evaluated as part of constant evaluati...
TemplateTemplateParmDecl * insertCanonicalTemplateTemplateParmDeclInternal(TemplateTemplateParmDecl *CanonTTP) const
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...
QualType getObjCInstanceType()
Retrieve the Objective-C "instancetype" type.
QualType getDependentNameType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier NNS, const IdentifierInfo *Name) const
Qualifiers::GC getObjCGCAttrKind(QualType Ty) const
Return one of the GCNone, Weak or Strong Objective-C garbage collection attributes.
PartialDiagnostic::DiagStorageAllocator & getDiagAllocator()
static bool hasSameType(const Type *T1, const Type *T2)
void setASTMutationListener(ASTMutationListener *Listener)
Attach an AST mutation listener to the AST context.
static bool hasLayout(const RecordDecl *D)
Whether layout (offset and size) information can be queried for D.
bool hasUniqueObjectRepresentations(QualType Ty, bool CheckIfTriviallyCopyable=true) const
Return true if the specified type has unique object representations according to (C++17 [meta....
const QualType GetHigherPrecisionFPType(QualType ElementType) const
CanQualType getCanonicalSizeType() const
bool typesAreBlockPointerCompatible(QualType, QualType)
CanQualType SatUnsignedAccumTy
bool useAbbreviatedThunkName(GlobalDecl VirtualMethodDecl, StringRef MangledName)
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.
llvm::SetVector< const VarDecl * > CUDADeviceVarODRUsedByHost
Keep track of CUDA/HIP device-side variables ODR-used by host code.
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...
CanQualType ArraySectionTy
CanQualType ObjCBuiltinIdTy
overridden_cxx_method_iterator overridden_methods_end(const CXXMethodDecl *Method) const
VTableContextBase * getVTableContext()
void setBOOLDecl(TypedefDecl *TD)
Save declaration of 'BOOL' typedef.
llvm::SetVector< const ValueDecl * > CUDAExternalDeviceDeclODRUsedByHost
Keep track of CUDA/HIP external kernels or device variables ODR-used by host code.
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
PointerAuthQualifier getObjCMemberSelTypePtrAuth()
void setcudaLaunchDeviceDecl(FunctionDecl *FD)
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)
friend class ASTDeclReader
QualType getCFConstantStringType() const
Return the C structure type used to represent constant CFStrings.
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.
std::string getObjCEncodingForFunctionDecl(const FunctionDecl *Decl) const
Emit the encoded type for the function Decl into S.
TypeSourceInfo * getTemplateSpecializationTypeInfo(ElaboratedTypeKeyword Keyword, SourceLocation ElaboratedKeywordLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKeywordLoc, TemplateName T, SourceLocation TLoc, const TemplateArgumentListInfo &SpecifiedArgs, ArrayRef< TemplateArgument > CanonicalArgs, QualType Canon=QualType()) const
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.
TemplateTemplateParmDecl * findCanonicalTemplateTemplateParmDeclInternal(TemplateTemplateParmDecl *TTP) const
const TargetInfo * getAuxTargetInfo() const
CanQualType ObjCBuiltinClassTy
unsigned NumImplicitDefaultConstructorsDeclared
The number of implicitly-declared default constructors for which declarations were built.
CanQualType UnresolvedTemplateTy
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.
friend class CXXRecordDecl
CanQualType UnsignedLongTy
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,...
bool computeBestEnumTypes(bool IsPacked, unsigned NumNegativeBits, unsigned NumPositiveBits, QualType &BestType, QualType &BestPromotionType)
Compute BestType and BestPromotionType for an enum based on the highest number of negative and positi...
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,...
QualType adjustType(QualType OldType, llvm::function_ref< QualType(QualType)> Adjust) const
Rebuild a type, preserving any existing type sugar.
void addedLocalImportDecl(ImportDecl *Import)
Notify the AST context that a new import declaration has been parsed or implicitly created within thi...
bool hasAnyFunctionEffects() const
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.
RawComment * getRawCommentNoCacheImpl(RawCommentLookupKey Key, const SourceLocation RepresentativeLoc, const std::map< unsigned, RawComment * > &CommentsInFile) const
CountAttributedType * getIncompleteCountAttributedType(QualType WrappedTy, bool CountInBytes, bool OrNull) const
Return a CountAttributedType whose count expression has not been parsed yet, for use by a late-parsed...
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 arePFPFieldsTriviallyCopyable(const RecordDecl *RD) const
Returns whether this record's PFP fields (if any) are trivially copyable (i.e.
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.
QualType getSubstTemplateTypeParmPackType(Decl *AssociatedDecl, unsigned Index, bool Final, const TemplateArgument &ArgPack)
llvm::DenseMap< const CXXMethodDecl *, CXXCastPath > LambdaCastPaths
For capturing lambdas with an explicit object parameter whose type is derived from the lambda type,...
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 ...
bool hasSameFunctionTypeIgnoringParamABI(QualType T, QualType U) const
Determine if two function types are the same, ignoring parameter ABI annotations.
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.
QualType getHLSLInlineSpirvType(uint32_t Opcode, uint32_t Size, uint32_t Alignment, ArrayRef< SpirvOperand > Operands)
unsigned NumImplicitMoveConstructorsDeclared
The number of implicitly-declared move constructors for which declarations were built.
bool isInSameModule(const Module *M1, const Module *M2) const
If the two module M1 and M2 are in the same module.
unsigned NumImplicitCopyConstructorsDeclared
The number of implicitly-declared copy constructors for which declarations were built.
QualType getLeastIntTypeForBitwidth(unsigned DestWidth, unsigned Signed) const
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
MangleContext * cudaNVInitDeviceMC()
unsigned getAlignOfGlobalVar(QualType T, const VarDecl *VD) const
Return the alignment in bits that should be given to a global variable with type T.
bool areCompatibleOverflowBehaviorTypes(QualType LHS, QualType RHS)
Return true if two OverflowBehaviorTypes are compatible for assignment.
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.
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 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 getPredefinedSugarType(PredefinedSugarType::Kind KD) 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.
interp::Context & getInterpContext() const
Returns the clang bytecode interpreter context.
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.
TemplateTemplateParmDecl * getCanonicalTemplateTemplateParmDecl(TemplateTemplateParmDecl *TTP) const
Canonicalize the given TemplateTemplateParmDecl.
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.
bool hasPFPFields(QualType Ty) const
const clang::PrintingPolicy & getPrintingPolicy() const
void ResetObjCLayout(const ObjCInterfaceDecl *D)
ArrayRef< Module * > getModulesWithMergedDefinition(const NamedDecl *Def)
Get the additional modules in which the definition Def has been merged.
static ImportDecl * getNextLocalImport(ImportDecl *Import)
void setCtorClosureDefaultArgs(const CXXConstructorDecl *CD, ArrayRef< CXXDefaultArgExpr * > Args)
llvm::FixedPointSemantics getFixedPointSemantics(QualType Ty) const
CanQualType SatUnsignedShortAccumTy
QualType mergeTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false, bool BlockReturnType=false, bool IsConditionalOperator=false)
CharUnits getAlignOfGlobalVarInChars(QualType T, const VarDecl *VD) const
Return the alignment in characters that should be given to a global variable with type T.
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists.
QualType getPackIndexingType(QualType Pattern, Expr *IndexExpr, bool FullySubstituted=false, ArrayRef< QualType > Expansions={}, UnsignedOrNone Index=std::nullopt) const
static bool isObjCNSObjectType(QualType Ty)
Return true if this is an NSObject object with its NSObject attribute set.
GVALinkage GetGVALinkageForVariable(const VarDecl *VD) const
llvm::PointerUnion< VarTemplateDecl *, MemberSpecializationInfo * > TemplateOrSpecializationInfo
A type synonym for the TemplateOrInstantiation mapping.
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 getVariableArrayType(QualType EltTy, Expr *NumElts, ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return a non-unique reference to the type for a variable array of the specified element type.
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".
QualType getFunctionTypeWithoutParamABIs(QualType T) const
Get or construct a function type that is equivalent to the input type except that the parameter ABI a...
QualType getCorrespondingUnsaturatedType(QualType Ty) const
comments::FullComment * getCommentForDecl(const Decl *D, const Preprocessor *PP) const
Return parsed documentation comment attached to a given declaration.
TemplateArgument getInjectedTemplateArg(NamedDecl *ParamDecl) const
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.
llvm::DenseMap< CanQualType, SYCLKernelInfo > SYCLKernels
Map of SYCL kernels indexed by the unique type used to name the kernel.
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.
QualType getTypeDeclType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TypeDecl *Decl) const
bool isDestroyingOperatorDelete(const FunctionDecl *FD) const
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.
llvm::iterator_range< overridden_cxx_method_iterator > overridden_method_range
unsigned NumImplicitMoveAssignmentOperatorsDeclared
The number of implicitly-declared move assignment operators for which declarations were built.
void setManglingNumber(const NamedDecl *ND, unsigned Number)
TypedefDecl * getBuiltinVaListDecl() const
Retrieve the C type declaration corresponding to the predefined __builtin_va_list type.
TypeInfo getTypeInfo(QualType T) const
CanQualType getCanonicalTypeDeclType(const TypeDecl *TD) const
QualType getPackExpansionType(QualType Pattern, UnsignedOrNone NumExpansions, bool ExpectPackInType=true) const
Form a pack expansion type with the given pattern.
CanQualType UnsignedCharTy
CanQualType UnsignedShortFractTy
BuiltinTemplateDecl * buildBuiltinTemplateDecl(BuiltinTemplateKind BTK, const IdentifierInfo *II) const
void * Allocate(size_t Size, unsigned Align=8) const
ArrayRef< ExplicitInstantiationDecl * > getExplicitInstantiationDecls(const NamedDecl *Spec) const
Get all ExplicitInstantiationDecls for a given specialization.
bool canBuiltinBeRedeclared(const FunctionDecl *) const
Return whether a declaration to a builtin is allowed to be overloaded/redeclared.
CanQualType UnsignedIntTy
unsigned NumImplicitMoveConstructors
The number of implicitly-declared move constructors.
QualType getTypedefType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TypedefNameDecl *Decl, QualType UnderlyingType=QualType(), std::optional< bool > TypeMatchesDeclOrNone=std::nullopt) const
Return the unique reference to the type for the specified typedef-name decl.
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...
static bool isPFPField(const FieldDecl *Field)
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.
QualType getTemplateSpecializationType(ElaboratedTypeKeyword Keyword, TemplateName T, ArrayRef< TemplateArgument > SpecifiedArgs, ArrayRef< TemplateArgument > CanonicalArgs, QualType Underlying=QualType()) const
TypeSourceInfo * CreateTypeSourceInfo(QualType T, unsigned Size=0) const
Allocate an uninitialized TypeSourceInfo.
TagDecl * getMSTypeInfoTagDecl() const
Retrieve the implicitly-predeclared 'struct type_info' declaration.
TemplateName getQualifiedTemplateName(NestedNameSpecifier Qualifier, bool TemplateKeyword, TemplateName Template) const
Retrieve the template name that represents a qualified template name such as std::vector.
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.
bool isSameAssociatedConstraint(const AssociatedConstraint &ACX, const AssociatedConstraint &ACY) const
Determine whether two 'requires' expressions are similar enough that they may be used in re-declarati...
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 ...
FieldDecl * getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field) const
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.
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...
void registerSYCLEntryPointFunction(FunctionDecl *FD)
Generates and stores SYCL kernel metadata for the provided SYCL kernel entry point function.
QualType getTypeDeclType(const TagDecl *) const =delete
Use the normal 'getFooBarType' constructors to obtain these types.
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
FunctionDecl * getOperatorDeleteForVDtor(const CXXDestructorDecl *Dtor, OperatorDeleteKind K) const
AttrVec * allocateAttrVec()
Allocate an empty attribute vector with the lifetime of this context.
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...
void UnwrapSimilarArrayTypes(QualType &T1, QualType &T2, bool AllowPiMismatch=true) const
Attempt to unwrap two types that may both be array types with the same bound (or both be array types ...
QualType getObjCConstantStringInterface() const
bool isRepresentableIntegerValue(llvm::APSInt &Value, QualType T)
Determine whether the given integral value is representable within the given type T.
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.
llvm::DenseMap< RawCommentLookupKey, const RawComment * > RawComments
Mapping from declaration or macro to directly attached comment.
const SYCLKernelInfo & getSYCLKernelInfo(QualType T) const
Given a type used as a SYCL kernel name, returns a reference to the metadata generated from the corre...
bool canAssignObjCInterfacesInBlockPointer(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT, bool BlockReturnType)
canAssignObjCInterfacesInBlockPointer - This routine is specifically written for providing type-safet...
CanQualType SatUnsignedLongFractTy
QualType getMemberPointerType(QualType T, NestedNameSpecifier Qualifier, const CXXRecordDecl *Cls) const
Return the uniqued reference to the type for a member pointer to the specified type in the specified ...
void setcudaConfigureCallDecl(FunctionDecl *FD)
CanQualType getDecayedType(CanQualType T) const
static bool hasSameType(QualType T1, QualType T2)
Determine whether the given types T1 and T2 are equivalent.
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
QualType getTagType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TagDecl *TD, bool OwnsTag) const
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.
CanQualType getMSGuidType() const
Retrieve the implicitly-predeclared 'struct _GUID' type.
const VariableArrayType * getAsVariableArrayType(QualType T) const
QualType getUnaryTransformType(QualType BaseType, QualType UnderlyingType, UnaryTransformType::UTTKind UKind) const
Unary type transforms.
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...
CanQualType getCanonicalUnresolvedUsingType(const UnresolvedUsingTypenameDecl *D) const
bool hasSimilarType(QualType T1, QualType T2) const
Determine if two types are similar, according to the C++ rules.
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.
void setObjCClassRedefinitionType(QualType RedefType)
Set the user-written type that redefines 'SEL'.
bool classMaybeNeedsVectorDeletingDestructor(const CXXRecordDecl *RD)
QualType getTemplateTypeParmType(int Depth, int 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 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)
void deduplicateMergedDefinitionsFor(NamedDecl *ND)
Clean up the merged definition list.
FunctionDecl * getcudaConfigureCallDecl()
static uint64_t getConstantArrayElementCount(const ConstantArrayType *CA)
Return number of (potentially nested) constant array elements.
bool isDeclVisible(const NamedDecl *D) const
DiagnosticsEngine & getDiagnostics() const
llvm::StringRef backupStr(llvm::StringRef S) const
QualType getAdjustedParameterType(QualType T) const
Perform adjustment on the parameter type of a function.
const SmallVectorImpl< Type * > & getRecordTypes() const
Retrieve all RecordType and InjectedClassNameType nodes created so far, in creation order.
QualType getUnqualifiedObjCPointerType(QualType type) const
getUnqualifiedObjCPointerType - Returns version of Objective-C pointer type with lifetime qualifier r...
void recordOffsetOfEvaluation(const OffsetOfExpr *E)
QualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
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.
QualType getUnresolvedUsingType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const UnresolvedUsingTypenameDecl *D) const
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
bool hasSameTemplateName(const TemplateName &X, const TemplateName &Y, bool IgnoreDeduced=false) const
Determine whether the given template names refer to the same template.
CanQualType SatLongFractTy
const TargetInfo & getTargetInfo() const
void setInstantiatedFromUnnamedFieldDecl(FieldDecl *Inst, FieldDecl *Tmpl)
OBTAssignResult checkOBTAssignmentCompatibility(QualType LHS, QualType RHS)
Check overflow behavior type compatibility for assignments.
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.
static uint64_t getArrayInitLoopExprElementCount(const ArrayInitLoopExpr *AILE)
Return number of elements initialized in a (potentially nested) ArrayInitLoopExpr.
void addExplicitInstantiationDecl(const NamedDecl *Spec, ExplicitInstantiationDecl *EID)
Add an ExplicitInstantiationDecl for a given specialization.
QualType getOverflowBehaviorType(const OverflowBehaviorAttr *Attr, QualType Wrapped) const
CanQualType IncompleteMatrixIdxTy
std::optional< CharUnits > getTypeSizeInCharsIfKnown(QualType Ty) const
CXXRecordDecl *& getLambdaDeclarationSlotForMerging(const Decl *ContextDecl, int IndexInContext)
friend class DeclarationNameTable
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
bool shouldEmitCUDADecl(const ValueDecl *D) const
Determines if the global variable or function D is emitted on the side of the CUDA/HIP compilation,...
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.
QualType getHLSLAttributedResourceType(QualType Wrapped, QualType Contained, const HLSLAttributedResourceType::Attributes &Attrs)
void addDestruction(T *Ptr) const
If T isn't trivially destructible, calls AddDeallocation to register it for destruction.
bool UnwrapSimilarTypes(QualType &T1, QualType &T2, bool AllowPiMismatch=true) const
Attempt to unwrap two types that may be similar (C++ [conv.qual]).
IntrusiveRefCntPtr< ExternalASTSource > getExternalSourcePtr() const
Retrieve a pointer to the external AST source associated with this AST context, if any.
QualType getAddrSpaceQualType(QualType T, LangAS AddressSpace) const
Return the uniqued reference to the type for an address space qualified type with the specified type ...
QualType getSignedSizeType() const
Return the unique signed counterpart of the integer type corresponding to size_t.
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any.
void setcudaGetParameterBufferDecl(FunctionDecl *FD)
CanQualType SatUnsignedLongAccumTy
QualType getUnconstrainedType(QualType T) const
Remove any type constraints from a template parameter type, for equivalence comparison of template pa...
CanQualType getCanonicalTagType(const TagDecl *TD) const
bool isSameTemplateArgument(const TemplateArgument &Arg1, const TemplateArgument &Arg2) const
Determine whether the given template arguments Arg1 and Arg2 are equivalent.
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.
unsigned getTargetAddressSpace(LangAS AS) const
ParentMapContext & getParentMapContext()
Returns the dynamic AST node parent map context.
std::vector< PFPField > findPFPFields(QualType Ty) const
Returns a list of PFP fields for the given type, including subfields in bases or other fields,...
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...
QualType getDependentSizedArrayType(QualType EltTy, Expr *NumElts, ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return a non-unique reference to the type for a dependently-sized array of the specified element type...
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.
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 getPointerAuthType(QualType Ty, PointerAuthQualifier PointerAuth)
Return a type with the given __ptrauth qualifier.
QualType getDecltypeType(Expr *e, QualType UnderlyingType) const
C++11 decltype.
std::optional< CXXRecordDeclRelocationInfo > getRelocationInfoForCXXRecord(const CXXRecordDecl *) const
static bool hasSameUnqualifiedType(QualType T1, QualType T2)
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
InlineVariableDefinitionKind getInlineVariableDefinitionKind(const VarDecl *VD) const
Determine whether a definition of this inline variable should be treated as a weak or strong definiti...
const RawComment * getRawCommentForAnyRedecl(RawCommentLookupKey Key, const Decl **OriginalDecl=nullptr) const
Return the documentation comment attached to a given declaration or macro.
void setPrimaryMergedDecl(Decl *D, Decl *Primary)
TemplateName getSubstTemplateTemplateParm(TemplateName replacement, Decl *AssociatedDecl, unsigned Index, UnsignedOrNone PackIndex, bool Final) const
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'.
CharUnits getOffsetOfBaseWithVBPtr(const CXXRecordDecl *RD) const
Loading virtual member pointers using the virtual inheritance model always results in an adjustment u...
LangAS getLangASForBuiltinAddressSpace(unsigned AS) const
bool hasSameFunctionTypeIgnoringPtrSizes(QualType T, QualType U)
Determine whether two function types are the same, ignoring pointer sizes in the return type and para...
void addOperatorDeleteForVDtor(const CXXDestructorDecl *Dtor, FunctionDecl *OperatorDelete, OperatorDeleteKind K) const
unsigned char getFixedPointScale(QualType Ty) const
QualType getIncompleteArrayType(QualType EltTy, ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return a unique reference to the type for an incomplete array of the specified element type.
QualType getDependentSizedExtVectorType(QualType VectorType, Expr *SizeExpr, SourceLocation AttrLoc) const
QualType DecodeTypeStr(const char *&Str, const ASTContext &Context, ASTContext::GetBuiltinTypeError &Error, bool &RequireICE, bool AllowTypeModifiers) const
void addObjCSubClass(const ObjCInterfaceDecl *D, const ObjCInterfaceDecl *SubClass)
TemplateName getAssumedTemplateName(DeclarationName Name) const
Retrieve a template name representing an unqualified-id that has been assumed to name a template for ...
@ GE_Missing_stdio
Missing a type from <stdio.h>
@ GE_Missing_type
Missing a type.
@ GE_Missing_ucontext
Missing a type from <ucontext.h>
@ GE_Missing_setjmp
Missing a type from <setjmp.h>
QualType adjustStringLiteralBaseType(QualType StrLTy) const
uint16_t getPointerAuthTypeDiscriminator(QualType T)
Return the "other" type-specific discriminator for the given type.
llvm::SetVector< const FieldDecl * > PFPFieldsWithEvaluatedOffset
uint16_t getPointerAuthVTablePointerDiscriminator(const CXXRecordDecl *RD, bool IsVTTEntry)
Return the "other" discriminator used for the pointer auth schema used for vtable pointers using the ...
bool canonicalizeTemplateArguments(MutableArrayRef< TemplateArgument > Args) const
Canonicalize the given template argument list.
QualType getTypeOfExprType(Expr *E, TypeOfKind Kind) const
C23 feature and GCC extension.
QualType getMatrixTypeWithLayout(QualType T, MatrixType::LayoutKind Layout) const
bool isUnaryOverflowPatternExcluded(const UnaryOperator *UO)
QualType getSignedWCharType() const
Return the type of "signed wchar_t".
QualType getUnqualifiedArrayType(QualType T, Qualifiers &Quals) const
Return this type as a completely-unqualified array type, capturing the qualifiers in Quals.
QualType getTypeDeclType(const TypedefDecl *) const =delete
bool hasCvrSimilarType(QualType T1, QualType T2)
Determine if two types are similar, ignoring only CVR qualifiers.
TemplateName getDeducedTemplateName(TemplateName Underlying, DefaultArguments DefaultArgs) const
Represents a TemplateName which had some of its default arguments deduced.
ObjCImplementationDecl * getObjCImplementation(ObjCInterfaceDecl *D)
Get the implementation of the ObjCInterfaceDecl D, or nullptr if none exists.
CanQualType UnsignedAccumTy
void setObjCMethodRedeclaration(const ObjCMethodDecl *MD, const ObjCMethodDecl *Redecl)
void addTypedefNameForUnnamedTagDecl(TagDecl *TD, TypedefNameDecl *TND)
bool isDependenceAllowed() const
QualType getWIntType() const
In C99, this returns a type compatible with the type defined in <stddef.h> as defined by the target.
const CXXRecordDecl * baseForVTableAuthentication(const CXXRecordDecl *ThisClass) const
Resolve the root record to be used to derive the vtable pointer authentication policy for the specifi...
void cacheRawComment(RawCommentLookupKey Original, const RawComment &Comment) const
Attaches Comment to Original (a declaration or macro), and to its redeclaration chain when Original i...
QualType getVariableArrayDecayedType(QualType Ty) const
Returns a vla type where known sizes are replaced with [*].
void setCFConstantStringType(QualType T)
const SYCLKernelInfo * findSYCLKernelInfo(QualType T) const
Returns a pointer to the metadata generated from the corresponding SYCLkernel entry point if the prov...
ASTContext & operator=(const ASTContext &)=delete
Module * getCurrentNamedModule() const
Get module under construction, nullptr if this is not a C++20 module.
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 getCommonSugaredType(QualType X, QualType Y, bool Unqualified=false) const
void setPrintingPolicy(const clang::PrintingPolicy &Policy)
void AddDeallocation(void(*Callback)(void *), void *Data) const
Add a deallocation callback that will be invoked when the ASTContext is destroyed.
QualType getDeducedTemplateSpecializationType(DeducedKind DK, QualType DeducedAsType, ElaboratedTypeKeyword Keyword, TemplateName Template) const
C++17 deduced class template specialization type.
CXXMethodVector::const_iterator overridden_cxx_method_iterator
unsigned getTypeAlign(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in bits.
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 isPromotableBitField(Expr *E) const
Whether this is a promotable bitfield reference according to C99 6.3.1.1p2, bullet 2 (and GCC extensi...
bool isSentinelNullExpr(const Expr *E)
CanQualType getNSUIntegerType() const
IdentifierInfo * getNSCopyingName()
Retrieve the identifier 'NSCopying'.
void setIsDestroyingOperatorDelete(const FunctionDecl *FD, bool IsDestroying)
TypedefDecl * getBuiltinZOSVaListDecl() const
Retrieve the C type declaration corresponding to the predefined __builtin_zos_va_list type.
void recordMemberDataPointerEvaluation(const ValueDecl *VD)
uint64_t getCharWidth() const
Return the size of the character type, in bits.
CanQualType getPointerType(CanQualType T) const
QualType getUnqualifiedArrayType(QualType T) const
import_range local_imports() const
QualType getBitIntType(bool Unsigned, unsigned NumBits) const
Return a bit-precise integer type with the specified signedness and bit count.
const DependentSizedArrayType * getAsDependentSizedArrayType(QualType T) const
unsigned NumImplicitMoveAssignmentOperators
The number of implicitly-declared move assignment operators.
FunctionDecl * getcudaLaunchDeviceDecl()
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
Represents a loop initializing the elements of an array.
Represents an array type, per C99 6.7.5.2 - Array Declarators.
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Attr - This represents one attribute.
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Represents the builtin template declaration which is used to implement __make_integer_seq and other b...
This class is used for builtin types like 'int'.
Holds information about both target-independent and target-specific builtins, allowing easy queries b...
Implements C++ ABI-specific semantic analysis functions.
Represents a C++ constructor within a class.
Represents a C++ destructor within a class.
Represents a static or instance method of a struct/union/class.
Represents a C++ struct/union/class.
static CanQual< Type > CreateUnsafe(QualType Other)
const T * getTypePtr() const
Retrieve the underlying type pointer, which refers to a canonical type.
This is an opaque type for sizes expressed in character units.
Declaration of a C++20 concept.
Represents the canonical version of C arrays with a specified constant size.
Represents a sugar type with __counted_by or __sized_by annotations, including their _or_null variant...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
A list storing NamedDecls in the lookup tables.
Decl - This represents one declaration (or definition), e.g.
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
bool isInvalidDecl() const
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
The name of a declaration.
Represents a ValueDecl that came out of a declarator.
Represents an array type in C++ whose size is a value-dependent expression.
Represents a dependent template name that cannot be resolved prior to template instantiation.
Concrete class used by the front-end to report problems and issues.
Container for either a single DynTypedNode or for an ArrayRef to DynTypedNode.
An instance of this object exists for each enum constant that is defined.
llvm::APSInt getInitVal() const
Represents an explicit instantiation of a template entity in source code.
This represents one expression.
Declaration context for names declared as extern "C" in C++.
Abstract interface for external sources of AST nodes.
Represents a member of a struct/union/class.
A SourceLocation and its associated SourceManager.
Represents a function declaration or definition.
Represents a prototype with parameter type info, e.g.
A class which abstracts out some details necessary for making a call.
FunctionType - C99 6.7.5.3 - Function Declarators.
GlobalDecl - represents a global declaration.
One of these records is kept for each identifier that is lexed.
Implements an efficient mapping from strings to IdentifierInfo nodes.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Represents a C array with an unspecified size.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangl...
Keeps track of the mangled names of lambda expressions and block literals within a particular context...
Provides information a specialization of a member of a class template, which may be a member function...
Describes a module or submodule.
This represents a decl that may have a name.
A C++ nested-name-specifier augmented with source location information.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
ObjCCategoryDecl - Represents a category declaration.
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
ObjCContainerDecl - Represents a container for method declarations.
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Represents an ObjC class declaration.
ObjCIvarDecl - Represents an ObjC instance variable.
ObjCMethodDecl - Represents an instance or class method declaration.
Represents a pointer to an Objective C object.
Represents one property declaration in an Objective-C interface.
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Represents an Objective-C protocol declaration.
Represents the declaration of an Objective-C type parameter.
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Represents a parameter to a function.
Pointer-authentication qualifiers.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
A (possibly-)qualified type.
QualType withFastQualifiers(unsigned TQs) const
PointerAuthQualifier getPointerAuth() const
QualType withConst() const
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
A qualifier set is used to build a set of qualifiers.
const Type * strip(QualType type)
Collect any qualifiers on the given type and return an unqualified type.
The collection of all-type qualifiers we support.
@ OCL_None
There is no lifetime qualification on this type.
void removeObjCLifetime()
bool hasNonFastQualifiers() const
Return true if the set contains any qualifiers which require an ExtQuals node to be allocated.
unsigned getFastQualifiers() const
static Qualifiers fromCVRMask(unsigned CVR)
void setPointerAuth(PointerAuthQualifier Q)
void addObjCLifetime(ObjCLifetime type)
Represents a struct/union/class.
RecordDecl * getDefinition() const
Returns the RecordDecl that actually defines this struct/union/class.
void setPreviousDecl(decl_type *PrevDecl)
Set the previous declaration.
Scope - A scope is a transient data structure that is used while parsing the program.
This table allows us to fully hide how we implement multi-keyword caching.
Selector getSelector(unsigned NumArgs, const IdentifierInfo **IIV)
Can create any sort of selector.
Smart pointer class that efficiently represents Objective-C method names.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.
clang::DiagStorageAllocator DiagStorageAllocator
StringLiteral - This represents a string literal expression, e.g.
Represents the declaration of a struct/union/class/enum.
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Kind
The basic C++ ABI kind.
Exposes information about the current target.
A convenient class for passing around template argument information.
Represents a template argument.
The base class of all kinds of template declarations (e.g., class, function, etc.).
Represents a C++ template name within the type system.
A template parameter object.
Stores a list of template parameters for a TemplateDecl and its derived classes.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Declaration of a template type parameter.
Token - This structure provides full information about a lexed token.
The top declaration context.
static TranslationUnitDecl * Create(ASTContext &C)
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Models the abbreviated syntax to constrain a template type parameter: template <convertible_to<string...
Represents a declaration of a type.
A container of type source information.
The base class of the type hierarchy.
bool isSizelessType() const
As an extension, we classify types as one of "sized" or "sizeless"; every type is one or the other.
bool isSignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is signed or an enumeration types whose underlying ty...
bool isObjCNSObjectType() const
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
QualType getCanonicalTypeInternal() const
bool isUndeducedType() const
Determine whether this type is an undeduced type, meaning that it somehow involves a C++11 'auto' typ...
bool isIncompleteType(NamedDecl **Def=nullptr) const
Types are partitioned into 3 broad categories (C99 6.2.5p1): object types, function types,...
NullabilityKindOrNone getNullability() const
Determine the nullability of the given type.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Base class for declarations which introduce a typedef-name.
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
An artificial decl, representing a global anonymous constant value which is uniquified by value withi...
The iterator over UnresolvedSets.
Represents the dependent type named by a dependently-scoped typename using declaration,...
Represents a dependent using declaration which was marked with typename.
Represents a C++ using-enum-declaration.
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a variable declaration or definition.
Declaration of a variable template.
Represents a C array with a specified size that is not an integer-constant-expression.
Represents a GCC generic vector type.
Holds all information required to evaluate constexpr code in a module.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
const internal::VariadicDynCastAllOfMatcher< Stmt, BlockExpr > blockExpr
Matches a reference to a block.
llvm::FixedPointSemantics FixedPointSemantics
Top level wrappers for InstallAPI frontend operations.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
GVALinkage
A more specific kind of linkage than enum Linkage.
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
bool isTargetAddressSpace(LangAS AS)
OpenCLTypeKind
OpenCL type kinds.
NullabilityKind
Describes the nullability of a particular type.
@ Nullable
Values of this type can be null.
@ Unspecified
Whether values of this type can be null is (explicitly) unspecified.
@ NonNull
Values of this type can never be null.
@ TemplateName
The identifier is a template name. FIXME: Add an annotation for that.
TypeOfKind
The kind of 'typeof' expression we're after.
SmallVector< Attr *, 4 > AttrVec
AttrVec - A vector of Attr, which is how they are stored on the AST.
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...
Selector GetUnarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing an unary selector.
@ Result
The result type of a method or function.
ArraySizeModifier
Capture whether this is a normal array (e.g.
OptionalUnsigned< unsigned > UnsignedOrNone
@ Template
We are parsing a template declaration.
Selector GetNullarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing a nullary selector.
@ Class
The "class" keyword.
BuiltinTemplateKind
Kinds of BuiltinTemplateDecl.
@ Keyword
The name has been typo-corrected to a keyword.
LangAS
Defines the address space values used by the address space qualifier of QualType.
TranslationUnitKind
Describes the kind of translation unit being processed.
@ TU_Incremental
The translation unit is a is a complete translation unit that we might incrementally extend later.
SmallVector< CXXBaseSpecifier *, 4 > CXXCastPath
A simple array of base specifiers.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ConceptReference *C)
Insertion operator for diagnostics.
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
CallingConv
CallingConv - Specifies the calling convention that a function uses.
U cast(CodeGen::Address addr)
@ ResistPragmaPack
The type's natural alignment is preserved under pragma pack in MSVC record layout (e....
@ None
The alignment was not explicit in code.
@ RequiredByEnum
The alignment comes from an alignment attribute on a enum type.
@ RequiredByTypedef
The alignment comes from an alignment attribute on a typedef.
@ RequiredByRecord
The alignment comes from an alignment attribute on a record type.
@ PackIndex
Index of a pack indexing expression or specifier.
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
@ None
No keyword precedes the qualified type name.
Diagnostic wrappers for TextAPI types for error reporting.
int const char * function
int32_t uint32_t uint32_t __builtin_riscv_mhracc_i32 __builtin_riscv_mhraccu_u32 __builtin_riscv_mhraccsu_i32 __builtin_riscv_mhacc_h1_i32 __builtin_riscv_mhaccsu_h1_i32 __builtin_riscv_mulqr_i32 __builtin_riscv_mqrwacc_i64 __packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 __packed_splat2 __packed_splat4 uint16_t
__builtin_elementwise_add_sat __builtin_elementwise_sub_sat uint32_t int64_t
__builtin_elementwise_add_sat __builtin_elementwise_sub_sat uint32_t uint64_t __builtin_riscv_ssha_i32 __builtin_riscv_sshl_u32 uint64_t
int32_t uint32_t uint32_t __builtin_riscv_mhracc_i32 __builtin_riscv_mhraccu_u32 __builtin_riscv_mhraccsu_i32 __builtin_riscv_mhacc_h1_i32 __builtin_riscv_mhaccsu_h1_i32 __builtin_riscv_mulqr_i32 __builtin_riscv_mqrwacc_i64 __packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 __packed_splat2 uint8_t
BuiltinVectorTypeInfo(QualType ElementType, llvm::ElementCount EC, unsigned NumVectors)
BuiltinVectorTypeInfo(QualType ElementType, llvm::ElementCount EC, unsigned NumVectors)
bool NoWrongSidedVars
Do not allow wrong-sided variables in constant expressions.
SourceLocation PragmaSectionLocation
SectionInfo(NamedDecl *Decl, SourceLocation PragmaSectionLocation, int SectionFlags)
Copy initialization expr of a __block variable and a boolean flag that indicates whether the expressi...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
Holds information about the various types of exception specification.
Extra information about a function prototype.
A late-parsed attribute that will be applied as a type attribute.
Parts of a decomposed MSGuidDecl.
Contains information gathered from parsing the contents of TargetAttr.
Describes how types, statements, expressions, and declarations should be printed.
UniquingSet info for pools keyed on a QualType and a bool.
static unsigned getHashValue(const KeyTy &Key)
static KeyTy getKey(const T &N)
static bool isEqual(const KeyTy &Key, const T &N)
std::pair< QualType, bool > KeyTy
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
const Type * Ty
The locally-unqualified type.
Qualifiers Quals
The local qualifiers.
AlignRequirementKind AlignRequirement
TypeInfoChars(CharUnits Width, CharUnits Align, AlignRequirementKind AlignRequirement)
AlignRequirementKind AlignRequirement
TypeInfo(uint64_t Width, unsigned Align, AlignRequirementKind AlignRequirement)
static bool isEqual(const ScalableVecTyKey &LHS, const ScalableVecTyKey &RHS)
static unsigned getHashValue(const ScalableVecTyKey &Val)
static bool isEqual(FoldingSetNodeIDRef LHS, FoldingSetNodeIDRef RHS)
static unsigned getHashValue(FoldingSetNodeIDRef Val)
static bool isEqual(const FoldingSetNodeID &LHS, FoldingSetNodeIDRef RHS)
static unsigned getHashValue(const FoldingSetNodeID &Val)
static bool isEqual(const FoldingSetNodeID &LHS, const FoldingSetNodeID &RHS)
static unsigned getHashValue(const FoldingSetNodeID &Val)
bool operator==(const ScalableVecTyKey &RHS) const