14 #ifndef LLVM_CLANG_AST_ASTCONTEXT_H 15 #define LLVM_CLANG_AST_ASTCONTEXT_H 46 #include "llvm/ADT/APSInt.h" 47 #include "llvm/ADT/ArrayRef.h" 48 #include "llvm/ADT/DenseMap.h" 49 #include "llvm/ADT/FoldingSet.h" 50 #include "llvm/ADT/IntrusiveRefCntPtr.h" 51 #include "llvm/ADT/MapVector.h" 52 #include "llvm/ADT/None.h" 53 #include "llvm/ADT/Optional.h" 54 #include "llvm/ADT/PointerIntPair.h" 55 #include "llvm/ADT/PointerUnion.h" 56 #include "llvm/ADT/SmallVector.h" 57 #include "llvm/ADT/StringMap.h" 58 #include "llvm/ADT/StringRef.h" 59 #include "llvm/ADT/TinyPtrVector.h" 60 #include "llvm/ADT/Triple.h" 61 #include "llvm/ADT/iterator_range.h" 62 #include "llvm/Support/AlignOf.h" 63 #include "llvm/Support/Allocator.h" 64 #include "llvm/Support/Casting.h" 65 #include "llvm/Support/Compiler.h" 72 #include <type_traits> 86 class ASTMutationListener;
87 class ASTRecordLayout;
90 class BuiltinTemplateDecl;
93 class CXXConstructorDecl;
96 class DiagnosticsEngine;
98 class FixedPointSemantics;
100 class MangleNumberingContext;
101 class MaterializeTemporaryExpr;
102 class MemberSpecializationInfo;
104 class ObjCCategoryDecl;
105 class ObjCCategoryImplDecl;
106 class ObjCContainerDecl;
108 class ObjCImplementationDecl;
109 class ObjCInterfaceDecl;
111 class ObjCMethodDecl;
112 class ObjCPropertyDecl;
113 class ObjCPropertyImplDecl;
114 class ObjCProtocolDecl;
115 class ObjCTypeParamDecl;
118 class StoredDeclsMap;
120 class TemplateParameterList;
121 class TemplateTemplateParmDecl;
122 class TemplateTypeParmDecl;
123 class UnresolvedSetIterator;
124 class UsingShadowDecl;
125 class VarTemplateDecl;
126 class VTableContextBase;
148 TypeInfo(uint64_t Width,
unsigned Align,
bool AlignIsRequired)
149 : Width(Width), Align(Align), AlignIsRequired(AlignIsRequired) {}
161 : ExprAndFlag(CopyExpr, CanThrow) {}
163 ExprAndFlag.setPointerAndInt(CopyExpr, CanThrow);
166 bool canThrow()
const {
return ExprAndFlag.getInt(); }
174 mutable llvm::FoldingSet<ExtQuals> ExtQualNodes;
175 mutable llvm::FoldingSet<ComplexType> ComplexTypes;
176 mutable llvm::FoldingSet<PointerType> PointerTypes;
177 mutable llvm::FoldingSet<AdjustedType> AdjustedTypes;
178 mutable llvm::FoldingSet<BlockPointerType> BlockPointerTypes;
179 mutable llvm::FoldingSet<LValueReferenceType> LValueReferenceTypes;
180 mutable llvm::FoldingSet<RValueReferenceType> RValueReferenceTypes;
181 mutable llvm::FoldingSet<MemberPointerType> MemberPointerTypes;
182 mutable llvm::FoldingSet<ConstantArrayType> ConstantArrayTypes;
183 mutable llvm::FoldingSet<IncompleteArrayType> IncompleteArrayTypes;
184 mutable std::vector<VariableArrayType*> VariableArrayTypes;
185 mutable llvm::FoldingSet<DependentSizedArrayType> DependentSizedArrayTypes;
186 mutable llvm::FoldingSet<DependentSizedExtVectorType>
187 DependentSizedExtVectorTypes;
188 mutable llvm::FoldingSet<DependentAddressSpaceType>
189 DependentAddressSpaceTypes;
190 mutable llvm::FoldingSet<VectorType> VectorTypes;
191 mutable llvm::FoldingSet<DependentVectorType> DependentVectorTypes;
192 mutable llvm::FoldingSet<FunctionNoProtoType> FunctionNoProtoTypes;
193 mutable llvm::ContextualFoldingSet<FunctionProtoType, ASTContext&>
195 mutable llvm::FoldingSet<DependentTypeOfExprType> DependentTypeOfExprTypes;
196 mutable llvm::FoldingSet<DependentDecltypeType> DependentDecltypeTypes;
197 mutable llvm::FoldingSet<TemplateTypeParmType> TemplateTypeParmTypes;
198 mutable llvm::FoldingSet<ObjCTypeParamType> ObjCTypeParamTypes;
199 mutable llvm::FoldingSet<SubstTemplateTypeParmType>
200 SubstTemplateTypeParmTypes;
201 mutable llvm::FoldingSet<SubstTemplateTypeParmPackType>
202 SubstTemplateTypeParmPackTypes;
203 mutable llvm::ContextualFoldingSet<TemplateSpecializationType, ASTContext&>
204 TemplateSpecializationTypes;
205 mutable llvm::FoldingSet<ParenType> ParenTypes;
206 mutable llvm::FoldingSet<ElaboratedType> ElaboratedTypes;
207 mutable llvm::FoldingSet<DependentNameType> DependentNameTypes;
210 DependentTemplateSpecializationTypes;
211 llvm::FoldingSet<PackExpansionType> PackExpansionTypes;
212 mutable llvm::FoldingSet<ObjCObjectTypeImpl> ObjCObjectTypes;
213 mutable llvm::FoldingSet<ObjCObjectPointerType> ObjCObjectPointerTypes;
214 mutable llvm::FoldingSet<DependentUnaryTransformType>
215 DependentUnaryTransformTypes;
216 mutable llvm::FoldingSet<AutoType> AutoTypes;
217 mutable llvm::FoldingSet<DeducedTemplateSpecializationType>
218 DeducedTemplateSpecializationTypes;
219 mutable llvm::FoldingSet<AtomicType> AtomicTypes;
220 llvm::FoldingSet<AttributedType> AttributedTypes;
221 mutable llvm::FoldingSet<PipeType> PipeTypes;
223 mutable llvm::FoldingSet<QualifiedTemplateName> QualifiedTemplateNames;
224 mutable llvm::FoldingSet<DependentTemplateName> DependentTemplateNames;
225 mutable llvm::FoldingSet<SubstTemplateTemplateParmStorage>
226 SubstTemplateTemplateParms;
229 SubstTemplateTemplateParmPacks;
234 mutable llvm::FoldingSet<NestedNameSpecifier> NestedNameSpecifiers;
240 mutable llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*>
242 mutable llvm::DenseMap<const ObjCContainerDecl*, const ASTRecordLayout*>
246 using TypeInfoMap = llvm::DenseMap<const Type *, struct TypeInfo>;
247 mutable TypeInfoMap MemoizedTypeInfo;
252 using UnadjustedAlignMap = llvm::DenseMap<const Type *, unsigned>;
253 mutable UnadjustedAlignMap MemoizedUnadjustedAlign;
256 llvm::DenseMap<const CXXRecordDecl*, LazyDeclPtr> KeyFunctions;
259 llvm::DenseMap<ObjCContainerDecl*, ObjCImplDecl*> ObjCImpls;
263 llvm::DenseMap<const ObjCMethodDecl*,const ObjCMethodDecl*> ObjCMethodRedecls;
266 llvm::DenseMap<const VarDecl *, BlockVarCopyInit> BlockVarCopyInits;
271 llvm::DenseMap<const MaterializeTemporaryExpr *, APValue *>
272 MaterializedTemporaryValues;
281 mutable llvm::StringMap<StringLiteral *> StringLiteralCache;
285 class CanonicalTemplateTemplateParm :
public llvm::FoldingSetNode {
294 void Profile(llvm::FoldingSetNodeID &
ID) { Profile(ID, Parm); }
296 static void Profile(llvm::FoldingSetNodeID &
ID,
299 mutable llvm::FoldingSet<CanonicalTemplateTemplateParm>
300 CanonTemplateTemplateParms;
316 mutable TypedefDecl *BuiltinMSVaListDecl =
nullptr;
355 mutable RecordDecl *CFConstantStringTagDecl =
nullptr;
356 mutable TypedefDecl *CFConstantStringTypeDecl =
nullptr;
381 mutable RecordDecl *BlockDescriptorType =
nullptr;
387 mutable RecordDecl *BlockDescriptorExtendedType =
nullptr;
396 llvm::DenseMap<const Decl*, AttrVec*> DeclAttrs;
401 llvm::DenseMap<Decl*, Decl*> MergedDecls;
406 llvm::DenseMap<NamedDecl*, llvm::TinyPtrVector<Module*>> MergedDefModules;
412 struct PerModuleInitializers {
418 llvm::DenseMap<Module*, PerModuleInitializers*> ModuleInitializers;
425 llvm::PointerUnion<VarTemplateDecl *, MemberSpecializationInfo *>;
463 llvm::DenseMap<const VarDecl *, TemplateOrSpecializationInfo>
464 TemplateOrInstantiation;
489 llvm::DenseMap<NamedDecl *, NamedDecl *> InstantiatedFromUsingDecl;
491 llvm::DenseMap<UsingShadowDecl*, UsingShadowDecl*>
492 InstantiatedFromUsingShadowDecl;
494 llvm::DenseMap<FieldDecl *, FieldDecl *> InstantiatedFromUnnamedFieldDecl;
502 using CXXMethodVector = llvm::TinyPtrVector<const CXXMethodDecl *>;
503 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector> OverriddenMethods;
508 llvm::DenseMap<const DeclContext *, std::unique_ptr<MangleNumberingContext>>
509 MangleNumberingContexts;
513 llvm::MapVector<const NamedDecl *, unsigned> MangleNumbers;
514 llvm::MapVector<const VarDecl *, unsigned> StaticLocalNumbers;
518 using ParameterIndexTable = llvm::DenseMap<const VarDecl *, unsigned>;
519 ParameterIndexTable ParamIndices;
538 std::unique_ptr<SanitizerBlacklist> SanitizerBL;
542 std::unique_ptr<XRayFunctionFilter> XRayFilter;
548 mutable llvm::BumpPtrAllocator BumpAlloc;
554 std::unique_ptr<CXXABI> ABI;
562 bool AddrSpaceMapMangling;
594 const ast_type_traits::DynTypedNode *
begin()
const {
598 return reinterpret_cast<const DynTypedNode *
>(Storage.buffer);
601 const ast_type_traits::DynTypedNode *
end()
const {
605 return reinterpret_cast<const DynTypedNode *
>(Storage.buffer) + 1;
608 size_t size()
const {
return end() - begin(); }
609 bool empty()
const {
return begin() == end(); }
612 assert(N < size() &&
"Out of bounds!");
613 return *(begin() + N);
625 void setTraversalScope(
const std::vector<Decl *> &);
658 return PrintingPolicy;
662 PrintingPolicy = Policy;
672 void *
Allocate(
size_t Size,
unsigned Align = 8)
const {
673 return BumpAlloc.Allocate(Size, Align);
675 template <
typename T> T *
Allocate(
size_t Num = 1)
const {
676 return static_cast<T *
>(Allocate(Num *
sizeof(T),
alignof(T)));
683 return BumpAlloc.getTotalMemory();
687 size_t getSideTableAllocatedMemory()
const;
690 return DiagAllocator;
700 QualType getIntTypeForBitwidth(
unsigned DestWidth,
701 unsigned Signed)
const;
706 QualType getRealTypeForBitwidth(
unsigned DestWidth)
const;
708 bool AtomicUsesUnsupportedLibcall(
const AtomicExpr *E)
const;
730 mutable bool CommentsLoaded =
false;
758 return Data.getInt();
766 return Data.getPointer();
782 llvm::PointerIntPair<const RawComment *, 2, Kind> Data;
783 const Decl *OriginalDecl;
807 assert(LangOpts.RetainCommentsFromSystemHeaders ||
818 getRawCommentForAnyRedecl(
const Decl *D,
819 const Decl **OriginalDecl =
nullptr)
const;
835 const Decl *D)
const;
841 class import_iterator {
848 using difference_type = int;
849 using iterator_category = std::forward_iterator_tag;
851 import_iterator() =
default;
852 explicit import_iterator(
ImportDecl *Import) : Import(Import) {}
854 reference
operator*()
const {
return Import; }
855 pointer operator->()
const {
return Import; }
857 import_iterator &operator++() {
858 Import = ASTContext::getNextLocalImport(Import);
862 import_iterator operator++(
int) {
863 import_iterator Other(*
this);
868 friend bool operator==(import_iterator
X, import_iterator Y) {
869 return X.Import == Y.Import;
872 friend bool operator!=(import_iterator X, import_iterator Y) {
873 return X.Import != Y.Import;
879 return CommentCommandTraits;
886 void eraseDeclAttrs(
const Decl *D);
896 getTemplateOrSpecializationInfo(
const VarDecl *Var);
900 void setInstantiatedFromStaticDataMember(
VarDecl *Inst,
VarDecl *Tmpl,
904 void setTemplateOrSpecializationInfo(
VarDecl *Inst,
932 unsigned overridden_methods_size(
const CXXMethodDecl *Method)
const;
935 llvm::iterator_range<overridden_cxx_method_iterator>;
951 void getOverriddenMethods(
957 void addedLocalImportDecl(
ImportDecl *Import);
960 return Import->NextLocalImport;
966 return import_range(import_iterator(FirstLocalImport), import_iterator());
970 Decl *Result = MergedDecls.lookup(D);
971 return Result ? Result : D;
974 MergedDecls[D] = Primary;
980 bool NotifyListeners =
true);
984 void deduplicateMergedDefinitonsFor(
NamedDecl *ND);
991 if (MergedIt == MergedDefModules.end())
993 return MergedIt->second;
1000 void addModuleInitializer(
Module *M,
Decl *Init);
1034 SatUnsignedLongAccumTy;
1037 SatUnsignedLongFractTy;
1048 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ 1049 CanQualType SingletonId; 1050 #include "clang/Basic/OpenCLImageTypes.def" 1054 #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \ 1056 #include "clang/Basic/OpenCLExtensionTypes.def" 1082 return ExternalSource.get();
1091 this->Listener = Listener;
1098 void PrintStats()
const;
1106 RecordDecl *buildImplicitRecord(StringRef Name,
1152 bool allowOnPointerType =
false)
const;
1202 QualType getFunctionTypeWithExceptionSpec(
1213 bool AsWritten =
false);
1226 return CanQualType::CreateUnsafe(getPointerType((
QualType) T));
1233 return CanQualType::CreateUnsafe(
1242 return CanQualType::CreateUnsafe(getDecayedType((
QualType) T));
1255 QualType getBlockDescriptorType()
const;
1265 QualType getBlockDescriptorExtendedType()
const;
1271 LangAS getOpenCLTypeAddrSpace(
const Type *T)
const;
1274 cudaConfigureCallDecl = FD;
1278 return cudaConfigureCallDecl;
1289 bool &HasByrefExtendedLayout)
const;
1310 unsigned IndexTypeQuals,
1320 unsigned IndexTypeQuals,
1327 unsigned IndexTypeQuals)
const;
1333 unsigned IndexTypeQuals)
const;
1370 Expr *AddrSpaceExpr,
1384 return getFunctionTypeInternal(ResultTy, Args, EPI,
false);
1393 bool OnlyWantCanonical)
const;
1399 const TypeDecl *PrevDecl =
nullptr)
const {
1400 assert(Decl &&
"Passed null for Decl param");
1401 if (Decl->TypeForDecl)
return QualType(Decl->TypeForDecl, 0);
1404 assert(PrevDecl->TypeForDecl &&
"previous decl has no TypeForDecl");
1405 Decl->TypeForDecl = PrevDecl->TypeForDecl;
1406 return QualType(PrevDecl->TypeForDecl, 0);
1409 return getTypeDeclTypeSlow(Decl);
1429 QualType getSubstTemplateTypeParmPackType(
1434 getTemplateTypeParmType(
unsigned Depth,
unsigned Index,
1462 TagDecl *OwnedTagDecl =
nullptr)
const;
1472 QualType getDependentTemplateSpecializationType(
1493 unsigned NumProtocols)
const;
1498 bool isKindOf)
const;
1509 bool QIdProtocolsAdoptObjCObjectProtocols(
QualType QT,
1528 bool IsDependent,
bool IsPack =
false)
const;
1531 QualType getAutoDeductType()
const;
1534 QualType getAutoRRefDeductType()
const;
1539 bool IsDependent)
const;
1575 QualType getSignedWCharType()
const;
1580 QualType getUnsignedWCharType()
const;
1596 QualType getPointerDiffType()
const;
1601 QualType getUnsignedPointerDiffType()
const;
1608 QualType getCFConstantStringType()
const;
1617 if (CFConstantStringTypeDecl)
1618 return getTypedefType(CFConstantStringTypeDecl);
1621 void setCFConstantStringType(
QualType T);
1623 RecordDecl *getCFConstantStringTagDecl()
const;
1628 return ObjCConstantStringType;
1632 return ObjCNSStringType;
1636 ObjCNSStringType = T;
1642 if (ObjCIdRedefinitionType.
isNull())
1643 return getObjCIdType();
1644 return ObjCIdRedefinitionType;
1649 ObjCIdRedefinitionType = RedefType;
1655 if (ObjCClassRedefinitionType.
isNull())
1656 return getObjCClassType();
1657 return ObjCClassRedefinitionType;
1662 ObjCClassRedefinitionType = RedefType;
1668 if (ObjCSelRedefinitionType.
isNull())
1669 return getObjCSelType();
1670 return ObjCSelRedefinitionType;
1675 ObjCSelRedefinitionType = RedefType;
1680 if (!NSObjectName) {
1681 NSObjectName = &Idents.
get(
"NSObject");
1684 return NSObjectName;
1689 if (!NSCopyingName) {
1690 NSCopyingName = &Idents.
get(
"NSCopying");
1693 return NSCopyingName;
1697 assert(Target &&
"Expected target to be initialized");
1698 const llvm::Triple &T = Target->
getTriple();
1700 if (T.isOSWindows() && T.isArch64Bit())
1701 return UnsignedLongLongTy;
1702 return UnsignedLongTy;
1706 assert(Target &&
"Expected target to be initialized");
1707 const llvm::Triple &T = Target->
getTriple();
1709 if (T.isOSWindows() && T.isArch64Bit())
1717 BoolName = &Idents.
get(
"bool");
1722 if (!MakeIntegerSeqName)
1723 MakeIntegerSeqName = &Idents.
get(
"__make_integer_seq");
1724 return MakeIntegerSeqName;
1728 if (!TypePackElementName)
1729 TypePackElementName = &Idents.
get(
"__type_pack_element");
1730 return TypePackElementName;
1736 return getTypeDeclType(getObjCInstanceTypeDecl());
1749 return getTypeDeclType(FILEDecl);
1755 this->jmp_bufDecl = jmp_bufDecl;
1761 return getTypeDeclType(jmp_bufDecl);
1767 this->sigjmp_bufDecl = sigjmp_bufDecl;
1773 return getTypeDeclType(sigjmp_bufDecl);
1779 this->ucontext_tDecl = ucontext_tDecl;
1785 return getTypeDeclType(ucontext_tDecl);
1791 return getLangOpts().CPlusPlus ? BoolTy : IntTy;
1798 void getObjCEncodingForType(
QualType T, std::string &S,
1800 QualType *NotEncodedT=
nullptr)
const;
1804 void getObjCEncodingForPropertyType(
QualType T, std::string &S)
const;
1806 void getLegacyIntegralTypeEncoding(
QualType &t)
const;
1810 std::string &S)
const;
1818 std::string getObjCEncodingForFunctionDecl(
const FunctionDecl *Decl)
const;
1822 std::string getObjCEncodingForMethodDecl(
const ObjCMethodDecl *Decl,
1823 bool Extended =
false)
const;
1833 const Decl *Container)
const;
1840 const Decl *Container)
const;
1855 return getTypeDeclType(getObjCIdDecl());
1865 return getTypeDeclType(getObjCSelDecl());
1877 return getTypeDeclType(getObjCClassDecl());
1896 return getTypeDeclType(getBOOLDecl());
1901 return getObjCInterfaceType(getObjCProtocolDecl());
1910 return getTypeDeclType(getBuiltinVaListDecl());
1916 Decl *getVaListTagDecl()
const;
1924 return getTypeDeclType(getBuiltinMSVaListDecl());
1929 bool canBuiltinBeRedeclared(
const FunctionDecl *)
const;
1934 return getQualifiedType(T, Qualifiers::fromCVRMask(CVR));
1939 return getQualifiedType(split.
Ty, split.
Quals);
1948 return getExtQualType(Ptr, Qc);
1955 return getExtQualType(T, Qs);
1964 assert(lifetime != Qualifiers::OCL_None);
1968 return getQualifiedType(type, qs);
1982 unsigned char getFixedPointScale(
QualType Ty)
const;
1983 unsigned char getFixedPointIBits(
QualType Ty)
const;
1996 bool TemplateKeyword,
2031 unsigned *IntegerConstantArgs =
nullptr)
const;
2069 const llvm::fltSemantics &getFloatTypeSemantics(
QualType T)
const;
2076 unsigned getOpenMPDefaultSimdAlign(
QualType T)
const;
2084 return getTypeSize(CharTy);
2088 CharUnits toCharUnitsFromBits(int64_t BitSize)
const;
2091 int64_t toBits(
CharUnits CharSize)
const;
2101 return getTypeSizeInChars(Ty);
2105 return getTypeSizeInCharsIfKnown(
QualType(Ty, 0));
2119 return getTypeUnadjustedAlign(T.
getTypePtr());
2121 unsigned getTypeUnadjustedAlign(
const Type *T)
const;
2126 unsigned getTypeAlignIfKnown(
QualType T)
const;
2137 CharUnits getTypeUnadjustedAlignInChars(
const Type *T)
const;
2141 std::pair<CharUnits, CharUnits> getTypeInfoDataSizeInChars(
QualType T)
const;
2143 std::pair<CharUnits, CharUnits> getTypeInfoInChars(
const Type *T)
const;
2144 std::pair<CharUnits, CharUnits> getTypeInfoInChars(
QualType T)
const;
2148 bool isAlignmentRequired(
const Type *T)
const;
2149 bool isAlignmentRequired(
QualType T)
const;
2156 unsigned getPreferredTypeAlign(
const Type *T)
const;
2160 unsigned getTargetDefaultAlignForAttributeAligned()
const;
2164 unsigned getAlignOfGlobalVar(
QualType T)
const;
2200 bool Simple =
false)
const;
2261 void CollectInheritedProtocols(
const Decl *CDecl,
2262 llvm::SmallPtrSet<ObjCProtocolDecl*, 8> &Protocols);
2266 bool hasUniqueObjectRepresentations(
QualType Ty)
const;
2297 return getCanonicalType(T1) == getCanonicalType(T2);
2300 return getCanonicalType(T1) == getCanonicalType(T2);
2321 return getCanonicalType(T1).getTypePtr() ==
2322 getCanonicalType(T2).getTypePtr();
2326 bool IsParam)
const {
2329 if (SubTnullability.hasValue() == SuperTnullability.hasValue()) {
2331 if (!SubTnullability)
2334 if (*SubTnullability == *SuperTnullability ||
2335 *SubTnullability == NullabilityKind::Unspecified ||
2336 *SuperTnullability == NullabilityKind::Unspecified)
2342 return (*SuperTnullability == NullabilityKind::NonNull &&
2343 *SubTnullability == NullabilityKind::Nullable);
2348 return (*SuperTnullability == NullabilityKind::Nullable &&
2349 *SubTnullability == NullabilityKind::NonNull);
2400 CallingConv getDefaultCallingConvention(
bool IsVariadic,
2402 bool IsBuiltin =
false)
const;
2442 return dyn_cast_or_null<ConstantArrayType>(getAsArrayType(T));
2445 return dyn_cast_or_null<VariableArrayType>(getAsArrayType(T));
2448 return dyn_cast_or_null<IncompleteArrayType>(getAsArrayType(T));
2452 return dyn_cast_or_null<DependentSizedArrayType>(getAsArrayType(T));
2540 unsigned getTargetAddressSpace(
LangAS AS)
const;
2542 LangAS getLangASForBuiltinAddressSpace(
unsigned AS)
const;
2546 uint64_t getTargetNullPointerValue(
QualType QT)
const;
2554 unsigned getIntegerRank(
const Type *T)
const;
2563 bool CompareUnqualified =
false);
2569 return T == getObjCIdType();
2573 return T == getObjCClassType();
2577 return T == getObjCSelType();
2590 bool canAssignObjCInterfacesInBlockPointer(
2593 bool BlockReturnType);
2601 bool Unqualified =
false,
bool BlockReturnType =
false);
2603 bool Unqualified =
false);
2605 bool OfBlockPointer =
false,
2606 bool Unqualified =
false);
2608 bool OfBlockPointer=
false,
2609 bool Unqualified =
false);
2632 bool mergeExtParameterInfo(
2635 bool &CanUseFirst,
bool &CanUseSecond,
2646 unsigned getIntWidth(
QualType T)
const;
2677 unsigned Width = getIntWidth(Type);
2678 if (Width != Res.getBitWidth())
2679 return Res.extOrTrunc(Width);
2683 bool isSentinelNullExpr(
const Expr *E);
2695 return !ObjCImpls.empty();
2744 getTrivialTypeSourceInfo(
QualType T,
2754 void AddDeallocation(
void (*Callback)(
void *),
void *Data)
const;
2759 if (!std::is_trivially_destructible<T>::value) {
2760 auto DestroyPtr = [](
void *
V) {
static_cast<T *
>(
V)->~T(); };
2761 AddDeallocation(DestroyPtr, Ptr);
2774 bool DeclMustBeEmitted(
const Decl *D);
2778 void forEachMultiversionedFunctionVersion(
2785 void addCopyConstructorForExceptionObject(
CXXRecordDecl *RD,
2796 void setManglingNumber(
const NamedDecl *ND,
unsigned Number);
2797 unsigned getManglingNumber(
const NamedDecl *ND)
const;
2799 void setStaticLocalNumber(
const VarDecl *VD,
unsigned Number);
2800 unsigned getStaticLocalNumber(
const VarDecl *VD)
const;
2806 std::unique_ptr<MangleNumberingContext> createMangleNumberingContext()
const;
2810 void setParameterIndex(
const ParmVarDecl *D,
unsigned index);
2814 unsigned getParameterIndex(
const ParmVarDecl *D)
const;
2824 StringLiteral *getPredefinedStringLiteralFromCache(StringRef Key)
const;
2831 unsigned NumImplicitDefaultConstructors = 0;
2835 unsigned NumImplicitDefaultConstructorsDeclared = 0;
2838 unsigned NumImplicitCopyConstructors = 0;
2842 unsigned NumImplicitCopyConstructorsDeclared = 0;
2845 unsigned NumImplicitMoveConstructors = 0;
2849 unsigned NumImplicitMoveConstructorsDeclared = 0;
2852 unsigned NumImplicitCopyAssignmentOperators = 0;
2856 unsigned NumImplicitCopyAssignmentOperatorsDeclared = 0;
2859 unsigned NumImplicitMoveAssignmentOperators = 0;
2863 unsigned NumImplicitMoveAssignmentOperatorsDeclared = 0;
2866 unsigned NumImplicitDestructors = 0;
2870 unsigned NumImplicitDestructorsDeclared = 0;
2879 void InitBuiltinTypes(
const TargetInfo &Target,
2885 class ObjCEncOptions {
2888 ObjCEncOptions(
unsigned Bits) : Bits(Bits) {}
2891 ObjCEncOptions() : Bits(0) {}
2892 ObjCEncOptions(
const ObjCEncOptions &RHS) : Bits(RHS.Bits) {}
2894 #define OPT_LIST(V) \ 2895 V(ExpandPointedToStructures, 0) \ 2896 V(ExpandStructures, 1) \ 2897 V(IsOutermostType, 2) \ 2898 V(EncodingProperty, 3) \ 2899 V(IsStructField, 4) \ 2900 V(EncodeBlockParameters, 5) \ 2901 V(EncodeClassNames, 6) \ 2903 #define V(N,I) ObjCEncOptions& set##N() { Bits |= 1 << I; return *this; } 2907 #define V(N,I) bool N() const { return Bits & 1 << I; } 2913 LLVM_NODISCARD ObjCEncOptions keepingOnly(ObjCEncOptions Mask)
const {
2914 return Bits & Mask.Bits;
2917 LLVM_NODISCARD ObjCEncOptions forComponentType()
const {
2918 ObjCEncOptions Mask = ObjCEncOptions()
2919 .setIsOutermostType()
2920 .setIsStructField();
2921 return Bits & ~Mask.Bits;
2926 void getObjCEncodingForTypeImpl(QualType t, std::string &S,
2927 ObjCEncOptions Options,
2928 const FieldDecl *Field,
2929 QualType *NotEncodedT =
nullptr)
const;
2932 void getObjCEncodingForStructureImpl(RecordDecl *RD, std::string &S,
2933 const FieldDecl *Field,
2934 bool includeVBases =
true,
2935 QualType *NotEncodedT=
nullptr)
const;
2939 void getObjCEncodingForMethodParameter(Decl::ObjCDeclQualifier QT,
2940 QualType T, std::string& S,
2941 bool Extended)
const;
2945 bool isMSStaticDataMemberInlineDefinition(
const VarDecl *VD)
const;
2967 getInlineVariableDefinitionKind(
const VarDecl *VD)
const;
2992 llvm::PointerIntPair<StoredDeclsMap *, 1> LastSDM;
2994 std::vector<Decl *> TraversalScope;
2996 std::unique_ptr<ParentMap> Parents;
2998 std::unique_ptr<VTableContextBase> VTContext;
3000 void ReleaseDeclContextMaps();
3009 PSF_Invalid = 0x80000000U,
3021 : Decl(Decl), PragmaSectionLocation(PragmaSectionLocation),
3022 SectionFlags(SectionFlags) {}
3073 size_t Alignment ) {
3074 return C.Allocate(Bytes, Alignment);
3111 size_t Alignment ) {
3112 return C.Allocate(Bytes, Alignment);
3126 template <
typename Owner,
typename T,
3135 return new (Ctx)
LazyData(Source, Value);
3139 #endif // LLVM_CLANG_AST_ASTCONTEXT_H static uint64_t getFieldOffset(const ASTContext &C, const FieldDecl *FD)
const IncompleteArrayType * getAsIncompleteArrayType(QualType T) const
CanQualType SatShortAccumTy
void setPrimaryMergedDecl(Decl *D, Decl *Primary)
const Type * Ty
The locally-unqualified type.
Represents a function declaration or definition.
void setjmp_bufDecl(TypeDecl *jmp_bufDecl)
Set the type for the C jmp_buf type.
Smart pointer class that efficiently represents Objective-C method names.
QualType getObjCIdType() const
Represents the Objective-CC id type.
Holds information about both target-independent and target-specific builtins, allowing easy queries b...
CanQualType LongDoubleComplexTy
A (possibly-)qualified type.
static void DumpRecordLayout(raw_ostream &OS, const RecordDecl *RD, const ASTContext &C, CharUnits Offset, unsigned IndentLevel, const char *Description, bool PrintSizeInfo, bool IncludeVirtualBases)
QualType getBuiltinVaListType() const
Retrieve the type of the __builtin_va_list type.
bool operator==(CanQual< T > x, CanQual< U > y)
InlineVariableDefinitionKind
Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be placed into a PointerUnion...
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
FunctionType - C99 6.7.5.3 - Function Declarators.
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
The fixed point semantics work similarly to llvm::fltSemantics.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
C Language Family Type Representation.
void setObjCClassRedefinitionType(QualType RedefType)
Set the user-written type that redefines 'SEL'.
void setucontext_tDecl(TypeDecl *ucontext_tDecl)
Set the type for the C ucontext_t type.
RawCommentList Comments
All comments in this translation unit.
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
Decl - This represents one declaration (or definition), e.g.
CanQualType ObjCBuiltinSelTy
QualType getUnqualifiedObjCPointerType(QualType type) const
getUnqualifiedObjCPointerType - Returns version of Objective-C pointer type with lifetime qualifier r...
The base class of the type hierarchy.
QualType getsigjmp_bufType() const
Retrieve the C sigjmp_buf type.
CanQualType getNSUIntegerType() const
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Optional< CharUnits > getTypeSizeInCharsIfKnown(const Type *Ty) const
QualType withConst() const
const TargetInfo & getTargetInfo() const
A container of type source information.
QualType getLogicalOperationType() const
The result type of logical operations, '<', '>', '!=', etc.
QualType getWCharType() const
Return the unique wchar_t type available in C++ (and available as __wchar_t as a Microsoft extension)...
Represents a C++ constructor within a class.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
QualType getConstType(QualType T) const
Return the uniqued reference to the type for a const qualified type.
unsigned getTypeAlign(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in bits.
QualType withFastQualifiers(unsigned TQs) const
const RawComment * getRaw() const LLVM_READONLY
Represents a variable declaration or definition.
const SourceManager & getSourceManager() const
void removeObjCLifetime()
QualType getRawCFConstantStringType() const
Get the structure type used to representation CFStrings, or NULL if it hasn't yet been built...
Extra information about a function prototype.
Declaration context for names declared as extern "C" in C++.
LangAS
Defines the address space values used by the address space qualifier of QualType. ...
ObjCMethodDecl - Represents an instance or class method declaration.
void setRaw(const RawComment *RC)
QualType getObjCClassType() const
Represents the Objective-C Class type.
Stores a list of template parameters for a TemplateDecl and its derived classes.
Describes how types, statements, expressions, and declarations should be printed. ...
const internal::VariadicDynCastAllOfMatcher< Stmt, BlockExpr > blockExpr
Matches a reference to a block.
Represents a parameter to a function.
QualType getQualifiedType(QualType T, Qualifiers Qs) const
Return a type with additional qualifiers.
Represents the builtin template declaration which is used to implement __make_integer_seq and other b...
The collection of all-type qualifiers we support.
Represents a struct/union/class.
One of these records is kept for each identifier that is lexed.
bool isObjCClassType(QualType T) const
bool isObjCIdType(QualType T) const
This table allows us to fully hide how we implement multi-keyword caching.
Represents a class type in Objective C.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getLifetimeQualifiedType(QualType type, Qualifiers::ObjCLifetime lifetime)
Return a type with the given lifetime qualifier.
Represents a member of a struct/union/class.
static CGCXXABI * createCXXABI(CodeGenModule &CGM)
DynTypedNodeList getParents(const NodeT &Node)
Returns the parents of the given node (within the traversal scope).
void setBOOLDecl(TypedefDecl *TD)
Save declaration of 'BOOL' typedef.
DynTypedNodeList(ArrayRef< DynTypedNode > A)
bool addressSpaceMapManglingFor(LangAS AS) const
The iterator over UnresolvedSets.
Container for either a single DynTypedNode or for an ArrayRef to DynTypedNode.
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
Defines the clang::attr::Kind enum.
clang::CharUnits operator*(clang::CharUnits::QuantityType Scale, const clang::CharUnits &CU)
void setPrintingPolicy(const clang::PrintingPolicy &Policy)
llvm::APSInt MakeIntValue(uint64_t Value, QualType Type) const
Make an APSInt of the appropriate width and signedness for the given Value and integer Type...
BlockVarCopyInit(Expr *CopyExpr, bool CanThrow)
CanQualType OCLReserveIDTy
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Describes a module or submodule.
RawCommentList & getRawCommentList()
CanQualType getComplexType(CanQualType T) const
Expr * getCopyExpr() const
ObjCContainerDecl - Represents a container for method declarations.
CharUnits - This is an opaque type for sizes expressed in character units.
A convenient class for passing around template argument information.
void setcudaConfigureCallDecl(FunctionDecl *FD)
CanQualType SatShortFractTy
QualType getVolatileType(QualType T) const
Return the uniqued reference to the type for a volatile qualified type.
CanQualType SatUnsignedShortAccumTy
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Keeps track of the mangled names of lambda expressions and block literals within a particular context...
QualType getObjCNSStringType() const
Concrete class used by the front-end to report problems and issues.
const clang::PrintingPolicy & getPrintingPolicy() const
Selector GetNullarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing a nullary selector.
Represents a declaration of a type.
CanQualType PseudoObjectTy
LangAS getAddressSpace() const
CXXMethodVector::const_iterator overridden_cxx_method_iterator
QualType getObjCClassRedefinitionType() const
Retrieve the type that Class has been defined to, which may be different from the built-in Class if C...
QualType getCVRQualifiedType(QualType T, unsigned CVR) const
Return a type with additional const, volatile, or restrict qualifiers.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
TypedefDecl * getBOOLDecl() const
Retrieve declaration of 'BOOL' typedef.
const DependentSizedArrayType * getAsDependentSizedArrayType(QualType T) const
Defines the Linkage enumeration and various utility functions.
import_range local_imports() const
virtual unsigned getExnObjectAlignment() const
Return the alignment (in bits) of the thrown exception object.
Represents an Objective-C protocol declaration.
unsigned getTypeAlign(const Type *T) const
A cache of the value of this pointer, in the most recent generation in which we queried it...
unsigned getTypeUnadjustedAlign(QualType T) const
Return the ABI-specified natural alignment of a (complete) type T, before alignment adjustments...
Represents an ObjC class declaration.
QualType getObjCProtoType() const
Retrieve the type of the Objective-C Protocol class.
QualType getBOOLType() const
type of 'BOOL' type.
Decl * getPrimaryMergedDecl(Decl *D)
IntrusiveRefCntPtr< ExternalASTSource > ExternalSource
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
llvm::iterator_range< overridden_cxx_method_iterator > overridden_method_range
The APFixedPoint class works similarly to APInt/APSInt in that it is a functional replacement for a s...
CanQualType Float128ComplexTy
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Provides definitions for the various language-specific address spaces.
const XRayFunctionFilter & getXRayFilter() const
llvm::StringMap< SectionInfo > SectionInfos
ArrayRef< Module * > getModulesWithMergedDefinition(const NamedDecl *Def)
Get the additional modules in which the definition Def has been merged.
Represents a prototype with parameter type info, e.g.
llvm::iterator_range< import_iterator > import_range
Represents a ValueDecl that came out of a declarator.
DeclarationNameTable DeclarationNames
TypeInfo getTypeInfo(QualType T) const
IdentifierInfo * getNSObjectName() const
Retrieve the identifier 'NSObject'.
ArraySizeModifier
Capture whether this is a normal array (e.g.
bool hasSameType(const Type *T1, const Type *T2) const
bool isObjCSelType(QualType T) const
void addObjCLifetime(ObjCLifetime type)
bool AnyObjCImplementation()
Return true if there is at least one @implementation in the TU.
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
CanQualType UnsignedShortFractTy
Exposes information about the current target.
Represents an array type in C++ whose size is a value-dependent expression.
CommentOptions CommentOpts
Options for parsing comments.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
This represents one expression.
Defines the clang::LangOptions interface.
QualType getucontext_tType() const
Retrieve the C ucontext_t type.
bool isInSystemHeader(SourceLocation Loc) const
Returns if a SourceLocation is in a system header.
Declaration of a template type parameter.
Implements an efficient mapping from strings to IdentifierInfo nodes.
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
CanQualType OMPArraySectionTy
Defines an enumeration for C++ overloaded operators.
unsigned getFastQualifiers() const
Optional< CharUnits > getTypeSizeInCharsIfKnown(QualType Ty) const
comments::CommandTraits & getCommentCommandTraits() const
static ImportDecl * getNextLocalImport(ImportDecl *Import)
void setObjCIdRedefinitionType(QualType RedefType)
Set the user-written type that redefines id.
An allocator for Storage objects, which uses a small cache to objects, used to reduce malloc()/free()...
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
DynTypedNodeList(const DynTypedNode &N)
Represents a C++ template name within the type system.
QualType getFILEType() const
Retrieve the C FILE type.
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
void addDestruction(T *Ptr) const
If T isn't trivially destructible, calls AddDeallocation to register it for destruction.
PartialDiagnostic::StorageAllocator & getDiagAllocator()
Qualifiers Quals
The local qualifiers.
bool hasSameNullabilityTypeQualifier(QualType SubT, QualType SuperT, bool IsParam) const
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
Represents a GCC generic vector type.
const Type * getCanonicalType(const Type *T) const
static bool CanThrow(Expr *E, ASTContext &Ctx)
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Common base class for placeholders for types that get replaced by placeholder type deduction: C++11 a...
Implements C++ ABI-specific semantic analysis functions.
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
void setOriginalDecl(const Decl *Orig)
CanQualType getNSIntegerType() const
CallingConv
CallingConv - Specifies the calling convention that a function uses.
const SanitizerBlacklist & getSanitizerBlacklist() const
const ast_type_traits::DynTypedNode * begin() const
IdentifierInfo * getNSCopyingName()
Retrieve the identifier 'NSCopying'.
Abstract interface for external sources of AST nodes.
SourceLocation PragmaSectionLocation
QualType getWideCharType() const
Return the type of wide characters.
QualType getBuiltinMSVaListType() const
Retrieve the type of the __builtin_ms_va_list type.
QualType getObjCIdRedefinitionType() const
Retrieve the type that id has been defined to, which may be different from the built-in id if id has ...
SelectorTable & Selectors
QualType getCanonicalType() const
llvm::PointerUnion< VarTemplateDecl *, MemberSpecializationInfo * > TemplateOrSpecializationInfo
A type synonym for the TemplateOrInstantiation mapping.
Encodes a location in the source.
CharUnits getExnObjectAlignment() const
Return the alignment (in bytes) of the thrown exception object.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
QualType getObjCSelRedefinitionType() const
Retrieve the type that 'SEL' has been defined to, which may be different from the built-in 'SEL' if '...
A structure for storing an already-substituted template template parameter pack.
Kind getKind() const LLVM_READONLY
Represents the declaration of a struct/union/class/enum.
QualType getFunctionNoProtoType(QualType ResultTy) const
QualType getObjCSelType() const
Retrieve the type that corresponds to the predefined Objective-C 'SEL' type.
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangl...
Represents a static or instance method of a struct/union/class.
const ConstantArrayType * getAsConstantArrayType(QualType T) const
QualType getWIntType() const
In C99, this returns a type compatible with the type defined in <stddef.h> as defined by the target...
static const ComplexType * getComplexType(QualType type)
Return the complex type that we are meant to emit.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
ObjCCategoryDecl - Represents a category declaration.
BuiltinTemplateKind
Kinds of BuiltinTemplateDecl.
bool isSignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is signed or an enumeration types whose underlying ty...
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
bool isObjCObjectPointerType() const
void setExprAndFlag(Expr *CopyExpr, bool CanThrow)
Represents one property declaration in an Objective-C interface.
We have found a comment attached to this particular declaration.
const SmallVectorImpl< Type * > & getTypes() const
FunctionDecl * getcudaConfigureCallDecl()
bool isTargetAddressSpace(LangAS AS)
void setObjCSuperType(QualType ST)
llvm::DenseMap< const Decl *, RawCommentAndCacheFlags > RedeclComments
Mapping from declarations to comments attached to any redeclaration.
std::vector< Decl * > getTraversalScope() const
CanQualType SatUnsignedShortFractTy
bool hasSameUnqualifiedType(QualType T1, QualType T2) const
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
llvm::PointerIntPair< Expr *, 1, bool > ExprAndFlag
Describes a module import declaration, which makes the contents of the named module visible in the cu...
QualType getObjCInstanceType()
Retrieve the Objective-C "instancetype" type, if already known; otherwise, returns a NULL type;...
unsigned getTargetAddressSpace(Qualifiers Q) const
ast_type_traits::DynTypedNode DynTypedNode
Defines various enumerations that describe declaration and type specifiers.
void * Allocate(size_t Size, unsigned Align=8) const
const DynTypedNode & operator[](size_t N) const
CanQualType UnsignedShortTy
Base class for declarations which introduce a typedef-name.
ast_type_traits::DynTypedNode Node
Represents a template argument.
TagTypeKind
The kind of a tag type.
Dataflow Directional Tag Classes.
SectionInfo(DeclaratorDecl *Decl, SourceLocation PragmaSectionLocation, int SectionFlags)
A qualifier set is used to build a set of qualifiers.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
CanQualType getAdjustedType(CanQualType Orig, CanQualType New) const
The base class of all kinds of template declarations (e.g., class, function, etc.).
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
QualType getRestrictType(QualType T) const
Return the uniqued reference to the type for a restrict qualified type.
CanQualType UnsignedShortAccumTy
unsigned[(unsigned) LangAS::FirstTargetAddressSpace] LangASMap
The type of a lookup table which maps from language-specific address spaces to target-specific ones...
Reads an AST files chain containing the contents of a translation unit.
CanQualType getPointerType(CanQualType T) const
CanQualType getDecayedType(CanQualType T) const
CanQualType UnsignedLongLongTy
std::unique_ptr< DiagnosticConsumer > create(StringRef OutputFile, DiagnosticOptions *Diags, bool MergeChildRecords=false)
Returns a DiagnosticConsumer that serializes diagnostics to a bitcode file.
The name of a declaration.
Represents the declaration of an Objective-C type parameter.
void setASTMutationListener(ASTMutationListener *Listener)
Attach an AST mutation listener to the AST context.
const Type * strip(QualType type)
Collect any qualifiers on the given type and return an unqualified type.
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
bool hasObjCLifetime() const
QualType AutoRRefDeductTy
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
llvm::BumpPtrAllocator & getAllocator() const
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any...
A dynamically typed AST node container.
const Decl * getOriginalDecl() const LLVM_READONLY
Represents a pointer to an Objective C object.
Copy initialization expr of a __block variable and a boolean flag that indicates whether the expressi...
CanQualType ObjCBuiltinBoolTy
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
QualType getCanonicalTypeInternal() const
Selector getSelector(unsigned NumArgs, IdentifierInfo **IIV)
Can create any sort of selector.
uint64_t getCharWidth() const
Return the size of the character type, in bits.
bool hasNonFastQualifiers() const
Return true if the set contains any qualifiers which require an ExtQuals node to be allocated...
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
void addComment(const RawComment &RC)
llvm::DenseMap< const Decl *, comments::FullComment * > ParsedComments
Mapping from declarations to parsed comments attached to any redeclaration.
Holds information about the various types of exception specification.
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream...
Optional< NullabilityKind > getNullability(const ASTContext &context) const
Determine the nullability of the given type.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
QualType getObjCConstantStringInterface() const
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
QualType getQualifiedType(const Type *T, Qualifiers Qs) const
Return a type with additional qualifiers.
SourceManager & getSourceManager()
bool isIncompleteType(NamedDecl **Def=nullptr) const
Types are partitioned into 3 broad categories (C99 6.2.5p1): object types, function types...
ASTMutationListener * getASTMutationListener() const
Retrieve a pointer to the AST mutation listener associated with this AST context, if any...
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
void setObjCNSStringType(QualType T)
TranslationUnitDecl * getTranslationUnitDecl() const
void Deallocate(void *Ptr) const
Defines the clang::SourceLocation class and associated facilities.
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
static QualType getCanonicalParamType(ASTContext &C, QualType T)
Represents a C++ struct/union/class.
IdentifierInfo * getTypePackElementName() const
Represents a template specialization type whose template cannot be resolved, e.g. ...
Selector GetUnarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing an unary selector.
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
Represents a C array with an unspecified size.
Missing a type from <stdio.h>
IdentifierInfo * getMakeIntegerSeqName() const
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
ObjCIvarDecl - Represents an ObjC instance variable.
bool operator!=(CanQual< T > x, CanQual< U > y)
Provides information a specialization of a member of a class template, which may be a member function...
Builtin::Context & BuiltinInfo
Writes an AST file containing the contents of a translation unit.
StringLiteral - This represents a string literal expression, e.g.
Defines the clang::TargetInfo interface.
A SourceLocation and its associated SourceManager.
void setObjCSelRedefinitionType(QualType RedefType)
Set the user-written type that redefines 'SEL'.
const VariableArrayType * getAsVariableArrayType(QualType T) const
QualType getjmp_bufType() const
Retrieve the C jmp_buf type.
The top declaration context.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
llvm::PointerUnion< T, LazyData * > ValueType
GVALinkage
A more specific kind of linkage than enum Linkage.
A lazy value (of type T) that is within an AST node of type Owner, where the value might change in la...
T * Allocate(size_t Num=1) const
const ast_type_traits::DynTypedNode * end() const
A trivial tuple used to represent a source range.
This represents a decl that may have a name.
void setsigjmp_bufDecl(TypeDecl *sigjmp_bufDecl)
Set the type for the C sigjmp_buf type.
void setFILEDecl(TypeDecl *FILEDecl)
Set the type for the C FILE type.
TypeInfo(uint64_t Width, unsigned Align, bool AlignIsRequired)
const TargetInfo * getAuxTargetInfo() const
Represents a C array with a specified size that is not an integer-constant-expression.
unsigned getTargetAddressSpace(QualType T) const
size_t getASTAllocatedMemory() const
Return the total amount of physical memory allocated for representing AST nodes and type information...
static bool isObjCNSObjectType(QualType Ty)
Return true if this is an NSObject object with its NSObject attribute set.
IdentifierInfo * getBoolName() const
Retrieve the identifier 'bool'.
Missing a type from <setjmp.h>
SourceLocation getBegin() const
const LangOptions & getLangOpts() const
FullSourceLoc getFullLoc(SourceLocation Loc) const
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
Represents the canonical version of C arrays with a specified constant size.
This class handles loading and caching of source files into memory.
uint64_t getTypeSize(const Type *T) const
bool isObjCNSObjectType() const
A class which abstracts out some details necessary for making a call.
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
static CharUnits getDeclAlign(Expr *E, CharUnits TypeAlign, ASTContext &Context)
A helper function to get the alignment of a Decl referred to by DeclRefExpr or MemberExpr.
Qualifiers::ObjCLifetime getObjCLifetime() const
Returns lifetime attribute of this type.
ComparisonCategories CompCategories
Types and expressions required to build C++2a three-way comparisons using operator<=>, including the values return by builtin <=> operators.