clang 22.0.0git
ASTContext Class Reference

Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic analysis of a file. More...

#include "clang/AST/ASTContext.h"

Inheritance diagram for ASTContext:
[legend]

Classes

struct  BuiltinVectorTypeInfo
struct  CUDAConstantEvalContext
struct  CUDAConstantEvalContextRAII
struct  CXXRecordDeclRelocationInfo
struct  SectionInfo

Public Types

enum  GetBuiltinTypeError {
  GE_None , GE_Missing_type , GE_Missing_stdio , GE_Missing_setjmp ,
  GE_Missing_ucontext
}
enum  NeedExtraManglingDecl_t { NeedExtraManglingDecl }
enum class  InlineVariableDefinitionKind { None , Weak , WeakUnknown , Strong }
enum  PragmaSectionFlag : unsigned {
  PSF_None = 0 , PSF_Read = 0x1 , PSF_Write = 0x2 , PSF_Execute = 0x4 ,
  PSF_Implicit = 0x8 , PSF_ZeroInit = 0x10 , PSF_Invalid = 0x80000000U
}
using TemplateOrSpecializationInfo
 A type synonym for the TemplateOrInstantiation mapping.
using overridden_cxx_method_iterator = CXXMethodVector::const_iterator
using overridden_method_range
using import_range = llvm::iterator_range<import_iterator>

Public Member Functions

std::optional< CXXRecordDeclRelocationInfogetRelocationInfoForCXXRecord (const CXXRecordDecl *) const
void setRelocationInfoForCXXRecord (const CXXRecordDecl *, CXXRecordDeclRelocationInfo)
bool containsAddressDiscriminatedPointerAuth (QualType T) const
 Examines a given type, and returns whether the type itself is address discriminated, or any transitively embedded types contain data that is address discriminated.
bool containsNonRelocatablePointerAuth (QualType T)
 Examines a given type, and returns whether the type itself or any data it transitively contains has a pointer authentication schema that is not safely relocatable.
interp::ContextgetInterpContext ()
 Returns the clang bytecode interpreter context.
ParentMapContextgetParentMapContext ()
 Returns the dynamic AST node parent map context.
ArrayRef< Decl * > getTraversalScope () const
void setTraversalScope (const std::vector< Decl * > &)
template<typename NodeT>
DynTypedNodeList getParents (const NodeT &Node)
 Forwards to get node parents from the ParentMapContext.
template<>
DynTypedNodeList getParents (const DynTypedNode &Node)
const clang::PrintingPolicygetPrintingPolicy () const
void setPrintingPolicy (const clang::PrintingPolicy &Policy)
SourceManager & getSourceManager ()
const SourceManager & getSourceManager () const
void cleanup ()
llvm::BumpPtrAllocator & getAllocator () const
void * Allocate (size_t Size, unsigned Align=8) const
template<typename T>
T * Allocate (size_t Num=1) const
void Deallocate (void *Ptr) const
llvm::StringRef backupStr (llvm::StringRef S) const
DeclListNode * AllocateDeclListNode (clang::NamedDecl *ND)
 Allocates a DeclListNode or returns one from the ListNodeFreeList pool.
void DeallocateDeclListNode (DeclListNode *N)
 Deallocates a DeclListNode by returning it to the ListNodeFreeList pool.
size_t getASTAllocatedMemory () const
 Return the total amount of physical memory allocated for representing AST nodes and type information.
size_t getSideTableAllocatedMemory () const
 Return the total memory used for various side tables.
PartialDiagnostic::DiagStorageAllocator & getDiagAllocator ()
const TargetInfo & getTargetInfo () const
const TargetInfo * getAuxTargetInfo () const
const QualType GetHigherPrecisionFPType (QualType ElementType) const
QualType getIntTypeForBitwidth (unsigned DestWidth, unsigned Signed) const
 getIntTypeForBitwidth - sets integer QualTy according to specified details: bitwidth, signed/unsigned.
QualType getRealTypeForBitwidth (unsigned DestWidth, FloatModeKind ExplicitType) const
 getRealTypeForBitwidth - sets floating point QualTy according to specified bitwidth.
bool AtomicUsesUnsupportedLibcall (const AtomicExpr *E) const
const LangOptions & getLangOpts () const
bool isDependenceAllowed () const
const NoSanitizeList & getNoSanitizeList () const
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 ignorelist.
const XRayFunctionFilter & getXRayFilter () const
const ProfileList & getProfileList () const
DiagnosticsEnginegetDiagnostics () const
FullSourceLoc getFullLoc (SourceLocation Loc) const
TargetCXXABI::Kind getCXXABIKind () const
 Return the C++ ABI kind that should be used.
void cacheRawCommentForDecl (const Decl &OriginalD, const RawComment &Comment) const
 Attaches Comment to OriginalD and to its redeclaration chain and removes the redeclaration chain from the set of commentless chains.
RawCommentgetRawCommentForDeclNoCacheImpl (const Decl *D, const SourceLocation RepresentativeLocForDecl, const std::map< unsigned, RawComment * > &CommentsInFile) const
RawCommentgetRawCommentForDeclNoCache (const Decl *D) const
 Return the documentation comment attached to a given declaration, without looking into cache.
void addComment (const RawComment &RC)
const RawCommentgetRawCommentForAnyRedecl (const Decl *D, const Decl **OriginalDecl=nullptr) const
 Return the documentation comment attached to a given declaration.
void attachCommentsToJustParsedDecls (ArrayRef< Decl * > Decls, const Preprocessor *PP)
 Searches existing comments for doc comments that should be attached to Decls.
comments::FullCommentgetCommentForDecl (const Decl *D, const Preprocessor *PP) const
 Return parsed documentation comment attached to a given declaration.
comments::FullCommentgetLocalCommentForDeclUncached (const Decl *D) const
 Return parsed documentation comment attached to a given declaration.
comments::FullCommentcloneFullComment (comments::FullComment *FC, const Decl *D) const
comments::CommandTraits & getCommentCommandTraits () const
AttrVecgetDeclAttrs (const Decl *D)
 Retrieve the attributes for the given declaration.
void eraseDeclAttrs (const Decl *D)
 Erase the attributes corresponding to the given declaration.
MemberSpecializationInfogetInstantiatedFromStaticDataMember (const VarDecl *Var)
 If this variable is an instantiated static data member of a class template specialization, returns the templated static data member from which it was instantiated.
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 a class template.
TemplateOrSpecializationInfo getTemplateOrSpecializationInfo (const VarDecl *Var)
void setTemplateOrSpecializationInfo (VarDecl *Inst, TemplateOrSpecializationInfo TSI)
NamedDeclgetInstantiatedFromUsingDecl (NamedDecl *Inst)
 If the given using decl Inst is an instantiation of another (possibly unresolved) using decl, return it.
void setInstantiatedFromUsingDecl (NamedDecl *Inst, NamedDecl *Pattern)
 Remember that the using decl Inst is an instantiation of the using decl Pattern of a class template.
UsingEnumDeclgetInstantiatedFromUsingEnumDecl (UsingEnumDecl *Inst)
 If the given using-enum decl Inst is an instantiation of another using-enum decl, return it.
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 template.
UsingShadowDeclgetInstantiatedFromUsingShadowDecl (UsingShadowDecl *Inst)
void setInstantiatedFromUsingShadowDecl (UsingShadowDecl *Inst, UsingShadowDecl *Pattern)
FieldDeclgetInstantiatedFromUnnamedFieldDecl (FieldDecl *Field) const
void setInstantiatedFromUnnamedFieldDecl (FieldDecl *Inst, FieldDecl *Tmpl)
overridden_cxx_method_iterator overridden_methods_begin (const CXXMethodDecl *Method) const
overridden_cxx_method_iterator overridden_methods_end (const CXXMethodDecl *Method) const
unsigned overridden_methods_size (const CXXMethodDecl *Method) const
overridden_method_range overridden_methods (const CXXMethodDecl *Method) const
void addOverriddenMethod (const CXXMethodDecl *Method, const CXXMethodDecl *Overridden)
 Note that the given C++ Method overrides the given Overridden method.
void getOverriddenMethods (const NamedDecl *Method, SmallVectorImpl< const NamedDecl * > &Overridden) const
 Return C++ or ObjC overridden methods for the given Method.
void addedLocalImportDecl (ImportDecl *Import)
 Notify the AST context that a new import declaration has been parsed or implicitly created within this translation unit.
import_range local_imports () const
Decl * getPrimaryMergedDecl (Decl *D)
void setPrimaryMergedDecl (Decl *D, Decl *Primary)
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 visible.
void deduplicateMergedDefinitionsFor (NamedDecl *ND)
 Clean up the merged definition list.
ArrayRef< Module * > getModulesWithMergedDefinition (const NamedDecl *Def)
 Get the additional modules in which the definition Def has been merged.
void addModuleInitializer (Module *M, Decl *Init)
 Add a declaration to the list of declarations that are initialized for a module.
void addLazyModuleInitializers (Module *M, ArrayRef< GlobalDeclID > IDs)
ArrayRef< Decl * > getModuleInitializers (Module *M)
 Get the initializations to perform when importing a module, if any.
void setCurrentNamedModule (Module *M)
 Set the (C++20) module we are building.
Module * getCurrentNamedModule () const
 Get module under construction, nullptr if this is not a C++20 module.
bool isInSameModule (const Module *M1, const Module *M2) const
 If the two module M1 and M2 are in the same module.
TranslationUnitDecl * getTranslationUnitDecl () const
void addTranslationUnitDecl ()
ExternCContextDeclgetExternCContextDecl () const
 ASTContext (LangOptions &LOpts, SourceManager &SM, IdentifierTable &idents, SelectorTable &sels, Builtin::Context &builtins, TranslationUnitKind TUKind)
 ASTContext (const ASTContext &)=delete
ASTContextoperator= (const ASTContext &)=delete
 ~ASTContext ()
void setExternalSource (IntrusiveRefCntPtr< ExternalASTSource > Source)
 Attach an external AST source to the AST context.
ExternalASTSource * getExternalSource () const
 Retrieve a pointer to the external AST source associated with this AST context, if any.
IntrusiveRefCntPtr< ExternalASTSource > getExternalSourcePtr () const
 Retrieve a pointer to the external AST source associated with this AST context, if any.
void setASTMutationListener (ASTMutationListener *Listener)
 Attach an AST mutation listener to the AST context.
ASTMutationListener * getASTMutationListener () const
 Retrieve a pointer to the AST mutation listener associated with this AST context, if any.
void PrintStats () const
const SmallVectorImpl< Type * > & getTypes () const
BuiltinTemplateDeclbuildBuiltinTemplateDecl (BuiltinTemplateKind BTK, const IdentifierInfo *II) const
RecordDeclbuildImplicitRecord (StringRef Name, RecordDecl::TagKind TK=RecordDecl::TagKind::Struct) const
 Create a new implicit TU-level CXXRecordDecl or RecordDecl declaration.
TypedefDeclbuildImplicitTypedef (QualType T, StringRef Name) const
 Create a new implicit TU-level typedef declaration.
TypedefDeclgetInt128Decl () const
 Retrieve the declaration for the 128-bit signed integer type.
TypedefDeclgetUInt128Decl () const
 Retrieve the declaration for the 128-bit unsigned integer type.
QualType getAddrSpaceQualType (QualType T, LangAS AddressSpace) const
 Return the uniqued reference to the type for an address space qualified type with the specified type and address space.
QualType removeAddrSpaceQualType (QualType T) const
 Remove any existing address space on the type and returns the type with qualifiers intact (or that's the idea anyway)
uint16_t getPointerAuthVTablePointerDiscriminator (const CXXRecordDecl *RD)
 Return the "other" discriminator used for the pointer auth schema used for vtable pointers in instances of the requested type.
uint16_t getPointerAuthTypeDiscriminator (QualType T)
 Return the "other" type-specific discriminator for the given type.
QualType applyObjCProtocolQualifiers (QualType type, ArrayRef< ObjCProtocolDecl * > protocols, bool &hasError, bool allowOnPointerType=false) const
 Apply Objective-C protocol qualifiers to the given type.
QualType getObjCGCQualType (QualType T, Qualifiers::GC gcAttr) const
 Return the uniqued reference to the type for an Objective-C gc-qualified type.
QualType removePtrSizeAddrSpace (QualType T) const
 Remove the existing address space on the type if it is a pointer size address space and return the type with qualifiers intact.
QualType getRestrictType (QualType T) const
 Return the uniqued reference to the type for a restrict qualified type.
QualType getVolatileType (QualType T) const
 Return the uniqued reference to the type for a volatile qualified type.
QualType getConstType (QualType T) const
 Return the uniqued reference to the type for a const qualified type.
QualType adjustType (QualType OldType, llvm::function_ref< QualType(QualType)> Adjust) const
 Rebuild a type, preserving any existing type sugar.
const FunctionTypeadjustFunctionType (const FunctionType *Fn, FunctionType::ExtInfo EInfo)
 Change the ExtInfo on a function type.
QualType adjustFunctionResultType (QualType FunctionType, QualType NewResultType)
 Change the result type of a function type, preserving sugar such as attributed types.
CanQualType getCanonicalFunctionResultType (QualType ResultType) const
 Adjust the given function result type.
void adjustDeducedFunctionResultType (FunctionDecl *FD, QualType ResultType)
 Change the result type of a function type once it is deduced.
QualType getFunctionTypeWithExceptionSpec (QualType Orig, const FunctionProtoType::ExceptionSpecInfo &ESI) const
 Get a function type and produce the equivalent function type with the specified exception specification.
bool hasSameFunctionTypeIgnoringExceptionSpec (QualType T, QualType U) const
 Determine whether two function types are the same, ignoring exception specifications in cases where they're part of the type.
void adjustExceptionSpec (FunctionDecl *FD, const FunctionProtoType::ExceptionSpecInfo &ESI, bool AsWritten=false)
 Change the exception specification on a function once it is delay-parsed, instantiated, or computed.
QualType getFunctionTypeWithoutPtrSizes (QualType T)
 Get a function type and produce the equivalent function type where pointer size address spaces in the return type and parameter types are replaced with the default address space.
bool hasSameFunctionTypeIgnoringPtrSizes (QualType T, QualType U)
 Determine whether two function types are the same, ignoring pointer sizes in the return type and parameter types.
QualType getFunctionTypeWithoutParamABIs (QualType T) const
 Get or construct a function type that is equivalent to the input type except that the parameter ABI annotations are stripped.
bool hasSameFunctionTypeIgnoringParamABI (QualType T, QualType U) const
 Determine if two function types are the same, ignoring parameter ABI annotations.
QualType getComplexType (QualType T) const
 Return the uniqued reference to the type for a complex number with the specified element type.
CanQualType getComplexType (CanQualType T) const
QualType getPointerType (QualType T) const
 Return the uniqued reference to the type for a pointer to the specified type.
CanQualType getPointerType (CanQualType T) const
QualType getCountAttributedType (QualType T, Expr *CountExpr, bool CountInBytes, bool OrNull, ArrayRef< TypeCoupledDeclRefInfo > DependentDecls) const
QualType getAdjustedType (QualType Orig, QualType New) const
 Return the uniqued reference to a type adjusted from the original type to a new type.
CanQualType getAdjustedType (CanQualType Orig, CanQualType New) const
QualType getDecayedType (QualType T) const
 Return the uniqued reference to the decayed version of the given type.
CanQualType getDecayedType (CanQualType T) const
QualType getDecayedType (QualType Orig, QualType Decayed) const
 Return the uniqued reference to a specified decay from the original type to the decayed type.
QualType getArrayParameterType (QualType Ty) const
 Return the uniqued reference to a specified array parameter type from the original array type.
QualType getAtomicType (QualType T) const
 Return the uniqued reference to the atomic type for the specified type.
QualType getBlockPointerType (QualType T) const
 Return the uniqued reference to the type for a block of the specified type.
QualType getBlockDescriptorType () const
 Gets the struct used to keep track of the descriptor for pointer to blocks.
QualType getReadPipeType (QualType T) const
 Return a read_only pipe type for the specified type.
QualType getWritePipeType (QualType T) const
 Return a write_only pipe type for the specified type.
QualType getBitIntType (bool Unsigned, unsigned NumBits) const
 Return a bit-precise integer type with the specified signedness and bit count.
QualType getDependentBitIntType (bool Unsigned, Expr *BitsExpr) const
 Return a dependent bit-precise integer type with the specified signedness and bit count.
QualType getPredefinedSugarType (PredefinedSugarType::Kind KD) const
QualType getBlockDescriptorExtendedType () const
 Gets the struct used to keep track of the extended descriptor for pointer to blocks.
OpenCLTypeKind getOpenCLTypeKind (const Type *T) const
 Map an AST Type to an OpenCLTypeKind enum value.
LangAS getOpenCLTypeAddrSpace (const Type *T) const
 Get address space for OpenCL type.
LangAS getDefaultOpenCLPointeeAddrSpace ()
 Returns default address space based on OpenCL version and enabled features.
void setcudaConfigureCallDecl (FunctionDecl *FD)
FunctionDecl * getcudaConfigureCallDecl ()
bool BlockRequiresCopying (QualType Ty, const VarDecl *D)
 Returns true iff we need copy/dispose helpers for the given type.
bool getByrefLifetime (QualType Ty, Qualifiers::ObjCLifetime &Lifetime, bool &HasByrefExtendedLayout) const
 Returns true, if given type has a known lifetime.
QualType getLValueReferenceType (QualType T, bool SpelledAsLValue=true) const
 Return the uniqued reference to the type for an lvalue reference to the specified type.
QualType getRValueReferenceType (QualType T) const
 Return the uniqued reference to the type for an rvalue reference to the specified type.
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 nested name.
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 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.
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 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.
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 getVariableArrayDecayedType (QualType Ty) const
 Returns a vla type where known sizes are replaced with [*].
BuiltinVectorTypeInfo getBuiltinVectorTypeInfo (const BuiltinType *VecTy) const
 Returns the element type, element count and number of vectors (in case of tuple) for a builtin vector type.
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 number of elements.
QualType getWebAssemblyExternrefType () const
 Return a WebAssembly externref type.
QualType getVectorType (QualType VectorType, unsigned NumElts, VectorKind VecKind) const
 Return the unique reference to a vector 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.
QualType getExtVectorType (QualType VectorType, unsigned NumElts) const
 Return the unique reference to an extended vector type of the specified element type and size.
QualType getDependentSizedExtVectorType (QualType VectorType, Expr *SizeExpr, SourceLocation AttrLoc) const
QualType getConstantMatrixType (QualType ElementType, unsigned NumRows, unsigned NumColumns) const
 Return the unique reference to the matrix type of the specified element type and size.
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 getDependentAddressSpaceType (QualType PointeeType, Expr *AddrSpaceExpr, SourceLocation AttrLoc) const
QualType getFunctionNoProtoType (QualType ResultTy, const FunctionType::ExtInfo &Info) const
 Return a K&R style C function type like 'int()'.
QualType getFunctionNoProtoType (QualType ResultTy) const
QualType getFunctionType (QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
 Return a normal function type with a typed argument list.
QualType adjustStringLiteralBaseType (QualType StrLTy) const
QualType getTypeDeclType (ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TypeDecl *Decl) const
QualType getTypeDeclType (const TypeDecl *Decl) const
 Return the unique reference to the type for the specified type declaration.
QualType getTypeDeclType (const TagDecl *) const=delete
 Use the normal 'getFooBarType' constructors to obtain these types.
QualType getTypeDeclType (const TypedefDecl *) const=delete
QualType getTypeDeclType (const TypeAliasDecl *) const=delete
QualType getTypeDeclType (const UnresolvedUsingTypenameDecl *) const=delete
CanQualType getCanonicalTypeDeclType (const TypeDecl *TD) const
QualType getUsingType (ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const UsingShadowDecl *D, QualType UnderlyingType=QualType()) const
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.
CanQualType getCanonicalTagType (const TagDecl *TD) const
QualType getTagType (ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TagDecl *TD, bool OwnsTag) const
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 positive bits of its elements.
bool isRepresentableIntegerValue (llvm::APSInt &Value, QualType T)
 Determine whether the given integral value is representable within the given type T.
template<typename RangeT>
bool computeEnumBits (RangeT EnumConstants, unsigned &NumNegativeBits, unsigned &NumPositiveBits)
 Compute NumNegativeBits and NumPositiveBits for an enum based on the constant values of its enumerators.
CanQualType getCanonicalUnresolvedUsingType (const UnresolvedUsingTypenameDecl *D) const
QualType getUnresolvedUsingType (ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const UnresolvedUsingTypenameDecl *D) const
QualType getAttributedType (attr::Kind attrKind, QualType modifiedType, QualType equivalentType, const Attr *attr=nullptr) const
QualType getAttributedType (const Attr *attr, QualType modifiedType, QualType equivalentType) const
QualType getAttributedType (NullabilityKind nullability, QualType modifiedType, QualType equivalentType)
QualType getBTFTagAttributedType (const BTFTypeTagAttr *BTFAttr, QualType Wrapped) const
QualType getHLSLAttributedResourceType (QualType Wrapped, QualType Contained, const HLSLAttributedResourceType::Attributes &Attrs)
QualType getHLSLInlineSpirvType (uint32_t Opcode, uint32_t Size, uint32_t Alignment, ArrayRef< SpirvOperand > Operands)
QualType getSubstTemplateTypeParmType (QualType Replacement, Decl *AssociatedDecl, unsigned Index, UnsignedOrNone PackIndex, bool Final) const
 Retrieve a substitution-result type.
QualType getSubstTemplateTypeParmPackType (Decl *AssociatedDecl, unsigned Index, bool Final, const TemplateArgument &ArgPack)
QualType getSubstBuiltinTemplatePack (const TemplateArgument &ArgPack)
QualType getTemplateTypeParmType (unsigned Depth, unsigned Index, bool ParameterPack, TemplateTypeParmDecl *ParmDecl=nullptr) const
 Retrieve the template type parameter type for a template parameter or parameter pack with the given depth, index, and (optionally) name.
QualType getCanonicalTemplateSpecializationType (TemplateName T, ArrayRef< TemplateArgument > CanonicalArgs) const
QualType getTemplateSpecializationType (ElaboratedTypeKeyword Keyword, TemplateName T, ArrayRef< TemplateArgument > SpecifiedArgs, ArrayRef< TemplateArgument > CanonicalArgs, QualType Underlying=QualType()) const
QualType getTemplateSpecializationType (ElaboratedTypeKeyword Keyword, TemplateName T, ArrayRef< TemplateArgumentLoc > SpecifiedArgs, ArrayRef< TemplateArgument > CanonicalArgs, QualType Canon=QualType()) const
TypeSourceInfogetTemplateSpecializationTypeInfo (ElaboratedTypeKeyword Keyword, SourceLocation ElaboratedKeywordLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKeywordLoc, TemplateName T, SourceLocation TLoc, const TemplateArgumentListInfo &SpecifiedArgs, ArrayRef< TemplateArgument > CanonicalArgs, QualType Canon=QualType()) const
QualType getParenType (QualType NamedType) const
QualType getMacroQualifiedType (QualType UnderlyingTy, const IdentifierInfo *MacroII) const
QualType getDependentNameType (ElaboratedTypeKeyword Keyword, NestedNameSpecifier NNS, const IdentifierInfo *Name) const
QualType getDependentTemplateSpecializationType (ElaboratedTypeKeyword Keyword, const DependentTemplateStorage &Name, ArrayRef< TemplateArgumentLoc > Args) const
QualType getDependentTemplateSpecializationType (ElaboratedTypeKeyword Keyword, const DependentTemplateStorage &Name, ArrayRef< TemplateArgument > Args, bool IsCanonical=false) const
TemplateArgument getInjectedTemplateArg (NamedDecl *ParamDecl) const
QualType getPackExpansionType (QualType Pattern, UnsignedOrNone NumExpansions, bool ExpectPackInType=true) const
 Form a pack expansion type with the given pattern.
QualType getObjCInterfaceType (const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl=nullptr) const
 getObjCInterfaceType - Return the unique reference to the type for the specified ObjC interface decl.
QualType getObjCObjectType (QualType Base, ObjCProtocolDecl *const *Protocols, unsigned NumProtocols) const
 Legacy interface: cannot provide type arguments or __kindof.
QualType getObjCObjectType (QualType Base, ArrayRef< QualType > typeArgs, ArrayRef< ObjCProtocolDecl * > protocols, bool isKindOf) const
QualType getObjCTypeParamType (const ObjCTypeParamDecl *Decl, ArrayRef< ObjCProtocolDecl * > protocols) const
void adjustObjCTypeParamBoundType (const ObjCTypeParamDecl *Orig, ObjCTypeParamDecl *New) const
bool ObjCObjectAdoptsQTypeProtocols (QualType QT, ObjCInterfaceDecl *Decl)
 ObjCObjectAdoptsQTypeProtocols - Checks that protocols in IC's protocol list adopt all protocols in QT's qualified-id protocol list.
bool QIdProtocolsAdoptObjCObjectProtocols (QualType QT, ObjCInterfaceDecl *IDecl)
 QIdProtocolsAdoptObjCObjectProtocols - Checks that protocols in QT's qualified-id protocol list adopt all protocols in IDecl's list of protocols.
QualType getObjCObjectPointerType (QualType OIT) const
 Return a ObjCObjectPointerType type for the given ObjCObjectType.
QualType getTypeOfExprType (Expr *E, TypeOfKind Kind) const
 C23 feature and GCC extension.
QualType getTypeOfType (QualType QT, TypeOfKind Kind) const
 getTypeOfType - Unlike many "get<Type>" functions, we don't unique TypeOfType nodes.
QualType getReferenceQualifiedType (const Expr *e) const
 getReferenceQualifiedType - Given an expr, will return the type for that expression, as in [dcl.type.simple]p4 but without taking id-expressions and class member access into account.
QualType getDecltypeType (Expr *e, QualType UnderlyingType) const
 C++11 decltype.
QualType getPackIndexingType (QualType Pattern, Expr *IndexExpr, bool FullySubstituted=false, ArrayRef< QualType > Expansions={}, UnsignedOrNone Index=std::nullopt) const
QualType getUnaryTransformType (QualType BaseType, QualType UnderlyingType, UnaryTransformType::UTTKind UKind) const
 Unary type transforms.
QualType getAutoType (QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent, bool IsPack=false, TemplateDecl *TypeConstraintConcept=nullptr, ArrayRef< TemplateArgument > TypeConstraintArgs={}) const
 C++11 deduced auto type.
QualType getAutoDeductType () const
 C++11 deduction pattern for 'auto' type.
QualType getAutoRRefDeductType () const
 C++11 deduction pattern for 'auto &&' type.
QualType getUnconstrainedType (QualType T) const
 Remove any type constraints from a template parameter type, for equivalence comparison of template parameters.
QualType getDeducedTemplateSpecializationType (ElaboratedTypeKeyword Keyword, TemplateName Template, QualType DeducedType, bool IsDependent) const
 C++17 deduced class template specialization type.
QualType getSizeType () const
 Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
CanQualType getCanonicalSizeType () const
QualType getSignedSizeType () const
 Return the unique signed counterpart of the integer type corresponding to size_t.
CanQualType getIntMaxType () const
 Return the unique type for "intmax_t" (C99 7.18.1.5), defined in <stdint.h>.
CanQualType getUIntMaxType () const
 Return the unique type for "uintmax_t" (C99 7.18.1.5), defined in <stdint.h>.
QualType getWCharType () const
 Return the unique wchar_t type available in C++ (and available as __wchar_t as a Microsoft extension).
QualType getWideCharType () const
 Return the type of wide characters.
QualType getSignedWCharType () const
 Return the type of "signed wchar_t".
QualType getUnsignedWCharType () const
 Return the type of "unsigned wchar_t".
QualType getWIntType () const
 In C99, this returns a type compatible with the type defined in <stddef.h> as defined by the target.
QualType getIntPtrType () const
 Return a type compatible with "intptr_t" (C99 7.18.1.4), as defined by the target.
QualType getUIntPtrType () const
 Return a type compatible with "uintptr_t" (C99 7.18.1.4), as defined by the target.
QualType getPointerDiffType () const
 Return the unique type for "ptrdiff_t" (C99 7.17) defined in <stddef.h>.
QualType getUnsignedPointerDiffType () const
 Return the unique unsigned counterpart of "ptrdiff_t" integer type.
QualType getProcessIDType () const
 Return the unique type for "pid_t" defined in <sys/types.h>.
QualType getCFConstantStringType () const
 Return the C structure type used to represent constant CFStrings.
QualType getObjCSuperType () const
 Returns the C struct type for objc_super.
void setObjCSuperType (QualType ST)
QualType getRawCFConstantStringType () const
 Get the structure type used to representation CFStrings, or NULL if it hasn't yet been built.
void setCFConstantStringType (QualType T)
TypedefDeclgetCFConstantStringDecl () const
RecordDeclgetCFConstantStringTagDecl () const
void setObjCConstantStringInterface (ObjCInterfaceDecl *Decl)
QualType getObjCConstantStringInterface () const
QualType getObjCNSStringType () const
void setObjCNSStringType (QualType T)
QualType getObjCIdRedefinitionType () const
 Retrieve the type that id has been defined to, which may be different from the built-in id if id has been typedef'd.
void setObjCIdRedefinitionType (QualType RedefType)
 Set the user-written type that redefines id.
QualType getObjCClassRedefinitionType () const
 Retrieve the type that Class has been defined to, which may be different from the built-in Class if Class has been typedef'd.
void setObjCClassRedefinitionType (QualType RedefType)
 Set the user-written type that redefines 'SEL'.
QualType getObjCSelRedefinitionType () const
 Retrieve the type that 'SEL' has been defined to, which may be different from the built-in 'SEL' if 'SEL' has been typedef'd.
void setObjCSelRedefinitionType (QualType RedefType)
 Set the user-written type that redefines 'SEL'.
IdentifierInfo * getNSObjectName () const
 Retrieve the identifier 'NSObject'.
IdentifierInfo * getNSCopyingName ()
 Retrieve the identifier 'NSCopying'.
CanQualType getNSUIntegerType () const
CanQualType getNSIntegerType () const
IdentifierInfo * getBoolName () const
 Retrieve the identifier 'bool'.
QualType getObjCInstanceType ()
 Retrieve the Objective-C "instancetype" type.
TypedefDeclgetObjCInstanceTypeDecl ()
 Retrieve the typedef declaration corresponding to the Objective-C "instancetype" type.
void setFILEDecl (TypeDecl *FILEDecl)
 Set the type for the C FILE type.
QualType getFILEType () const
 Retrieve the C FILE type.
void setjmp_bufDecl (TypeDecl *jmp_bufDecl)
 Set the type for the C jmp_buf type.
QualType getjmp_bufType () const
 Retrieve the C jmp_buf type.
void setsigjmp_bufDecl (TypeDecl *sigjmp_bufDecl)
 Set the type for the C sigjmp_buf type.
QualType getsigjmp_bufType () const
 Retrieve the C sigjmp_buf type.
void setucontext_tDecl (TypeDecl *ucontext_tDecl)
 Set the type for the C ucontext_t type.
QualType getucontext_tType () const
 Retrieve the C ucontext_t type.
CanQualType getLogicalOperationType () const
 The result type of logical operations, '<', '>', '!=', etc.
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.
void getObjCEncodingForPropertyType (QualType T, std::string &S) const
 Emit the Objective-C property type encoding for the given type T into S.
void getLegacyIntegralTypeEncoding (QualType &t) const
 getLegacyIntegralTypeEncoding - Another legacy compatibility encoding: 32-bit longs are encoded as 'l' or 'L' , but not always.
void getObjCEncodingForTypeQualifier (Decl::ObjCDeclQualifier QT, std::string &S) const
 Put the string version of the type qualifiers QT into S.
std::string getObjCEncodingForFunctionDecl (const FunctionDecl *Decl) const
 Emit the encoded type for the function Decl into S.
std::string getObjCEncodingForMethodDecl (const ObjCMethodDecl *Decl, bool Extended=false) const
 Emit the encoded type for the method declaration Decl into S.
std::string getObjCEncodingForBlock (const BlockExpr *blockExpr) const
 Return the encoded type for this block declaration.
std::string getObjCEncodingForPropertyDecl (const ObjCPropertyDecl *PD, const Decl *Container) const
 getObjCEncodingForPropertyDecl - Return the encoded type for this method declaration.
bool ProtocolCompatibleWithProtocol (ObjCProtocolDecl *lProto, ObjCProtocolDecl *rProto) const
 ProtocolCompatibleWithProtocol - return 'true' if 'lProto' is in the inheritance hierarchy of 'rProto'.
ObjCPropertyImplDeclgetObjCPropertyImplDeclForPropertyDecl (const ObjCPropertyDecl *PD, const Decl *Container) const
CharUnits getObjCEncodingTypeSize (QualType T) const
 Return the size of type T for Objective-C encoding purpose, in characters.
TypedefDeclgetObjCIdDecl () const
 Retrieve the typedef corresponding to the predefined id type in Objective-C.
QualType getObjCIdType () const
 Represents the Objective-CC id type.
TypedefDeclgetObjCSelDecl () const
 Retrieve the typedef corresponding to the predefined 'SEL' type in Objective-C.
QualType getObjCSelType () const
 Retrieve the type that corresponds to the predefined Objective-C 'SEL' type.
PointerAuthQualifier getObjCMemberSelTypePtrAuth ()
TypedefDeclgetObjCClassDecl () const
 Retrieve the typedef declaration corresponding to the predefined Objective-C 'Class' type.
QualType getObjCClassType () const
 Represents the Objective-C Class type.
ObjCInterfaceDeclgetObjCProtocolDecl () const
 Retrieve the Objective-C class declaration corresponding to the predefined Protocol class.
TypedefDecl * getBOOLDecl () const
 Retrieve declaration of 'BOOL' typedef.
void setBOOLDecl (TypedefDecl *TD)
 Save declaration of 'BOOL' typedef.
QualType getBOOLType () const
 type of 'BOOL' type.
QualType getObjCProtoType () const
 Retrieve the type of the Objective-C Protocol class.
TypedefDeclgetBuiltinVaListDecl () const
 Retrieve the C type declaration corresponding to the predefined __builtin_va_list type.
QualType getBuiltinVaListType () const
 Retrieve the type of the __builtin_va_list type.
DeclgetVaListTagDecl () const
 Retrieve the C type declaration corresponding to the predefined __va_list_tag type used to help define the __builtin_va_list type for some targets.
TypedefDeclgetBuiltinMSVaListDecl () const
 Retrieve the C type declaration corresponding to the predefined __builtin_ms_va_list type.
QualType getBuiltinMSVaListType () const
 Retrieve the type of the __builtin_ms_va_list type.
TagDecl * getMSGuidTagDecl () const
 Retrieve the implicitly-predeclared 'struct _GUID' declaration.
CanQualType getMSGuidType () const
 Retrieve the implicitly-predeclared 'struct _GUID' type.
TagDecl * getMSTypeInfoTagDecl () const
 Retrieve the implicitly-predeclared 'struct type_info' declaration.
bool canBuiltinBeRedeclared (const FunctionDecl *) const
 Return whether a declaration to a builtin is allowed to be overloaded/redeclared.
QualType getCVRQualifiedType (QualType T, unsigned CVR) const
 Return a type with additional const, volatile, or restrict qualifiers.
QualType getQualifiedType (SplitQualType split) const
 Un-split a SplitQualType.
QualType getQualifiedType (QualType T, Qualifiers Qs) const
 Return a type with additional qualifiers.
QualType getQualifiedType (const Type *T, Qualifiers Qs) const
 Return a type with additional qualifiers.
QualType getLifetimeQualifiedType (QualType type, Qualifiers::ObjCLifetime lifetime)
 Return a type with the given lifetime qualifier.
QualType getUnqualifiedObjCPointerType (QualType type) const
 getUnqualifiedObjCPointerType - Returns version of Objective-C pointer type with lifetime qualifier removed.
QualType getPointerAuthType (QualType Ty, PointerAuthQualifier PointerAuth)
 Return a type with the given __ptrauth qualifier.
unsigned char getFixedPointScale (QualType Ty) const
unsigned char getFixedPointIBits (QualType Ty) const
llvm::FixedPointSemantics getFixedPointSemantics (QualType Ty) const
llvm::APFixedPoint getFixedPointMax (QualType Ty) const
llvm::APFixedPoint getFixedPointMin (QualType Ty) const
DeclarationNameInfo getNameForTemplate (TemplateName Name, SourceLocation NameLoc) const
TemplateName getOverloadedTemplateName (UnresolvedSetIterator Begin, UnresolvedSetIterator End) const
 Retrieve the template name that corresponds to a non-empty lookup.
TemplateName getAssumedTemplateName (DeclarationName Name) const
 Retrieve a template name representing an unqualified-id that has been assumed to name a template for ADL purposes.
TemplateName getQualifiedTemplateName (NestedNameSpecifier Qualifier, bool TemplateKeyword, TemplateName Template) const
 Retrieve the template name that represents a qualified template name such as std::vector.
TemplateName getDependentTemplateName (const DependentTemplateStorage &Name) const
 Retrieve the template name that represents a dependent template name such as MetaFun::template operator+.
TemplateName getSubstTemplateTemplateParm (TemplateName replacement, Decl *AssociatedDecl, unsigned Index, UnsignedOrNone PackIndex, bool Final) const
TemplateName getSubstTemplateTemplateParmPack (const TemplateArgument &ArgPack, Decl *AssociatedDecl, unsigned Index, bool Final) const
TemplateName getDeducedTemplateName (TemplateName Underlying, DefaultArguments DefaultArgs) const
 Represents a TemplateName which had some of its default arguments deduced.
QualType DecodeTypeStr (const char *&Str, const ASTContext &Context, ASTContext::GetBuiltinTypeError &Error, bool &RequireICE, bool AllowTypeModifiers) const
QualType GetBuiltinType (unsigned ID, GetBuiltinTypeError &Error, unsigned *IntegerConstantArgs=nullptr) const
 Return the type for the specified builtin.
Qualifiers::GC getObjCGCAttrKind (QualType Ty) const
 Return one of the GCNone, Weak or Strong Objective-C garbage collection attributes.
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 the same GCC vector type.
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-length representation of the RISC-V vector builtin type for a specific vector-length.
bool areLaxCompatibleRVVTypes (QualType FirstType, QualType SecondType)
 Return true if the given vector types are lax-compatible RISC-V vector types as defined by -flax-vector-conversions=, which permits implicit conversions between vectors with different number of elements and/or incompatible element types, false otherwise.
bool hasDirectOwnershipQualifier (QualType Ty) const
 Return true if the type has been explicitly qualified with ObjC ownership.
const llvm::fltSemantics & getFloatTypeSemantics (QualType T) const
 Return the APFloat 'semantics' for the specified scalar floating point type.
TypeInfo getTypeInfo (const Type *T) const
 Get the size and alignment of the specified complete type in bits.
TypeInfo getTypeInfo (QualType T) const
unsigned getOpenMPDefaultSimdAlign (QualType T) const
 Get default simd alignment of the specified complete type in bits.
uint64_t getTypeSize (QualType T) const
 Return the size of the specified (complete) type T, in bits.
uint64_t getTypeSize (const Type *T) const
uint64_t getCharWidth () const
 Return the size of the character type, in bits.
CharUnits toCharUnitsFromBits (int64_t BitSize) const
 Convert a size in bits to a size in characters.
int64_t toBits (CharUnits CharSize) const
 Convert a size in characters to a size in bits.
CharUnits getTypeSizeInChars (QualType T) const
 Return the size of the specified (complete) type T, in characters.
CharUnits getTypeSizeInChars (const Type *T) const
std::optional< CharUnits > getTypeSizeInCharsIfKnown (QualType Ty) const
std::optional< CharUnits > getTypeSizeInCharsIfKnown (const Type *Ty) const
unsigned getTypeAlign (QualType T) const
 Return the ABI-specified alignment of a (complete) type T, in bits.
unsigned getTypeAlign (const Type *T) const
unsigned getTypeUnadjustedAlign (QualType T) const
 Return the ABI-specified natural alignment of a (complete) type T, before alignment adjustments, in bits.
unsigned getTypeUnadjustedAlign (const Type *T) const
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 alignment (for example, from alignment attributes).
CharUnits getTypeAlignInChars (QualType T) const
 Return the ABI-specified alignment of a (complete) type T, in characters.
CharUnits getTypeAlignInChars (const Type *T) const
CharUnits getPreferredTypeAlignInChars (QualType T) const
 Return the PreferredAlignment of a (complete) type T, in characters.
CharUnits getTypeUnadjustedAlignInChars (QualType T) const
 getTypeUnadjustedAlignInChars - Return the ABI-specified alignment of a type, in characters, before alignment adjustments.
CharUnits getTypeUnadjustedAlignInChars (const Type *T) const
TypeInfoChars getTypeInfoDataSizeInChars (QualType T) const
TypeInfoChars getTypeInfoInChars (const Type *T) const
TypeInfoChars getTypeInfoInChars (QualType T) const
bool isAlignmentRequired (const Type *T) const
 Determine if the alignment the type has was required using an alignment attribute.
bool isAlignmentRequired (QualType T) const
bool isPromotableIntegerType (QualType T) const
 More type predicates useful for type checking/promotion.
unsigned getPreferredTypeAlign (QualType T) const
 Return the "preferred" alignment of the specified type T for the current target, in bits.
unsigned getPreferredTypeAlign (const Type *T) const
 getPreferredTypeAlign - Return the "preferred" alignment of the specified type for the current target in bits.
unsigned getTargetDefaultAlignForAttributeAligned () const
 Return the default alignment for attribute((aligned)) on this target, to be used if no alignment value is specified.
unsigned getAlignOfGlobalVar (QualType T, const VarDecl *VD) const
 Return the alignment in bits that should be given to a global variable with type T.
CharUnits getAlignOfGlobalVarInChars (QualType T, const VarDecl *VD) const
 Return the alignment in characters that should be given to a global variable with type T.
unsigned getMinGlobalAlignOfVar (uint64_t Size, const VarDecl *VD) const
 Return the minimum alignment as specified by the target.
CharUnits getDeclAlign (const Decl *D, bool ForAlignof=false) const
 Return a conservative estimate of the alignment of the specified decl D.
CharUnits getExnObjectAlignment () const
 Return the alignment (in bytes) of the thrown exception object.
const ASTRecordLayoutgetASTRecordLayout (const RecordDecl *D) const
 Get or compute information about the layout of the specified record (struct/union/class) D, which indicates its size and field position information.
const ASTRecordLayoutgetASTObjCInterfaceLayout (const ObjCInterfaceDecl *D) const
 Get or compute information about the layout of the specified Objective-C interface.
void DumpRecordLayout (const RecordDecl *RD, raw_ostream &OS, bool Simple=false) const
const CXXMethodDeclgetCurrentKeyFunction (const CXXRecordDecl *RD)
 Get our current best idea for the key function of the given record decl, or nullptr if there isn't one.
void setNonKeyFunction (const CXXMethodDecl *method)
 Observe that the given method cannot be a key function.
CharUnits getOffsetOfBaseWithVBPtr (const CXXRecordDecl *RD) const
 Loading virtual member pointers using the virtual inheritance model always results in an adjustment using the vbtable even if the index is zero.
uint64_t getFieldOffset (const ValueDecl *FD) const
 Get the offset of a FieldDecl or IndirectFieldDecl, in bits.
uint64_t lookupFieldBitOffset (const ObjCInterfaceDecl *OID, const ObjCIvarDecl *Ivar) const
 Get the offset of an ObjCIvarDecl in bits.
CharUnits getMemberPointerPathAdjustment (const APValue &MP) const
 Find the 'this' offset for the member path in a pointer-to-member APValue.
bool isNearlyEmpty (const CXXRecordDecl *RD) const
VTableContextBasegetVTableContext ()
MangleContextcreateMangleContext (const TargetInfo *T=nullptr)
 If T is null pointer, assume the target in ASTContext.
MangleContextcreateDeviceMangleContext (const TargetInfo &T)
 Creates a device mangle context to correctly mangle lambdas in a mixed architecture compile by setting the lambda mangling number source to the DeviceLambdaManglingNumber.
void DeepCollectObjCIvars (const ObjCInterfaceDecl *OI, bool leafClass, SmallVectorImpl< const ObjCIvarDecl * > &Ivars) const
 DeepCollectObjCIvars - This routine first collects all declared, but not synthesized, ivars in super class and then collects all ivars, including those synthesized for current class.
unsigned CountNonClassIvars (const ObjCInterfaceDecl *OI) const
void CollectInheritedProtocols (const Decl *CDecl, llvm::SmallPtrSet< ObjCProtocolDecl *, 8 > &Protocols)
 CollectInheritedProtocols - Collect all protocols in current class and those inherited by it.
bool hasUniqueObjectRepresentations (QualType Ty, bool CheckIfTriviallyCopyable=true) const
 Return true if the specified type has unique object representations according to (C++17 [meta.unary.prop]p9)
CanQualType getCanonicalType (QualType T) const
 Return the canonical (structural) type corresponding to the specified potentially non-canonical type T.
const Type * getCanonicalType (const Type *T) const
CanQualType getCanonicalParamType (QualType T) const
 Return the canonical parameter type corresponding to the specific potentially non-canonical one.
bool hasSameType (QualType T1, QualType T2) const
 Determine whether the given types T1 and T2 are equivalent.
bool hasSameType (const Type *T1, const Type *T2) const
bool hasSameExpr (const Expr *X, const Expr *Y) const
 Determine whether the given expressions X and Y are equivalent.
QualType getUnqualifiedArrayType (QualType T, Qualifiers &Quals) const
 Return this type as a completely-unqualified array type, capturing the qualifiers in Quals.
QualType getUnqualifiedArrayType (QualType T) const
bool hasSameUnqualifiedType (QualType T1, QualType T2) const
 Determine whether the given types are equivalent after cvr-qualifiers have been removed.
bool hasSameNullabilityTypeQualifier (QualType SubT, QualType SuperT, bool IsParam) const
bool ObjCMethodsAreEqual (const ObjCMethodDecl *MethodDecl, const ObjCMethodDecl *MethodImp)
bool UnwrapSimilarTypes (QualType &T1, QualType &T2, bool AllowPiMismatch=true) const
 Attempt to unwrap two types that may be similar (C++ [conv.qual]).
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 of unknown bound) for the purpose of comparing the cv-decomposition of two types per C++ [conv.qual].
bool hasSimilarType (QualType T1, QualType T2) const
 Determine if two types are similar, according to the C++ rules.
bool hasCvrSimilarType (QualType T1, QualType T2)
 Determine if two types are similar, ignoring only CVR qualifiers.
CallingConv getDefaultCallingConvention (bool IsVariadic, bool IsCXXMethod) const
 Retrieves the default calling convention for the current context.
TemplateName getCanonicalTemplateName (TemplateName Name, bool IgnoreDeduced=false) const
 Retrieves the "canonical" template name that refers to a given template.
bool hasSameTemplateName (const TemplateName &X, const TemplateName &Y, bool IgnoreDeduced=false) const
 Determine whether the given template names refer to the same template.
bool isSameEntity (const NamedDecl *X, const NamedDecl *Y) const
 Determine whether the two declarations refer to the same entity.
bool isSameTemplateParameterList (const TemplateParameterList *X, const TemplateParameterList *Y) const
 Determine whether two template parameter lists are similar enough that they may be used in declarations of the same template.
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 the same template.
bool isSameAssociatedConstraint (const AssociatedConstraint &ACX, const AssociatedConstraint &ACY) const
 Determine whether two 'requires' expressions are similar enough that they may be used in re-declarations.
bool isSameConstraintExpr (const Expr *XCE, const Expr *YCE) const
 Determine whether two 'requires' expressions are similar enough that they may be used in re-declarations.
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 same template.
bool isSameDefaultTemplateArgument (const NamedDecl *X, const NamedDecl *Y) const
 Determine whether two default template arguments are similar enough that they may be used in declarations of the same template.
TemplateArgument getCanonicalTemplateArgument (const TemplateArgument &Arg) const
 Retrieve the "canonical" template argument.
bool canonicalizeTemplateArguments (MutableArrayRef< TemplateArgument > Args) const
 Canonicalize the given template argument list.
TemplateTemplateParmDeclgetCanonicalTemplateTemplateParmDecl (TemplateTemplateParmDecl *TTP) const
 Canonicalize the given TemplateTemplateParmDecl.
TemplateTemplateParmDeclfindCanonicalTemplateTemplateParmDeclInternal (TemplateTemplateParmDecl *TTP) const
TemplateTemplateParmDeclinsertCanonicalTemplateTemplateParmDeclInternal (TemplateTemplateParmDecl *CanonTTP) const
bool isSameTemplateArgument (const TemplateArgument &Arg1, const TemplateArgument &Arg2) const
 Determine whether the given template arguments Arg1 and Arg2 are equivalent.
const ArrayTypegetAsArrayType (QualType T) const
 Type Query functions.
const ConstantArrayType * getAsConstantArrayType (QualType T) const
const VariableArrayType * getAsVariableArrayType (QualType T) const
const IncompleteArrayType * getAsIncompleteArrayType (QualType T) const
const DependentSizedArrayType * getAsDependentSizedArrayType (QualType T) const
QualType getBaseElementType (const ArrayType *VAT) const
 Return the innermost element type of an array type.
QualType getBaseElementType (QualType QT) const
 Return the innermost element type of a type (which needn't actually be an array type).
uint64_t getConstantArrayElementCount (const ConstantArrayType *CA) const
 Return number of constant array elements.
uint64_t getArrayInitLoopExprElementCount (const ArrayInitLoopExpr *AILE) const
 Return number of elements initialized in an ArrayInitLoopExpr.
QualType getAdjustedParameterType (QualType T) const
 Perform adjustment on the parameter type of a function.
QualType getSignatureParameterType (QualType T) const
 Retrieve the parameter type as adjusted for use in the signature of a function, decaying array and function types and removing top-level cv-qualifiers.
QualType getExceptionObjectType (QualType T) const
QualType getArrayDecayedType (QualType T) const
 Return the properly qualified result of decaying the specified array type to a pointer.
QualType getPromotedIntegerType (QualType PromotableType) const
 Return the type that PromotableType will promote to: C99 6.3.1.1p2, assuming that PromotableType is a promotable integer type.
Qualifiers::ObjCLifetime getInnerObjCOwnership (QualType T) const
 Recurses in pointer/array types until it finds an Objective-C retainable type and returns its ownership.
QualType isPromotableBitField (Expr *E) const
 Whether this is a promotable bitfield reference according to C99 6.3.1.1p2, bullet 2 (and GCC extensions).
int getIntegerTypeOrder (QualType LHS, QualType RHS) const
 Return the highest ranked integer type, see C99 6.3.1.8p1.
int getFloatingTypeOrder (QualType LHS, QualType RHS) const
 Compare the rank of the two specified floating point types, ignoring the domain of the type (i.e.
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 floating-point semantics on the target (i.e.
unsigned getTargetAddressSpace (LangAS AS) const
LangAS getLangASForBuiltinAddressSpace (unsigned AS) const
uint64_t getTargetNullPointerValue (QualType QT) const
 Get target-dependent integer value for null pointer which is used for constant folding.
bool addressSpaceMapManglingFor (LangAS AS) const
bool hasAnyFunctionEffects () const
FunctionProtoType::ExceptionSpecInfo mergeExceptionSpecs (FunctionProtoType::ExceptionSpecInfo ESI1, FunctionProtoType::ExceptionSpecInfo ESI2, SmallVectorImpl< QualType > &ExceptionTypeStorage, bool AcceptDependent) const
QualType getCommonSugaredType (QualType X, QualType Y, bool Unqualified=false) const
bool typesAreCompatible (QualType T1, QualType T2, bool CompareUnqualified=false)
 Compatibility predicates used to check assignment expressions.
bool propertyTypesAreCompatible (QualType, QualType)
bool typesAreBlockPointerCompatible (QualType, QualType)
bool isObjCIdType (QualType T) const
bool isObjCClassType (QualType T) const
bool isObjCSelType (QualType T) const
bool ObjCQualifiedIdTypesAreCompatible (const ObjCObjectPointerType *LHS, const ObjCObjectPointerType *RHS, bool ForCompare)
 ObjCQualifiedIdTypesAreCompatible - We know that one of lhs/rhs is an ObjCQualifiedIDType.
bool ObjCQualifiedClassTypesAreCompatible (const ObjCObjectPointerType *LHS, const ObjCObjectPointerType *RHS)
 ObjCQualifiedClassTypesAreCompatible - compare Class<pr,...> and Class<pr1, ...>.
bool canAssignObjCInterfaces (const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
 canAssignObjCInterfaces - Return true if the two interface types are compatible for assignment from RHS to LHS.
bool canAssignObjCInterfaces (const ObjCObjectType *LHS, const ObjCObjectType *RHS)
bool canAssignObjCInterfacesInBlockPointer (const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT, bool BlockReturnType)
 canAssignObjCInterfacesInBlockPointer - This routine is specifically written for providing type-safety for objective-c pointers used to pass/return arguments in block literals.
bool areComparableObjCPointerTypes (QualType LHS, QualType RHS)
QualType areCommonBaseCompatible (const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
bool canBindObjCObjectType (QualType To, QualType From)
QualType mergeTypes (QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false, bool BlockReturnType=false, bool IsConditionalOperator=false)
QualType mergeFunctionTypes (QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false, bool AllowCXX=false, bool IsConditionalOperator=false)
QualType mergeFunctionParameterTypes (QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
 mergeFunctionParameterTypes - merge two types which appear as function parameter types
QualType mergeTransparentUnionType (QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
 mergeTransparentUnionType - if T is a transparent union type and a member of T is compatible with SubType, return the merged type, else return QualType()
QualType mergeTagDefinitions (QualType, QualType)
QualType mergeObjCGCQualifiers (QualType, QualType)
 mergeObjCGCQualifiers - This routine merges ObjC's GC attribute of 'LHS' and 'RHS' attributes and returns the merged version; including for function return types.
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.
void ResetObjCLayout (const ObjCInterfaceDecl *D)
void addObjCSubClass (const ObjCInterfaceDecl *D, const ObjCInterfaceDecl *SubClass)
unsigned getIntWidth (QualType T) const
QualType getCorrespondingUnsignedType (QualType T) const
QualType getCorrespondingSignedType (QualType T) const
QualType getCorrespondingSaturatedType (QualType Ty) const
QualType getCorrespondingUnsaturatedType (QualType Ty) const
QualType getCorrespondingSignedFixedPointType (QualType Ty) const
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.
bool isSentinelNullExpr (const Expr *E)
ObjCImplementationDeclgetObjCImplementation (ObjCInterfaceDecl *D)
 Get the implementation of the ObjCInterfaceDecl D, or nullptr if none exists.
ObjCCategoryImplDeclgetObjCImplementation (ObjCCategoryDecl *D)
 Get the implementation of the ObjCCategoryDecl D, or nullptr if none exists.
bool AnyObjCImplementation ()
 Return true if there is at least one @implementation in the TU.
void setObjCImplementation (ObjCInterfaceDecl *IFaceD, ObjCImplementationDecl *ImplD)
 Set the implementation of ObjCInterfaceDecl.
void setObjCImplementation (ObjCCategoryDecl *CatD, ObjCCategoryImplDecl *ImplD)
 Set the implementation of ObjCCategoryDecl.
const ObjCMethodDeclgetObjCMethodRedeclaration (const ObjCMethodDecl *MD) const
 Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists.
void setObjCMethodRedeclaration (const ObjCMethodDecl *MD, const ObjCMethodDecl *Redecl)
const ObjCInterfaceDeclgetObjContainingInterface (const NamedDecl *ND) const
 Returns the Objective-C interface that ND belongs to if it is an Objective-C method/property/ivar etc.
void setBlockVarCopyInit (const VarDecl *VD, Expr *CopyExpr, bool CanThrow)
 Set the copy initialization expression of a block var decl.
BlockVarCopyInit getBlockVarCopyInit (const VarDecl *VD) const
 Get the copy initialization expression of the VarDecl VD, or nullptr if none exists.
TypeSourceInfoCreateTypeSourceInfo (QualType T, unsigned Size=0) const
 Allocate an uninitialized TypeSourceInfo.
TypeSourceInfogetTrivialTypeSourceInfo (QualType T, SourceLocation Loc=SourceLocation()) const
 Allocate a TypeSourceInfo where all locations have been initialized to a given location, which defaults to the empty location.
void AddDeallocation (void(*Callback)(void *), void *Data) const
 Add a deallocation callback that will be invoked when the ASTContext is destroyed.
template<typename T>
void addDestruction (T *Ptr) const
 If T isn't trivially destructible, calls AddDeallocation to register it for destruction.
GVALinkage GetGVALinkageForFunction (const FunctionDecl *FD) const
GVALinkage GetGVALinkageForVariable (const VarDecl *VD) const
bool DeclMustBeEmitted (const Decl *D)
 Determines if the decl can be CodeGen'ed or deserialized from PCH lazily, only when used; this is only relevant for function or file scoped var definitions.
void forEachMultiversionedFunctionVersion (const FunctionDecl *FD, llvm::function_ref< void(FunctionDecl *)> Pred) const
 Visits all versions of a multiversioned function with the passed predicate.
const CXXConstructorDeclgetCopyConstructorForExceptionObject (CXXRecordDecl *RD)
void addCopyConstructorForExceptionObject (CXXRecordDecl *RD, CXXConstructorDecl *CD)
void addTypedefNameForUnnamedTagDecl (TagDecl *TD, TypedefNameDecl *TND)
TypedefNameDeclgetTypedefNameForUnnamedTagDecl (const TagDecl *TD)
void addDeclaratorForUnnamedTagDecl (TagDecl *TD, DeclaratorDecl *DD)
DeclaratorDeclgetDeclaratorForUnnamedTagDecl (const TagDecl *TD)
void setManglingNumber (const NamedDecl *ND, unsigned Number)
unsigned getManglingNumber (const NamedDecl *ND, bool ForAuxTarget=false) const
void setStaticLocalNumber (const VarDecl *VD, unsigned Number)
unsigned getStaticLocalNumber (const VarDecl *VD) const
bool hasSeenTypeAwareOperatorNewOrDelete () const
void setIsDestroyingOperatorDelete (const FunctionDecl *FD, bool IsDestroying)
bool isDestroyingOperatorDelete (const FunctionDecl *FD) const
void setIsTypeAwareOperatorNewOrDelete (const FunctionDecl *FD, bool IsTypeAware)
bool isTypeAwareOperatorNewOrDelete (const FunctionDecl *FD) const
MangleNumberingContextgetManglingNumberContext (const DeclContext *DC)
 Retrieve the context for computing mangling numbers in the given DeclContext.
MangleNumberingContextgetManglingNumberContext (NeedExtraManglingDecl_t, const Decl *D)
std::unique_ptr< MangleNumberingContextcreateMangleNumberingContext () const
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 normal bitfield.
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 the normal bitfield.
StringLiteralgetPredefinedStringLiteralFromCache (StringRef Key) const
 Return a string representing the human readable name for the specified function declaration or file name.
unsigned getNextStringLiteralVersion ()
 Return the next version number to be used for a string literal evaluated as part of constant evaluation.
MSGuidDeclgetMSGuidDecl (MSGuidDeclParts Parts) const
 Return a declaration for the global GUID object representing the given GUID value.
UnnamedGlobalConstantDeclgetUnnamedGlobalConstantDecl (QualType Ty, const APValue &Value) const
 Return a declaration for a uniquified anonymous global constant corresponding to a given APValue.
TemplateParamObjectDeclgetTemplateParamObjectDecl (QualType T, const APValue &V) const
 Return the template parameter object of the given type with the given value.
ParsedTargetAttr filterFunctionTargetAttrs (const TargetAttr *TD) const
 Parses the target attributes passed in, and returns only the ones that are valid feature names.
void getFunctionFeatureMap (llvm::StringMap< bool > &FeatureMap, const FunctionDecl *) const
void getFunctionFeatureMap (llvm::StringMap< bool > &FeatureMap, GlobalDecl GD) const
void registerSYCLEntryPointFunction (FunctionDecl *FD)
 Generates and stores SYCL kernel metadata for the provided SYCL kernel entry point function.
const SYCLKernelInfogetSYCLKernelInfo (QualType T) const
 Given a type used as a SYCL kernel name, returns a reference to the metadata generated from the corresponding SYCL kernel entry point.
const SYCLKernelInfofindSYCLKernelInfo (QualType T) const
 Returns a pointer to the metadata generated from the corresponding SYCLkernel entry point if the provided type corresponds to a registered SYCL kernel name.
void InitBuiltinTypes (const TargetInfo &Target, const TargetInfo *AuxTarget=nullptr)
 Initialize built-in types.
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 type.
bool isMSStaticDataMemberInlineDefinition (const VarDecl *VD) const
 Returns true if this is an inline-initialized static data member which is treated as a definition for MSVC compatibility.
InlineVariableDefinitionKind getInlineVariableDefinitionKind (const VarDecl *VD) const
 Determine whether a definition of this inline variable should be treated as a weak or strong definition.
OMPTraitInfogetNewOMPTraitInfo ()
 Return a new OMPTraitInfo object owned by this context.
bool mayExternalize (const Decl *D) const
 Whether a C++ static variable or CUDA/HIP kernel may be externalized.
bool shouldExternalize (const Decl *D) const
 Whether a C++ static variable or CUDA/HIP kernel should be externalized.
const CXXRecordDeclbaseForVTableAuthentication (const CXXRecordDecl *ThisClass) const
 Resolve the root record to be used to derive the vtable pointer authentication policy for the specified record.
bool useAbbreviatedThunkName (GlobalDecl VirtualMethodDecl, StringRef MangledName)
StringRef getCUIDHash () const

Static Public Member Functions

static ImportDecl * getNextLocalImport (ImportDecl *Import)
static bool isObjCNSObjectType (QualType Ty)
 Return true if this is an NSObject object with its NSObject attribute set.

Public Attributes

IdentifierTable & Idents
SelectorTable & Selectors
Builtin::Context & BuiltinInfo
const TranslationUnitKind TUKind
DeclarationNameTable DeclarationNames
IntrusiveRefCntPtr< ExternalASTSource > ExternalSource
ASTMutationListener * Listener = nullptr
struct clang::ASTContext::CUDAConstantEvalContext CUDAConstantEvalCtx
RawCommentList Comments
 All comments in this translation unit.
bool CommentsLoaded = false
 True if comments are already loaded from ExternalASTSource.
llvm::DenseMap< const Decl *, const RawComment * > DeclRawComments
 Mapping from declaration to directly attached comment.
llvm::DenseMap< const Decl *, const Decl * > RedeclChainComments
 Mapping from canonical declaration to the first redeclaration in chain that has a comment attached.
llvm::DenseMap< const Decl *, const Decl * > CommentlessRedeclChains
 Keeps track of redeclaration chains that don't have any comment attached.
llvm::DenseMap< const Decl *, comments::FullComment * > ParsedComments
 Mapping from declarations to parsed comments attached to any redeclaration.
CanQualType VoidTy
CanQualType BoolTy
CanQualType CharTy
CanQualType WCharTy
CanQualType WideCharTy
CanQualType WIntTy
CanQualType Char8Ty
CanQualType Char16Ty
CanQualType Char32Ty
CanQualType SignedCharTy
CanQualType ShortTy
CanQualType IntTy
CanQualType LongTy
CanQualType LongLongTy
CanQualType Int128Ty
CanQualType UnsignedCharTy
CanQualType UnsignedShortTy
CanQualType UnsignedIntTy
CanQualType UnsignedLongTy
CanQualType UnsignedLongLongTy
CanQualType UnsignedInt128Ty
CanQualType FloatTy
CanQualType DoubleTy
CanQualType LongDoubleTy
CanQualType Float128Ty
CanQualType Ibm128Ty
CanQualType ShortAccumTy
CanQualType AccumTy
CanQualType LongAccumTy
CanQualType UnsignedShortAccumTy
CanQualType UnsignedAccumTy
CanQualType UnsignedLongAccumTy
CanQualType ShortFractTy
CanQualType FractTy
CanQualType LongFractTy
CanQualType UnsignedShortFractTy
CanQualType UnsignedFractTy
CanQualType UnsignedLongFractTy
CanQualType SatShortAccumTy
CanQualType SatAccumTy
CanQualType SatLongAccumTy
CanQualType SatUnsignedShortAccumTy
CanQualType SatUnsignedAccumTy
CanQualType SatUnsignedLongAccumTy
CanQualType SatShortFractTy
CanQualType SatFractTy
CanQualType SatLongFractTy
CanQualType SatUnsignedShortFractTy
CanQualType SatUnsignedFractTy
CanQualType SatUnsignedLongFractTy
CanQualType HalfTy
CanQualType BFloat16Ty
CanQualType Float16Ty
CanQualType VoidPtrTy
CanQualType NullPtrTy
CanQualType DependentTy
CanQualType OverloadTy
CanQualType BoundMemberTy
CanQualType UnresolvedTemplateTy
CanQualType UnknownAnyTy
CanQualType BuiltinFnTy
CanQualType PseudoObjectTy
CanQualType ARCUnbridgedCastTy
CanQualType ObjCBuiltinIdTy
CanQualType ObjCBuiltinClassTy
CanQualType ObjCBuiltinSelTy
CanQualType ObjCBuiltinBoolTy
CanQualType OCLSamplerTy
CanQualType OCLEventTy
CanQualType OCLClkEventTy
CanQualType OCLQueueTy
CanQualType OCLReserveIDTy
CanQualType IncompleteMatrixIdxTy
CanQualType ArraySectionTy
CanQualType OMPArrayShapingTy
CanQualType OMPIteratorTy
QualType AutoDeductTy
QualType AutoRRefDeductTy
Decl * VaListTagDecl = nullptr
TagDecl * MSGuidTagDecl = nullptr
TagDecl * MSTypeInfoTagDecl = nullptr
llvm::DenseSet< const VarDecl * > CUDADeviceVarODRUsedByHost
 Keep track of CUDA/HIP device-side variables ODR-used by host code.
llvm::SetVector< const ValueDecl * > CUDAExternalDeviceDeclODRUsedByHost
 Keep track of CUDA/HIP external kernels or device variables ODR-used by host code.
llvm::DenseSet< const FunctionDecl * > CUDAImplicitHostDeviceFunUsedByDevice
 Keep track of CUDA/HIP implicit host device functions used on device side in device compilation.
llvm::DenseMap< CanQualType, SYCLKernelInfo > SYCLKernels
 Map of SYCL kernels indexed by the unique type used to name the kernel.
llvm::DenseMap< const CXXMethodDecl *, CXXCastPath > LambdaCastPaths
 For capturing lambdas with an explicit object parameter whose type is derived from the lambda type, we need to perform derived-to-base conversion so we can access the captures; the cast paths for that are stored here.
ComparisonCategories CompCategories
 Types and expressions required to build C++2a three-way comparisons using operator<=>, including the values return by builtin <=> operators.
unsigned NumImplicitDefaultConstructors = 0
 The number of implicitly-declared default constructors.
unsigned NumImplicitDefaultConstructorsDeclared = 0
 The number of implicitly-declared default constructors for which declarations were built.
unsigned NumImplicitCopyConstructors = 0
 The number of implicitly-declared copy constructors.
unsigned NumImplicitCopyConstructorsDeclared = 0
 The number of implicitly-declared copy constructors for which declarations were built.
unsigned NumImplicitMoveConstructors = 0
 The number of implicitly-declared move constructors.
unsigned NumImplicitMoveConstructorsDeclared = 0
 The number of implicitly-declared move constructors for which declarations were built.
unsigned NumImplicitCopyAssignmentOperators = 0
 The number of implicitly-declared copy assignment operators.
unsigned NumImplicitCopyAssignmentOperatorsDeclared = 0
 The number of implicitly-declared copy assignment operators for which declarations were built.
unsigned NumImplicitMoveAssignmentOperators = 0
 The number of implicitly-declared move assignment operators.
unsigned NumImplicitMoveAssignmentOperatorsDeclared = 0
 The number of implicitly-declared move assignment operators for which declarations were built.
unsigned NumImplicitDestructors = 0
 The number of implicitly-declared destructors.
unsigned NumImplicitDestructorsDeclared = 0
 The number of implicitly-declared destructors for which declarations were built.
llvm::StringMap< SectionInfoSectionInfos

Friends

class NestedNameSpecifier
class ASTDeclReader
class ASTReader
class ASTWriter
template<class>
class serialization::AbstractTypeReader
class CXXRecordDecl
class IncrementalParser
class DeclarationNameTable
class DeclContext

Detailed Description

Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic analysis of a file.

Definition at line 188 of file ASTContext.h.

Member Typedef Documentation

◆ import_range

using clang::ASTContext::import_range = llvm::iterator_range<import_iterator>

Definition at line 1151 of file ASTContext.h.

◆ overridden_cxx_method_iterator

using clang::ASTContext::overridden_cxx_method_iterator = CXXMethodVector::const_iterator

Definition at line 1113 of file ASTContext.h.

◆ overridden_method_range

Initial value:
llvm::iterator_range<overridden_cxx_method_iterator>

Definition at line 1122 of file ASTContext.h.

◆ TemplateOrSpecializationInfo

Initial value:
llvm::PointerUnion<VarTemplateDecl *, MemberSpecializationInfo *>

A type synonym for the TemplateOrInstantiation mapping.

Definition at line 515 of file ASTContext.h.

Member Enumeration Documentation

◆ GetBuiltinTypeError

Enumerator
GE_None 

No error.

GE_Missing_type 

Missing a type.

GE_Missing_stdio 

Missing a type from <stdio.h>

GE_Missing_setjmp 

Missing a type from <setjmp.h>

GE_Missing_ucontext 

Missing a type from <ucontext.h>

Definition at line 2534 of file ASTContext.h.

◆ InlineVariableDefinitionKind

Enumerator
None 

Not an inline variable.

Weak 

Weak definition of inline variable.

WeakUnknown 

Weak for now, might become strong later in this TU.

Strong 

Strong definition.

Definition at line 3637 of file ASTContext.h.

◆ NeedExtraManglingDecl_t

Enumerator
NeedExtraManglingDecl 

Definition at line 3453 of file ASTContext.h.

◆ PragmaSectionFlag

Enumerator
PSF_None 
PSF_Read 
PSF_Write 
PSF_Execute 
PSF_Implicit 
PSF_ZeroInit 
PSF_Invalid 

Definition at line 3689 of file ASTContext.h.

Constructor & Destructor Documentation

◆ ASTContext() [1/2]

ASTContext::ASTContext ( LangOptions & LOpts,
SourceManager & SM,
IdentifierTable & idents,
SelectorTable & sels,
Builtin::Context & builtins,
TranslationUnitKind TUKind )

Definition at line 936 of file ASTContext.cpp.

◆ ASTContext() [2/2]

clang::ASTContext::ASTContext ( const ASTContext & )
delete

◆ ~ASTContext()

ASTContext::~ASTContext ( )

Definition at line 1002 of file ASTContext.cpp.

Member Function Documentation

◆ addComment()

void ASTContext::addComment ( const RawComment & RC)

Definition at line 348 of file ASTContext.cpp.

◆ addCopyConstructorForExceptionObject()

void ASTContext::addCopyConstructorForExceptionObject ( CXXRecordDecl * RD,
CXXConstructorDecl * CD )

Definition at line 13484 of file ASTContext.cpp.

◆ AddDeallocation()

void ASTContext::AddDeallocation ( void(* Callback )(void *),
void * Data ) const

Add a deallocation callback that will be invoked when the ASTContext is destroyed.

Parameters
CallbackA callback function that will be invoked on destruction.
DataPointer data that will be provided to the callback function when it is called.

Definition at line 1009 of file ASTContext.cpp.

◆ addDeclaratorForUnnamedTagDecl()

void ASTContext::addDeclaratorForUnnamedTagDecl ( TagDecl * TD,
DeclaratorDecl * DD )

Definition at line 13501 of file ASTContext.cpp.

◆ addDestruction()

template<typename T>
void clang::ASTContext::addDestruction ( T * Ptr) const
inline

If T isn't trivially destructible, calls AddDeallocation to register it for destruction.

Definition at line 3396 of file ASTContext.h.

◆ addedLocalImportDecl()

void ASTContext::addedLocalImportDecl ( ImportDecl * Import)

Notify the AST context that a new import declaration has been parsed or implicitly created within this translation unit.

Definition at line 1778 of file ASTContext.cpp.

◆ addLazyModuleInitializers()

void ASTContext::addLazyModuleInitializers ( Module * M,
ArrayRef< GlobalDeclID > IDs )

Definition at line 1154 of file ASTContext.cpp.

◆ addModuleInitializer()

void ASTContext::addModuleInitializer ( Module * M,
Decl * Init )

Add a declaration to the list of declarations that are initialized for a module.

This will typically be a global variable (with internal linkage) that runs module initializers, such as the iostream initializer, or an ImportDecl nominating another module that has initializers.

Definition at line 1128 of file ASTContext.cpp.

◆ addObjCSubClass()

void clang::ASTContext::addObjCSubClass ( const ObjCInterfaceDecl * D,
const ObjCInterfaceDecl * SubClass )
inline

Definition at line 3261 of file ASTContext.h.

◆ addOverriddenMethod()

void ASTContext::addOverriddenMethod ( const CXXMethodDecl * Method,
const CXXMethodDecl * Overridden )

Note that the given C++ Method overrides the given Overridden method.

Definition at line 1666 of file ASTContext.cpp.

◆ addressSpaceMapManglingFor()

bool clang::ASTContext::addressSpaceMapManglingFor ( LangAS AS) const
inline

Definition at line 3151 of file ASTContext.h.

◆ addTranslationUnitDecl()

void clang::ASTContext::addTranslationUnitDecl ( )
inline

Definition at line 1206 of file ASTContext.h.

◆ addTypedefNameForUnnamedTagDecl()

void ASTContext::addTypedefNameForUnnamedTagDecl ( TagDecl * TD,
TypedefNameDecl * TND )

Definition at line 13491 of file ASTContext.cpp.

◆ adjustDeducedFunctionResultType()

void ASTContext::adjustDeducedFunctionResultType ( FunctionDecl * FD,
QualType ResultType )

Change the result type of a function type once it is deduced.

Definition at line 3785 of file ASTContext.cpp.

◆ adjustExceptionSpec()

void ASTContext::adjustExceptionSpec ( FunctionDecl * FD,
const FunctionProtoType::ExceptionSpecInfo & ESI,
bool AsWritten = false )

Change the exception specification on a function once it is delay-parsed, instantiated, or computed.

Definition at line 3858 of file ASTContext.cpp.

◆ adjustFunctionResultType()

QualType ASTContext::adjustFunctionResultType ( QualType FunctionType,
QualType NewResultType )

Change the result type of a function type, preserving sugar such as attributed types.

Definition at line 3773 of file ASTContext.cpp.

◆ adjustFunctionType()

const FunctionType * ASTContext::adjustFunctionType ( const FunctionType * Fn,
FunctionType::ExtInfo EInfo )

Change the ExtInfo on a function type.

Definition at line 3755 of file ASTContext.cpp.

◆ adjustObjCTypeParamBoundType()

void ASTContext::adjustObjCTypeParamBoundType ( const ObjCTypeParamDecl * Orig,
ObjCTypeParamDecl * New ) const

Definition at line 6509 of file ASTContext.cpp.

◆ adjustStringLiteralBaseType()

QualType ASTContext::adjustStringLiteralBaseType ( QualType StrLTy) const

Definition at line 5163 of file ASTContext.cpp.

◆ adjustType()

QualType ASTContext::adjustType ( QualType OldType,
llvm::function_ref< QualType(QualType)> Adjust ) const

Rebuild a type, preserving any existing type sugar.

For function types, you probably want to just use adjustFunctionResultType and friends instead.

Definition at line 3717 of file ASTContext.cpp.

◆ Allocate() [1/2]

template<typename T>
T * clang::ASTContext::Allocate ( size_t Num = 1) const
inline

Definition at line 817 of file ASTContext.h.

◆ Allocate() [2/2]

void * clang::ASTContext::Allocate ( size_t Size,
unsigned Align = 8 ) const
inline

Definition at line 814 of file ASTContext.h.

◆ AllocateDeclListNode()

DeclListNode * clang::ASTContext::AllocateDeclListNode ( clang::NamedDecl * ND)
inline

Allocates a DeclListNode or returns one from the ListNodeFreeList pool.

Definition at line 830 of file ASTContext.h.

◆ AnyObjCImplementation()

bool clang::ASTContext::AnyObjCImplementation ( )
inline

Return true if there is at least one @implementation in the TU.

Definition at line 3332 of file ASTContext.h.

◆ applyObjCProtocolQualifiers()

QualType ASTContext::applyObjCProtocolQualifiers ( QualType type,
ArrayRef< ObjCProtocolDecl * > protocols,
bool & hasError,
bool allowOnPointerType = false ) const

Apply Objective-C protocol qualifiers to the given type.

Parameters
allowOnPointerTypespecifies if we can apply protocol qualifiers on ObjCObjectPointerType. It can be set to true when constructing the canonical type of a Objective-C type parameter.

If this is for the canonical type of a type parameter, we can apply protocol qualifiers on the ObjCObjectPointerType.

Definition at line 6408 of file ASTContext.cpp.

◆ areCommonBaseCompatible()

QualType ASTContext::areCommonBaseCompatible ( const ObjCObjectPointerType * LHSOPT,
const ObjCObjectPointerType * RHSOPT )

Definition at line 11197 of file ASTContext.cpp.

◆ areComparableObjCPointerTypes()

bool ASTContext::areComparableObjCPointerTypes ( QualType LHS,
QualType RHS )

Definition at line 11382 of file ASTContext.cpp.

◆ areCompatibleRVVTypes()

bool ASTContext::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-length representation of the RISC-V vector builtin type for a specific vector-length.

Definition at line 10684 of file ASTContext.cpp.

◆ areCompatibleVectorTypes()

bool ASTContext::areCompatibleVectorTypes ( QualType FirstVec,
QualType SecondVec )

Return true if the given vector types are of the same unqualified type or if they are equivalent to the same GCC vector type.

Note
This ignores whether they are target-specific (AltiVec or Neon) types.

Definition at line 10629 of file ASTContext.cpp.

◆ areLaxCompatibleRVVTypes()

bool ASTContext::areLaxCompatibleRVVTypes ( QualType FirstType,
QualType SecondType )

Return true if the given vector types are lax-compatible RISC-V vector types as defined by -flax-vector-conversions=, which permits implicit conversions between vectors with different number of elements and/or incompatible element types, false otherwise.

Definition at line 10733 of file ASTContext.cpp.

◆ AtomicUsesUnsupportedLibcall()

bool ASTContext::AtomicUsesUnsupportedLibcall ( const AtomicExpr * E) const

Definition at line 13601 of file ASTContext.cpp.

◆ attachCommentsToJustParsedDecls()

void ASTContext::attachCommentsToJustParsedDecls ( ArrayRef< Decl * > Decls,
const Preprocessor * PP )

Searches existing comments for doc comments that should be attached to Decls.

If any doc comment is found, it is parsed.

Requirement: All Decls are in the same file.

If the last comment in the file is already attached we assume there are not comments left to be attached to Decls.

Definition at line 532 of file ASTContext.cpp.

◆ backupStr()

llvm::StringRef clang::ASTContext::backupStr ( llvm::StringRef S) const
inline

Definition at line 822 of file ASTContext.h.

◆ baseForVTableAuthentication()

const CXXRecordDecl * ASTContext::baseForVTableAuthentication ( const CXXRecordDecl * ThisClass) const

Resolve the root record to be used to derive the vtable pointer authentication policy for the specified record.

Definition at line 15197 of file ASTContext.cpp.

◆ BlockRequiresCopying()

bool ASTContext::BlockRequiresCopying ( QualType Ty,
const VarDecl * D )

Returns true iff we need copy/dispose helpers for the given type.

BlockRequiresCopying - Returns true if byref variable "D" of type "Ty" requires copy/dispose.

Note that this must match the logic in buildByrefHelpers.

Definition at line 8690 of file ASTContext.cpp.

◆ buildBuiltinTemplateDecl()

BuiltinTemplateDecl * ASTContext::buildBuiltinTemplateDecl ( BuiltinTemplateKind BTK,
const IdentifierInfo * II ) const

Definition at line 1213 of file ASTContext.cpp.

◆ buildImplicitRecord()

RecordDecl * ASTContext::buildImplicitRecord ( StringRef Name,
RecordDecl::TagKind TK = RecordDecl::TagKind::Struct ) const

Create a new implicit TU-level CXXRecordDecl or RecordDecl declaration.

Definition at line 1232 of file ASTContext.cpp.

◆ buildImplicitTypedef()

TypedefDecl * ASTContext::buildImplicitTypedef ( QualType T,
StringRef Name ) const

Create a new implicit TU-level typedef declaration.

Definition at line 1248 of file ASTContext.cpp.

◆ cacheRawCommentForDecl()

void ASTContext::cacheRawCommentForDecl ( const Decl & OriginalD,
const RawComment & Comment ) const

Attaches Comment to OriginalD and to its redeclaration chain and removes the redeclaration chain from the set of commentless chains.

Don't do anything if a comment has already been attached to OriginalD or its redeclaration chain.

Definition at line 506 of file ASTContext.cpp.

◆ canAssignObjCInterfaces() [1/2]

bool ASTContext::canAssignObjCInterfaces ( const ObjCObjectPointerType * LHSOPT,
const ObjCObjectPointerType * RHSOPT )

canAssignObjCInterfaces - Return true if the two interface types are compatible for assignment from RHS to LHS.

This handles validation of any protocol qualifiers on the LHS or RHS.

Definition at line 10951 of file ASTContext.cpp.

◆ canAssignObjCInterfaces() [2/2]

bool ASTContext::canAssignObjCInterfaces ( const ObjCObjectType * LHS,
const ObjCObjectType * RHS )

Definition at line 11320 of file ASTContext.cpp.

◆ canAssignObjCInterfacesInBlockPointer()

bool ASTContext::canAssignObjCInterfacesInBlockPointer ( const ObjCObjectPointerType * LHSOPT,
const ObjCObjectPointerType * RHSOPT,
bool BlockReturnType )

canAssignObjCInterfacesInBlockPointer - This routine is specifically written for providing type-safety for objective-c pointers used to pass/return arguments in block literals.

When passed as arguments, passing 'A*' where 'id' is expected is not OK. Passing 'Sub *" where 'Super *" is expected is not OK. For the return type, the opposite is not OK.

Definition at line 11004 of file ASTContext.cpp.

◆ canBindObjCObjectType()

bool ASTContext::canBindObjCObjectType ( QualType To,
QualType From )

Definition at line 11394 of file ASTContext.cpp.

◆ canBuiltinBeRedeclared()

bool ASTContext::canBuiltinBeRedeclared ( const FunctionDecl * FD) const

Return whether a declaration to a builtin is allowed to be overloaded/redeclared.

Definition at line 10382 of file ASTContext.cpp.

◆ canonicalizeTemplateArguments()

bool ASTContext::canonicalizeTemplateArguments ( MutableArrayRef< TemplateArgument > Args) const

Canonicalize the given template argument list.

Returns true if any arguments were non-canonical, false otherwise.

Definition at line 3212 of file ASTContext.cpp.

◆ cleanup()

void ASTContext::cleanup ( )

Definition at line 961 of file ASTContext.cpp.

◆ cloneFullComment()

comments::FullComment * ASTContext::cloneFullComment ( comments::FullComment * FC,
const Decl * D ) const

Definition at line 594 of file ASTContext.cpp.

◆ CollectInheritedProtocols()

void ASTContext::CollectInheritedProtocols ( const Decl * CDecl,
llvm::SmallPtrSet< ObjCProtocolDecl *, 8 > & Protocols )

CollectInheritedProtocols - Collect all protocols in current class and those inherited by it.

Definition at line 2811 of file ASTContext.cpp.

◆ computeBestEnumTypes()

bool ASTContext::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 positive bits of its elements.

Returns true if enum width is too large.

Definition at line 5535 of file ASTContext.cpp.

◆ computeEnumBits()

template<typename RangeT>
bool clang::ASTContext::computeEnumBits ( RangeT EnumConstants,
unsigned & NumNegativeBits,
unsigned & NumPositiveBits )
inline

Compute NumNegativeBits and NumPositiveBits for an enum based on the constant values of its enumerators.

Definition at line 1831 of file ASTContext.h.

◆ containsAddressDiscriminatedPointerAuth()

bool clang::ASTContext::containsAddressDiscriminatedPointerAuth ( QualType T) const
inline

Examines a given type, and returns whether the type itself is address discriminated, or any transitively embedded types contain data that is address discriminated.

This includes implicitly authenticated values like vtable pointers, as well as explicitly qualified fields.

Definition at line 645 of file ASTContext.h.

◆ containsNonRelocatablePointerAuth()

bool clang::ASTContext::containsNonRelocatablePointerAuth ( QualType T)
inline

Examines a given type, and returns whether the type itself or any data it transitively contains has a pointer authentication schema that is not safely relocatable.

e.g. any data or fields with address discrimination other than any otherwise similar vtable pointers.

Definition at line 656 of file ASTContext.h.

◆ CountNonClassIvars()

unsigned ASTContext::CountNonClassIvars ( const ObjCInterfaceDecl * OI) const

Definition at line 3068 of file ASTContext.cpp.

◆ createDeviceMangleContext()

MangleContext * ASTContext::createDeviceMangleContext ( const TargetInfo & T)

Creates a device mangle context to correctly mangle lambdas in a mixed architecture compile by setting the lambda mangling number source to the DeviceLambdaManglingNumber.

Currently this asserts that the TargetInfo (from the AuxTargetInfo) is a an itanium target.

Definition at line 13301 of file ASTContext.cpp.

◆ createMangleContext()

MangleContext * ASTContext::createMangleContext ( const TargetInfo * T = nullptr)

If T is null pointer, assume the target in ASTContext.

Definition at line 13280 of file ASTContext.cpp.

◆ createMangleNumberingContext()

std::unique_ptr< MangleNumberingContext > ASTContext::createMangleNumberingContext ( ) const

Definition at line 13474 of file ASTContext.cpp.

◆ CreateTypeSourceInfo()

TypeSourceInfo * ASTContext::CreateTypeSourceInfo ( QualType T,
unsigned Size = 0 ) const

Allocate an uninitialized TypeSourceInfo.

The caller should initialize the memory held by TypeSourceInfo using the TypeLoc wrappers.

Parameters
Tthe type that will be the basis for type source info. This type should refer to how the declarator was written in source code, not to what type semantic analysis resolved the declarator to.
Sizethe size of the type info to create, or 0 if the size should be calculated based on the type.

Definition at line 3178 of file ASTContext.cpp.

◆ Deallocate()

void clang::ASTContext::Deallocate ( void * Ptr) const
inline

Definition at line 820 of file ASTContext.h.

◆ DeallocateDeclListNode()

void clang::ASTContext::DeallocateDeclListNode ( DeclListNode * N)
inline

Deallocates a DeclListNode by returning it to the ListNodeFreeList pool.

Definition at line 841 of file ASTContext.h.

◆ DeclMustBeEmitted()

bool ASTContext::DeclMustBeEmitted ( const Decl * D)

Determines if the decl can be CodeGen'ed or deserialized from PCH lazily, only when used; this is only relevant for function or file scoped var definitions.

Returns
true if the function/var must be CodeGen'ed/deserialized even if it is not used.

Definition at line 13078 of file ASTContext.cpp.

◆ DecodeTypeStr()

QualType ASTContext::DecodeTypeStr ( const char *& Str,
const ASTContext & Context,
ASTContext::GetBuiltinTypeError & Error,
bool & RequireICE,
bool AllowTypeModifiers ) const

Definition at line 12787 of file ASTContext.cpp.

◆ deduplicateMergedDefinitionsFor()

void ASTContext::deduplicateMergedDefinitionsFor ( NamedDecl * ND)

Clean up the merged definition list.

Call this if you might have added duplicates into the list.

Definition at line 1089 of file ASTContext.cpp.

◆ DeepCollectObjCIvars()

void ASTContext::DeepCollectObjCIvars ( const ObjCInterfaceDecl * OI,
bool leafClass,
SmallVectorImpl< const ObjCIvarDecl * > & Ivars ) const

DeepCollectObjCIvars - This routine first collects all declared, but not synthesized, ivars in super class and then collects all ivars, including those synthesized for current class.

This routine is used for implementation of current class when all ivars, declared and synthesized are known.

Definition at line 2794 of file ASTContext.cpp.

◆ DumpRecordLayout()

void ASTContext::DumpRecordLayout ( const RecordDecl * RD,
raw_ostream & OS,
bool Simple = false ) const

Definition at line 3764 of file RecordLayoutBuilder.cpp.

◆ eraseDeclAttrs()

void ASTContext::eraseDeclAttrs ( const Decl * D)

Erase the attributes corresponding to the given declaration.

Definition at line 1538 of file ASTContext.cpp.

◆ filterFunctionTargetAttrs()

ParsedTargetAttr ASTContext::filterFunctionTargetAttrs ( const TargetAttr * TD) const

Parses the target attributes passed in, and returns only the ones that are valid feature names.

Definition at line 14976 of file ASTContext.cpp.

◆ findCanonicalTemplateTemplateParmDeclInternal()

TemplateTemplateParmDecl * ASTContext::findCanonicalTemplateTemplateParmDeclInternal ( TemplateTemplateParmDecl * TTP) const

Definition at line 852 of file ASTContext.cpp.

◆ findSYCLKernelInfo()

const SYCLKernelInfo * ASTContext::findSYCLKernelInfo ( QualType T) const

Returns a pointer to the metadata generated from the corresponding SYCLkernel entry point if the provided type corresponds to a registered SYCL kernel name.

Returns a null pointer otherwise.

Definition at line 15142 of file ASTContext.cpp.

◆ forEachMultiversionedFunctionVersion()

void ASTContext::forEachMultiversionedFunctionVersion ( const FunctionDecl * FD,
llvm::function_ref< void(FunctionDecl *)> Pred ) const

Visits all versions of a multiversioned function with the passed predicate.

Definition at line 13204 of file ASTContext.cpp.

◆ getAddrSpaceQualType()

QualType ASTContext::getAddrSpaceQualType ( QualType T,
LangAS AddressSpace ) const

Return the uniqued reference to the type for an address space qualified type with the specified type and address space.

The resulting type has a union of the qualifiers from T and the address space. If T already has an address space specifier, it is silently replaced.

Definition at line 3257 of file ASTContext.cpp.

◆ getAdjustedParameterType()

QualType ASTContext::getAdjustedParameterType ( QualType T) const

Perform adjustment on the parameter type of a function.

This routine adjusts the given parameter type T to the actual parameter type used by semantic analysis (C99 6.7.5.3p[7,8], C++ [dcl.fct]p3). The adjusted parameter type is returned.

Definition at line 8084 of file ASTContext.cpp.

◆ getAdjustedType() [1/2]

CanQualType clang::ASTContext::getAdjustedType ( CanQualType Orig,
CanQualType New ) const
inline

Definition at line 1540 of file ASTContext.h.

◆ getAdjustedType() [2/2]

QualType ASTContext::getAdjustedType ( QualType Orig,
QualType New ) const

Return the uniqued reference to a type adjusted from the original type to a new type.

Definition at line 3942 of file ASTContext.cpp.

◆ getAlignOfGlobalVar()

unsigned ASTContext::getAlignOfGlobalVar ( QualType T,
const VarDecl * VD ) const

Return the alignment in bits that should be given to a global variable with type T.

getAlignOfGlobalVar - Return the alignment in bits that should be given to a global variable of the specified type.

If VD is non-null it will be considered specifically for the query.

Definition at line 2739 of file ASTContext.cpp.

◆ getAlignOfGlobalVarInChars()

CharUnits ASTContext::getAlignOfGlobalVarInChars ( QualType T,
const VarDecl * VD ) const

Return the alignment in characters that should be given to a global variable with type T.

getAlignOfGlobalVarInChars - Return the alignment in characters that should be given to a global variable of the specified type.

If VD is non-null it will be considered specifically for the query.

Definition at line 2747 of file ASTContext.cpp.

◆ getAllocator()

llvm::BumpPtrAllocator & clang::ASTContext::getAllocator ( ) const
inline

Definition at line 810 of file ASTContext.h.

◆ getArrayDecayedType()

QualType ASTContext::getArrayDecayedType ( QualType Ty) const

Return the properly qualified result of decaying the specified array type to a pointer.

getArrayDecayedType - Return the properly qualified result of decaying the specified array type to a pointer.

This operation is non-trivial when handling typedefs etc. The canonical type of T must be an array type, this returns a pointer to a properly qualified element of the array.

See C99 6.7.5.3p7 and C99 6.3.2.1p3.

This operation is non-trivial when handling typedefs etc. The canonical type of "T" must be an array type, this returns a pointer to a properly qualified element of the array.

See C99 6.7.5.3p7 and C99 6.3.2.1p3.

Definition at line 8117 of file ASTContext.cpp.

◆ getArrayInitLoopExprElementCount()

uint64_t ASTContext::getArrayInitLoopExprElementCount ( const ArrayInitLoopExpr * AILE) const

Return number of elements initialized in an ArrayInitLoopExpr.

Definition at line 8169 of file ASTContext.cpp.

◆ getArrayParameterType()

QualType ASTContext::getArrayParameterType ( QualType Ty) const

Return the uniqued reference to a specified array parameter type from the original array type.

Definition at line 4006 of file ASTContext.cpp.

◆ getAsArrayType()

const ArrayType * ASTContext::getAsArrayType ( QualType T) const

Type Query functions.

If the type is an instance of the specified class, return the Type pointer for the underlying maximally pretty type. This is a member of ASTContext because this may need to do some amount of canonicalization, e.g. to move type qualifiers into the element type.

Examples
/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp.

Definition at line 8031 of file ASTContext.cpp.

◆ getAsConstantArrayType()

const ConstantArrayType * clang::ASTContext::getAsConstantArrayType ( QualType T) const
inline

◆ getAsDependentSizedArrayType()

const DependentSizedArrayType * clang::ASTContext::getAsDependentSizedArrayType ( QualType T) const
inline

Definition at line 3065 of file ASTContext.h.

◆ getAsIncompleteArrayType()

const IncompleteArrayType * clang::ASTContext::getAsIncompleteArrayType ( QualType T) const
inline

Definition at line 3062 of file ASTContext.h.

◆ getAssumedTemplateName()

TemplateName ASTContext::getAssumedTemplateName ( DeclarationName Name) const

Retrieve a template name representing an unqualified-id that has been assumed to name a template for ADL purposes.

Definition at line 10429 of file ASTContext.cpp.

◆ getASTAllocatedMemory()

size_t clang::ASTContext::getASTAllocatedMemory ( ) const
inline

Return the total amount of physical memory allocated for representing AST nodes and type information.

Definition at line 848 of file ASTContext.h.

◆ getASTMutationListener()

ASTMutationListener * clang::ASTContext::getASTMutationListener ( ) const
inline

Retrieve a pointer to the AST mutation listener associated with this AST context, if any.

Definition at line 1360 of file ASTContext.h.

◆ getASTObjCInterfaceLayout()

const ASTRecordLayout & ASTContext::getASTObjCInterfaceLayout ( const ObjCInterfaceDecl * D) const

Get or compute information about the layout of the specified Objective-C interface.

Definition at line 3200 of file ASTContext.cpp.

◆ getASTRecordLayout()

const ASTRecordLayout & ASTContext::getASTRecordLayout ( const RecordDecl * D) const

Get or compute information about the layout of the specified record (struct/union/class) D, which indicates its size and field position information.

getASTRecordLayout - Get or compute information about the layout of the specified record (struct/union/class), which indicates its size and field position information.

Definition at line 3366 of file RecordLayoutBuilder.cpp.

◆ getAsVariableArrayType()

const VariableArrayType * clang::ASTContext::getAsVariableArrayType ( QualType T) const
inline

Definition at line 3059 of file ASTContext.h.

◆ getAtomicType()

QualType ASTContext::getAtomicType ( QualType T) const

Return the uniqued reference to the atomic type for the specified type.

getAtomicType - Return the uniqued reference to the atomic type for the given value type.

Definition at line 6963 of file ASTContext.cpp.

◆ getAttributedType() [1/3]

QualType ASTContext::getAttributedType ( attr::Kind attrKind,
QualType modifiedType,
QualType equivalentType,
const Attr * attr = nullptr ) const

Definition at line 5692 of file ASTContext.cpp.

◆ getAttributedType() [2/3]

QualType ASTContext::getAttributedType ( const Attr * attr,
QualType modifiedType,
QualType equivalentType ) const

Definition at line 5715 of file ASTContext.cpp.

◆ getAttributedType() [3/3]

QualType ASTContext::getAttributedType ( NullabilityKind nullability,
QualType modifiedType,
QualType equivalentType )

Definition at line 5720 of file ASTContext.cpp.

◆ getAutoDeductType()

QualType ASTContext::getAutoDeductType ( ) const

C++11 deduction pattern for 'auto' type.

getAutoDeductType - Get type pattern for deducing against 'auto'.

Definition at line 6990 of file ASTContext.cpp.

◆ getAutoRRefDeductType()

QualType ASTContext::getAutoRRefDeductType ( ) const

C++11 deduction pattern for 'auto &&' type.

getAutoRRefDeductType - Get type pattern for deducing against 'auto &&'.

Definition at line 7001 of file ASTContext.cpp.

◆ getAutoType()

QualType ASTContext::getAutoType ( QualType DeducedType,
AutoTypeKeyword Keyword,
bool IsDependent,
bool IsPack = false,
TemplateDecl * TypeConstraintConcept = nullptr,
ArrayRef< TemplateArgument > TypeConstraintArgs = {} ) const

C++11 deduced auto type.

getAutoType - Return the uniqued reference to the 'auto' type which has been deduced to the given type, or to the canonical undeduced 'auto' type, or the canonical deduced-but-dependent 'auto' type.

Definition at line 6883 of file ASTContext.cpp.

◆ getAuxTargetInfo()

const TargetInfo * clang::ASTContext::getAuxTargetInfo ( ) const
inline

Definition at line 860 of file ASTContext.h.

◆ getBaseElementType() [1/2]

QualType ASTContext::getBaseElementType ( const ArrayType * VAT) const

Return the innermost element type of an array type.

For example, will return "int" for int[m][n]

Definition at line 8139 of file ASTContext.cpp.

◆ getBaseElementType() [2/2]

QualType ASTContext::getBaseElementType ( QualType QT) const

Return the innermost element type of a type (which needn't actually be an array type).

Definition at line 8143 of file ASTContext.cpp.

◆ getBitIntType()

QualType ASTContext::getBitIntType ( bool Unsigned,
unsigned NumBits ) const

Return a bit-precise integer type with the specified signedness and bit count.

Definition at line 5177 of file ASTContext.cpp.

◆ getBlockDescriptorExtendedType()

QualType ASTContext::getBlockDescriptorExtendedType ( ) const

Gets the struct used to keep track of the extended descriptor for pointer to blocks.

Definition at line 8608 of file ASTContext.cpp.

◆ getBlockDescriptorType()

QualType ASTContext::getBlockDescriptorType ( ) const

Gets the struct used to keep track of the descriptor for pointer to blocks.

Definition at line 8573 of file ASTContext.cpp.

◆ getBlockPointerType()

QualType ASTContext::getBlockPointerType ( QualType T) const

Return the uniqued reference to the type for a block of the specified type.

getBlockPointerType - Return the uniqued reference to the type for a pointer to the specified block.

Definition at line 4040 of file ASTContext.cpp.

◆ getBlockVarCopyInit()

BlockVarCopyInit ASTContext::getBlockVarCopyInit ( const VarDecl * VD) const

Get the copy initialization expression of the VarDecl VD, or nullptr if none exists.

Get the copy initialization expression of VarDecl, or nullptr if none exists.

Definition at line 3159 of file ASTContext.cpp.

◆ getBOOLDecl()

TypedefDecl * clang::ASTContext::getBOOLDecl ( ) const
inline

Retrieve declaration of 'BOOL' typedef.

Definition at line 2369 of file ASTContext.h.

◆ getBoolName()

IdentifierInfo * clang::ASTContext::getBoolName ( ) const
inline

Retrieve the identifier 'bool'.

Definition at line 2193 of file ASTContext.h.

◆ getBOOLType()

QualType clang::ASTContext::getBOOLType ( ) const
inline

type of 'BOOL' type.

Definition at line 2379 of file ASTContext.h.

◆ getBTFTagAttributedType()

QualType ASTContext::getBTFTagAttributedType ( const BTFTypeTagAttr * BTFAttr,
QualType Wrapped ) const

Definition at line 5742 of file ASTContext.cpp.

◆ getBuiltinMSVaListDecl()

TypedefDecl * ASTContext::getBuiltinMSVaListDecl ( ) const

Retrieve the C type declaration corresponding to the predefined __builtin_ms_va_list type.

Definition at line 10375 of file ASTContext.cpp.

◆ getBuiltinMSVaListType()

QualType clang::ASTContext::getBuiltinMSVaListType ( ) const
inline

Retrieve the type of the __builtin_ms_va_list type.

Definition at line 2409 of file ASTContext.h.

◆ GetBuiltinType()

QualType ASTContext::GetBuiltinType ( unsigned ID,
GetBuiltinTypeError & Error,
unsigned * IntegerConstantArgs = nullptr ) const

Return the type for the specified builtin.

GetBuiltinType - Return the type for the specified builtin.

If IntegerConstantArgs is non-null, it is filled in with a bitmask of arguments to the builtin that are required to be integer constant expressions.

Definition at line 12794 of file ASTContext.cpp.

◆ getBuiltinVaListDecl()

TypedefDecl * ASTContext::getBuiltinVaListDecl ( ) const

Retrieve the C type declaration corresponding to the predefined __builtin_va_list type.

Definition at line 10357 of file ASTContext.cpp.

◆ getBuiltinVaListType()

QualType clang::ASTContext::getBuiltinVaListType ( ) const
inline

Retrieve the type of the __builtin_va_list type.

Definition at line 2394 of file ASTContext.h.

◆ getBuiltinVectorTypeInfo()

ASTContext::BuiltinVectorTypeInfo ASTContext::getBuiltinVectorTypeInfo ( const BuiltinType * VecTy) const

Returns the element type, element count and number of vectors (in case of tuple) for a builtin vector type.

Definition at line 4517 of file ASTContext.cpp.

◆ getByrefLifetime()

bool ASTContext::getByrefLifetime ( QualType Ty,
Qualifiers::ObjCLifetime & Lifetime,
bool & HasByrefExtendedLayout ) const

Returns true, if given type has a known lifetime.

HasByrefExtendedLayout is set to false in this case. If HasByrefExtendedLayout returns true, byref variable has extended lifetime.

Definition at line 8733 of file ASTContext.cpp.

◆ getCanonicalFunctionResultType()

CanQualType ASTContext::getCanonicalFunctionResultType ( QualType ResultType) const

Adjust the given function result type.

Definition at line 4943 of file ASTContext.cpp.

◆ getCanonicalParamType()

CanQualType ASTContext::getCanonicalParamType ( QualType T) const

Return the canonical parameter type corresponding to the specific potentially non-canonical one.

Qualifiers are stripped off, functions are turned into function pointers, and arrays decay one level into pointers.

Definition at line 7080 of file ASTContext.cpp.

◆ getCanonicalSizeType()

CanQualType ASTContext::getCanonicalSizeType ( ) const

Definition at line 7015 of file ASTContext.cpp.

◆ getCanonicalTagType()

CanQualType ASTContext::getCanonicalTagType ( const TagDecl * TD) const

Definition at line 5478 of file ASTContext.cpp.

◆ getCanonicalTemplateArgument()

TemplateArgument ASTContext::getCanonicalTemplateArgument ( const TemplateArgument & Arg) const

Retrieve the "canonical" template argument.

The canonical template argument is the simplest template argument (which may be a type, value, expression, or declaration) that expresses the value of the argument.

Definition at line 7925 of file ASTContext.cpp.

◆ getCanonicalTemplateName()

TemplateName ASTContext::getCanonicalTemplateName ( TemplateName Name,
bool IgnoreDeduced = false ) const

Retrieves the "canonical" template name that refers to a given template.

The canonical template name is the simplest expression that can be used to refer to a given template. For most templates, this expression is just the template declaration itself. For example, the template std::vector can be referred to via a variety of names—std::vector, ::std::vector, vector (if vector is in scope), etc.—but all of these names map down to the same TemplateDecl, which is used to form the canonical template name.

Dependent template names are more interesting. Here, the template name could be something like T::template apply or std::allocator<T>::template rebind, where the nested name specifier itself is dependent. In this case, the canonical template name uses the shortest form of the dependent nested-name-specifier, which itself contains all canonical types, values, and templates.

Definition at line 7364 of file ASTContext.cpp.

◆ getCanonicalTemplateSpecializationType()

QualType ASTContext::getCanonicalTemplateSpecializationType ( TemplateName T,
ArrayRef< TemplateArgument > CanonicalArgs ) const

Definition at line 5972 of file ASTContext.cpp.

◆ getCanonicalTemplateTemplateParmDecl()

TemplateTemplateParmDecl * ASTContext::getCanonicalTemplateTemplateParmDecl ( TemplateTemplateParmDecl * TTP) const

Canonicalize the given TemplateTemplateParmDecl.

Definition at line 766 of file ASTContext.cpp.

◆ getCanonicalType() [1/2]

const Type * clang::ASTContext::getCanonicalType ( const Type * T) const
inline

Definition at line 2855 of file ASTContext.h.

◆ getCanonicalType() [2/2]

CanQualType clang::ASTContext::getCanonicalType ( QualType T) const
inline

Return the canonical (structural) type corresponding to the specified potentially non-canonical type T.

The non-canonical version of a type may have many "decorated" versions of types. Decorators can include typedefs, 'typeof' operators, etc. The returned type is guaranteed to be free of any of these, allowing two canonical types to be compared for exact equality with a simple pointer comparison.

Examples
/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp.

Definition at line 2851 of file ASTContext.h.

◆ getCanonicalTypeDeclType()

CanQualType ASTContext::getCanonicalTypeDeclType ( const TypeDecl * TD) const

Definition at line 5258 of file ASTContext.cpp.

◆ getCanonicalUnresolvedUsingType()

CanQualType ASTContext::getCanonicalUnresolvedUsingType ( const UnresolvedUsingTypenameDecl * D) const

Definition at line 5646 of file ASTContext.cpp.

◆ getCFConstantStringDecl()

TypedefDecl * ASTContext::getCFConstantStringDecl ( ) const

Objective-C ABI

typedef struct __NSConstantString_tag { const int *isa; int flags; const char *str; long length; } __NSConstantString;

Swift ABI (4.1, 4.2)

typedef struct __NSConstantString_tag { uintptr_t _cfisa; uintptr_t _swift_rc; _Atomic(uint64_t) _cfinfoa; const char *_ptr; uint32_t _length; } __NSConstantString;

Swift ABI (5.0)

typedef struct __NSConstantString_tag { uintptr_t _cfisa; uintptr_t _swift_rc; _Atomic(uint64_t) _cfinfoa; const char *_ptr; uintptr_t _length; } __NSConstantString;

Definition at line 8462 of file ASTContext.cpp.

◆ getCFConstantStringTagDecl()

RecordDecl * ASTContext::getCFConstantStringTagDecl ( ) const

Definition at line 8546 of file ASTContext.cpp.

◆ getCFConstantStringType()

QualType ASTContext::getCFConstantStringType ( ) const

Return the C structure type used to represent constant CFStrings.

Definition at line 8553 of file ASTContext.cpp.

◆ getCharWidth()

uint64_t clang::ASTContext::getCharWidth ( ) const
inline

Return the size of the character type, in bits.

Definition at line 2629 of file ASTContext.h.

◆ getCommentCommandTraits()

comments::CommandTraits & clang::ASTContext::getCommentCommandTraits ( ) const
inline

Definition at line 1058 of file ASTContext.h.

◆ getCommentForDecl()

comments::FullComment * ASTContext::getCommentForDecl ( const Decl * D,
const Preprocessor * PP ) const

Return parsed documentation comment attached to a given declaration.

Returns nullptr if no comment is attached.

Parameters
PPthe Preprocessor used with this TU. Could be nullptr if preprocessor is not available.

Definition at line 614 of file ASTContext.cpp.

◆ getCommonSugaredType()

QualType ASTContext::getCommonSugaredType ( QualType X,
QualType Y,
bool Unqualified = false ) const

Definition at line 14645 of file ASTContext.cpp.

◆ getComplexType() [1/2]

CanQualType clang::ASTContext::getComplexType ( CanQualType T) const
inline

Definition at line 1521 of file ASTContext.h.

◆ getComplexType() [2/2]

QualType ASTContext::getComplexType ( QualType T) const

Return the uniqued reference to the type for a complex number with the specified element type.

getComplexType - Return the uniqued reference to the type for a complex number with the specified element type.

Definition at line 3888 of file ASTContext.cpp.

◆ getConstantArrayElementCount()

uint64_t ASTContext::getConstantArrayElementCount ( const ConstantArrayType * CA) const

Return number of constant array elements.

getConstantArrayElementCount - Returns number of constant array elements.

Examples
/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp.

Definition at line 8159 of file ASTContext.cpp.

◆ getConstantArrayType()

QualType ASTContext::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.

getConstantArrayType - Return the unique reference to the type for an array of the specified element type.

Definition at line 4197 of file ASTContext.cpp.

◆ getConstantMatrixType()

QualType ASTContext::getConstantMatrixType ( QualType ElementType,
unsigned NumRows,
unsigned NumColumns ) const

Return the unique reference to the matrix type of the specified element type and size.

Precondition
ElementType must be a valid matrix element type (see MatrixType::isValidElementType).

Definition at line 4789 of file ASTContext.cpp.

◆ getConstType()

QualType clang::ASTContext::getConstType ( QualType T) const
inline

Return the uniqued reference to the type for a const qualified type.

The resulting type has a union of the qualifiers from T and const.

It can be reasonably expected that this will always be equivalent to calling T.withConst().

Definition at line 1461 of file ASTContext.h.

◆ getCopyConstructorForExceptionObject()

const CXXConstructorDecl * ASTContext::getCopyConstructorForExceptionObject ( CXXRecordDecl * RD)

Definition at line 13479 of file ASTContext.cpp.

◆ getCorrespondingSaturatedType()

QualType ASTContext::getCorrespondingSaturatedType ( QualType Ty) const

Definition at line 14760 of file ASTContext.cpp.

◆ getCorrespondingSignedFixedPointType()

QualType ASTContext::getCorrespondingSignedFixedPointType ( QualType Ty) const

Definition at line 14927 of file ASTContext.cpp.

◆ getCorrespondingSignedType()

QualType ASTContext::getCorrespondingSignedType ( QualType T) const

Definition at line 12339 of file ASTContext.cpp.

◆ getCorrespondingUnsaturatedType()

QualType ASTContext::getCorrespondingUnsaturatedType ( QualType Ty) const

Definition at line 14724 of file ASTContext.cpp.

◆ getCorrespondingUnsignedType()

QualType ASTContext::getCorrespondingUnsignedType ( QualType T) const

Definition at line 12265 of file ASTContext.cpp.

◆ getCountAttributedType()

QualType ASTContext::getCountAttributedType ( QualType T,
Expr * CountExpr,
bool CountInBytes,
bool OrNull,
ArrayRef< TypeCoupledDeclRefInfo > DependentDecls ) const

Definition at line 3690 of file ASTContext.cpp.

◆ getcudaConfigureCallDecl()

FunctionDecl * clang::ASTContext::getcudaConfigureCallDecl ( )
inline

Definition at line 1608 of file ASTContext.h.

◆ getCUIDHash()

StringRef ASTContext::getCUIDHash ( ) const

Definition at line 15187 of file ASTContext.cpp.

◆ getCurrentKeyFunction()

const CXXMethodDecl * ASTContext::getCurrentKeyFunction ( const CXXRecordDecl * RD)

Get our current best idea for the key function of the given record decl, or nullptr if there isn't one.

The key function is, according to the Itanium C++ ABI section 5.2.3: ...the first non-pure virtual function that is not inline at the point of class definition.

Other ABIs use the same idea. However, the ARM C++ ABI ignores virtual functions that are defined 'inline', which means that the result of this computation can change.

Definition at line 3469 of file RecordLayoutBuilder.cpp.

◆ getCurrentNamedModule()

Module * clang::ASTContext::getCurrentNamedModule ( ) const
inline

Get module under construction, nullptr if this is not a C++20 module.

Definition at line 1193 of file ASTContext.h.

◆ getCVRQualifiedType()

QualType clang::ASTContext::getCVRQualifiedType ( QualType T,
unsigned CVR ) const
inline

Return a type with additional const, volatile, or restrict qualifiers.

Definition at line 2437 of file ASTContext.h.

◆ getCXXABIKind()

TargetCXXABI::Kind ASTContext::getCXXABIKind ( ) const

Return the C++ ABI kind that should be used.

The C++ ABI can be overriden at compile time with -fc++-abi=. If this is not provided, we instead use the default ABI set by the target.

Definition at line 884 of file ASTContext.cpp.

◆ getDecayedType() [1/3]

CanQualType clang::ASTContext::getDecayedType ( CanQualType T) const
inline

Definition at line 1549 of file ASTContext.h.

◆ getDecayedType() [2/3]

QualType ASTContext::getDecayedType ( QualType Orig,
QualType Decayed ) const

Return the uniqued reference to a specified decay from the original type to the decayed type.

Definition at line 3963 of file ASTContext.cpp.

◆ getDecayedType() [3/3]

QualType ASTContext::getDecayedType ( QualType T) const

Return the uniqued reference to the decayed version of the given type.

Can only be called on array and function types which decay to pointer types.

Definition at line 3983 of file ASTContext.cpp.

◆ getDeclAlign()

CharUnits ASTContext::getDeclAlign ( const Decl * D,
bool ForAlignof = false ) const

Return a conservative estimate of the alignment of the specified decl D.

Precondition
D must not be a bitfield type, as bitfields do not have a valid alignment.

If ForAlignof, references are treated like their underlying type and large arrays don't get any special treatment. If not ForAlignof it computes the value expected by CodeGen: references are treated like pointers and large arrays get extra alignment.

Definition at line 1823 of file ASTContext.cpp.

◆ getDeclaratorForUnnamedTagDecl()

DeclaratorDecl * ASTContext::getDeclaratorForUnnamedTagDecl ( const TagDecl * TD)

Definition at line 13506 of file ASTContext.cpp.

◆ getDeclAttrs()

AttrVec & ASTContext::getDeclAttrs ( const Decl * D)

Retrieve the attributes for the given declaration.

Definition at line 1527 of file ASTContext.cpp.

◆ getDecltypeType()

QualType ASTContext::getDecltypeType ( Expr * E,
QualType UnderlyingType ) const

C++11 decltype.

Unlike many "get<Type>" functions, we don't unique DecltypeType nodes.

This would never be helpful, since each such type has its own expression, and would not give a significant memory saving, since there is an Expr tree under each such type.

Definition at line 6717 of file ASTContext.cpp.

◆ getDeducedTemplateName()

TemplateName ASTContext::getDeducedTemplateName ( TemplateName Underlying,
DefaultArguments DefaultArgs ) const

Represents a TemplateName which had some of its default arguments deduced.

Retrieve the template name that represents a template name deduced from a specialization.

This both represents this default argument deduction as sugar, and provides the support for it's equivalences through canonicalization. For example DeducedTemplateNames which have the same set of default arguments are equivalent, and are also equivalent to the underlying template when the deduced template arguments are the same.

Definition at line 10529 of file ASTContext.cpp.

◆ getDeducedTemplateSpecializationType()

QualType ASTContext::getDeducedTemplateSpecializationType ( ElaboratedTypeKeyword Keyword,
TemplateName Template,
QualType DeducedType,
bool IsDependent ) const

C++17 deduced class template specialization type.

Return the uniqued reference to the deduced template specialization type which has been deduced to the given type, or to the canonical undeduced such type, or the canonical deduced-but-dependent such type.

Definition at line 6944 of file ASTContext.cpp.

◆ getDefaultCallingConvention()

CallingConv ASTContext::getDefaultCallingConvention ( bool IsVariadic,
bool IsCXXMethod ) const

Retrieves the default calling convention for the current context.

The context's default calling convention may differ from the current target's default calling convention if the -fdefault-calling-conv option is used; to get the target's default calling convention, e.g. for built-in functions, call getTargetInfo().getDefaultCallingConv() instead.

Definition at line 13223 of file ASTContext.cpp.

◆ getDefaultOpenCLPointeeAddrSpace()

LangAS clang::ASTContext::getDefaultOpenCLPointeeAddrSpace ( )
inline

Returns default address space based on OpenCL version and enabled features.

Definition at line 1599 of file ASTContext.h.

◆ getDependentAddressSpaceType()

QualType ASTContext::getDependentAddressSpaceType ( QualType PointeeType,
Expr * AddrSpaceExpr,
SourceLocation AttrLoc ) const

Definition at line 4862 of file ASTContext.cpp.

◆ getDependentBitIntType()

QualType ASTContext::getDependentBitIntType ( bool Unsigned,
Expr * BitsExpr ) const

Return a dependent bit-precise integer type with the specified signedness and bit count.

Definition at line 5191 of file ASTContext.cpp.

◆ getDependentNameType()

QualType ASTContext::getDependentNameType ( ElaboratedTypeKeyword Keyword,
NestedNameSpecifier NNS,
const IdentifierInfo * Name ) const

Definition at line 6112 of file ASTContext.cpp.

◆ getDependentSizedArrayType()

QualType ASTContext::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.

getDependentSizedArrayType - Returns a non-unique reference to the type for a dependently-sized array of the specified element type.

FIXME: We will need these to be uniqued, or at least comparable, at some point.

Definition at line 4417 of file ASTContext.cpp.

◆ getDependentSizedExtVectorType()

QualType ASTContext::getDependentSizedExtVectorType ( QualType VectorType,
Expr * SizeExpr,
SourceLocation AttrLoc ) const
Precondition
Return a non-unique reference to the type for a dependently-sized vector of the specified element type.

FIXME: We will need these to be uniqued, or at least comparable, at some point.

Definition at line 4749 of file ASTContext.cpp.

◆ getDependentSizedMatrixType()

QualType ASTContext::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.

Definition at line 4821 of file ASTContext.cpp.

◆ getDependentTemplateName()

TemplateName ASTContext::getDependentTemplateName ( const DependentTemplateStorage & Name) const

Retrieve the template name that represents a dependent template name such as MetaFun::template operator+.

Definition at line 10467 of file ASTContext.cpp.

◆ getDependentTemplateSpecializationType() [1/2]

QualType ASTContext::getDependentTemplateSpecializationType ( ElaboratedTypeKeyword Keyword,
const DependentTemplateStorage & Name,
ArrayRef< TemplateArgument > Args,
bool IsCanonical = false ) const

Definition at line 6153 of file ASTContext.cpp.

◆ getDependentTemplateSpecializationType() [2/2]

QualType ASTContext::getDependentTemplateSpecializationType ( ElaboratedTypeKeyword Keyword,
const DependentTemplateStorage & Name,
ArrayRef< TemplateArgumentLoc > Args ) const

Definition at line 6143 of file ASTContext.cpp.

◆ getDependentVectorType()

QualType ASTContext::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.

Definition at line 4676 of file ASTContext.cpp.

◆ getDiagAllocator()

PartialDiagnostic::DiagStorageAllocator & clang::ASTContext::getDiagAllocator ( )
inline

Definition at line 855 of file ASTContext.h.

◆ getDiagnostics()

DiagnosticsEngine & ASTContext::getDiagnostics ( ) const

Definition at line 1523 of file ASTContext.cpp.

◆ getExceptionObjectType()

QualType ASTContext::getExceptionObjectType ( QualType T) const

Definition at line 8098 of file ASTContext.cpp.

◆ getExnObjectAlignment()

CharUnits ASTContext::getExnObjectAlignment ( ) const

Return the alignment (in bytes) of the thrown exception object.

This is only meaningful for targets that allocate C++ exceptions in a system runtime, such as those using the Itanium C++ ABI.

Definition at line 1922 of file ASTContext.cpp.

◆ getExternalSource()

ExternalASTSource * clang::ASTContext::getExternalSource ( ) const
inline

Retrieve a pointer to the external AST source associated with this AST context, if any.

Definition at line 1339 of file ASTContext.h.

◆ getExternalSourcePtr()

IntrusiveRefCntPtr< ExternalASTSource > clang::ASTContext::getExternalSourcePtr ( ) const
inline

Retrieve a pointer to the external AST source associated with this AST context, if any.

Returns as an IntrusiveRefCntPtr.

Definition at line 1345 of file ASTContext.h.

◆ getExternCContextDecl()

ExternCContextDecl * ASTContext::getExternCContextDecl ( ) const

Definition at line 1205 of file ASTContext.cpp.

◆ getExtVectorType()

QualType ASTContext::getExtVectorType ( QualType vecType,
unsigned NumElts ) const

Return the unique reference to an extended vector type of the specified element type and size.

getExtVectorType - Return the unique reference to an extended vector type of the specified element type and size.

Precondition
VectorType must be a built-in type.

VectorType must be a built-in type.

Definition at line 4716 of file ASTContext.cpp.

◆ getFieldOffset()

uint64_t ASTContext::getFieldOffset ( const ValueDecl * FD) const

Get the offset of a FieldDecl or IndirectFieldDecl, in bits.

Definition at line 3520 of file RecordLayoutBuilder.cpp.

◆ getFILEType()

QualType clang::ASTContext::getFILEType ( ) const
inline

Retrieve the C FILE type.

Definition at line 2222 of file ASTContext.h.

◆ getFixedPointIBits()

unsigned char ASTContext::getFixedPointIBits ( QualType Ty) const

Definition at line 14860 of file ASTContext.cpp.

◆ getFixedPointMax()

llvm::APFixedPoint ASTContext::getFixedPointMax ( QualType Ty) const

Definition at line 14917 of file ASTContext.cpp.

◆ getFixedPointMin()

llvm::APFixedPoint ASTContext::getFixedPointMin ( QualType Ty) const

Definition at line 14922 of file ASTContext.cpp.

◆ getFixedPointScale()

unsigned char ASTContext::getFixedPointScale ( QualType Ty) const

Definition at line 14814 of file ASTContext.cpp.

◆ getFixedPointSemantics()

llvm::FixedPointSemantics ASTContext::getFixedPointSemantics ( QualType Ty) const

Definition at line 14902 of file ASTContext.cpp.

◆ getFloatingTypeOrder()

int ASTContext::getFloatingTypeOrder ( QualType LHS,
QualType RHS ) const

Compare the rank of the two specified floating point types, ignoring the domain of the type (i.e.

getFloatingTypeOrder - Compare the rank of the two specified floating point types, ignoring the domain of the type (i.e.

'double' == '_Complex double').

If LHS > RHS, returns 1. If LHS == RHS, returns 0. If LHS < RHS, return -1.

'double' == '_Complex double'). If LHS > RHS, return 1. If LHS == RHS, return 0. If LHS < RHS, return -1.

Definition at line 8207 of file ASTContext.cpp.

◆ getFloatingTypeSemanticOrder()

int ASTContext::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 floating-point semantics on the target (i.e.

long double and double on AArch64 will return 0).

Definition at line 8218 of file ASTContext.cpp.

◆ getFloatTypeSemantics()

const llvm::fltSemantics & ASTContext::getFloatTypeSemantics ( QualType T) const

Return the APFloat 'semantics' for the specified scalar floating point type.

getFloatTypeSemantics - Return the APFloat 'semantics' for the specified scalar floating point type.

Definition at line 1798 of file ASTContext.cpp.

◆ getFullLoc()

FullSourceLoc clang::ASTContext::getFullLoc ( SourceLocation Loc) const
inline

Definition at line 917 of file ASTContext.h.

◆ getFunctionFeatureMap() [1/2]

void ASTContext::getFunctionFeatureMap ( llvm::StringMap< bool > & FeatureMap,
const FunctionDecl * FD ) const

Definition at line 14986 of file ASTContext.cpp.

◆ getFunctionFeatureMap() [2/2]

void ASTContext::getFunctionFeatureMap ( llvm::StringMap< bool > & FeatureMap,
GlobalDecl GD ) const

Definition at line 14998 of file ASTContext.cpp.

◆ getFunctionNoProtoType() [1/2]

QualType clang::ASTContext::getFunctionNoProtoType ( QualType ResultTy) const
inline

Definition at line 1745 of file ASTContext.h.

◆ getFunctionNoProtoType() [2/2]

QualType ASTContext::getFunctionNoProtoType ( QualType ResultTy,
const FunctionType::ExtInfo & Info ) const

Return a K&R style C function type like 'int()'.

getFunctionNoProtoType - Return a K&R style C function type like 'int()'.

Definition at line 4905 of file ASTContext.cpp.

◆ getFunctionType()

QualType clang::ASTContext::getFunctionType ( QualType ResultTy,
ArrayRef< QualType > Args,
const FunctionProtoType::ExtProtoInfo & EPI ) const
inline

Return a normal function type with a typed argument list.

Definition at line 1750 of file ASTContext.h.

◆ getFunctionTypeWithExceptionSpec()

QualType ASTContext::getFunctionTypeWithExceptionSpec ( QualType Orig,
const FunctionProtoType::ExceptionSpecInfo & ESI ) const

Get a function type and produce the equivalent function type with the specified exception specification.

Type sugar that can be present on a declaration of a function with an exception specification is permitted and preserved. Other type sugar (for instance, typedefs) is not.

Definition at line 3803 of file ASTContext.cpp.

◆ getFunctionTypeWithoutParamABIs()

QualType ASTContext::getFunctionTypeWithoutParamABIs ( QualType T) const

Get or construct a function type that is equivalent to the input type except that the parameter ABI annotations are stripped.

Definition at line 3843 of file ASTContext.cpp.

◆ getFunctionTypeWithoutPtrSizes()

QualType ASTContext::getFunctionTypeWithoutPtrSizes ( QualType T)

Get a function type and produce the equivalent function type where pointer size address spaces in the return type and parameter types are replaced with the default address space.

Definition at line 3820 of file ASTContext.cpp.

◆ GetGVALinkageForFunction()

GVALinkage ASTContext::GetGVALinkageForFunction ( const FunctionDecl * FD) const

Definition at line 12979 of file ASTContext.cpp.

◆ GetGVALinkageForVariable()

GVALinkage ASTContext::GetGVALinkageForVariable ( const VarDecl * VD) const

Definition at line 13072 of file ASTContext.cpp.

◆ GetHigherPrecisionFPType()

const QualType clang::ASTContext::GetHigherPrecisionFPType ( QualType ElementType) const
inline

Definition at line 862 of file ASTContext.h.

◆ getHLSLAttributedResourceType()

QualType ASTContext::getHLSLAttributedResourceType ( QualType Wrapped,
QualType Contained,
const HLSLAttributedResourceType::Attributes & Attrs )

Definition at line 5763 of file ASTContext.cpp.

◆ getHLSLInlineSpirvType()

QualType ASTContext::getHLSLInlineSpirvType ( uint32_t Opcode,
uint32_t Size,
uint32_t Alignment,
ArrayRef< SpirvOperand > Operands )

Definition at line 5785 of file ASTContext.cpp.

◆ getIncompleteArrayType()

QualType ASTContext::getIncompleteArrayType ( QualType EltTy,
ArraySizeModifier ASM,
unsigned IndexTypeQuals ) const

Return a unique reference to the type for an incomplete array of the specified element type.

Definition at line 4479 of file ASTContext.cpp.

◆ getInjectedTemplateArg()

TemplateArgument ASTContext::getInjectedTemplateArg ( NamedDecl * ParamDecl) const

Definition at line 6205 of file ASTContext.cpp.

◆ getInlineVariableDefinitionKind()

ASTContext::InlineVariableDefinitionKind ASTContext::getInlineVariableDefinitionKind ( const VarDecl * VD) const

Determine whether a definition of this inline variable should be treated as a weak or strong definition.

For compatibility with C++14 and before, for a constexpr static data member, if there is an out-of-line declaration of the member, we may promote it from weak to strong.

Definition at line 8815 of file ASTContext.cpp.

◆ getInnerObjCOwnership()

Qualifiers::ObjCLifetime ASTContext::getInnerObjCOwnership ( QualType T) const

Recurses in pointer/array types until it finds an Objective-C retainable type and returns its ownership.

Recurses in pointer/array types until it finds an objc retainable type and returns its ownership.

Definition at line 8388 of file ASTContext.cpp.

◆ getInstantiatedFromStaticDataMember()

MemberSpecializationInfo * ASTContext::getInstantiatedFromStaticDataMember ( const VarDecl * Var)

If this variable is an instantiated static data member of a class template specialization, returns the templated static data member from which it was instantiated.

Definition at line 1548 of file ASTContext.cpp.

◆ getInstantiatedFromUnnamedFieldDecl()

FieldDecl * ASTContext::getInstantiatedFromUnnamedFieldDecl ( FieldDecl * Field) const

Definition at line 1625 of file ASTContext.cpp.

◆ getInstantiatedFromUsingDecl()

NamedDecl * ASTContext::getInstantiatedFromUsingDecl ( NamedDecl * Inst)

If the given using decl Inst is an instantiation of another (possibly unresolved) using decl, return it.

Definition at line 1583 of file ASTContext.cpp.

◆ getInstantiatedFromUsingEnumDecl()

UsingEnumDecl * ASTContext::getInstantiatedFromUsingEnumDecl ( UsingEnumDecl * Inst)

If the given using-enum decl Inst is an instantiation of another using-enum decl, return it.

Definition at line 1602 of file ASTContext.cpp.

◆ getInstantiatedFromUsingShadowDecl()

UsingShadowDecl * ASTContext::getInstantiatedFromUsingShadowDecl ( UsingShadowDecl * Inst)

Definition at line 1613 of file ASTContext.cpp.

◆ getInt128Decl()

TypedefDecl * ASTContext::getInt128Decl ( ) const

Retrieve the declaration for the 128-bit signed integer type.

Definition at line 1258 of file ASTContext.cpp.

◆ getIntegerTypeOrder()

int ASTContext::getIntegerTypeOrder ( QualType LHS,
QualType RHS ) const

Return the highest ranked integer type, see C99 6.3.1.8p1.

getIntegerTypeOrder - Returns the highest ranked integer type: C99 6.3.1.8p1.

If LHS > RHS, returns 1. If LHS == RHS, returns 0. If LHS < RHS, return -1.

If LHS > RHS, return 1. If LHS == RHS, return 0. If LHS < RHS, return -1.

Definition at line 8417 of file ASTContext.cpp.

◆ getInterpContext()

interp::Context & ASTContext::getInterpContext ( )

Returns the clang bytecode interpreter context.

Definition at line 910 of file ASTContext.cpp.

◆ getIntMaxType()

CanQualType ASTContext::getIntMaxType ( ) const

Return the unique type for "intmax_t" (C99 7.18.1.5), defined in <stdint.h>.

getIntMaxType - Return the unique type for "intmax_t" (C99 7.18.1.5).

Definition at line 7039 of file ASTContext.cpp.

◆ getIntPtrType()

QualType ASTContext::getIntPtrType ( ) const

Return a type compatible with "intptr_t" (C99 7.18.1.4), as defined by the target.

Definition at line 7062 of file ASTContext.cpp.

◆ getIntTypeForBitwidth()

QualType ASTContext::getIntTypeForBitwidth ( unsigned DestWidth,
unsigned Signed ) const

getIntTypeForBitwidth - sets integer QualTy according to specified details: bitwidth, signed/unsigned.

Returns empty type if there is no appropriate target types.

Definition at line 13352 of file ASTContext.cpp.

◆ getIntWidth()

unsigned ASTContext::getIntWidth ( QualType T) const

Definition at line 12254 of file ASTContext.cpp.

◆ getjmp_bufType()

QualType clang::ASTContext::getjmp_bufType ( ) const
inline

Retrieve the C jmp_buf type.

Definition at line 2235 of file ASTContext.h.

◆ getLangASForBuiltinAddressSpace()

LangAS ASTContext::getLangASForBuiltinAddressSpace ( unsigned AS) const

Definition at line 14795 of file ASTContext.cpp.

◆ getLangOpts()

const LangOptions & clang::ASTContext::getLangOpts ( ) const
inline

◆ getLegacyIntegralTypeEncoding()

void ASTContext::getLegacyIntegralTypeEncoding ( QualType & PointeeTy) const

getLegacyIntegralTypeEncoding - Another legacy compatibility encoding: 32-bit longs are encoded as 'l' or 'L' , but not always.

For typedefs, we need to use 'i' or 'I' instead if encoding a struct field, or a pointer!

Definition at line 9127 of file ASTContext.cpp.

◆ getLifetimeQualifiedType()

QualType clang::ASTContext::getLifetimeQualifiedType ( QualType type,
Qualifiers::ObjCLifetime lifetime )
inline

Return a type with the given lifetime qualifier.

Precondition
Neither type.ObjCLifetime() nor lifetime may be OCL_None.

Definition at line 2465 of file ASTContext.h.

◆ getLocalCommentForDeclUncached()

comments::FullComment * ASTContext::getLocalCommentForDeclUncached ( const Decl * D) const

Return parsed documentation comment attached to a given declaration.

Returns nullptr if no comment is attached. Does not look at any redeclarations of the declaration.

Definition at line 609 of file ASTContext.cpp.

◆ getLogicalOperationType()

CanQualType clang::ASTContext::getLogicalOperationType ( ) const
inline

The result type of logical operations, '<', '>', '!=', etc.

Definition at line 2269 of file ASTContext.h.

◆ getLValueReferenceType()

QualType ASTContext::getLValueReferenceType ( QualType T,
bool SpelledAsLValue = true ) const

Return the uniqued reference to the type for an lvalue reference to the specified type.

getLValueReferenceType - Return the uniqued reference to the type for an lvalue reference to the specified type.

Definition at line 4073 of file ASTContext.cpp.

◆ getMacroQualifiedType()

QualType ASTContext::getMacroQualifiedType ( QualType UnderlyingTy,
const IdentifierInfo * MacroII ) const

Definition at line 6076 of file ASTContext.cpp.

◆ getManglingNumber()

unsigned ASTContext::getManglingNumber ( const NamedDecl * ND,
bool ForAuxTarget = false ) const

Definition at line 13398 of file ASTContext.cpp.

◆ getManglingNumberContext() [1/2]

MangleNumberingContext & ASTContext::getManglingNumberContext ( const DeclContext * DC)

Retrieve the context for computing mangling numbers in the given DeclContext.

Definition at line 13455 of file ASTContext.cpp.

◆ getManglingNumberContext() [2/2]

MangleNumberingContext & ASTContext::getManglingNumberContext ( NeedExtraManglingDecl_t ,
const Decl * D )

Definition at line 13464 of file ASTContext.cpp.

◆ getMemberPointerPathAdjustment()

CharUnits ASTContext::getMemberPointerPathAdjustment ( const APValue & MP) const

Find the 'this' offset for the member path in a pointer-to-member APValue.

Definition at line 2770 of file ASTContext.cpp.

◆ getMemberPointerType()

QualType ASTContext::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 nested name.

Definition at line 4150 of file ASTContext.cpp.

◆ getMinGlobalAlignOfVar()

unsigned ASTContext::getMinGlobalAlignOfVar ( uint64_t Size,
const VarDecl * VD ) const

Return the minimum alignment as specified by the target.

If VD is non-null it may be used to identify external or weak variables.

Definition at line 2752 of file ASTContext.cpp.

◆ getModuleInitializers()

ArrayRef< Decl * > ASTContext::getModuleInitializers ( Module * M)

Get the initializations to perform when importing a module, if any.

Definition at line 1163 of file ASTContext.cpp.

◆ getModulesWithMergedDefinition()

ArrayRef< Module * > ASTContext::getModulesWithMergedDefinition ( const NamedDecl * Def)

Get the additional modules in which the definition Def has been merged.

Definition at line 1103 of file ASTContext.cpp.

◆ getMSGuidDecl()

MSGuidDecl * ASTContext::getMSGuidDecl ( MSGuidDeclParts Parts) const

Return a declaration for the global GUID object representing the given GUID value.

Definition at line 13547 of file ASTContext.cpp.

◆ getMSGuidTagDecl()

TagDecl * clang::ASTContext::getMSGuidTagDecl ( ) const
inline

Retrieve the implicitly-predeclared 'struct _GUID' declaration.

Definition at line 2415 of file ASTContext.h.

◆ getMSGuidType()

CanQualType clang::ASTContext::getMSGuidType ( ) const
inline

Retrieve the implicitly-predeclared 'struct _GUID' type.

Definition at line 2418 of file ASTContext.h.

◆ getMSTypeInfoTagDecl()

TagDecl * clang::ASTContext::getMSTypeInfoTagDecl ( ) const
inline

Retrieve the implicitly-predeclared 'struct type_info' declaration.

Definition at line 2424 of file ASTContext.h.

◆ getNameForTemplate()

DeclarationNameInfo ASTContext::getNameForTemplate ( TemplateName Name,
SourceLocation NameLoc ) const

Definition at line 7284 of file ASTContext.cpp.

◆ getNewOMPTraitInfo()

OMPTraitInfo & ASTContext::getNewOMPTraitInfo ( )

Return a new OMPTraitInfo object owned by this context.

Definition at line 15150 of file ASTContext.cpp.

◆ getNextLocalImport()

ImportDecl * clang::ASTContext::getNextLocalImport ( ImportDecl * Import)
inlinestatic

Definition at line 1147 of file ASTContext.h.

◆ getNextStringLiteralVersion()

unsigned clang::ASTContext::getNextStringLiteralVersion ( )
inline

Return the next version number to be used for a string literal evaluated as part of constant evaluation.

Definition at line 3474 of file ASTContext.h.

◆ getNoSanitizeList()

const NoSanitizeList & clang::ASTContext::getNoSanitizeList ( ) const
inline

Definition at line 904 of file ASTContext.h.

◆ getNSCopyingName()

IdentifierInfo * clang::ASTContext::getNSCopyingName ( )
inline

Retrieve the identifier 'NSCopying'.

Definition at line 2180 of file ASTContext.h.

◆ getNSIntegerType()

CanQualType ASTContext::getNSIntegerType ( ) const

Definition at line 8764 of file ASTContext.cpp.

◆ getNSObjectName()

IdentifierInfo * clang::ASTContext::getNSObjectName ( ) const
inline

Retrieve the identifier 'NSObject'.

Definition at line 2171 of file ASTContext.h.

◆ getNSUIntegerType()

CanQualType ASTContext::getNSUIntegerType ( ) const

Definition at line 8755 of file ASTContext.cpp.

◆ getObjCClassDecl()

TypedefDecl * ASTContext::getObjCClassDecl ( ) const

Retrieve the typedef declaration corresponding to the predefined Objective-C 'Class' type.

Definition at line 9906 of file ASTContext.cpp.

◆ getObjCClassRedefinitionType()

QualType clang::ASTContext::getObjCClassRedefinitionType ( ) const
inline

Retrieve the type that Class has been defined to, which may be different from the built-in Class if Class has been typedef'd.

Definition at line 2146 of file ASTContext.h.

◆ getObjCClassType()

QualType clang::ASTContext::getObjCClassType ( ) const
inline

Represents the Objective-C Class type.

This is set up lazily, by Sema. Class is always a (typedef for a) pointer type, a pointer to a struct.

Definition at line 2359 of file ASTContext.h.

◆ getObjCConstantStringInterface()

QualType clang::ASTContext::getObjCConstantStringInterface ( ) const
inline

Definition at line 2119 of file ASTContext.h.

◆ getObjCEncodingForBlock()

std::string ASTContext::getObjCEncodingForBlock ( const BlockExpr * blockExpr) const

Return the encoded type for this block declaration.

getObjCEncodingForBlock - Return the encoded type for this block declaration.

Definition at line 8841 of file ASTContext.cpp.

◆ getObjCEncodingForFunctionDecl()

std::string ASTContext::getObjCEncodingForFunctionDecl ( const FunctionDecl * Decl) const

Emit the encoded type for the function Decl into S.

This is in the same format as Objective-C method encodings.

Returns
true if an error occurred (e.g., because one of the parameter types is incomplete), false otherwise.

Definition at line 8897 of file ASTContext.cpp.

◆ getObjCEncodingForMethodDecl()

std::string ASTContext::getObjCEncodingForMethodDecl ( const ObjCMethodDecl * Decl,
bool Extended = false ) const

Emit the encoded type for the method declaration Decl into S.

getObjCEncodingForMethodDecl - Return the encoded type for this method declaration.

Definition at line 8955 of file ASTContext.cpp.

◆ getObjCEncodingForMethodParameter()

void ASTContext::getObjCEncodingForMethodParameter ( Decl::ObjCDeclQualifier QT,
QualType T,
std::string & S,
bool Extended ) const

getObjCEncodingForMethodParameter - Return the encoded type for a single method parameter or return type.

If Extended, include class names and block object types.

Definition at line 8938 of file ASTContext.cpp.

◆ getObjCEncodingForPropertyDecl()

std::string ASTContext::getObjCEncodingForPropertyDecl ( const ObjCPropertyDecl * PD,
const Decl * Container ) const

getObjCEncodingForPropertyDecl - Return the encoded type for this method declaration.

getObjCEncodingForPropertyDecl - Return the encoded type for this property declaration.

If non-NULL, Container must be either an ObjCCategoryImplDecl or ObjCImplementationDecl; it should only be NULL when getting encodings for protocol properties.

If non-NULL, Container must be either an ObjCCategoryImplDecl or ObjCImplementationDecl; it should only be NULL when getting encodings for protocol properties. Property attributes are stored as a comma-delimited C string. The simple attributes readonly and bycopy are encoded as single characters. The parametrized attributes, getter=name, setter=name, and ivar=name, are encoded as single characters, followed by an identifier. Property types are also encoded as a parametrized attribute. The characters used to encode these attributes are defined by the following enumeration:

enum PropertyAttributes {
kPropertyReadOnly = 'R', // property is read-only.
kPropertyBycopy = 'C', // property is a copy of the value last assigned
kPropertyByref = '&', // property is a reference to the value last assigned
kPropertyDynamic = 'D', // property is dynamic
kPropertyGetter = 'G', // followed by getter selector name
kPropertySetter = 'S', // followed by setter selector name
kPropertyInstanceVariable = 'V' // followed by instance variable name
kPropertyType = 'T' // followed by old-style type encoding.
kPropertyWeak = 'W' // 'weak' property
kPropertyStrong = 'P' // property GC'able
kPropertyNonAtomic = 'N' // property non-atomic
kPropertyOptional = '?' // property optional
};

Definition at line 9053 of file ASTContext.cpp.

◆ getObjCEncodingForPropertyType()

void ASTContext::getObjCEncodingForPropertyType ( QualType T,
std::string & S ) const

Emit the Objective-C property type encoding for the given type T into S.

Definition at line 9154 of file ASTContext.cpp.

◆ getObjCEncodingForType()

void ASTContext::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.

If Field is specified then record field names are also encoded.

Definition at line 9139 of file ASTContext.cpp.

◆ getObjCEncodingForTypeQualifier()

void ASTContext::getObjCEncodingForTypeQualifier ( Decl::ObjCDeclQualifier QT,
std::string & S ) const

Put the string version of the type qualifiers QT into S.

Definition at line 9873 of file ASTContext.cpp.

◆ getObjCEncodingTypeSize()

CharUnits ASTContext::getObjCEncodingTypeSize ( QualType T) const

Return the size of type T for Objective-C encoding purpose, in characters.

getObjCEncodingTypeSize returns size of type for objective-c encoding purpose.

Definition at line 8792 of file ASTContext.cpp.

◆ getObjCGCAttrKind()

Qualifiers::GC ASTContext::getObjCGCAttrKind ( QualType Ty) const

Return one of the GCNone, Weak or Strong Objective-C garbage collection attributes.

getObjCGCAttr - Returns one of GCNone, Weak or Strong objc's garbage collection attribute.

Definition at line 10578 of file ASTContext.cpp.

◆ getObjCGCQualType()

QualType ASTContext::getObjCGCQualType ( QualType T,
Qualifiers::GC gcAttr ) const

Return the uniqued reference to the type for an Objective-C gc-qualified type.

The resulting type has a union of the qualifiers from T and the gc attribute.

Definition at line 3652 of file ASTContext.cpp.

◆ getObjCIdDecl()

TypedefDecl * ASTContext::getObjCIdDecl ( ) const

Retrieve the typedef corresponding to the predefined id type in Objective-C.

Definition at line 9889 of file ASTContext.cpp.

◆ getObjCIdRedefinitionType()

QualType clang::ASTContext::getObjCIdRedefinitionType ( ) const
inline

Retrieve the type that id has been defined to, which may be different from the built-in id if id has been typedef'd.

Definition at line 2133 of file ASTContext.h.

◆ getObjCIdType()

QualType clang::ASTContext::getObjCIdType ( ) const
inline

Represents the Objective-CC id type.

This is set up lazily, by Sema. id is always a (typedef for a) pointer type, a pointer to a struct.

Definition at line 2333 of file ASTContext.h.

◆ getObjCImplementation() [1/2]

ObjCCategoryImplDecl * ASTContext::getObjCImplementation ( ObjCCategoryDecl * D)

Get the implementation of the ObjCCategoryDecl D, or nullptr if none exists.

Get the implementation of ObjCCategoryDecl, or nullptr if none exists.

Definition at line 3112 of file ASTContext.cpp.

◆ getObjCImplementation() [2/2]

ObjCImplementationDecl * ASTContext::getObjCImplementation ( ObjCInterfaceDecl * D)

Get the implementation of the ObjCInterfaceDecl D, or nullptr if none exists.

Get the implementation of ObjCInterfaceDecl, or nullptr if none exists.

Definition at line 3102 of file ASTContext.cpp.

◆ getObjCInstanceType()

QualType clang::ASTContext::getObjCInstanceType ( )
inline

Retrieve the Objective-C "instancetype" type.

Definition at line 2208 of file ASTContext.h.

◆ getObjCInstanceTypeDecl()

TypedefDecl * ASTContext::getObjCInstanceTypeDecl ( )

Retrieve the typedef declaration corresponding to the Objective-C "instancetype" type.

Definition at line 8773 of file ASTContext.cpp.

◆ getObjCInterfaceType()

QualType ASTContext::getObjCInterfaceType ( const ObjCInterfaceDecl * Decl,
ObjCInterfaceDecl * PrevDecl = nullptr ) const

getObjCInterfaceType - Return the unique reference to the type for the specified ObjC interface decl.

The list of protocols is optional.

Definition at line 6619 of file ASTContext.cpp.

◆ getObjCMemberSelTypePtrAuth()

PointerAuthQualifier ASTContext::getObjCMemberSelTypePtrAuth ( )

Definition at line 9929 of file ASTContext.cpp.

◆ getObjCMethodRedeclaration()

const ObjCMethodDecl * ASTContext::getObjCMethodRedeclaration ( const ObjCMethodDecl * MD) const

Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists.

Definition at line 3135 of file ASTContext.cpp.

◆ getObjCNSStringType()

QualType clang::ASTContext::getObjCNSStringType ( ) const
inline

Definition at line 2123 of file ASTContext.h.

◆ getObjCObjectPointerType()

QualType ASTContext::getObjCObjectPointerType ( QualType OIT) const

Return a ObjCObjectPointerType type for the given ObjCObjectType.

getObjCObjectPointerType - Return a ObjCObjectPointerType type for the given object type.

Definition at line 6588 of file ASTContext.cpp.

◆ getObjCObjectType() [1/2]

QualType ASTContext::getObjCObjectType ( QualType Base,
ArrayRef< QualType > typeArgs,
ArrayRef< ObjCProtocolDecl * > protocols,
bool isKindOf ) const

Definition at line 6327 of file ASTContext.cpp.

◆ getObjCObjectType() [2/2]

QualType ASTContext::getObjCObjectType ( QualType Base,
ObjCProtocolDecl *const * Protocols,
unsigned NumProtocols ) const

Legacy interface: cannot provide type arguments or __kindof.

Definition at line 6320 of file ASTContext.cpp.

◆ getObjContainingInterface()

const ObjCInterfaceDecl * ASTContext::getObjContainingInterface ( const NamedDecl * ND) const

Returns the Objective-C interface that ND belongs to if it is an Objective-C method/property/ivar etc.

that is part of an interface, otherwise returns null.

Definition at line 3145 of file ASTContext.cpp.

◆ getObjCPropertyImplDeclForPropertyDecl()

ObjCPropertyImplDecl * ASTContext::getObjCPropertyImplDeclForPropertyDecl ( const ObjCPropertyDecl * PD,
const Decl * Container ) const

Definition at line 9008 of file ASTContext.cpp.

◆ getObjCProtocolDecl()

ObjCInterfaceDecl * ASTContext::getObjCProtocolDecl ( ) const

Retrieve the Objective-C class declaration corresponding to the predefined Protocol class.

Definition at line 9915 of file ASTContext.cpp.

◆ getObjCProtoType()

QualType clang::ASTContext::getObjCProtoType ( ) const
inline

Retrieve the type of the Objective-C Protocol class.

Definition at line 2385 of file ASTContext.h.

◆ getObjCSelDecl()

TypedefDecl * ASTContext::getObjCSelDecl ( ) const

Retrieve the typedef corresponding to the predefined 'SEL' type in Objective-C.

Definition at line 9898 of file ASTContext.cpp.

◆ getObjCSelRedefinitionType()

QualType clang::ASTContext::getObjCSelRedefinitionType ( ) const
inline

Retrieve the type that 'SEL' has been defined to, which may be different from the built-in 'SEL' if 'SEL' has been typedef'd.

Definition at line 2159 of file ASTContext.h.

◆ getObjCSelType()

QualType clang::ASTContext::getObjCSelType ( ) const
inline

Retrieve the type that corresponds to the predefined Objective-C 'SEL' type.

Definition at line 2344 of file ASTContext.h.

◆ getObjCSuperType()

QualType ASTContext::getObjCSuperType ( ) const

Returns the C struct type for objc_super.

Definition at line 8558 of file ASTContext.cpp.

◆ getObjCTypeParamType()

QualType ASTContext::getObjCTypeParamType ( const ObjCTypeParamDecl * Decl,
ArrayRef< ObjCProtocolDecl * > protocols ) const

Definition at line 6479 of file ASTContext.cpp.

◆ getOffsetOfBaseWithVBPtr()

CharUnits ASTContext::getOffsetOfBaseWithVBPtr ( const CXXRecordDecl * RD) const

Loading virtual member pointers using the virtual inheritance model always results in an adjustment using the vbtable even if the index is zero.

This is usually OK because the first slot in the vbtable points backwards to the top of the MDC. However, the MDC might be reusing a vbptr from an nv-base. In this case, the first slot in the vbtable points to the start of the nv-base which introduced the vbptr and not the MDC. Modify the NonVirtualBaseAdjustment to account for this.

Definition at line 2760 of file ASTContext.cpp.

◆ getOpenCLTypeAddrSpace()

LangAS ASTContext::getOpenCLTypeAddrSpace ( const Type * T) const

Get address space for OpenCL type.

Definition at line 8683 of file ASTContext.cpp.

◆ getOpenCLTypeKind()

OpenCLTypeKind ASTContext::getOpenCLTypeKind ( const Type * T) const

Map an AST Type to an OpenCLTypeKind enum value.

Definition at line 8647 of file ASTContext.cpp.

◆ getOpenMPDefaultSimdAlign()

unsigned ASTContext::getOpenMPDefaultSimdAlign ( QualType T) const

Get default simd alignment of the specified complete type in bits.

Definition at line 2632 of file ASTContext.cpp.

◆ getOverloadedTemplateName()

TemplateName ASTContext::getOverloadedTemplateName ( UnresolvedSetIterator Begin,
UnresolvedSetIterator End ) const

Retrieve the template name that corresponds to a non-empty lookup.

Definition at line 10405 of file ASTContext.cpp.

◆ getOverriddenMethods()

void ASTContext::getOverriddenMethods ( const NamedDecl * Method,
SmallVectorImpl< const NamedDecl * > & Overridden ) const

Return C++ or ObjC overridden methods for the given Method.

An ObjC method is considered to override any method in the class's base classes, its protocols, or its categories' protocols, that has the same selector and is of the same kind (class or instance). A method in an implementation is not considered as overriding the same method in the interface or its categories.

Definition at line 1672 of file ASTContext.cpp.

◆ getPackExpansionType()

QualType ASTContext::getPackExpansionType ( QualType Pattern,
UnsignedOrNone NumExpansions,
bool ExpectPackInType = true ) const

Form a pack expansion type with the given pattern.

Parameters
NumExpansionsThe number of expansions for the pack, if known.
ExpectPackInTypeIf false, we should not expect Pattern to contain an unexpanded pack. This only makes sense if the pack expansion is used in a context where the arity is inferred from elsewhere, such as if the pattern contains a placeholder type or if this is the canonical type of another pack expansion type.

Definition at line 6255 of file ASTContext.cpp.

◆ getPackIndexingType()

QualType ASTContext::getPackIndexingType ( QualType Pattern,
Expr * IndexExpr,
bool FullySubstituted = false,
ArrayRef< QualType > Expansions = {},
UnsignedOrNone Index = std::nullopt ) const

Definition at line 6749 of file ASTContext.cpp.

◆ getParameterIndex()

unsigned ASTContext::getParameterIndex ( const ParmVarDecl * D) const

Used by ParmVarDecl to retrieve on the side the index of the parameter when it exceeds the size of the normal bitfield.

Definition at line 13514 of file ASTContext.cpp.

◆ getParentMapContext()

ParentMapContext & ASTContext::getParentMapContext ( )

Returns the dynamic AST node parent map context.

Definition at line 917 of file ASTContext.cpp.

◆ getParents() [1/2]

template<>
DynTypedNodeList clang::ASTContext::getParents ( const DynTypedNode & Node)
inline

Definition at line 136 of file ParentMapContext.h.

◆ getParents() [2/2]

template<typename NodeT>
DynTypedNodeList clang::ASTContext::getParents ( const NodeT & Node)
inline

Forwards to get node parents from the ParentMapContext.

New callers should use ParentMapContext::getParents() directly.

Definition at line 131 of file ParentMapContext.h.

◆ getParenType()

QualType ASTContext::getParenType ( QualType NamedType) const

Definition at line 6052 of file ASTContext.cpp.

◆ getPointerAuthType()

QualType clang::ASTContext::getPointerAuthType ( QualType Ty,
PointerAuthQualifier PointerAuth )
inline

Return a type with the given __ptrauth qualifier.

Definition at line 2487 of file ASTContext.h.

◆ getPointerAuthTypeDiscriminator()

uint16_t ASTContext::getPointerAuthTypeDiscriminator ( QualType T)

Return the "other" type-specific discriminator for the given type.

Definition at line 3602 of file ASTContext.cpp.

◆ getPointerAuthVTablePointerDiscriminator()

uint16_t ASTContext::getPointerAuthVTablePointerDiscriminator ( const CXXRecordDecl * RD)

Return the "other" discriminator used for the pointer auth schema used for vtable pointers in instances of the requested type.

Definition at line 3318 of file ASTContext.cpp.

◆ getPointerDiffType()

QualType ASTContext::getPointerDiffType ( ) const

Return the unique type for "ptrdiff_t" (C99 7.17) defined in <stddef.h>.

getPointerDiffType - Return the unique type for "ptrdiff_t" (C99 7.17) defined in <stddef.h>.

Pointer - pointer requires this (C99 6.5.6p9).

Definition at line 7027 of file ASTContext.cpp.

◆ getPointerType() [1/2]

CanQualType clang::ASTContext::getPointerType ( CanQualType T) const
inline

Definition at line 1528 of file ASTContext.h.

◆ getPointerType() [2/2]

QualType ASTContext::getPointerType ( QualType T) const

Return the uniqued reference to the type for a pointer to the specified type.

getPointerType - Return the uniqued reference to the type for a pointer to the specified type.

Definition at line 3916 of file ASTContext.cpp.

◆ getPredefinedStringLiteralFromCache()

StringLiteral * ASTContext::getPredefinedStringLiteralFromCache ( StringRef Key) const

Return a string representing the human readable name for the specified function declaration or file name.

Used by SourceLocExpr and PredefinedExpr to cache evaluated results.

Definition at line 13536 of file ASTContext.cpp.

◆ getPredefinedSugarType()

QualType ASTContext::getPredefinedSugarType ( PredefinedSugarType::Kind KD) const

Definition at line 5211 of file ASTContext.cpp.

◆ getPreferredTypeAlign() [1/2]

unsigned ASTContext::getPreferredTypeAlign ( const Type * T) const

getPreferredTypeAlign - Return the "preferred" alignment of the specified type for the current target in bits.

This can be different than the ABI alignment in cases where it is beneficial for performance or backwards compatibility preserving to overalign a data type. (Note: despite the name, the preferred alignment is ABI-impacting, and not an optimization.)

Definition at line 2681 of file ASTContext.cpp.

◆ getPreferredTypeAlign() [2/2]

unsigned clang::ASTContext::getPreferredTypeAlign ( QualType T) const
inline

Return the "preferred" alignment of the specified type T for the current target, in bits.

This can be different than the ABI alignment in cases where it is beneficial for performance or backwards compatibility preserving to overalign a data type. (Note: despite the name, the preferred alignment is ABI-impacting, and not an optimization.)

Definition at line 2716 of file ASTContext.h.

◆ getPreferredTypeAlignInChars()

CharUnits clang::ASTContext::getPreferredTypeAlignInChars ( QualType T) const
inline

Return the PreferredAlignment of a (complete) type T, in characters.

Definition at line 2684 of file ASTContext.h.

◆ getPrimaryMergedDecl()

Decl * clang::ASTContext::getPrimaryMergedDecl ( Decl * D)
inline

Definition at line 1157 of file ASTContext.h.

◆ getPrintingPolicy()

const clang::PrintingPolicy & clang::ASTContext::getPrintingPolicy ( ) const
inline

Definition at line 793 of file ASTContext.h.

◆ getProcessIDType()

QualType ASTContext::getProcessIDType ( ) const

Return the unique type for "pid_t" defined in <sys/types.h>.

We need this to compute the correct type for vfork().

Definition at line 7072 of file ASTContext.cpp.

◆ getProfileList()

const ProfileList & clang::ASTContext::getProfileList ( ) const
inline

Definition at line 913 of file ASTContext.h.

◆ getPromotedIntegerType()

QualType ASTContext::getPromotedIntegerType ( QualType PromotableType) const

Return the type that PromotableType will promote to: C99 6.3.1.1p2, assuming that PromotableType is a promotable integer type.

getPromotedIntegerType - Returns the type that Promotable will promote to: C99 6.3.1.1p2, assuming that Promotable is a promotable integer type.

Definition at line 8345 of file ASTContext.cpp.

◆ getQualifiedTemplateName()

TemplateName ASTContext::getQualifiedTemplateName ( NestedNameSpecifier Qualifier,
bool TemplateKeyword,
TemplateName Template ) const

Retrieve the template name that represents a qualified template name such as std::vector.

Definition at line 10436 of file ASTContext.cpp.

◆ getQualifiedType() [1/3]

QualType clang::ASTContext::getQualifiedType ( const Type * T,
Qualifiers Qs ) const
inline

Return a type with additional qualifiers.

Definition at line 2456 of file ASTContext.h.

◆ getQualifiedType() [2/3]

QualType clang::ASTContext::getQualifiedType ( QualType T,
Qualifiers Qs ) const
inline

Return a type with additional qualifiers.

Definition at line 2447 of file ASTContext.h.

◆ getQualifiedType() [3/3]

QualType clang::ASTContext::getQualifiedType ( SplitQualType split) const
inline

Un-split a SplitQualType.

Definition at line 2442 of file ASTContext.h.

◆ getRawCFConstantStringType()

QualType clang::ASTContext::getRawCFConstantStringType ( ) const
inline

Get the structure type used to representation CFStrings, or NULL if it hasn't yet been built.

Definition at line 2106 of file ASTContext.h.

◆ getRawCommentForAnyRedecl()

const RawComment * ASTContext::getRawCommentForAnyRedecl ( const Decl * D,
const Decl ** OriginalDecl = nullptr ) const

Return the documentation comment attached to a given declaration.

Returns nullptr if no comment is attached.

Parameters
OriginalDeclif not nullptr, is set to declaration AST node that had the comment, if the comment we found comes from a redeclaration.

Definition at line 424 of file ASTContext.cpp.

◆ getRawCommentForDeclNoCache()

RawComment * ASTContext::getRawCommentForDeclNoCache ( const Decl * D) const

Return the documentation comment attached to a given declaration, without looking into cache.

Definition at line 315 of file ASTContext.cpp.

◆ getRawCommentForDeclNoCacheImpl()

RawComment * ASTContext::getRawCommentForDeclNoCacheImpl ( const Decl * D,
const SourceLocation RepresentativeLocForDecl,
const std::map< unsigned, RawComment * > & CommentsInFile ) const
Returns
searches CommentsInFile for doc comment for D.

RepresentativeLocForDecl is used as a location for searching doc comments. CommentsInFile is a mapping offset -> comment of files in the same file where RepresentativeLocForDecl is.

Definition at line 237 of file ASTContext.cpp.

◆ getReadPipeType()

QualType ASTContext::getReadPipeType ( QualType T) const

Return a read_only pipe type for the specified type.

Definition at line 5169 of file ASTContext.cpp.

Referenced by getCommonNonSugarTypeNode().

◆ getRealTypeForBitwidth()

QualType ASTContext::getRealTypeForBitwidth ( unsigned DestWidth,
FloatModeKind ExplicitType ) const

getRealTypeForBitwidth - sets floating point QualTy according to specified bitwidth.

Returns empty type if there is no appropriate target types.

Definition at line 13364 of file ASTContext.cpp.

◆ getReferenceQualifiedType()

QualType ASTContext::getReferenceQualifiedType ( const Expr * e) const

getReferenceQualifiedType - Given an expr, will return the type for that expression, as in [dcl.type.simple]p4 but without taking id-expressions and class member access into account.

Definition at line 6693 of file ASTContext.cpp.

◆ getRelocationInfoForCXXRecord()

std::optional< ASTContext::CXXRecordDeclRelocationInfo > ASTContext::getRelocationInfoForCXXRecord ( const CXXRecordDecl * RD) const

Definition at line 1693 of file ASTContext.cpp.

◆ getRestrictType()

QualType clang::ASTContext::getRestrictType ( QualType T) const
inline

Return the uniqued reference to the type for a restrict qualified type.

The resulting type has a union of the qualifiers from T and restrict.

Definition at line 1441 of file ASTContext.h.

◆ getRValueReferenceType()

QualType ASTContext::getRValueReferenceType ( QualType T) const

Return the uniqued reference to the type for an rvalue reference to the specified type.

getRValueReferenceType - Return the uniqued reference to the type for an rvalue reference to the specified type.

Definition at line 4113 of file ASTContext.cpp.

◆ getScalableVectorType()

QualType ASTContext::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 number of elements.

getScalableVectorType - Return the unique reference to a scalable vector type of the specified element type and size.

For RISC-V, number of fields is also provided when it fetching for tuple type.

Precondition
EltTy must be a built-in type.

VectorType must be a built-in type.

Definition at line 4587 of file ASTContext.cpp.

◆ getSideTableAllocatedMemory()

size_t ASTContext::getSideTableAllocatedMemory ( ) const

Return the total memory used for various side tables.

Definition at line 13332 of file ASTContext.cpp.

◆ getsigjmp_bufType()

QualType clang::ASTContext::getsigjmp_bufType ( ) const
inline

Retrieve the C sigjmp_buf type.

Definition at line 2248 of file ASTContext.h.

◆ getSignatureParameterType()

QualType ASTContext::getSignatureParameterType ( QualType T) const

Retrieve the parameter type as adjusted for use in the signature of a function, decaying array and function types and removing top-level cv-qualifiers.

Definition at line 8092 of file ASTContext.cpp.

◆ getSignedSizeType()

QualType ASTContext::getSignedSizeType ( ) const

Return the unique signed counterpart of the integer type corresponding to size_t.

Definition at line 7021 of file ASTContext.cpp.

◆ getSignedWCharType()

QualType ASTContext::getSignedWCharType ( ) const

Return the type of "signed wchar_t".

getSignedWCharType - Return the type of "signed wchar_t".

Used when in C++, as a GCC extension.

Definition at line 7050 of file ASTContext.cpp.

◆ getSizeType()

QualType ASTContext::getSizeType ( ) const

Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.

getSizeType - Return the unique type for "size_t" (C99 7.17), the result of the sizeof operator (C99 6.5.3.4p4).

The sizeof operator requires this (C99 6.5.3.4p4).

The value is target dependent and needs to agree with the definition in <stddef.h>.

Definition at line 7011 of file ASTContext.cpp.

◆ getSourceManager() [1/2]

SourceManager & clang::ASTContext::getSourceManager ( )
inline

Definition at line 801 of file ASTContext.h.

◆ getSourceManager() [2/2]

const SourceManager & clang::ASTContext::getSourceManager ( ) const
inline

Definition at line 802 of file ASTContext.h.

◆ getStaticLocalNumber()

unsigned ASTContext::getStaticLocalNumber ( const VarDecl * VD) const

Definition at line 13423 of file ASTContext.cpp.

◆ getStringLiteralArrayType()

QualType ASTContext::getStringLiteralArrayType ( QualType EltTy,
unsigned Length ) const

Return a type for a constant array for a string literal of the specified element type and length.

Definition at line 13521 of file ASTContext.cpp.

◆ getSubstBuiltinTemplatePack()

QualType ASTContext::getSubstBuiltinTemplatePack ( const TemplateArgument & ArgPack)

Definition at line 5874 of file ASTContext.cpp.

◆ getSubstTemplateTemplateParm()

TemplateName ASTContext::getSubstTemplateTemplateParm ( TemplateName replacement,
Decl * AssociatedDecl,
unsigned Index,
UnsignedOrNone PackIndex,
bool Final ) const

Definition at line 10482 of file ASTContext.cpp.

◆ getSubstTemplateTemplateParmPack()

TemplateName ASTContext::getSubstTemplateTemplateParmPack ( const TemplateArgument & ArgPack,
Decl * AssociatedDecl,
unsigned Index,
bool Final ) const

Definition at line 10505 of file ASTContext.cpp.

◆ getSubstTemplateTypeParmPackType()

QualType ASTContext::getSubstTemplateTypeParmPackType ( Decl * AssociatedDecl,
unsigned Index,
bool Final,
const TemplateArgument & ArgPack )

Definition at line 5836 of file ASTContext.cpp.

◆ getSubstTemplateTypeParmType()

QualType ASTContext::getSubstTemplateTypeParmType ( QualType Replacement,
Decl * AssociatedDecl,
unsigned Index,
UnsignedOrNone PackIndex,
bool Final ) const

Retrieve a substitution-result type.

Definition at line 5810 of file ASTContext.cpp.

◆ getSYCLKernelInfo()

const SYCLKernelInfo & ASTContext::getSYCLKernelInfo ( QualType T) const

Given a type used as a SYCL kernel name, returns a reference to the metadata generated from the corresponding SYCL kernel entry point.

Aborts if the provided type is not a registered SYCL kernel name.

Definition at line 15137 of file ASTContext.cpp.

◆ getTagType()

QualType ASTContext::getTagType ( ElaboratedTypeKeyword Keyword,
NestedNameSpecifier Qualifier,
const TagDecl * TD,
bool OwnsTag ) const

Definition at line 5492 of file ASTContext.cpp.

◆ getTargetAddressSpace()

unsigned ASTContext::getTargetAddressSpace ( LangAS AS) const

Definition at line 13660 of file ASTContext.cpp.

◆ getTargetDefaultAlignForAttributeAligned()

unsigned ASTContext::getTargetDefaultAlignForAttributeAligned ( ) const

Return the default alignment for attribute((aligned)) on this target, to be used if no alignment value is specified.

getTargetDefaultAlignForAttributeAligned - Return the default alignment for attribute((aligned)) on this target, to be used if no alignment value is specified.

Definition at line 2733 of file ASTContext.cpp.

◆ getTargetInfo()

const TargetInfo & clang::ASTContext::getTargetInfo ( ) const
inline

Definition at line 859 of file ASTContext.h.

◆ getTargetNullPointerValue()

uint64_t ASTContext::getTargetNullPointerValue ( QualType QT) const

Get target-dependent integer value for null pointer which is used for constant folding.

Definition at line 13650 of file ASTContext.cpp.

◆ getTemplateOrSpecializationInfo()

ASTContext::TemplateOrSpecializationInfo ASTContext::getTemplateOrSpecializationInfo ( const VarDecl * Var)

Definition at line 1555 of file ASTContext.cpp.

◆ getTemplateParamObjectDecl()

TemplateParamObjectDecl * ASTContext::getTemplateParamObjectDecl ( QualType T,
const APValue & V ) const

Return the template parameter object of the given type with the given value.

Definition at line 13581 of file ASTContext.cpp.

◆ getTemplateSpecializationType() [1/2]

QualType ASTContext::getTemplateSpecializationType ( ElaboratedTypeKeyword Keyword,
TemplateName T,
ArrayRef< TemplateArgument > SpecifiedArgs,
ArrayRef< TemplateArgument > CanonicalArgs,
QualType Underlying = QualType() ) const

Definition at line 6001 of file ASTContext.cpp.

◆ getTemplateSpecializationType() [2/2]

QualType ASTContext::getTemplateSpecializationType ( ElaboratedTypeKeyword Keyword,
TemplateName T,
ArrayRef< TemplateArgumentLoc > SpecifiedArgs,
ArrayRef< TemplateArgument > CanonicalArgs,
QualType Canon = QualType() ) const

Definition at line 5951 of file ASTContext.cpp.

◆ getTemplateSpecializationTypeInfo()

TypeSourceInfo * ASTContext::getTemplateSpecializationTypeInfo ( ElaboratedTypeKeyword Keyword,
SourceLocation ElaboratedKeywordLoc,
NestedNameSpecifierLoc QualifierLoc,
SourceLocation TemplateKeywordLoc,
TemplateName T,
SourceLocation TLoc,
const TemplateArgumentListInfo & SpecifiedArgs,
ArrayRef< TemplateArgument > CanonicalArgs,
QualType Canon = QualType() ) const

Definition at line 5935 of file ASTContext.cpp.

◆ getTemplateTypeParmType()

QualType ASTContext::getTemplateTypeParmType ( unsigned Depth,
unsigned Index,
bool ParameterPack,
TemplateTypeParmDecl * ParmDecl = nullptr ) const

Retrieve the template type parameter type for a template parameter or parameter pack with the given depth, index, and (optionally) name.

Definition at line 5904 of file ASTContext.cpp.

◆ getTranslationUnitDecl()

TranslationUnitDecl * clang::ASTContext::getTranslationUnitDecl ( ) const
inline

Definition at line 1201 of file ASTContext.h.

◆ getTraversalScope()

ArrayRef< Decl * > clang::ASTContext::getTraversalScope ( ) const
inline

Definition at line 786 of file ASTContext.h.

◆ getTrivialTypeSourceInfo()

TypeSourceInfo * ASTContext::getTrivialTypeSourceInfo ( QualType T,
SourceLocation Loc = SourceLocation() ) const

Allocate a TypeSourceInfo where all locations have been initialized to a given location, which defaults to the empty location.

Definition at line 3192 of file ASTContext.cpp.

◆ getTypeAlign() [1/2]

unsigned clang::ASTContext::getTypeAlign ( const Type * T) const
inline

Definition at line 2657 of file ASTContext.h.

◆ getTypeAlign() [2/2]

unsigned clang::ASTContext::getTypeAlign ( QualType T) const
inline

Return the ABI-specified alignment of a (complete) type T, in bits.

Definition at line 2656 of file ASTContext.h.

◆ getTypeAlignIfKnown()

unsigned ASTContext::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 alignment (for example, from alignment attributes).

The returned alignment is the Preferred alignment if NeedsPreferredAlignment is true, otherwise is the ABI alignment.

Definition at line 2024 of file ASTContext.cpp.

◆ getTypeAlignInChars() [1/2]

CharUnits ASTContext::getTypeAlignInChars ( const Type * T) const

Definition at line 2662 of file ASTContext.cpp.

◆ getTypeAlignInChars() [2/2]

CharUnits ASTContext::getTypeAlignInChars ( QualType T) const

Return the ABI-specified alignment of a (complete) type T, in characters.

getTypeAlignInChars - Return the ABI-specified alignment of a type, in characters.

This method does not work on incomplete types.

Definition at line 2659 of file ASTContext.cpp.

◆ getTypeDeclType() [1/6]

QualType clang::ASTContext::getTypeDeclType ( const TagDecl * ) const
delete

Use the normal 'getFooBarType' constructors to obtain these types.

◆ getTypeDeclType() [2/6]

QualType clang::ASTContext::getTypeDeclType ( const TypeAliasDecl * ) const
delete

◆ getTypeDeclType() [3/6]

QualType ASTContext::getTypeDeclType ( const TypeDecl * Decl) const

Return the unique reference to the type for the specified type declaration.

Definition at line 5269 of file ASTContext.cpp.

◆ getTypeDeclType() [4/6]

QualType clang::ASTContext::getTypeDeclType ( const TypedefDecl * ) const
delete

◆ getTypeDeclType() [5/6]

QualType clang::ASTContext::getTypeDeclType ( const UnresolvedUsingTypenameDecl * ) const
delete

◆ getTypeDeclType() [6/6]

QualType ASTContext::getTypeDeclType ( ElaboratedTypeKeyword Keyword,
NestedNameSpecifier Qualifier,
const TypeDecl * Decl ) const

Definition at line 5242 of file ASTContext.cpp.

◆ getTypedefNameForUnnamedTagDecl()

TypedefNameDecl * ASTContext::getTypedefNameForUnnamedTagDecl ( const TagDecl * TD)

Definition at line 13497 of file ASTContext.cpp.

◆ getTypedefType()

QualType ASTContext::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.

getTypedefType - Return the unique reference to the type for the specified typedef name decl.

FIXME: TypeMatchesDeclOrNone is a workaround for a serialization issue: The decl underlying type might still not be available.

Definition at line 5286 of file ASTContext.cpp.

◆ getTypeInfo() [1/2]

TypeInfo ASTContext::getTypeInfo ( const Type * T) const

Get the size and alignment of the specified complete type in bits.

Definition at line 2049 of file ASTContext.cpp.

◆ getTypeInfo() [2/2]

TypeInfo clang::ASTContext::getTypeInfo ( QualType T) const
inline

Definition at line 2619 of file ASTContext.h.

◆ getTypeInfoDataSizeInChars()

TypeInfoChars ASTContext::getTypeInfoDataSizeInChars ( QualType T) const

Definition at line 1930 of file ASTContext.cpp.

◆ getTypeInfoInChars() [1/2]

TypeInfoChars ASTContext::getTypeInfoInChars ( const Type * T) const

Definition at line 1966 of file ASTContext.cpp.

◆ getTypeInfoInChars() [2/2]

TypeInfoChars ASTContext::getTypeInfoInChars ( QualType T) const

Definition at line 1974 of file ASTContext.cpp.

◆ getTypeOfExprType()

QualType ASTContext::getTypeOfExprType ( Expr * tofExpr,
TypeOfKind Kind ) const

C23 feature and GCC extension.

getTypeOfExprType - Unlike many "get<Type>" functions, we can't unique TypeOfExprType AST's (since expression's are never shared).

For example, multiple declarations that refer to "typeof(x)" all contain different DeclRefExpr's. This doesn't effect the type checker, since it operates on canonical type's (which are always unique).

Definition at line 6646 of file ASTContext.cpp.

◆ getTypeOfType()

QualType ASTContext::getTypeOfType ( QualType tofType,
TypeOfKind Kind ) const

getTypeOfType - Unlike many "get<Type>" functions, we don't unique TypeOfType nodes.

The only motivation to unique these nodes would be memory savings. Since typeof(t) is fairly uncommon, space shouldn't be an issue. This doesn't affect the type checker, since it operates on canonical types (which are always unique).

Definition at line 6682 of file ASTContext.cpp.

◆ getTypes()

const SmallVectorImpl< Type * > & clang::ASTContext::getTypes ( ) const
inline

Definition at line 1363 of file ASTContext.h.

◆ getTypeSize() [1/2]

uint64_t clang::ASTContext::getTypeSize ( const Type * T) const
inline

Definition at line 2626 of file ASTContext.h.

◆ getTypeSize() [2/2]

uint64_t clang::ASTContext::getTypeSize ( QualType T) const
inline

Return the size of the specified (complete) type T, in bits.

Examples
/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp.

Definition at line 2625 of file ASTContext.h.

◆ getTypeSizeInChars() [1/2]

CharUnits ASTContext::getTypeSizeInChars ( const Type * T) const

Definition at line 2653 of file ASTContext.cpp.

◆ getTypeSizeInChars() [2/2]

CharUnits ASTContext::getTypeSizeInChars ( QualType T) const

Return the size of the specified (complete) type T, in characters.

getTypeSizeInChars - Return the size of the specified type, in characters.

This method does not work on incomplete types.

Examples
/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp.

Definition at line 2650 of file ASTContext.cpp.

◆ getTypeSizeInCharsIfKnown() [1/2]

std::optional< CharUnits > clang::ASTContext::getTypeSizeInCharsIfKnown ( const Type * Ty) const
inline

Definition at line 2650 of file ASTContext.h.

◆ getTypeSizeInCharsIfKnown() [2/2]

std::optional< CharUnits > clang::ASTContext::getTypeSizeInCharsIfKnown ( QualType Ty) const
inline

Definition at line 2644 of file ASTContext.h.

◆ getTypeUnadjustedAlign() [1/2]

unsigned ASTContext::getTypeUnadjustedAlign ( const Type * T) const

Definition at line 2612 of file ASTContext.cpp.

◆ getTypeUnadjustedAlign() [2/2]

unsigned clang::ASTContext::getTypeUnadjustedAlign ( QualType T) const
inline

Return the ABI-specified natural alignment of a (complete) type T, before alignment adjustments, in bits.

This alignment is currently used only by ARM and AArch64 when passing arguments of a composite type.

Definition at line 2664 of file ASTContext.h.

◆ getTypeUnadjustedAlignInChars() [1/2]

CharUnits ASTContext::getTypeUnadjustedAlignInChars ( const Type * T) const

Definition at line 2672 of file ASTContext.cpp.

◆ getTypeUnadjustedAlignInChars() [2/2]

CharUnits ASTContext::getTypeUnadjustedAlignInChars ( QualType T) const

getTypeUnadjustedAlignInChars - Return the ABI-specified alignment of a type, in characters, before alignment adjustments.

This method does not work on incomplete types.

Definition at line 2669 of file ASTContext.cpp.

◆ getucontext_tType()

QualType clang::ASTContext::getucontext_tType ( ) const
inline

Retrieve the C ucontext_t type.

Definition at line 2261 of file ASTContext.h.

◆ getUInt128Decl()

TypedefDecl * ASTContext::getUInt128Decl ( ) const

Retrieve the declaration for the 128-bit unsigned integer type.

Definition at line 1264 of file ASTContext.cpp.

◆ getUIntMaxType()

CanQualType ASTContext::getUIntMaxType ( ) const

Return the unique type for "uintmax_t" (C99 7.18.1.5), defined in <stdint.h>.

getUIntMaxType - Return the unique type for "uintmax_t" (C99 7.18.1.5).

Definition at line 7044 of file ASTContext.cpp.

◆ getUIntPtrType()

QualType ASTContext::getUIntPtrType ( ) const

Return a type compatible with "uintptr_t" (C99 7.18.1.4), as defined by the target.

Definition at line 7066 of file ASTContext.cpp.

◆ getUnaryTransformType()

QualType ASTContext::getUnaryTransformType ( QualType BaseType,
QualType UnderlyingType,
UnaryTransformType::UTTKind UKind ) const

Unary type transforms.

getUnaryTransformationType - We don't unique these, since the memory savings are minimal and these are rare.

Definition at line 6787 of file ASTContext.cpp.

◆ getUnconstrainedType()

QualType ASTContext::getUnconstrainedType ( QualType T) const

Remove any type constraints from a template parameter type, for equivalence comparison of template parameters.

Definition at line 6894 of file ASTContext.cpp.

◆ getUnnamedGlobalConstantDecl()

UnnamedGlobalConstantDecl * ASTContext::getUnnamedGlobalConstantDecl ( QualType Ty,
const APValue & Value ) const

Return a declaration for a uniquified anonymous global constant corresponding to a given APValue.

Definition at line 13564 of file ASTContext.cpp.

◆ getUnqualifiedArrayType() [1/2]

QualType clang::ASTContext::getUnqualifiedArrayType ( QualType T) const
inline

Definition at line 2891 of file ASTContext.h.

◆ getUnqualifiedArrayType() [2/2]

QualType ASTContext::getUnqualifiedArrayType ( QualType T,
Qualifiers & Quals ) const

Return this type as a completely-unqualified array type, capturing the qualifiers in Quals.

This will remove the minimal amount of sugaring from the types, similar to the behavior of QualType::getUnqualifiedType().

Parameters
Tis the qualified type, which may be an ArrayType
Qualswill receive the full set of qualifiers that were applied to the array.
Returns
if this is an array type, the completely unqualified array type that corresponds to it. Otherwise, returns T.getUnqualifiedType().

Definition at line 7100 of file ASTContext.cpp.

◆ getUnqualifiedObjCPointerType()

QualType clang::ASTContext::getUnqualifiedObjCPointerType ( QualType type) const
inline

getUnqualifiedObjCPointerType - Returns version of Objective-C pointer type with lifetime qualifier removed.

Definition at line 2477 of file ASTContext.h.

◆ getUnresolvedUsingType()

QualType ASTContext::getUnresolvedUsingType ( ElaboratedTypeKeyword Keyword,
NestedNameSpecifier Qualifier,
const UnresolvedUsingTypenameDecl * D ) const

Definition at line 5661 of file ASTContext.cpp.

◆ getUnsignedPointerDiffType()

QualType ASTContext::getUnsignedPointerDiffType ( ) const

Return the unique unsigned counterpart of "ptrdiff_t" integer type.

The standard (C11 7.21.6.1p7) refers to this type in the definition of tu format specifier.

Definition at line 7034 of file ASTContext.cpp.

◆ getUnsignedWCharType()

QualType ASTContext::getUnsignedWCharType ( ) const

Return the type of "unsigned wchar_t".

getUnsignedWCharType - Return the type of "unsigned wchar_t".

Used when in C++, as a GCC extension.

Definition at line 7057 of file ASTContext.cpp.

◆ getUsingType()

QualType ASTContext::getUsingType ( ElaboratedTypeKeyword Keyword,
NestedNameSpecifier Qualifier,
const UsingShadowDecl * D,
QualType UnderlyingType = QualType() ) const

Definition at line 5342 of file ASTContext.cpp.

◆ getVaListTagDecl()

Decl * ASTContext::getVaListTagDecl ( ) const

Retrieve the C type declaration corresponding to the predefined __va_list_tag type used to help define the __builtin_va_list type for some targets.

Definition at line 10366 of file ASTContext.cpp.

◆ getVariableArrayDecayedType()

QualType ASTContext::getVariableArrayDecayedType ( QualType Ty) const

Returns a vla type where known sizes are replaced with [*].

getVariableArrayDecayedType - Turns the given type, which may be variably-modified, into the corresponding type with all the known sizes replaced with [*].

Definition at line 4251 of file ASTContext.cpp.

◆ getVariableArrayType()

QualType ASTContext::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.

getVariableArrayType - Returns a non-unique reference to the type for a variable array of the specified element type.

Definition at line 4389 of file ASTContext.cpp.

◆ getVectorType()

QualType ASTContext::getVectorType ( QualType vecType,
unsigned NumElts,
VectorKind VecKind ) const

Return the unique reference to a vector type of the specified element type and size.

getVectorType - Return the unique reference to a vector type of the specified element type and size.

Precondition
VectorType must be a built-in type.

VectorType must be a built-in type.

Definition at line 4644 of file ASTContext.cpp.

◆ getVolatileType()

QualType clang::ASTContext::getVolatileType ( QualType T) const
inline

Return the uniqued reference to the type for a volatile qualified type.

The resulting type has a union of the qualifiers from T and volatile.

Definition at line 1450 of file ASTContext.h.

◆ getVTableContext()

VTableContextBase * ASTContext::getVTableContext ( )

Definition at line 13265 of file ASTContext.cpp.

◆ getWCharType()

QualType clang::ASTContext::getWCharType ( ) const
inline

Return the unique wchar_t type available in C++ (and available as __wchar_t as a Microsoft extension).

Definition at line 2055 of file ASTContext.h.

◆ getWebAssemblyExternrefType()

QualType ASTContext::getWebAssemblyExternrefType ( ) const

Return a WebAssembly externref type.

getExternrefType - Return a WebAssembly externref type, which represents an opaque reference to a host value.

Definition at line 4573 of file ASTContext.cpp.

◆ getWideCharType()

QualType clang::ASTContext::getWideCharType ( ) const
inline

Return the type of wide characters.

In C++, this returns the unique wchar_t type. In C99, this returns a type compatible with the type defined in <stddef.h> as defined by the target.

Definition at line 2060 of file ASTContext.h.

◆ getWIntType()

QualType clang::ASTContext::getWIntType ( ) const
inline

In C99, this returns a type compatible with the type defined in <stddef.h> as defined by the target.

Definition at line 2074 of file ASTContext.h.

◆ getWritePipeType()

QualType ASTContext::getWritePipeType ( QualType T) const

Return a write_only pipe type for the specified type.

Definition at line 5173 of file ASTContext.cpp.

Referenced by getCommonNonSugarTypeNode().

◆ getXRayFilter()

const XRayFunctionFilter & clang::ASTContext::getXRayFilter ( ) const
inline

Definition at line 909 of file ASTContext.h.

◆ hasAnyFunctionEffects()

bool clang::ASTContext::hasAnyFunctionEffects ( ) const
inline

Definition at line 3155 of file ASTContext.h.

◆ hasCvrSimilarType()

bool ASTContext::hasCvrSimilarType ( QualType T1,
QualType T2 )

Determine if two types are similar, ignoring only CVR qualifiers.

Definition at line 7264 of file ASTContext.cpp.

◆ hasDirectOwnershipQualifier()

bool ASTContext::hasDirectOwnershipQualifier ( QualType Ty) const

Return true if the type has been explicitly qualified with ObjC ownership.

A type may be implicitly qualified with ownership under ObjC ARC, and in some cases the compiler treats these differently.

Definition at line 10776 of file ASTContext.cpp.

◆ hasSameExpr()

bool ASTContext::hasSameExpr ( const Expr * X,
const Expr * Y ) const

Determine whether the given expressions X and Y are equivalent.

Definition at line 13664 of file ASTContext.cpp.

◆ hasSameFunctionTypeIgnoringExceptionSpec()

bool ASTContext::hasSameFunctionTypeIgnoringExceptionSpec ( QualType T,
QualType U ) const

Determine whether two function types are the same, ignoring exception specifications in cases where they're part of the type.

Definition at line 3812 of file ASTContext.cpp.

◆ hasSameFunctionTypeIgnoringParamABI()

bool ASTContext::hasSameFunctionTypeIgnoringParamABI ( QualType T,
QualType U ) const

Determine if two function types are the same, ignoring parameter ABI annotations.

Definition at line 3852 of file ASTContext.cpp.

◆ hasSameFunctionTypeIgnoringPtrSizes()

bool ASTContext::hasSameFunctionTypeIgnoringPtrSizes ( QualType T,
QualType U )

Determine whether two function types are the same, ignoring pointer sizes in the return type and parameter types.

Definition at line 3837 of file ASTContext.cpp.

◆ hasSameNullabilityTypeQualifier()

bool clang::ASTContext::hasSameNullabilityTypeQualifier ( QualType SubT,
QualType SuperT,
bool IsParam ) const
inline

Definition at line 2903 of file ASTContext.h.

◆ hasSameTemplateName()

bool ASTContext::hasSameTemplateName ( const TemplateName & X,
const TemplateName & Y,
bool IgnoreDeduced = false ) const

Determine whether the given template names refer to the same template.

Definition at line 7451 of file ASTContext.cpp.

◆ hasSameType() [1/2]

bool clang::ASTContext::hasSameType ( const Type * T1,
const Type * T2 ) const
inline

Definition at line 2870 of file ASTContext.h.

◆ hasSameType() [2/2]

bool clang::ASTContext::hasSameType ( QualType T1,
QualType T2 ) const
inline

Determine whether the given types T1 and T2 are equivalent.

Definition at line 2867 of file ASTContext.h.

◆ hasSameUnqualifiedType()

bool clang::ASTContext::hasSameUnqualifiedType ( QualType T1,
QualType T2 ) const
inline

Determine whether the given types are equivalent after cvr-qualifiers have been removed.

Examples
/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp.

Definition at line 2898 of file ASTContext.h.

◆ hasSeenTypeAwareOperatorNewOrDelete()

bool clang::ASTContext::hasSeenTypeAwareOperatorNewOrDelete ( ) const
inline

Definition at line 3441 of file ASTContext.h.

◆ hasSimilarType()

bool ASTContext::hasSimilarType ( QualType T1,
QualType T2 ) const

Determine if two types are similar, according to the C++ rules.

That is, determine if they are the same other than qualifiers on the initial sequence of pointer / pointer-to-member / array (and in Clang, object pointer) types and their element types.

Clang offers a number of qualifiers in addition to the C++ qualifiers; those qualifiers are also ignored in the 'similarity' check.

Definition at line 7252 of file ASTContext.cpp.

◆ hasUniqueObjectRepresentations()

bool ASTContext::hasUniqueObjectRepresentations ( QualType Ty,
bool CheckIfTriviallyCopyable = true ) const

Return true if the specified type has unique object representations according to (C++17 [meta.unary.prop]p9)

Definition at line 2988 of file ASTContext.cpp.

◆ InitBuiltinTypes()

void ASTContext::InitBuiltinTypes ( const TargetInfo & Target,
const TargetInfo * AuxTarget = nullptr )

Initialize built-in types.

This routine may only be invoked once for a given ASTContext object. It is normally invoked after ASTContext construction.

Parameters
TargetThe target

Definition at line 1276 of file ASTContext.cpp.

◆ insertCanonicalTemplateTemplateParmDeclInternal()

TemplateTemplateParmDecl * ASTContext::insertCanonicalTemplateTemplateParmDeclInternal ( TemplateTemplateParmDecl * CanonTTP) const

Definition at line 863 of file ASTContext.cpp.

◆ isAlignmentRequired() [1/2]

bool ASTContext::isAlignmentRequired ( const Type * T) const

Determine if the alignment the type has was required using an alignment attribute.

Definition at line 2016 of file ASTContext.cpp.

◆ isAlignmentRequired() [2/2]

bool ASTContext::isAlignmentRequired ( QualType T) const

Definition at line 2020 of file ASTContext.cpp.

◆ isDependenceAllowed()

bool clang::ASTContext::isDependenceAllowed ( ) const
inline

Definition at line 900 of file ASTContext.h.

◆ isDestroyingOperatorDelete()

bool ASTContext::isDestroyingOperatorDelete ( const FunctionDecl * FD) const

Definition at line 13437 of file ASTContext.cpp.

◆ isInSameModule()

bool ASTContext::isInSameModule ( const Module * M1,
const Module * M2 ) const

If the two module M1 and M2 are in the same module.

FIXME: The signature may be confusing since clang::Module means to a module fragment or a module unit but not a C++20 module.

Get the representative module for M. The representative module is the first module unit for a specific primary module name. So that the module units have the same representative module belongs to the same module.

The process is helpful to reduce the expensive string operations.

Definition at line 1180 of file ASTContext.cpp.

◆ isMSStaticDataMemberInlineDefinition()

bool ASTContext::isMSStaticDataMemberInlineDefinition ( const VarDecl * VD) const

Returns true if this is an inline-initialized static data member which is treated as a definition for MSVC compatibility.

Definition at line 8807 of file ASTContext.cpp.

◆ isNearlyEmpty()

bool ASTContext::isNearlyEmpty ( const CXXRecordDecl * RD) const

Definition at line 13260 of file ASTContext.cpp.

◆ isObjCClassType()

bool clang::ASTContext::isObjCClassType ( QualType T) const
inline

Definition at line 3192 of file ASTContext.h.

◆ isObjCIdType()

bool clang::ASTContext::isObjCIdType ( QualType T) const
inline

Definition at line 3190 of file ASTContext.h.

◆ isObjCNSObjectType()

bool clang::ASTContext::isObjCNSObjectType ( QualType Ty)
inlinestatic

Return true if this is an NSObject object with its NSObject attribute set.

Definition at line 2605 of file ASTContext.h.

◆ isObjCSelType()

bool clang::ASTContext::isObjCSelType ( QualType T) const
inline

Definition at line 3194 of file ASTContext.h.

◆ isPromotableBitField()

QualType ASTContext::isPromotableBitField ( Expr * E) const

Whether this is a promotable bitfield reference according to C99 6.3.1.1p2, bullet 2 (and GCC extensions).

Returns
the type this bit-field will promote to, or NULL if no promotion occurs.

Definition at line 8282 of file ASTContext.cpp.

◆ isPromotableIntegerType()

bool ASTContext::isPromotableIntegerType ( QualType T) const

More type predicates useful for type checking/promotion.

Definition at line 1978 of file ASTContext.cpp.

◆ isRepresentableIntegerValue()

bool ASTContext::isRepresentableIntegerValue ( llvm::APSInt & Value,
QualType T )

Determine whether the given integral value is representable within the given type T.

Definition at line 5614 of file ASTContext.cpp.

◆ isSameAssociatedConstraint()

bool ASTContext::isSameAssociatedConstraint ( const AssociatedConstraint & ACX,
const AssociatedConstraint & ACY ) const

Determine whether two 'requires' expressions are similar enough that they may be used in re-declarations.

Use of 'requires' isn't mandatory, works with constraints expressed in other ways too.

Definition at line 7458 of file ASTContext.cpp.

◆ isSameConstraintExpr()

bool ASTContext::isSameConstraintExpr ( const Expr * XCE,
const Expr * YCE ) const

Determine whether two 'requires' expressions are similar enough that they may be used in re-declarations.

Use of 'requires' isn't mandatory, works with constraints expressed in other ways too.

Definition at line 7467 of file ASTContext.cpp.

◆ isSameDefaultTemplateArgument()

bool ASTContext::isSameDefaultTemplateArgument ( const NamedDecl * X,
const NamedDecl * Y ) const

Determine whether two default template arguments are similar enough that they may be used in declarations of the same template.

Definition at line 7563 of file ASTContext.cpp.

◆ isSameEntity()

bool ASTContext::isSameEntity ( const NamedDecl * X,
const NamedDecl * Y ) const

Determine whether the two declarations refer to the same entity.

Definition at line 7684 of file ASTContext.cpp.

◆ isSameTemplateArgument()

bool ASTContext::isSameTemplateArgument ( const TemplateArgument & Arg1,
const TemplateArgument & Arg2 ) const

Determine whether the given template arguments Arg1 and Arg2 are equivalent.

Definition at line 7982 of file ASTContext.cpp.

◆ isSameTemplateParameter()

bool ASTContext::isSameTemplateParameter ( const NamedDecl * X,
const NamedDecl * Y ) const

Determine whether two template parameters are similar enough that they may be used in declarations of the same template.

Definition at line 7521 of file ASTContext.cpp.

◆ isSameTemplateParameterList()

bool ASTContext::isSameTemplateParameterList ( const TemplateParameterList * X,
const TemplateParameterList * Y ) const

Determine whether two template parameter lists are similar enough that they may be used in declarations of the same template.

Definition at line 7551 of file ASTContext.cpp.

◆ isSameTypeConstraint()

bool ASTContext::isSameTypeConstraint ( const TypeConstraint * XTC,
const TypeConstraint * YTC ) const

Determine whether two type contraint are similar enough that they could used in declarations of the same template.

Definition at line 7480 of file ASTContext.cpp.

◆ isSentinelNullExpr()

bool ASTContext::isSentinelNullExpr ( const Expr * E)

Definition at line 3082 of file ASTContext.cpp.

◆ isTypeAwareOperatorNewOrDelete()

bool ASTContext::isTypeAwareOperatorNewOrDelete ( const FunctionDecl * FD) const

Definition at line 13450 of file ASTContext.cpp.

◆ isTypeIgnoredBySanitizer()

bool ASTContext::isTypeIgnoredBySanitizer ( const SanitizerMask & Mask,
const QualType & Ty ) const

Check if a type can have its sanitizer instrumentation elided based on its presence within an ignorelist.

Definition at line 878 of file ASTContext.cpp.

◆ local_imports()

import_range clang::ASTContext::local_imports ( ) const
inline

Definition at line 1153 of file ASTContext.h.

◆ lookupFieldBitOffset()

uint64_t ASTContext::lookupFieldBitOffset ( const ObjCInterfaceDecl * OID,
const ObjCIvarDecl * Ivar ) const

Get the offset of an ObjCIvarDecl in bits.

Definition at line 3535 of file RecordLayoutBuilder.cpp.

◆ MakeIntValue()

llvm::APSInt clang::ASTContext::MakeIntValue ( uint64_t Value,
QualType Type ) const
inline

Make an APSInt of the appropriate width and signedness for the given Value and integer Type.

Definition at line 3310 of file ASTContext.h.

◆ mayExternalize()

bool ASTContext::mayExternalize ( const Decl * D) const

Whether a C++ static variable or CUDA/HIP kernel may be externalized.

Definition at line 15163 of file ASTContext.cpp.

◆ mergeDefinitionIntoModule()

void ASTContext::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 visible.

Definition at line 1079 of file ASTContext.cpp.

◆ mergeExceptionSpecs()

FunctionProtoType::ExceptionSpecInfo ASTContext::mergeExceptionSpecs ( FunctionProtoType::ExceptionSpecInfo ESI1,
FunctionProtoType::ExceptionSpecInfo ESI2,
SmallVectorImpl< QualType > & ExceptionTypeStorage,
bool AcceptDependent ) const

Definition at line 13974 of file ASTContext.cpp.

◆ mergeExtParameterInfo()

bool ASTContext::mergeExtParameterInfo ( const FunctionProtoType * FirstFnType,
const FunctionProtoType * SecondFnType,
bool & CanUseFirst,
bool & CanUseSecond,
SmallVectorImpl< FunctionProtoType::ExtParameterInfo > & NewParamInfos )

This function merges the ExtParameterInfo lists of two functions.

It returns true if the lists are compatible. The merged list is returned in NewParamInfos.

Parameters
FirstFnTypeThe type of the first function.
SecondFnTypeThe type of the second function.
CanUseFirstThis flag is set to true if the first function's ExtParameterInfo list can be used as the composite list of ExtParameterInfo.
CanUseSecondThis flag is set to true if the second function's ExtParameterInfo list can be used as the composite list of ExtParameterInfo.
NewParamInfosThe composite list of ExtParameterInfo. The list is empty if none of the flags are set.

Definition at line 12120 of file ASTContext.cpp.

◆ mergeFunctionParameterTypes()

QualType ASTContext::mergeFunctionParameterTypes ( QualType lhs,
QualType rhs,
bool OfBlockPointer = false,
bool Unqualified = false )

mergeFunctionParameterTypes - merge two types which appear as function parameter types

Definition at line 11443 of file ASTContext.cpp.

◆ mergeFunctionTypes()

QualType ASTContext::mergeFunctionTypes ( QualType lhs,
QualType rhs,
bool OfBlockPointer = false,
bool Unqualified = false,
bool AllowCXX = false,
bool IsConditionalOperator = false )

Definition at line 11462 of file ASTContext.cpp.

◆ mergeObjCGCQualifiers()

QualType ASTContext::mergeObjCGCQualifiers ( QualType LHS,
QualType RHS )

mergeObjCGCQualifiers - This routine merges ObjC's GC attribute of 'LHS' and 'RHS' attributes and returns the merged version; including for function return types.

Definition at line 12178 of file ASTContext.cpp.

◆ mergeTagDefinitions()

QualType ASTContext::mergeTagDefinitions ( QualType LHS,
QualType RHS )

Definition at line 11712 of file ASTContext.cpp.

◆ mergeTransparentUnionType()

QualType ASTContext::mergeTransparentUnionType ( QualType T,
QualType SubType,
bool OfBlockPointer = false,
bool Unqualified = false )

mergeTransparentUnionType - if T is a transparent union type and a member of T is compatible with SubType, return the merged type, else return QualType()

Definition at line 11423 of file ASTContext.cpp.

◆ mergeTypes()

QualType ASTContext::mergeTypes ( QualType LHS,
QualType RHS,
bool OfBlockPointer = false,
bool Unqualified = false,
bool BlockReturnType = false,
bool IsConditionalOperator = false )

Definition at line 11728 of file ASTContext.cpp.

◆ ObjCMethodsAreEqual()

bool ASTContext::ObjCMethodsAreEqual ( const ObjCMethodDecl * MethodDecl,
const ObjCMethodDecl * MethodImp )

Definition at line 13620 of file ASTContext.cpp.

◆ ObjCObjectAdoptsQTypeProtocols()

bool ASTContext::ObjCObjectAdoptsQTypeProtocols ( QualType QT,
ObjCInterfaceDecl * Decl )

ObjCObjectAdoptsQTypeProtocols - Checks that protocols in IC's protocol list adopt all protocols in QT's qualified-id protocol list.

Definition at line 6523 of file ASTContext.cpp.

◆ ObjCQualifiedClassTypesAreCompatible()

bool ASTContext::ObjCQualifiedClassTypesAreCompatible ( const ObjCObjectPointerType * LHS,
const ObjCObjectPointerType * RHS )

ObjCQualifiedClassTypesAreCompatible - compare Class<pr,...> and Class<pr1, ...>.

Definition at line 10817 of file ASTContext.cpp.

◆ ObjCQualifiedIdTypesAreCompatible()

bool ASTContext::ObjCQualifiedIdTypesAreCompatible ( const ObjCObjectPointerType * LHS,
const ObjCObjectPointerType * RHS,
bool ForCompare )

ObjCQualifiedIdTypesAreCompatible - We know that one of lhs/rhs is an ObjCQualifiedIDType.

Definition at line 10835 of file ASTContext.cpp.

◆ operator=()

ASTContext & clang::ASTContext::operator= ( const ASTContext & )
delete

◆ overridden_methods()

ASTContext::overridden_method_range ASTContext::overridden_methods ( const CXXMethodDecl * Method) const

Definition at line 1658 of file ASTContext.cpp.

◆ overridden_methods_begin()

ASTContext::overridden_cxx_method_iterator ASTContext::overridden_methods_begin ( const CXXMethodDecl * Method) const

Definition at line 1642 of file ASTContext.cpp.

◆ overridden_methods_end()

ASTContext::overridden_cxx_method_iterator ASTContext::overridden_methods_end ( const CXXMethodDecl * Method) const

Definition at line 1647 of file ASTContext.cpp.

◆ overridden_methods_size()

unsigned ASTContext::overridden_methods_size ( const CXXMethodDecl * Method) const

Definition at line 1652 of file ASTContext.cpp.

◆ PrintStats()

void ASTContext::PrintStats ( ) const

Definition at line 1018 of file ASTContext.cpp.

◆ propertyTypesAreCompatible()

bool ASTContext::propertyTypesAreCompatible ( QualType LHS,
QualType RHS )

Definition at line 11412 of file ASTContext.cpp.

◆ ProtocolCompatibleWithProtocol()

bool ASTContext::ProtocolCompatibleWithProtocol ( ObjCProtocolDecl * lProto,
ObjCProtocolDecl * rProto ) const

ProtocolCompatibleWithProtocol - return 'true' if 'lProto' is in the inheritance hierarchy of 'rProto'.

Definition at line 10805 of file ASTContext.cpp.

◆ QIdProtocolsAdoptObjCObjectProtocols()

bool ASTContext::QIdProtocolsAdoptObjCObjectProtocols ( QualType QT,
ObjCInterfaceDecl * IDecl )

QIdProtocolsAdoptObjCObjectProtocols - Checks that protocols in QT's qualified-id protocol list adopt all protocols in IDecl's list of protocols.

Definition at line 6542 of file ASTContext.cpp.

◆ registerSYCLEntryPointFunction()

void ASTContext::registerSYCLEntryPointFunction ( FunctionDecl * FD)

Generates and stores SYCL kernel metadata for the provided SYCL kernel entry point function.

The provided function must have an attached sycl_kernel_entry_point attribute that specifies a unique type for the name of a SYCL kernel. Callers are required to detect conflicting SYCL kernel names and issue a diagnostic prior to calling this function.

Definition at line 15115 of file ASTContext.cpp.

◆ removeAddrSpaceQualType()

QualType ASTContext::removeAddrSpaceQualType ( QualType T) const

Remove any existing address space on the type and returns the type with qualifiers intact (or that's the idea anyway)

The return type should be T with all prior qualifiers minus the address space.

Definition at line 3277 of file ASTContext.cpp.

◆ removePtrSizeAddrSpace()

QualType ASTContext::removePtrSizeAddrSpace ( QualType T) const

Remove the existing address space on the type if it is a pointer size address space and return the type with qualifiers intact.

Definition at line 3680 of file ASTContext.cpp.

◆ ResetObjCLayout()

void ASTContext::ResetObjCLayout ( const ObjCInterfaceDecl * D)

Definition at line 12167 of file ASTContext.cpp.

◆ setASTMutationListener()

void clang::ASTContext::setASTMutationListener ( ASTMutationListener * Listener)
inline

Attach an AST mutation listener to the AST context.

The AST mutation listener provides the ability to track modifications to the abstract syntax tree entities committed after they were initially created.

Definition at line 1354 of file ASTContext.h.

◆ setBlockVarCopyInit()

void ASTContext::setBlockVarCopyInit ( const VarDecl * VD,
Expr * CopyExpr,
bool CanThrow )

Set the copy initialization expression of a block var decl.

CanThrow indicates whether the copy expression can throw or not.

Definition at line 3170 of file ASTContext.cpp.

◆ setBOOLDecl()

void clang::ASTContext::setBOOLDecl ( TypedefDecl * TD)
inline

Save declaration of 'BOOL' typedef.

Definition at line 2374 of file ASTContext.h.

◆ setCFConstantStringType()

void ASTContext::setCFConstantStringType ( QualType T)

Definition at line 8567 of file ASTContext.cpp.

◆ setcudaConfigureCallDecl()

void clang::ASTContext::setcudaConfigureCallDecl ( FunctionDecl * FD)
inline

Definition at line 1604 of file ASTContext.h.

◆ setCurrentNamedModule()

void ASTContext::setCurrentNamedModule ( Module * M)

Set the (C++20) module we are building.

Definition at line 1173 of file ASTContext.cpp.

◆ setExternalSource()

void ASTContext::setExternalSource ( IntrusiveRefCntPtr< ExternalASTSource > Source)

Attach an external AST source to the AST context.

The external AST source provides the ability to load parts of the abstract syntax tree as needed from some external storage, e.g., a precompiled header.

Definition at line 1014 of file ASTContext.cpp.

◆ setFILEDecl()

void clang::ASTContext::setFILEDecl ( TypeDecl * FILEDecl)
inline

Set the type for the C FILE type.

Definition at line 2219 of file ASTContext.h.

◆ setInstantiatedFromStaticDataMember()

void ASTContext::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 a class template.

Definition at line 1565 of file ASTContext.cpp.

◆ setInstantiatedFromUnnamedFieldDecl()

void ASTContext::setInstantiatedFromUnnamedFieldDecl ( FieldDecl * Inst,
FieldDecl * Tmpl )

Definition at line 1629 of file ASTContext.cpp.

◆ setInstantiatedFromUsingDecl()

void ASTContext::setInstantiatedFromUsingDecl ( NamedDecl * Inst,
NamedDecl * Pattern )

Remember that the using decl Inst is an instantiation of the using decl Pattern of a class template.

Definition at line 1588 of file ASTContext.cpp.

◆ setInstantiatedFromUsingEnumDecl()

void ASTContext::setInstantiatedFromUsingEnumDecl ( UsingEnumDecl * Inst,
UsingEnumDecl * Pattern )

Remember that the using enum decl Inst is an instantiation of the using enum decl Pattern of a class template.

Definition at line 1606 of file ASTContext.cpp.

◆ setInstantiatedFromUsingShadowDecl()

void ASTContext::setInstantiatedFromUsingShadowDecl ( UsingShadowDecl * Inst,
UsingShadowDecl * Pattern )

Definition at line 1618 of file ASTContext.cpp.

◆ setIsDestroyingOperatorDelete()

void ASTContext::setIsDestroyingOperatorDelete ( const FunctionDecl * FD,
bool IsDestroying )

Definition at line 13428 of file ASTContext.cpp.

◆ setIsTypeAwareOperatorNewOrDelete()

void ASTContext::setIsTypeAwareOperatorNewOrDelete ( const FunctionDecl * FD,
bool IsTypeAware )

Definition at line 13441 of file ASTContext.cpp.

◆ setjmp_bufDecl()

void clang::ASTContext::setjmp_bufDecl ( TypeDecl * jmp_bufDecl)
inline

Set the type for the C jmp_buf type.

Definition at line 2230 of file ASTContext.h.

◆ setManglingNumber()

void ASTContext::setManglingNumber ( const NamedDecl * ND,
unsigned Number )

Definition at line 13388 of file ASTContext.cpp.

◆ setNonKeyFunction()

void ASTContext::setNonKeyFunction ( const CXXMethodDecl * method)

Observe that the given method cannot be a key function.

Checks the key-function cache for the method's class and clears it if matches the given declaration.

This is used in ABIs where out-of-line definitions marked inline are not considered to be key functions.

Parameters
methodshould be the declaration from the class definition

Definition at line 3492 of file RecordLayoutBuilder.cpp.

◆ setObjCClassRedefinitionType()

void clang::ASTContext::setObjCClassRedefinitionType ( QualType RedefType)
inline

Set the user-written type that redefines 'SEL'.

Definition at line 2153 of file ASTContext.h.

◆ setObjCConstantStringInterface()

void ASTContext::setObjCConstantStringInterface ( ObjCInterfaceDecl * Decl)

Definition at line 10395 of file ASTContext.cpp.

◆ setObjCIdRedefinitionType()

void clang::ASTContext::setObjCIdRedefinitionType ( QualType RedefType)
inline

Set the user-written type that redefines id.

Definition at line 2140 of file ASTContext.h.

◆ setObjCImplementation() [1/2]

void ASTContext::setObjCImplementation ( ObjCCategoryDecl * CatD,
ObjCCategoryImplDecl * ImplD )

Set the implementation of ObjCCategoryDecl.

Definition at line 3128 of file ASTContext.cpp.

◆ setObjCImplementation() [2/2]

void ASTContext::setObjCImplementation ( ObjCInterfaceDecl * IFaceD,
ObjCImplementationDecl * ImplD )

Set the implementation of ObjCInterfaceDecl.

Definition at line 3121 of file ASTContext.cpp.

◆ setObjCMethodRedeclaration()

void ASTContext::setObjCMethodRedeclaration ( const ObjCMethodDecl * MD,
const ObjCMethodDecl * Redecl )

Definition at line 3139 of file ASTContext.cpp.

◆ setObjCNSStringType()

void clang::ASTContext::setObjCNSStringType ( QualType T)
inline

Definition at line 2127 of file ASTContext.h.

◆ setObjCSelRedefinitionType()

void clang::ASTContext::setObjCSelRedefinitionType ( QualType RedefType)
inline

Set the user-written type that redefines 'SEL'.

Definition at line 2166 of file ASTContext.h.

◆ setObjCSuperType()

void clang::ASTContext::setObjCSuperType ( QualType ST)
inline

Definition at line 2102 of file ASTContext.h.

◆ setParameterIndex()

void ASTContext::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 normal bitfield.

Definition at line 13510 of file ASTContext.cpp.

◆ setPrimaryMergedDecl()

void clang::ASTContext::setPrimaryMergedDecl ( Decl * D,
Decl * Primary )
inline

Definition at line 1161 of file ASTContext.h.

◆ setPrintingPolicy()

void clang::ASTContext::setPrintingPolicy ( const clang::PrintingPolicy & Policy)
inline

Definition at line 797 of file ASTContext.h.

◆ setRelocationInfoForCXXRecord()

void ASTContext::setRelocationInfoForCXXRecord ( const CXXRecordDecl * RD,
CXXRecordDeclRelocationInfo Info )

Definition at line 1702 of file ASTContext.cpp.

◆ setsigjmp_bufDecl()

void clang::ASTContext::setsigjmp_bufDecl ( TypeDecl * sigjmp_bufDecl)
inline

Set the type for the C sigjmp_buf type.

Definition at line 2243 of file ASTContext.h.

◆ setStaticLocalNumber()

void ASTContext::setStaticLocalNumber ( const VarDecl * VD,
unsigned Number )

Definition at line 13413 of file ASTContext.cpp.

◆ setTemplateOrSpecializationInfo()

void ASTContext::setTemplateOrSpecializationInfo ( VarDecl * Inst,
TemplateOrSpecializationInfo TSI )

Definition at line 1575 of file ASTContext.cpp.

◆ setTraversalScope()

void ASTContext::setTraversalScope ( const std::vector< Decl * > & TopLevelDecls)

Definition at line 1004 of file ASTContext.cpp.

◆ setucontext_tDecl()

void clang::ASTContext::setucontext_tDecl ( TypeDecl * ucontext_tDecl)
inline

Set the type for the C ucontext_t type.

Definition at line 2256 of file ASTContext.h.

◆ shouldExternalize()

bool ASTContext::shouldExternalize ( const Decl * D) const

Whether a C++ static variable or CUDA/HIP kernel should be externalized.

Definition at line 15181 of file ASTContext.cpp.

◆ toBits()

int64_t ASTContext::toBits ( CharUnits CharSize) const

Convert a size in characters to a size in bits.

toBits - Convert a size in characters to a size in characters.

Definition at line 2644 of file ASTContext.cpp.

◆ toCharUnitsFromBits()

CharUnits ASTContext::toCharUnitsFromBits ( int64_t BitSize) const

Convert a size in bits to a size in characters.

toCharUnitsFromBits - Convert a size in bits to a size in characters.

Definition at line 2639 of file ASTContext.cpp.

◆ typesAreBlockPointerCompatible()

bool ASTContext::typesAreBlockPointerCompatible ( QualType LHS,
QualType RHS )

Definition at line 11416 of file ASTContext.cpp.

◆ typesAreCompatible()

bool ASTContext::typesAreCompatible ( QualType LHS,
QualType RHS,
bool CompareUnqualified = false )

Compatibility predicates used to check assignment expressions.

typesAreCompatible - C99 6.7.3p9: For two qualified types to be compatible, both shall have the identically qualified version of a compatible type.

C99 6.2.7p1: Two types have compatible types if their types are the same. See 6.7.[2,3,5] for additional rules.

Definition at line 11404 of file ASTContext.cpp.

◆ UnwrapSimilarArrayTypes()

void ASTContext::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 of unknown bound) for the purpose of comparing the cv-decomposition of two types per C++ [conv.qual].

Parameters
AllowPiMismatchAllow the Pi1 and Pi2 to differ as described in C++20 [conv.qual], if permitted by the current language mode.

Definition at line 7159 of file ASTContext.cpp.

◆ UnwrapSimilarTypes()

bool ASTContext::UnwrapSimilarTypes ( QualType & T1,
QualType & T2,
bool AllowPiMismatch = true ) const

Attempt to unwrap two types that may be similar (C++ [conv.qual]).

If T1 and T2 are both pointer types of the same kind, or both array types with the same bound, unwraps layers from T1 and T2 until a pointer type is unwrapped. Top-level qualifiers on T1 and T2 are ignored.

This function will typically be called in a loop that successively "unwraps" pointer and pointer-to-member types to compare them at each level.

Parameters
AllowPiMismatchAllow the Pi1 and Pi2 to differ as described in C++20 [conv.qual], if permitted by the current language mode.
Returns
true if a pointer type was unwrapped, false if we reached a pair of types that can't be unwrapped further.

Definition at line 7210 of file ASTContext.cpp.

◆ useAbbreviatedThunkName()

bool ASTContext::useAbbreviatedThunkName ( GlobalDecl VirtualMethodDecl,
StringRef MangledName )

Definition at line 15213 of file ASTContext.cpp.

◆ ASTDeclReader

friend class ASTDeclReader
friend

Definition at line 519 of file ASTContext.h.

◆ ASTReader

friend class ASTReader
friend

Definition at line 520 of file ASTContext.h.

◆ ASTWriter

friend class ASTWriter
friend

Definition at line 521 of file ASTContext.h.

◆ CXXRecordDecl

friend class CXXRecordDecl
friend

Definition at line 523 of file ASTContext.h.

◆ DeclarationNameTable

friend class DeclarationNameTable
friend

Definition at line 3660 of file ASTContext.h.

◆ DeclContext

friend class DeclContext
friend

Definition at line 3661 of file ASTContext.h.

◆ IncrementalParser

friend class IncrementalParser
friend

Definition at line 524 of file ASTContext.h.

◆ NestedNameSpecifier

friend class NestedNameSpecifier
friend

Definition at line 189 of file ASTContext.h.

◆ serialization::AbstractTypeReader

template<class>
friend class serialization::AbstractTypeReader
friend

Definition at line 522 of file ASTContext.h.

Member Data Documentation

◆ AccumTy

CanQualType clang::ASTContext::AccumTy

Definition at line 1235 of file ASTContext.h.

◆ ARCUnbridgedCastTy

CanQualType clang::ASTContext::ARCUnbridgedCastTy

Definition at line 1253 of file ASTContext.h.

◆ ArraySectionTy

CanQualType clang::ASTContext::ArraySectionTy

Definition at line 1262 of file ASTContext.h.

◆ AutoDeductTy

QualType clang::ASTContext::AutoDeductTy
mutable

Definition at line 1285 of file ASTContext.h.

◆ AutoRRefDeductTy

QualType clang::ASTContext::AutoRRefDeductTy
mutable

Definition at line 1286 of file ASTContext.h.

◆ BFloat16Ty

CanQualType clang::ASTContext::BFloat16Ty

Definition at line 1247 of file ASTContext.h.

◆ BoolTy

CanQualType clang::ASTContext::BoolTy

Definition at line 1223 of file ASTContext.h.

◆ BoundMemberTy

CanQualType clang::ASTContext::BoundMemberTy

Definition at line 1250 of file ASTContext.h.

◆ BuiltinFnTy

CanQualType clang::ASTContext::BuiltinFnTy

Definition at line 1252 of file ASTContext.h.

◆ BuiltinInfo

Builtin::Context& clang::ASTContext::BuiltinInfo

Definition at line 742 of file ASTContext.h.

◆ Char16Ty

CanQualType clang::ASTContext::Char16Ty

Definition at line 1229 of file ASTContext.h.

◆ Char32Ty

CanQualType clang::ASTContext::Char32Ty

Definition at line 1230 of file ASTContext.h.

◆ Char8Ty

CanQualType clang::ASTContext::Char8Ty

Definition at line 1228 of file ASTContext.h.

◆ CharTy

CanQualType clang::ASTContext::CharTy

Definition at line 1224 of file ASTContext.h.

◆ CommentlessRedeclChains

llvm::DenseMap<const Decl *, const Decl *> clang::ASTContext::CommentlessRedeclChains
mutable

Keeps track of redeclaration chains that don't have any comment attached.

Mapping from canonical declaration to redeclaration chain that has no comments attached to any redeclaration. Specifically it's mapping to the last redeclaration we've checked.

Shall not contain declarations that have comments attached to any redeclaration in their chain.

Definition at line 952 of file ASTContext.h.

◆ Comments

RawCommentList clang::ASTContext::Comments

All comments in this translation unit.

Definition at line 927 of file ASTContext.h.

◆ CommentsLoaded

bool clang::ASTContext::CommentsLoaded = false
mutable

True if comments are already loaded from ExternalASTSource.

Definition at line 930 of file ASTContext.h.

◆ CompCategories

ComparisonCategories clang::ASTContext::CompCategories

Types and expressions required to build C++2a three-way comparisons using operator<=>, including the values return by builtin <=> operators.

Definition at line 2565 of file ASTContext.h.

◆ CUDAConstantEvalCtx

struct clang::ASTContext::CUDAConstantEvalContext clang::ASTContext::CUDAConstantEvalCtx

◆ CUDADeviceVarODRUsedByHost

llvm::DenseSet<const VarDecl *> clang::ASTContext::CUDADeviceVarODRUsedByHost

Keep track of CUDA/HIP device-side variables ODR-used by host code.

This does not include extern shared variables used by device host functions as addresses of shared variables are per warp, therefore cannot be accessed by host code.

Definition at line 1302 of file ASTContext.h.

◆ CUDAExternalDeviceDeclODRUsedByHost

llvm::SetVector<const ValueDecl *> clang::ASTContext::CUDAExternalDeviceDeclODRUsedByHost

Keep track of CUDA/HIP external kernels or device variables ODR-used by host code.

SetVector is used to maintain the order.

Definition at line 1306 of file ASTContext.h.

◆ CUDAImplicitHostDeviceFunUsedByDevice

llvm::DenseSet<const FunctionDecl *> clang::ASTContext::CUDAImplicitHostDeviceFunUsedByDevice

Keep track of CUDA/HIP implicit host device functions used on device side in device compilation.

Definition at line 1310 of file ASTContext.h.

◆ DeclarationNames

DeclarationNameTable clang::ASTContext::DeclarationNames
mutable

Definition at line 744 of file ASTContext.h.

◆ DeclRawComments

llvm::DenseMap<const Decl *, const RawComment *> clang::ASTContext::DeclRawComments
mutable

Mapping from declaration to directly attached comment.

Raw comments are owned by Comments list. This mapping is populated lazily.

Definition at line 936 of file ASTContext.h.

◆ DependentTy

CanQualType clang::ASTContext::DependentTy

Definition at line 1250 of file ASTContext.h.

◆ DoubleTy

CanQualType clang::ASTContext::DoubleTy

Definition at line 1234 of file ASTContext.h.

◆ ExternalSource

IntrusiveRefCntPtr<ExternalASTSource> clang::ASTContext::ExternalSource

Definition at line 745 of file ASTContext.h.

◆ Float128Ty

CanQualType clang::ASTContext::Float128Ty

Definition at line 1234 of file ASTContext.h.

◆ Float16Ty

CanQualType clang::ASTContext::Float16Ty

Definition at line 1248 of file ASTContext.h.

◆ FloatTy

CanQualType clang::ASTContext::FloatTy

Definition at line 1234 of file ASTContext.h.

◆ FractTy

CanQualType clang::ASTContext::FractTy

Definition at line 1238 of file ASTContext.h.

◆ HalfTy

CanQualType clang::ASTContext::HalfTy

Definition at line 1246 of file ASTContext.h.

◆ Ibm128Ty

CanQualType clang::ASTContext::Ibm128Ty

Definition at line 1234 of file ASTContext.h.

◆ Idents

IdentifierTable& clang::ASTContext::Idents

Definition at line 740 of file ASTContext.h.

◆ IncompleteMatrixIdxTy

CanQualType clang::ASTContext::IncompleteMatrixIdxTy

Definition at line 1261 of file ASTContext.h.

◆ Int128Ty

CanQualType clang::ASTContext::Int128Ty

Definition at line 1231 of file ASTContext.h.

◆ IntTy

◆ LambdaCastPaths

llvm::DenseMap<const CXXMethodDecl *, CXXCastPath> clang::ASTContext::LambdaCastPaths

For capturing lambdas with an explicit object parameter whose type is derived from the lambda type, we need to perform derived-to-base conversion so we can access the captures; the cast paths for that are stored here.

Definition at line 1321 of file ASTContext.h.

◆ Listener

ASTMutationListener* clang::ASTContext::Listener = nullptr

Definition at line 746 of file ASTContext.h.

◆ LongAccumTy

CanQualType clang::ASTContext::LongAccumTy

Definition at line 1236 of file ASTContext.h.

◆ LongDoubleTy

CanQualType clang::ASTContext::LongDoubleTy

Definition at line 1234 of file ASTContext.h.

◆ LongFractTy

CanQualType clang::ASTContext::LongFractTy

Definition at line 1238 of file ASTContext.h.

◆ LongLongTy

CanQualType clang::ASTContext::LongLongTy

Definition at line 1231 of file ASTContext.h.

◆ LongTy

CanQualType clang::ASTContext::LongTy

Definition at line 1231 of file ASTContext.h.

◆ MSGuidTagDecl

TagDecl* clang::ASTContext::MSGuidTagDecl = nullptr
mutable

Definition at line 1293 of file ASTContext.h.

◆ MSTypeInfoTagDecl

TagDecl* clang::ASTContext::MSTypeInfoTagDecl = nullptr
mutable

Definition at line 1296 of file ASTContext.h.

◆ NullPtrTy

CanQualType clang::ASTContext::NullPtrTy

Definition at line 1249 of file ASTContext.h.

◆ NumImplicitCopyAssignmentOperators

unsigned clang::ASTContext::NumImplicitCopyAssignmentOperators = 0

The number of implicitly-declared copy assignment operators.

Definition at line 3543 of file ASTContext.h.

◆ NumImplicitCopyAssignmentOperatorsDeclared

unsigned clang::ASTContext::NumImplicitCopyAssignmentOperatorsDeclared = 0

The number of implicitly-declared copy assignment operators for which declarations were built.

Definition at line 3547 of file ASTContext.h.

◆ NumImplicitCopyConstructors

unsigned clang::ASTContext::NumImplicitCopyConstructors = 0

The number of implicitly-declared copy constructors.

Definition at line 3529 of file ASTContext.h.

◆ NumImplicitCopyConstructorsDeclared

unsigned clang::ASTContext::NumImplicitCopyConstructorsDeclared = 0

The number of implicitly-declared copy constructors for which declarations were built.

Definition at line 3533 of file ASTContext.h.

◆ NumImplicitDefaultConstructors

unsigned clang::ASTContext::NumImplicitDefaultConstructors = 0

The number of implicitly-declared default constructors.

Definition at line 3522 of file ASTContext.h.

◆ NumImplicitDefaultConstructorsDeclared

unsigned clang::ASTContext::NumImplicitDefaultConstructorsDeclared = 0

The number of implicitly-declared default constructors for which declarations were built.

Definition at line 3526 of file ASTContext.h.

◆ NumImplicitDestructors

unsigned clang::ASTContext::NumImplicitDestructors = 0

The number of implicitly-declared destructors.

Definition at line 3557 of file ASTContext.h.

◆ NumImplicitDestructorsDeclared

unsigned clang::ASTContext::NumImplicitDestructorsDeclared = 0

The number of implicitly-declared destructors for which declarations were built.

Definition at line 3561 of file ASTContext.h.

◆ NumImplicitMoveAssignmentOperators

unsigned clang::ASTContext::NumImplicitMoveAssignmentOperators = 0

The number of implicitly-declared move assignment operators.

Definition at line 3550 of file ASTContext.h.

◆ NumImplicitMoveAssignmentOperatorsDeclared

unsigned clang::ASTContext::NumImplicitMoveAssignmentOperatorsDeclared = 0

The number of implicitly-declared move assignment operators for which declarations were built.

Definition at line 3554 of file ASTContext.h.

◆ NumImplicitMoveConstructors

unsigned clang::ASTContext::NumImplicitMoveConstructors = 0

The number of implicitly-declared move constructors.

Definition at line 3536 of file ASTContext.h.

◆ NumImplicitMoveConstructorsDeclared

unsigned clang::ASTContext::NumImplicitMoveConstructorsDeclared = 0

The number of implicitly-declared move constructors for which declarations were built.

Definition at line 3540 of file ASTContext.h.

◆ ObjCBuiltinBoolTy

CanQualType clang::ASTContext::ObjCBuiltinBoolTy

Definition at line 1255 of file ASTContext.h.

◆ ObjCBuiltinClassTy

CanQualType clang::ASTContext::ObjCBuiltinClassTy

Definition at line 1254 of file ASTContext.h.

◆ ObjCBuiltinIdTy

CanQualType clang::ASTContext::ObjCBuiltinIdTy

Definition at line 1254 of file ASTContext.h.

◆ ObjCBuiltinSelTy

CanQualType clang::ASTContext::ObjCBuiltinSelTy

Definition at line 1254 of file ASTContext.h.

◆ OCLClkEventTy

CanQualType clang::ASTContext::OCLClkEventTy

Definition at line 1259 of file ASTContext.h.

◆ OCLEventTy

CanQualType clang::ASTContext::OCLEventTy

Definition at line 1259 of file ASTContext.h.

◆ OCLQueueTy

CanQualType clang::ASTContext::OCLQueueTy

Definition at line 1260 of file ASTContext.h.

◆ OCLReserveIDTy

CanQualType clang::ASTContext::OCLReserveIDTy

Definition at line 1260 of file ASTContext.h.

◆ OCLSamplerTy

CanQualType clang::ASTContext::OCLSamplerTy

Definition at line 1259 of file ASTContext.h.

◆ OMPArrayShapingTy

CanQualType clang::ASTContext::OMPArrayShapingTy

Definition at line 1263 of file ASTContext.h.

◆ OMPIteratorTy

CanQualType clang::ASTContext::OMPIteratorTy

Definition at line 1263 of file ASTContext.h.

◆ OverloadTy

CanQualType clang::ASTContext::OverloadTy

Definition at line 1250 of file ASTContext.h.

◆ ParsedComments

llvm::DenseMap<const Decl *, comments::FullComment *> clang::ASTContext::ParsedComments
mutable

Mapping from declarations to parsed comments attached to any redeclaration.

Definition at line 956 of file ASTContext.h.

◆ PseudoObjectTy

CanQualType clang::ASTContext::PseudoObjectTy

Definition at line 1253 of file ASTContext.h.

◆ RedeclChainComments

llvm::DenseMap<const Decl *, const Decl *> clang::ASTContext::RedeclChainComments
mutable

Mapping from canonical declaration to the first redeclaration in chain that has a comment attached.

Raw comments are owned by Comments list. This mapping is populated lazily.

Definition at line 943 of file ASTContext.h.

◆ SatAccumTy

CanQualType clang::ASTContext::SatAccumTy

Definition at line 1240 of file ASTContext.h.

◆ SatFractTy

CanQualType clang::ASTContext::SatFractTy

Definition at line 1243 of file ASTContext.h.

◆ SatLongAccumTy

CanQualType clang::ASTContext::SatLongAccumTy

Definition at line 1240 of file ASTContext.h.

◆ SatLongFractTy

CanQualType clang::ASTContext::SatLongFractTy

Definition at line 1243 of file ASTContext.h.

◆ SatShortAccumTy

CanQualType clang::ASTContext::SatShortAccumTy

Definition at line 1240 of file ASTContext.h.

◆ SatShortFractTy

CanQualType clang::ASTContext::SatShortFractTy

Definition at line 1243 of file ASTContext.h.

◆ SatUnsignedAccumTy

CanQualType clang::ASTContext::SatUnsignedAccumTy

Definition at line 1241 of file ASTContext.h.

◆ SatUnsignedFractTy

CanQualType clang::ASTContext::SatUnsignedFractTy

Definition at line 1244 of file ASTContext.h.

◆ SatUnsignedLongAccumTy

CanQualType clang::ASTContext::SatUnsignedLongAccumTy

Definition at line 1242 of file ASTContext.h.

◆ SatUnsignedLongFractTy

CanQualType clang::ASTContext::SatUnsignedLongFractTy

Definition at line 1245 of file ASTContext.h.

◆ SatUnsignedShortAccumTy

CanQualType clang::ASTContext::SatUnsignedShortAccumTy

Definition at line 1241 of file ASTContext.h.

◆ SatUnsignedShortFractTy

CanQualType clang::ASTContext::SatUnsignedShortFractTy

Definition at line 1244 of file ASTContext.h.

◆ SectionInfos

llvm::StringMap<SectionInfo> clang::ASTContext::SectionInfos

Definition at line 3711 of file ASTContext.h.

◆ Selectors

SelectorTable& clang::ASTContext::Selectors

Definition at line 741 of file ASTContext.h.

◆ ShortAccumTy

CanQualType clang::ASTContext::ShortAccumTy

Definition at line 1235 of file ASTContext.h.

◆ ShortFractTy

CanQualType clang::ASTContext::ShortFractTy

Definition at line 1238 of file ASTContext.h.

◆ ShortTy

CanQualType clang::ASTContext::ShortTy

Definition at line 1231 of file ASTContext.h.

◆ SignedCharTy

CanQualType clang::ASTContext::SignedCharTy

Definition at line 1231 of file ASTContext.h.

◆ SYCLKernels

llvm::DenseMap<CanQualType, SYCLKernelInfo> clang::ASTContext::SYCLKernels

Map of SYCL kernels indexed by the unique type used to name the kernel.

Entries are not serialized but are recreated on deserialization of a sycl_kernel_entry_point attributed function declaration.

Definition at line 1315 of file ASTContext.h.

◆ TUKind

const TranslationUnitKind clang::ASTContext::TUKind

Definition at line 743 of file ASTContext.h.

◆ UnknownAnyTy

CanQualType clang::ASTContext::UnknownAnyTy

Definition at line 1251 of file ASTContext.h.

◆ UnresolvedTemplateTy

CanQualType clang::ASTContext::UnresolvedTemplateTy

Definition at line 1250 of file ASTContext.h.

◆ UnsignedAccumTy

CanQualType clang::ASTContext::UnsignedAccumTy

Definition at line 1237 of file ASTContext.h.

◆ UnsignedCharTy

CanQualType clang::ASTContext::UnsignedCharTy

Definition at line 1232 of file ASTContext.h.

◆ UnsignedFractTy

CanQualType clang::ASTContext::UnsignedFractTy

Definition at line 1239 of file ASTContext.h.

◆ UnsignedInt128Ty

CanQualType clang::ASTContext::UnsignedInt128Ty

Definition at line 1233 of file ASTContext.h.

◆ UnsignedIntTy

CanQualType clang::ASTContext::UnsignedIntTy

Definition at line 1232 of file ASTContext.h.

◆ UnsignedLongAccumTy

CanQualType clang::ASTContext::UnsignedLongAccumTy

Definition at line 1237 of file ASTContext.h.

◆ UnsignedLongFractTy

CanQualType clang::ASTContext::UnsignedLongFractTy

Definition at line 1239 of file ASTContext.h.

◆ UnsignedLongLongTy

CanQualType clang::ASTContext::UnsignedLongLongTy

Definition at line 1233 of file ASTContext.h.

◆ UnsignedLongTy

CanQualType clang::ASTContext::UnsignedLongTy

Definition at line 1232 of file ASTContext.h.

◆ UnsignedShortAccumTy

CanQualType clang::ASTContext::UnsignedShortAccumTy

Definition at line 1237 of file ASTContext.h.

◆ UnsignedShortFractTy

CanQualType clang::ASTContext::UnsignedShortFractTy

Definition at line 1239 of file ASTContext.h.

◆ UnsignedShortTy

CanQualType clang::ASTContext::UnsignedShortTy

Definition at line 1232 of file ASTContext.h.

◆ VaListTagDecl

Decl* clang::ASTContext::VaListTagDecl = nullptr
mutable

Definition at line 1290 of file ASTContext.h.

◆ VoidPtrTy

CanQualType clang::ASTContext::VoidPtrTy

Definition at line 1249 of file ASTContext.h.

◆ VoidTy

CanQualType clang::ASTContext::VoidTy

Definition at line 1222 of file ASTContext.h.

◆ WCharTy

CanQualType clang::ASTContext::WCharTy

Definition at line 1225 of file ASTContext.h.

◆ WideCharTy

CanQualType clang::ASTContext::WideCharTy

Definition at line 1226 of file ASTContext.h.

◆ WIntTy

CanQualType clang::ASTContext::WIntTy

Definition at line 1227 of file ASTContext.h.


The documentation for this class was generated from the following files: