clang 22.0.0git
clang::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 clang::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.
const clang::PrintingPolicygetPrintingPolicy () const
void setPrintingPolicy (const clang::PrintingPolicy &Policy)
SourceManagergetSourceManager ()
const SourceManagergetSourceManager () const
void cleanup ()
llvm::BumpPtrAllocator & getAllocator () const
void * Allocate (size_t Size, unsigned Align=8) const
template<typename T>
TAllocate (size_t Num=1) const
void Deallocate (void *Ptr) const
llvm::StringRef backupStr (llvm::StringRef S) const
DeclListNodeAllocateDeclListNode (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::DiagStorageAllocatorgetDiagAllocator ()
const TargetInfogetTargetInfo () const
const TargetInfogetAuxTargetInfo () 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 LangOptionsgetLangOpts () const
bool isDependenceAllowed () const
const NoSanitizeListgetNoSanitizeList () 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 XRayFunctionFiltergetXRayFilter () const
const ProfileListgetProfileList () 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::CommandTraitsgetCommentCommandTraits () 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
DeclgetPrimaryMergedDecl (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.
ModulegetCurrentNamedModule () 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.
TranslationUnitDeclgetTranslationUnitDecl () 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.
ExternalASTSourcegetExternalSource () const
 Retrieve a pointer to the external AST source associated with this AST context, if any.
IntrusiveRefCntPtr< ExternalASTSourcegetExternalSourcePtr () 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.
ASTMutationListenergetASTMutationListener () 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)
FunctionDeclgetcudaConfigureCallDecl ()
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 (ElaboratedTypeKeyword Keyword, 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
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'.
IdentifierInfogetNSObjectName () const
 Retrieve the identifier 'NSObject'.
IdentifierInfogetNSCopyingName ()
 Retrieve the identifier 'NSCopying'.
CanQualType getNSUIntegerType () const
CanQualType getNSIntegerType () const
IdentifierInfogetBoolName () 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.
TypedefDeclgetBOOLDecl () 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.
TagDeclgetMSGuidTagDecl () const
 Retrieve the implicitly-predeclared 'struct _GUID' declaration.
CanQualType getMSGuidType () const
 Retrieve the implicitly-predeclared 'struct _GUID' type.
TagDeclgetMSTypeInfoTagDecl () 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< CharUnitsgetTypeSizeInCharsIfKnown (QualType Ty) const
std::optional< CharUnitsgetTypeSizeInCharsIfKnown (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 TypegetCanonicalType (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 ConstantArrayTypegetAsConstantArrayType (QualType T) const
const VariableArrayTypegetAsVariableArrayType (QualType T) const
const IncompleteArrayTypegetAsIncompleteArrayType (QualType T) const
const DependentSizedArrayTypegetAsDependentSizedArrayType (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
template<>
DynTypedNodeList getParents (const DynTypedNode &Node)

Static Public Member Functions

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

Public Attributes

IdentifierTableIdents
SelectorTableSelectors
Builtin::ContextBuiltinInfo
const TranslationUnitKind TUKind
DeclarationNameTable DeclarationNames
IntrusiveRefCntPtr< ExternalASTSourceExternalSource
ASTMutationListenerListener = 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
DeclVaListTagDecl = nullptr
TagDeclMSGuidTagDecl = nullptr
TagDeclMSTypeInfoTagDecl = 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, SYCLKernelInfoSYCLKernels
 Map of SYCL kernels indexed by the unique type used to name the kernel.
llvm::DenseMap< const CXXMethodDecl *, CXXCastPathLambdaCastPaths
 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 1148 of file ASTContext.h.

◆ overridden_cxx_method_iterator

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

Definition at line 1110 of file ASTContext.h.

◆ overridden_method_range

Initial value:
llvm::iterator_range<overridden_cxx_method_iterator>

Definition at line 1119 of file ASTContext.h.

◆ TemplateOrSpecializationInfo

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

A type synonym for the TemplateOrInstantiation mapping.

Definition at line 512 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 2525 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 3628 of file ASTContext.h.

◆ NeedExtraManglingDecl_t

Enumerator
NeedExtraManglingDecl 

Definition at line 3444 of file ASTContext.h.

◆ PragmaSectionFlag

Enumerator
PSF_None 
PSF_Read 
PSF_Write 
PSF_Execute 
PSF_Implicit 
PSF_ZeroInit 
PSF_Invalid 

Definition at line 3680 of file ASTContext.h.

Constructor & Destructor Documentation

◆ ASTContext() [1/2]

◆ ASTContext() [2/2]

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

References ASTContext().

◆ ~ASTContext()

ASTContext::~ASTContext ( )

Definition at line 1002 of file ASTContext.cpp.

References cleanup().

Member Function Documentation

◆ addComment()

void ASTContext::addComment ( const RawComment & RC)

◆ addCopyConstructorForExceptionObject()

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

◆ 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.

References clang::Data.

Referenced by addDestruction().

◆ addDeclaratorForUnnamedTagDecl()

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

Definition at line 13441 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 3387 of file ASTContext.h.

References AddDeallocation(), clang::T, and V.

Referenced by clang::MSGuidDecl::getAsAPValue(), clang::CompoundLiteralExpr::getOrCreateStaticValue(), clang::LifetimeExtendedTemporaryDecl::getOrCreateValue(), and clang::ASTDeclReader::VisitLifetimeExtendedTemporaryDecl().

◆ 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.

Referenced by clang::DeclContext::addHiddenDecl().

◆ 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.

References clang::isa().

◆ addObjCSubClass()

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

Definition at line 3252 of file ASTContext.h.

Referenced by clang::SemaObjC::ActOnSuperClassOfClassInterface().

◆ 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.

References clang::Decl::isCanonicalDecl(), and clang::Method.

Referenced by clang::CXXMethodDecl::addOverriddenMethod().

◆ addressSpaceMapManglingFor()

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

Definition at line 3142 of file ASTContext.h.

References clang::isTargetAddressSpace().

◆ addTranslationUnitDecl()

void clang::ASTContext::addTranslationUnitDecl ( )
inline

◆ addTypedefNameForUnnamedTagDecl()

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

Definition at line 13431 of file ASTContext.cpp.

◆ adjustDeducedFunctionResultType()

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

◆ 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.

References clang::TypeLoc::getFullDataSizeForType(), getFunctionTypeWithExceptionSpec(), clang::ValueDecl::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), and clang::ValueDecl::setType().

Referenced by clang::ASTReader::FinishedDeserializing().

◆ 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.

References adjustType(), clang::Type::castAs(), clang::Type::getAs(), getFunctionNoProtoType(), and getFunctionType().

Referenced by adjustDeducedFunctionResultType().

◆ 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.

References clang::cast(), clang::FunctionProtoType::ExtProtoInfo::ExtInfo, getFunctionNoProtoType(), getFunctionType(), clang::Result, and clang::T.

Referenced by handleFunctionTypeAttr().

◆ adjustObjCTypeParamBoundType()

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

◆ adjustStringLiteralBaseType()

QualType ASTContext::adjustStringLiteralBaseType ( QualType StrLTy) const

Definition at line 5162 of file ASTContext.cpp.

References getAddrSpaceQualType(), and clang::opencl_constant.

Referenced by getStringLiteralArrayType().

◆ 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.

References adjustType(), clang::cast(), getAdjustedType(), getAttributedType(), getBTFTagAttributedType(), getMacroQualifiedType(), getParenType(), and clang::Type::getTypeClass().

Referenced by adjustFunctionResultType(), adjustType(), and getFunctionTypeWithExceptionSpec().

◆ Allocate() [1/2]

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

Definition at line 814 of file ASTContext.h.

References Allocate(), clang::Num, and clang::T.

◆ Allocate() [2/2]

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

Definition at line 811 of file ASTContext.h.

Referenced by Allocate(), ASTAllocateString(), clang::CallExpr::Create(), clang::CaseStmt::Create(), clang::CUDAKernelCallExpr::Create(), clang::CXXConstructExpr::Create(), clang::CXXDefaultInitExpr::Create(), clang::CXXDependentScopeMemberExpr::Create(), clang::CXXMemberCallExpr::Create(), clang::CXXNewExpr::Create(), clang::CXXOperatorCallExpr::Create(), clang::CXXTemporaryObjectExpr::Create(), clang::IfStmt::Create(), clang::ParenListExpr::Create(), clang::PredefinedExpr::Create(), clang::RecoveryExpr::Create(), clang::ReturnStmt::Create(), clang::StringLiteral::Create(), clang::SwitchStmt::Create(), clang::UserDefinedLiteral::Create(), clang::WhileStmt::Create(), clang::ObjCTypeParamList::create(), clang::CallExpr::CreateEmpty(), clang::CaseStmt::CreateEmpty(), clang::CUDAKernelCallExpr::CreateEmpty(), clang::CXXConstructExpr::CreateEmpty(), clang::CXXDependentScopeMemberExpr::CreateEmpty(), clang::CXXMemberCallExpr::CreateEmpty(), clang::CXXNewExpr::CreateEmpty(), clang::CXXOperatorCallExpr::CreateEmpty(), clang::CXXTemporaryObjectExpr::CreateEmpty(), clang::IfStmt::CreateEmpty(), clang::ParenListExpr::CreateEmpty(), clang::PredefinedExpr::CreateEmpty(), clang::RecoveryExpr::CreateEmpty(), clang::ReturnStmt::CreateEmpty(), clang::StringLiteral::CreateEmpty(), clang::SwitchStmt::CreateEmpty(), clang::UserDefinedLiteral::CreateEmpty(), clang::WhileStmt::CreateEmpty(), getCanonicalTemplateSpecializationType(), getCountAttributedType(), getDeclAttrs(), getDeducedTemplateName(), getHLSLInlineSpirvType(), getObjCInterfaceType(), getObjCObjectPointerType(), getObjCObjectType(), getObjCTypeParamType(), getOverloadedTemplateName(), getPackIndexingType(), getSubstTemplateTypeParmType(), getTemplateSpecializationType(), getTypedefType(), and getUsingType().

◆ AllocateDeclListNode()

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

Allocates a DeclListNode or returns one from the ListNodeFreeList pool.

Definition at line 827 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 3323 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 6348 of file ASTContext.cpp.

References getObjCObjectPointerType(), getObjCObjectType(), getObjCTypeParamType(), ObjCBuiltinClassTy, ObjCBuiltinIdTy, and clang::ast_matchers::type.

Referenced by getObjCTypeParamType().

◆ areCommonBaseCompatible()

◆ areComparableObjCPointerTypes()

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

Definition at line 11322 of file ASTContext.cpp.

References canAssignObjCInterfaces(), and clang::Type::getAs().

◆ areCompatibleRVVTypes()

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

◆ areCompatibleVectorTypes()

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

◆ 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 10673 of file ASTContext.cpp.

References clang::LangOptionsBase::All, clang::Generic, clang::Type::getAs(), getLangOpts(), clang::Type::getRVVEltType(), getRVVTypeSize(), getTypeSize(), clang::LangOptionsBase::Integer, clang::Type::isIntegerType(), clang::Type::isRVVSizelessBuiltinType(), and clang::Type::isVectorType().

Referenced by IsVectorConversion().

◆ AtomicUsesUnsupportedLibcall()

◆ 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.

References adjustDeclToTemplate(), cacheRawCommentForDecl(), Comments, DeclRawComments, clang::File, getDeclLocsForCommentSearch(), getRawCommentForDeclNoCacheImpl(), clang::SourceLocation::isValid(), and ParsedComments.

◆ backupStr()

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

Definition at line 819 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 15122 of file ASTContext.cpp.

References CXXRecordDecl, getASTRecordLayout(), and clang::CXXRecordDecl::isPolymorphic().

◆ BlockRequiresCopying()

◆ buildBuiltinTemplateDecl()

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

◆ buildImplicitRecord()

◆ buildImplicitTypedef()

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

◆ 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.

References CommentlessRedeclChains, DeclRawComments, clang::Decl::getCanonicalDecl(), clang::RawComment::isDocumentation(), and RedeclChainComments.

Referenced by attachCommentsToJustParsedDecls(), and getRawCommentForAnyRedecl().

◆ canAssignObjCInterfaces() [1/2]

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

◆ canAssignObjCInterfaces() [2/2]

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

◆ 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 10944 of file ASTContext.cpp.

References canAssignObjCInterfacesInBlockPointer(), clang::ObjCInterfaceType::getDecl(), clang::ObjCObjectPointerType::getInterfaceType(), getLangOpts(), clang::Type::isObjCBuiltinType(), clang::ObjCObjectPointerType::isObjCIdType(), clang::ObjCObjectPointerType::isObjCQualifiedIdType(), clang::ObjCInterfaceDecl::isSuperClassOf(), ObjCQualifiedIdTypesAreCompatible(), and clang::ObjCObjectPointerType::stripObjCKindOfTypeAndQuals().

Referenced by canAssignObjCInterfacesInBlockPointer(), and mergeTypes().

◆ canBindObjCObjectType()

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

Definition at line 11334 of file ASTContext.cpp.

References canAssignObjCInterfaces(), and getObjCObjectPointerType().

◆ canBuiltinBeRedeclared()

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

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

Definition at line 10322 of file ASTContext.cpp.

References BuiltinInfo, clang::FunctionDecl::getBuiltinID(), getTargetInfo(), and clang::Builtin::NotBuiltin.

◆ 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.

References getCanonicalTemplateArgument().

Referenced by clang::ClassTemplateDecl::getCanonicalInjectedSpecializationType(), and getTemplateSpecializationType().

◆ cleanup()

void ASTContext::cleanup ( )

Definition at line 961 of file ASTContext.cpp.

References clang::Value::clear().

Referenced by ~ASTContext().

◆ cloneFullComment()

◆ 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.

References CollectInheritedProtocols(), and clang::ObjCInterfaceDecl::getSuperClass().

Referenced by canAssignObjCInterfaces(), CollectInheritedProtocols(), ObjCQualifiedIdTypesAreCompatible(), and QIdProtocolsAdoptObjCObjectProtocols().

◆ 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 5534 of file ASTContext.cpp.

References IntTy, LongLongTy, LongTy, ShortTy, SignedCharTy, UnsignedCharTy, UnsignedIntTy, UnsignedLongLongTy, UnsignedLongTy, and UnsignedShortTy.

◆ 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 1828 of file ASTContext.h.

References clang::EnumConstantDecl::getInitVal(), IntTy, and isRepresentableIntegerValue().

◆ 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 642 of file ASTContext.h.

References clang::T.

Referenced by IsEligibleForTrivialRelocation(), and IsTriviallyRelocatableType().

◆ 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 653 of file ASTContext.h.

References clang::T.

◆ CountNonClassIvars()

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

◆ 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 13241 of file ASTContext.cpp.

References ASTContext(), clang::ItaniumMangleContext::create(), clang::MicrosoftMangleContext::create(), getDiagnostics(), and clang::T.

Referenced by InitDeviceMC().

◆ createMangleContext()

◆ createMangleNumberingContext()

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

Definition at line 13414 of file ASTContext.cpp.

Referenced by getManglingNumberContext(), and getManglingNumberContext().

◆ 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.

References clang::TypeLoc::getFullDataSizeForType(), and clang::T.

Referenced by EvaluateBooleanTypeTrait(), getTemplateSpecializationTypeInfo(), getTrivialTypeSourceInfo(), and GetTypeSourceInfoForDeclarator().

◆ Deallocate()

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

◆ DeallocateDeclListNode()

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

Deallocates a DeclListNode by returning it to the ListNodeFreeList pool.

Definition at line 838 of file ASTContext.h.

◆ DeclMustBeEmitted()

◆ DecodeTypeStr()

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

Definition at line 12727 of file ASTContext.cpp.

References ASTContext(), DecodeTypeFromStr(), and clang::Error.

◆ 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.

References clang::cast(), clang::Found, and clang::Decl::getCanonicalDecl().

◆ 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.

References DeepCollectObjCIvars(), clang::ObjCIvarDecl::getNextIvar(), clang::ObjCInterfaceDecl::getSuperClass(), and clang::ObjCInterfaceDecl::ivars().

Referenced by DeepCollectObjCIvars().

◆ DumpRecordLayout()

◆ eraseDeclAttrs()

void ASTContext::eraseDeclAttrs ( const Decl * D)

Erase the attributes corresponding to the given declaration.

Definition at line 1538 of file ASTContext.cpp.

Referenced by clang::Decl::dropAttrs().

◆ 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 14901 of file ASTContext.cpp.

Referenced by getFunctionFeatureMap().

◆ 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 15067 of file ASTContext.cpp.

References getCanonicalType(), SYCLKernels, and clang::T.

Referenced by clang::SemaSYCL::CheckSYCLEntryPointFunctionDecl().

◆ forEachMultiversionedFunctionVersion()

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

◆ getAddrSpaceQualType()

◆ 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 8024 of file ASTContext.cpp.

References getArrayParameterType(), getDecayedType(), getLangOpts(), clang::HLSL, and clang::T.

Referenced by DeduceNonTypeTemplateArgument(), and getSignatureParameterType().

◆ getAdjustedType() [1/2]

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

Definition at line 1537 of file ASTContext.h.

References clang::CanQual< Type >::CreateUnsafe(), getAdjustedType(), and New.

◆ 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.

References getCanonicalType(), New, and clang::AdjustedType::Profile().

Referenced by adjustType(), getAdjustedType(), and getCommonSugarTypeNode().

◆ 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.

References getMinGlobalAlignOfVar(), getPreferredTypeAlign(), getTypeSize(), and clang::T.

Referenced by getAlignOfGlobalVarInChars().

◆ 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.

References getAlignOfGlobalVar(), clang::T, and toCharUnitsFromBits().

Referenced by clang::CodeGen::CodeGenModule::GetAddrOfConstantCString(), clang::CodeGen::CodeGenModule::GetAddrOfConstantStringFromLiteral(), and clang::SemaOpenMP::isOpenMPCapturedByRef().

◆ getAllocator()

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

Definition at line 807 of file ASTContext.h.

Referenced by clang::Decl::getID().

◆ 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 8057 of file ASTContext.cpp.

References ASTContext(), getAsArrayType(), getAttributedType(), clang::ArrayType::getElementType(), clang::ArrayType::getIndexTypeQualifiers(), clang::Type::getNullability(), getPointerType(), getQualifiedType(), and clang::Result.

Referenced by BuildCookedLiteralOperatorCall(), CheckTemplateArgumentAddressOfObjectOrFunction(), CompareDerivedToBaseConversions(), CompareStandardConversionSequences(), doRewriteToUTF8StringBoxedExpressionHelper(), GetBuiltinType(), getCanonicalParamType(), getDecayedType(), and IsStandardConversion().

◆ getArrayInitLoopExprElementCount()

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

Return number of elements initialized in an ArrayInitLoopExpr.

Definition at line 8109 of file ASTContext.cpp.

References clang::ArrayInitLoopExpr::getArraySize(), and clang::ArrayInitLoopExpr::getSubExpr().

◆ getArrayParameterType()

QualType ASTContext::getArrayParameterType ( QualType Ty) const

◆ 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.

Definition at line 7971 of file ASTContext.cpp.

References clang::cast(), clang::Qualifiers::empty(), getConstantArrayType(), getDependentSizedArrayType(), getIncompleteArrayType(), getQualifiedType(), getVariableArrayType(), clang::isa(), clang::SplitQualType::Quals, clang::T, and clang::SplitQualType::Ty.

Referenced by CheckC23ConstexprInitStringLiteral(), clang::Sema::CheckCountedByAttrOnField(), checkFormatStringExpr(), DeduceFromInitializerList(), DeduceTemplateArgumentsByTypeMatch(), diagnoseArrayStarInParamType(), DiagnoseDivisionSizeofPointerOrArray(), DiagnoseIsEmptyReason(), DiagnoseIsFinalReason(), clang::CIRGen::CIRGenFunction::emitArrayLength(), clang::CodeGen::CodeGenFunction::emitArrayLength(), clang::CIRGen::CIRGenFunction::emitDestroy(), clang::CodeGen::CodeGenFunction::emitDestroy(), clang::CodeGen::ReductionCodeGen::emitInitialization(), clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit(), emitPartialArrayDestroy(), findSubobject(), getArrayDecayedType(), getAsConstantArrayType(), getAsDependentSizedArrayType(), getAsIncompleteArrayType(), getAsVariableArrayType(), getDeclAlign(), clang::CFGImplicitDtor::getDestructorDecl(), getLValueType(), handleInitPriorityAttr(), clang::interp::InterpretOffsetOf(), isDesignatorAtObjectEnd(), isSafeToConvert(), isSameEntity(), clang::extractapi::impl::ExtractAPIVisitorBase< std::conditional_t< std::is_same_v< Derived, void >, ExtractAPIVisitor<>, Derived > >::maybeMergeWithAnonymousTag(), mergeTypes(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), TryArrayCopy(), TryListConversion(), TryListInitialization(), tryObjCWritebackConversion(), TryOrBuildParenListInitialization(), TypeRequiresBuiltinLaunderImp(), and UnwrapSimilarArrayTypes().

◆ getAsConstantArrayType()

◆ getAsDependentSizedArrayType()

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

Definition at line 3056 of file ASTContext.h.

References getAsArrayType(), and clang::T.

Referenced by DeduceTemplateArgumentsByTypeMatch().

◆ getAsIncompleteArrayType()

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

◆ 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 10369 of file ASTContext.cpp.

References clang::TemplateName.

◆ 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 845 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 1357 of file ASTContext.h.

References Listener.

Referenced by adjustDeducedFunctionResultType(), applyOMPAllocateAttribute(), clang::Decl::getASTMutationListener(), and mergeDefinitionIntoModule().

◆ 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.

Referenced by getTypeUnadjustedAlign(), and lookupFieldBitOffset().

◆ 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.

References DumpRecordLayout(), clang::CharUnits::fromQuantity(), clang::RecordDecl::getDefinition(), getDiagnostics(), getExternalSource(), getLangOpts(), clang::Decl::getLocation(), clang::RecordDecl::getMostRecentDecl(), clang::NamedDecl::getName(), clang::CharUnits::getQuantity(), clang::ASTRecordLayout::getSize(), getTargetInfo(), clang::DeclContext::hasExternalLexicalStorage(), clang::TagDecl::isCompleteDefinition(), clang::CXXRecordDecl::isDynamicClass(), clang::Decl::isInvalidDecl(), mustSkipTailPadding(), and clang::CharUnits::Zero().

Referenced by clang::interp::IntPointer::atOffset(), clang::interp::IntPointer::baseCast(), baseForVTableAuthentication(), clang::CodeGen::CGCXXABI::buildThisParam(), calculateOffset(), CastToDerivedClass(), classifyType(), clang::RecordDecl::completeDefinition(), clang::interp::computePointerOffset(), DumpRecordLayout(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), EmitNullBaseClassInitialization(), EmitNullConstant(), EncodeBitField(), enumerateData(), clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), clang::CodeGen::CodeGenFunction::GetAddressOfDirectBaseInCompleteClass(), clang::CIRGen::CIRGenFunction::getAddressOfDirectBaseInCompleteClass(), getBaseAlignmentAndOffsetFromLValue(), getBaseAlignmentAndOffsetFromPtr(), clang::CodeGen::CodeGenModule::getClassPointerAlignment(), getDeclAlign(), getDerivedToBaseAlignmentAndOffset(), clang::CIRGen::CIRGenModule::getDynamicOffsetAlignment(), clang::CodeGen::CodeGenModule::getDynamicOffsetAlignment(), GetFieldOffset(), getFieldOffsetInBits(), clang::VarDecl::getFlexibleArrayInitChars(), getMemberPointerPathAdjustment(), clang::CodeGen::CodeGenModule::getMinimumClassObjectSize(), getOffsetOfBaseWithVBPtr(), getPreferredTypeAlign(), getTypeInfoDataSizeInChars(), getTypeUnadjustedAlign(), clang::CIRGen::CIRGenModule::getVBaseAlignment(), clang::CodeGen::CodeGenModule::getVBaseAlignment(), clang::CIRGen::CIRGenFunction::getVTablePointers(), clang::CodeGen::CodeGenFunction::getVTablePointers(), clang::CodeGen::CodeGenFunction::GetVTTParameter(), clang::CIRGen::CIRGenFunction::getVTTParameter(), HandleClassZeroInitialization(), HandleConstructorCall(), HandleDestructionImpl(), HandleLValueBase(), HandleLValueDirectBase(), HandleLValueMember(), clang::interp::InterpretOffsetOf(), isDesignatorAtObjectEnd(), and clang::interp::Pointer::toAPValue().

◆ getAsVariableArrayType()

◆ 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 6903 of file ASTContext.cpp.

References getAtomicType(), getCanonicalType(), New, clang::AtomicType::Profile(), and clang::T.

Referenced by getAtomicType(), getCommonNonSugarTypeNode(), getVariableArrayDecayedType(), makeQualifiedLValueReferenceType(), and mergeTypes().

◆ getAttributedType() [1/3]

◆ getAttributedType() [2/3]

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

Definition at line 5714 of file ASTContext.cpp.

References getAttributedType().

◆ getAttributedType() [3/3]

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

◆ getAutoDeductType()

QualType ASTContext::getAutoDeductType ( ) const

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

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

Definition at line 6930 of file ASTContext.cpp.

References clang::Auto, and AutoDeductTy.

Referenced by getAutoRRefDeductType(), and getDummyLambdaType().

◆ getAutoRRefDeductType()

QualType ASTContext::getAutoRRefDeductType ( ) const

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

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

Definition at line 6941 of file ASTContext.cpp.

References AutoRRefDeductTy, getAutoDeductType(), and getRValueReferenceType().

◆ 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 6823 of file ASTContext.cpp.

References clang::QualType::isNull(), and clang::Keyword.

Referenced by ConvertDeclSpecToType(), getCommonNonSugarTypeNode(), getCommonSugarTypeNode(), and getUnconstrainedType().

◆ getAuxTargetInfo()

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

Definition at line 857 of file ASTContext.h.

Referenced by handleCodeModelAttr(), InitDeviceMC(), and ProcessStmtAttribute().

◆ 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 8079 of file ASTContext.cpp.

References getBaseElementType(), and clang::ArrayType::getElementType().

Referenced by clang::SemaOpenMP::ActOnOpenMPCopyinClause(), clang::SemaOpenMP::ActOnOpenMPCopyprivateClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), BuildImplicitMemberInitializer(), CheckAggExprForMemSetUse(), CheckBitcastType(), CheckC23ConstexprVarType(), clang::interp::CheckNewTypeMismatch(), checkTrivialClassMembers(), defaultedSpecialMemberIsConstexpr(), DiagnoseDivisionSizeofPointerOrArray(), DiagnoseNonReplaceableReason(), diagnoseOpenCLTypes(), clang::CodeGen::CodeGenFunction::EmitCXXDeleteExpr(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), clang::CIRGen::CIRGenFunction::emitCXXNewExpr(), EmitMemberInitializer(), emitMemberInitializer(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), emitReadOnlyPlacementAttrWarning(), clang::CodeGen::CGHLSLRuntime::emitResourceArraySubscriptExpr(), getBaseElementType(), getDeclAlign(), clang::CFGImplicitDtor::getDestructorDecl(), getInnerObjCOwnership(), clang::CodeGen::CodeGenModule::getNaturalTypeAlignment(), getTypeAlignIfKnown(), handleInitPriorityAttr(), hasUniqueObjectRepresentations(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), clang::Sema::IsCXXReplaceableType(), clang::Sema::IsCXXTriviallyRelocatableType(), clang::QualType::isNonConstantStorage(), IsTriviallyRelocatableType(), MarkFieldDestructorReferenced(), PerformConstructorInitialization(), clang::ento::ExprEngine::ProcessDeleteDtor(), resolveAllocationOverloadInterior(), TryDefaultInitialization(), TryValueInitialization(), and TypeRequiresBuiltinLaunderImp().

◆ getBaseElementType() [2/2]

QualType ASTContext::getBaseElementType ( QualType QT) const

◆ 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 5176 of file ASTContext.cpp.

References New, and clang::BitIntType::Profile().

Referenced by ChangeIntegralSignedness(), getCorrespondingSignedType(), and getCorrespondingUnsignedType().

◆ getBlockDescriptorExtendedType()

QualType ASTContext::getBlockDescriptorExtendedType ( ) const

◆ getBlockDescriptorType()

QualType ASTContext::getBlockDescriptorType ( ) const

◆ 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.

References getBlockPointerType(), getCanonicalType(), New, clang::BlockPointerType::Profile(), and clang::T.

Referenced by addBlockPointerConversion(), checkConditionalPointerCompatibility(), getBlockPointerType(), getCommonNonSugarTypeNode(), clang::ento::MemRegionManager::getVarRegion(), and mergeTypes().

◆ 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.

References clang::Decl::hasAttr().

Referenced by BlockRequiresCopying(), and getBlockCaptureStr().

◆ getBOOLDecl()

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

Retrieve declaration of 'BOOL' typedef.

Definition at line 2360 of file ASTContext.h.

Referenced by getBOOLType().

◆ getBoolName()

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

Retrieve the identifier 'bool'.

Definition at line 2184 of file ASTContext.h.

References Idents.

◆ getBOOLType()

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

type of 'BOOL' type.

Definition at line 2370 of file ASTContext.h.

References getBOOLDecl(), getTypedefType(), and clang::None.

◆ getBTFTagAttributedType()

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

Definition at line 5741 of file ASTContext.cpp.

References getCanonicalType().

Referenced by adjustType(), and getCommonSugarTypeNode().

◆ getBuiltinMSVaListDecl()

TypedefDecl * ASTContext::getBuiltinMSVaListDecl ( ) const

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

Definition at line 10315 of file ASTContext.cpp.

References CreateMSVaListDecl().

Referenced by getBuiltinMSVaListType().

◆ getBuiltinMSVaListType()

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

Retrieve the type of the __builtin_ms_va_list type.

Definition at line 2400 of file ASTContext.h.

References getBuiltinMSVaListDecl(), getTypedefType(), and clang::None.

◆ GetBuiltinType()

◆ getBuiltinVaListDecl()

TypedefDecl * ASTContext::getBuiltinVaListDecl ( ) const

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

Definition at line 10297 of file ASTContext.cpp.

References CreateVaListDecl().

Referenced by getBuiltinVaListType(), GetFullTypeForDeclarator(), and getVaListTagDecl().

◆ getBuiltinVaListType()

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

Retrieve the type of the __builtin_va_list type.

Definition at line 2385 of file ASTContext.h.

References getBuiltinVaListDecl(), getTypedefType(), and clang::None.

Referenced by clang::CodeGen::getVAListElementType().

◆ 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 4516 of file ASTContext.cpp.

References clang::BuiltinType::getKind().

Referenced by areCompatibleRVVTypes(), clang::CheckInvalidVLENandLMUL(), checkSizelessVectorShift(), clang::Type::getRVVEltType(), clang::Type::getSveEltType(), and HandleRISCVRVVVectorBitsTypeAttr().

◆ 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 8673 of file ASTContext.cpp.

References getLangOpts(), clang::QualType::getObjCLifetime(), clang::Type::isBlockPointerType(), clang::Type::isObjCObjectPointerType(), clang::Type::isRecordType(), clang::LangOptionsBase::NonGC, clang::ObjC, clang::Qualifiers::OCL_ExplicitNone, and clang::Qualifiers::OCL_None.

Referenced by clang::CodeGen::CodeGenFunction::emitByrefStructureInit().

◆ getCanonicalFunctionResultType()

◆ 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 7020 of file ASTContext.cpp.

References clang::CanQual< Type >::CreateUnsafe(), getArrayDecayedType(), getArrayParameterType(), getCanonicalType(), getLangOpts(), getPointerType(), getVariableArrayDecayedType(), clang::HLSL, clang::isa(), clang::Result, and clang::T.

Referenced by arrangeFreeFunctionLikeCall(), arrangeFreeFunctionLikeCall(), getArgTypesForCall(), and getArgTypesForDeclaration().

◆ getCanonicalSizeType()

CanQualType ASTContext::getCanonicalSizeType ( ) const

Definition at line 6955 of file ASTContext.cpp.

Referenced by appendParameterTypes().

◆ getCanonicalTagType()

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

Definition at line 5477 of file ASTContext.cpp.

References clang::CanQual< Type >::CreateUnsafe(), clang::TagDecl::getCanonicalDecl(), getNonInjectedClassName(), and clang::None.

Referenced by clang::hlsl::BuiltinTypeDeclBuilder::addCopyAssignmentOperator(), clang::hlsl::BuiltinTypeDeclBuilder::addCopyConstructor(), clang::ODRHash::AddStructuralValue(), clang::CodeGen::CodeGenModule::AddVTableTypeMetadata(), BuildImplicitMemberInitializer(), clang::hlsl::BuiltinTypeMethodBuilder::BuiltinTypeMethodBuilder(), canPassInRegisters(), checkMemberDecomposition(), CheckOperatorDeleteDeclaration(), CheckOperatorNewDeleteTypes(), ComputeDefaultedSpecialMemberExceptionSpec(), clang::interp::computeFullDescSize(), createBufferHandleType(), createFieldForHostLayoutStruct(), createHostLayoutStruct(), DeduceTemplateArgumentsByTypeMatch(), clang::CIRGen::CIRGenTypes::deriveThisType(), clang::InitializationSequence::Diagnose(), DiagnoseBadAccess(), clang::Sema::DiagnoseInvalidExplicitObjectParameterInLambda(), DumpRecordLayout(), emitBadConversionNotes(), clang::CodeGen::CodeGenFunction::EmitCXXAggrConstructorCall(), clang::CIRGen::CIRGenFunction::emitCXXAggrConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitLambdaInAllocaCallOpBody(), clang::CodeGen::CodeGenFunction::EmitLambdaStaticInvokeBody(), clang::CodeGen::CGCXXABI::EmitLoadOfMemberFunctionPointer(), clang::CodeGen::CodeGenFunction::EmitLValueForLambdaField(), EmitMemberInitializer(), emitMemberInitializer(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTaskBasedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective(), clang::CodeGen::CodeGenModule::EmitVTableTypeMetadata(), FindBaseInitializer(), findDecomposableBaseClass(), findSubobject(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), clang::CodeGen::CodeGenFunction::GetAddressOfDerivedClass(), getBlockDescriptorExtendedType(), getBlockDescriptorType(), getCanonicalTypeDeclType(), getCFConstantStringDecl(), GetDeclSpecTypeForDeclarator(), clang::Expr::getEnumCoercedType(), clang::ento::CXXInstanceCall::getInitialStackFrameContents(), getLValueType(), getMemberPointerType(), getMSGuidType(), getObjCSuperType(), getOpenCLEnumType(), getTagType(), clang::interp::Descriptor::getType(), getTypeDeclType(), clang::interp::GetTypeidPtr(), getTypeSourceInfoForStdAlignValT(), clang::ento::CXXBaseObjectRegion::getValueType(), clang::ento::CXXDerivedObjectRegion::getValueType(), HandleConstructorCall(), HandleDynamicCast(), hasCopyOrMoveCtorParam(), HasNonDeletedDefaultedEqualityComparison(), clang::CodeGen::CodeGenFunction::InitCapturedStruct(), clang::dataflow::Environment::initialize(), clang::isBetterOverloadCandidate(), isNonPlacementDeallocationFunction(), IsOverloadOrOverrideImpl(), clang::Expr::isPotentialConstantExpr(), isSafeToConvert(), LookupSpecialMemberFromXValue(), MarkBaseDestructorsReferenced(), mergeAlignedAttrs(), recordFixedType(), ShouldDiagnoseSwitchCaseNotInEnum(), clang::interp::Pointer::toRValue(), TryDiagnoseProtectedAccess(), and TryObjectArgumentInitialization().

◆ 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 7865 of file ASTContext.cpp.

References ASTContext(), clang::cast(), clang::TemplateArgument::CreatePackCopy(), clang::TemplateArgument::Declaration, clang::TemplateArgument::Expression, clang::TemplateArgument::getAsDecl(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsStructuralValue(), clang::TemplateArgument::getAsTemplate(), clang::TemplateArgument::getAsTemplateOrTemplatePattern(), clang::TemplateArgument::getAsType(), clang::Decl::getCanonicalDecl(), getCanonicalTemplateArguments(), getCanonicalTemplateName(), getCanonicalType(), clang::TemplateArgument::getIntegralType(), clang::TemplateArgument::getIsDefaulted(), clang::TemplateArgument::getKind(), clang::TemplateArgument::getNullPtrType(), clang::TemplateArgument::getNumTemplateExpansions(), clang::TemplateArgument::getParamTypeForDecl(), clang::TemplateArgument::getStructuralValueType(), clang::TemplateArgument::Integral, clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_elements(), clang::TemplateArgument::StructuralValue, clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.

Referenced by canonicalizeTemplateArguments(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentPointerToMember(), ConvertDeducedTemplateArguments(), getCanonicalTemplateName(), getCanonicalTemplateSpecializationType(), getSubstBuiltinTemplatePack(), getSubstTemplateTypeParmPackType(), isSubstitutedTemplateArgument(), and clang::ASTRecordReader::readTemplateArgument().

◆ 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 7304 of file ASTContext.cpp.

References clang::DefaultArguments::Args, clang::TemplateParameterList::asArray(), clang::TemplateName::AssumedTemplate, clang::cast(), clang::TemplateName::DeducedTemplate, clang::TemplateName::DependentTemplate, clang::TemplateName::desugar(), clang::SubstTemplateTemplateParmPackStorage::getArgumentPack(), clang::TemplateName::getAsDeducedTemplateName(), clang::TemplateName::getAsDependentTemplateName(), clang::SubstTemplateTemplateParmPackStorage::getAssociatedDecl(), clang::TemplateName::getAsSubstTemplateTemplateParmPack(), clang::TemplateName::getAsTemplateDecl(), clang::Decl::getCanonicalDecl(), getCanonicalTemplateArgument(), getCanonicalTemplateArguments(), getCanonicalTemplateName(), getCanonicalTemplateTemplateParmDecl(), getDeducedTemplateName(), clang::DeducedTemplateStorage::getDefaultArguments(), getDefaultTemplateArgumentOrNone(), getDependentTemplateName(), clang::SubstTemplateTemplateParmPackStorage::getFinal(), clang::SubstTemplateTemplateParmPackStorage::getIndex(), clang::TemplateName::getKind(), clang::DependentTemplateStorage::getName(), clang::DependentTemplateStorage::getQualifier(), getSubstTemplateTemplateParmPack(), clang::TemplateDecl::getTemplateParameters(), clang::DeducedTemplateStorage::getUnderlying(), clang::DependentTemplateStorage::hasTemplateKeyword(), NestedNameSpecifier, clang::TemplateName::OverloadedTemplate, clang::TemplateName::QualifiedTemplate, clang::DefaultArguments::StartPos, clang::TemplateArgument::structurallyEquals(), clang::TemplateName::SubstTemplateTemplateParm, clang::TemplateName::SubstTemplateTemplateParmPack, clang::Template, clang::TemplateName::Template, clang::TemplateName, and clang::TemplateName::UsingTemplate.

Referenced by getCanonicalTemplateArgument(), getCanonicalTemplateName(), getCanonicalTemplateSpecializationType(), getCommonTemplateName(), getDeducedTemplateSpecializationType(), getTemplateSpecializationType(), hasSameTemplateName(), and isSameTemplateArgument().

◆ getCanonicalTemplateSpecializationType()

◆ getCanonicalTemplateTemplateParmDecl()

◆ getCanonicalType() [1/2]

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

Definition at line 2846 of file ASTContext.h.

References clang::T.

◆ 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.

Definition at line 2842 of file ASTContext.h.

References clang::CanQual< Type >::CreateUnsafe(), and clang::T.

Referenced by addBlockPointerConversion(), AddBuiltinAssignmentOperatorCandidates(), addFunctionPointerConversion(), buildDeclareReductionRef(), buildSingleCopyAssignRecursively(), buildUserDefinedMapperRef(), CheckC23ConstexprVarType(), clang::CheckEquivalentExceptionSpecImpl(), CheckOperatorDeleteDeclaration(), CheckOperatorNewDeclaration(), CheckOperatorNewDeleteTypes(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentPointerToMember(), CompareDerivedToBaseConversions(), CompareQualificationConversions(), CompareStandardConversionSequences(), clang::ConversionFixItGenerator::compareTypesSimple(), DiagnoseBadConversion(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CIRGen::CIRGenFunction::emitCall(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), clang::CIRGen::CIRGenFunction::emitUnaryOpLValue(), findDecomposableBaseClass(), findSubobject(), findSYCLKernelInfo(), getAddrSpaceQualType(), getAdjustedType(), getArrayParameterType(), getAtomicType(), getAttributedType(), getBlockPointerType(), getBTFTagAttributedType(), getCanonicalFunctionResultType(), getCanonicalParamType(), getCanonicalTemplateArgument(), getCanonicalTemplateTemplateParmDecl(), getCanonicalTypeDeclType(), getComplexType(), getConstantArrayType(), getConstantMatrixType(), getCountAttributedType(), getDecayedType(), getDecltypeType(), getDependentAddressSpaceType(), getDependentSizedArrayType(), getDependentSizedExtVectorType(), getDependentSizedMatrixType(), getDependentVectorType(), getExtVectorType(), getIncompleteArrayType(), getIntegerTypeOrder(), getLValueReferenceType(), getMacroQualifiedType(), getMemberPointerType(), getObjCGCQualType(), getObjCObjectPointerType(), getObjCObjectType(), getObjCTypeParamType(), getPackExpansionType(), getPackIndexingType(), getParenType(), getPointerType(), getPredefinedSugarType(), getRValueReferenceType(), getSYCLKernelInfo(), getTypeOfExprType(), getTypeOfType(), getVariableArrayType(), getVectorType(), hasSameType(), hasSameType(), hasSameUnqualifiedType(), hasUserDefinedMapper(), InitBuiltinTypes(), InitCatchParam(), IsImplicitBoolFloatConversion(), IsInvalidCmseNSCallConversion(), IsModifiable(), IsOverloadOrOverrideImpl(), IsStandardConversion(), clang::Expr::isUnusedResultAWarning(), LookupMemberExpr(), MarkUsedTemplateParameters(), mergeFunctionTypes(), mergeObjCGCQualifiers(), mergeTypeLists(), mergeTypes(), MightInstantiateTo(), OpenCLArithmeticConversions(), registerSYCLEntryPointFunction(), RemoveAddressSpaceFromPtr(), ResolveOverloadedFunctionForReferenceBinding(), SelectPropertyForSynthesisFromProtocols(), clang::cross_tu::shouldImport(), TryListConversion(), TryObjectArgumentInitialization(), TryReferenceInit(), TryReferenceInitializationCore(), clang::ConversionFixItGenerator::tryToFixConversion(), TryUserDefinedConversion(), clang::ento::ExprEngine::VisitBinaryOperator(), and clang::ento::ExprEngine::VisitBlockExpr().

◆ getCanonicalTypeDeclType()

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

◆ getCanonicalUnresolvedUsingType()

◆ 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 8402 of file ASTContext.cpp.

References clang::AS_public, buildImplicitRecord(), buildImplicitTypedef(), clang::LangOptions::CFRuntime, CharTy, clang::FieldDecl::Create(), getCanonicalTagType(), getLangOpts(), getPointerType(), getUIntPtrType(), clang::ICIS_NoInit, Idents, IntTy, LongTy, clang::LangOptionsBase::Swift, clang::LangOptionsBase::Swift4_1, clang::LangOptionsBase::Swift4_2, and clang::ast_matchers::tagType.

Referenced by getCFConstantStringTagDecl(), and getCFConstantStringType().

◆ getCFConstantStringTagDecl()

RecordDecl * ASTContext::getCFConstantStringTagDecl ( ) const

Definition at line 8486 of file ASTContext.cpp.

References getCFConstantStringDecl().

◆ getCFConstantStringType()

QualType ASTContext::getCFConstantStringType ( ) const

Return the C structure type used to represent constant CFStrings.

Definition at line 8493 of file ASTContext.cpp.

References getCFConstantStringDecl(), getTypedefType(), and clang::None.

◆ getCharWidth()

◆ getCommentCommandTraits()

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

Definition at line 1055 of file ASTContext.h.

Referenced by clang::Decl::dump().

◆ getCommentForDecl()

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

◆ getCommonSugaredType()

◆ getComplexType() [1/2]

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

Definition at line 1518 of file ASTContext.h.

References clang::CanQual< Type >::CreateUnsafe(), getComplexType(), and clang::T.

◆ 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.

References getCanonicalType(), getComplexType(), New, clang::ComplexType::Profile(), and clang::T.

Referenced by getCommonNonSugarTypeNode(), getComplexType(), getComplexType(), handleComplexFloatConversion(), handleComplexIntConversion(), and handleIntToFloatConversion().

◆ getConstantArrayElementCount()

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

Return number of constant array elements.

getConstantArrayElementCount - Returns number of constant array elements.

Definition at line 8099 of file ASTContext.cpp.

References clang::Type::getAsArrayTypeUnsafe(), clang::ArrayType::getElementType(), and clang::ConstantArrayType::getZExtSize().

Referenced by clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), and clang::CodeGen::CGHLSLRuntime::emitResourceArraySubscriptExpr().

◆ 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.

References getCanonicalType(), getConstantArrayType(), getQualifiedType(), clang::QualType::hasLocalQualifiers(), clang::QualType::isCanonical(), clang::Type::isConstantSizeType(), clang::Type::isDependentType(), clang::Type::isIncompleteType(), clang::Expr::isInstantiationDependent(), New, clang::ConstantArrayType::Profile(), clang::SplitQualType::Quals, clang::CanQual< T >::split(), and clang::SplitQualType::Ty.

Referenced by clang::interp::CheckNewTypeMismatch(), CheckStringInit(), diagnoseListInit(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), EmitDoacrossOrdered(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTaskBasedDirective(), clang::Sema::FindCompositePointerType(), getAsArrayType(), getCommonNonSugarTypeNode(), clang::ArrayParameterType::getConstantArrayType(), getConstantArrayType(), clang::interp::Descriptor::getDataType(), getStringLiteralArrayType(), getUnqualifiedArrayType(), getVariableArrayDecayedType(), HandleOperatorNewCall(), clang::interp::interp__builtin_operator_new(), mergeTypes(), clang::InitializationSequence::Perform(), clang::interp::SubPtr(), TryInitializerListConstruction(), TryListConversion(), and TryOrBuildParenListInitialization().

◆ 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 4788 of file ASTContext.cpp.

References getCanonicalType(), getConstantMatrixType(), clang::QualType::isCanonical(), clang::ConstantMatrixType::isDimensionValid(), clang::MatrixType::isValidElementType(), New, and clang::ConstantMatrixType::Profile().

Referenced by getCommonNonSugarTypeNode(), and getConstantMatrixType().

◆ 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 1458 of file ASTContext.h.

References clang::T.

Referenced by EvaluateAsStringImpl(), makeAttributeArgExpr(), and makeLaunchBoundsArgExpr().

◆ getCopyConstructorForExceptionObject()

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

◆ getCorrespondingSaturatedType()

◆ getCorrespondingSignedFixedPointType()

◆ getCorrespondingSignedType()

◆ getCorrespondingUnsaturatedType()

◆ getCorrespondingUnsignedType()

◆ getCountAttributedType()

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

◆ getcudaConfigureCallDecl()

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

Definition at line 1605 of file ASTContext.h.

Referenced by clang::SemaCUDA::ActOnExecConfigExpr().

◆ getCUIDHash()

StringRef ASTContext::getCUIDHash ( ) const

◆ 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.

References computeKeyFunction(), CXXRecordDecl, clang::LazyOffsetPtr< T, OffsT, Get >::get(), clang::CXXRecordDecl::getDefinition(), getExternalSource(), getTargetInfo(), clang::LazyOffsetPtr< T, OffsT, Get >::isOffset(), clang::LazyOffsetPtr< T, OffsT, Get >::isValid(), and clang::Result.

Referenced by DeclMustBeEmitted(), clang::installapi::getVTableLinkage(), clang::installapi::hasVTable(), and clang::installapi::isRTTIWeakDef().

◆ getCurrentNamedModule()

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

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

Definition at line 1190 of file ASTContext.h.

Referenced by clang::CXX20ModulesGenerator::getEmittingModule(), clang::Decl::isInAnotherModuleUnit(), clang::Decl::isInCurrentModuleUnit(), and clang::CodeGen::CodeGenModule::Release().

◆ getCVRQualifiedType()

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

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

Definition at line 2428 of file ASTContext.h.

References clang::Qualifiers::fromCVRMask(), getQualifiedType(), and clang::T.

◆ 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.

References clang::LangOptions::CXXABI, clang::TargetInfo::getCXXABI(), clang::TargetCXXABI::getKind(), getLangOpts(), and getTargetInfo().

Referenced by clang::CIRGen::CreateCIRGenItaniumCXXABI(), createCXXABI(), createCXXABI(), clang::CodeGen::CreateItaniumCXXABI(), and markUsedForAliasOrIfunc().

◆ getDecayedType() [1/3]

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

Definition at line 1546 of file ASTContext.h.

References clang::CanQual< Type >::CreateUnsafe(), getDecayedType(), and clang::T.

◆ 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.

References getCanonicalType(), and clang::AdjustedType::Profile().

◆ 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.

References getArrayDecayedType(), getDecayedType(), getPointerType(), and clang::T.

Referenced by AdjustFunctionParmAndArgTypesForDeduction(), BuiltinAlignment(), getAdjustedParameterType(), getCommonSugarTypeNode(), getDecayedType(), getDecayedType(), getExceptionObjectType(), and GetVTablePointer().

◆ 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.

References clang::ast_matchers::arrayType, clang::cast(), clang::ASTRecordLayout::getAlignment(), getAsArrayType(), getASTRecordLayout(), getBaseElementType(), clang::ASTRecordLayout::getFieldOffset(), clang::TargetInfo::getMaxAlignedAttribute(), clang::Decl::getMaxAlignment(), getMinGlobalAlignOfVar(), clang::DeclContext::getParent(), getPointerType(), getPreferredTypeAlign(), clang::QualType::getQualifiers(), getTargetInfo(), getTypeSize(), clang::Qualifiers::hasUnaligned(), clang::isa(), clang::Type::isIncompleteType(), clang::Decl::isInvalidDecl(), clang::SC_Static, clang::T, toBits(), and toCharUnitsFromBits().

Referenced by emitAddrOfVarFromArray(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CIRGen::CIRGenFunction::emitAutoVarAlloca(), EmitFunctionDeclLValue(), emitFunctionDeclLValue(), EmitGlobalNamedRegister(), EmitGlobalVarDeclLValue(), emitGlobalVarDeclLValue(), emitOutlinedFunctionPrologue(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), clang::CIRGen::CIRGenFunction::emitStaticVarDecl(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), GetAlignOfExpr(), getBaseAlignment(), getBaseAlignmentAndOffsetFromLValue(), clang::CodeGen::CodeGenFunction::getBlockByrefInfo(), clang::CodeGen::CodeGenModule::GetWeakRefReference(), clang::interp::interp__builtin_assume_aligned(), clang::interp::interp__builtin_is_aligned_up_down(), clang::CIRGen::CIRGenFunction::startFunction(), and clang::interp::Compiler< Emitter >::VisitUnaryExprOrTypeTraitExpr().

◆ getDeclaratorForUnnamedTagDecl()

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

Definition at line 13446 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.

References Allocate(), and clang::Result.

Referenced by clang::Decl::getAttrs().

◆ 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 6657 of file ASTContext.cpp.

References getCanonicalType(), getDecltypeType(), clang::Expr::isInstantiationDependent(), and clang::QualType::isNull().

Referenced by getDecltypeType().

◆ 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 10469 of file ASTContext.cpp.

References Allocate(), clang::DefaultArguments::Args, clang::DeducedTemplateStorage::Profile(), and clang::TemplateName.

Referenced by DeduceTemplateArguments(), and getCanonicalTemplateName().

◆ 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 6884 of file ASTContext.cpp.

References getCanonicalTemplateName(), clang::QualType::getCanonicalType(), clang::QualType::isNull(), clang::Keyword, clang::None, and clang::Template.

◆ 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 13163 of file ASTContext.cpp.

References clang::CC_C, clang::CC_M68kRTD, clang::CC_X86FastCall, clang::CC_X86RegCall, clang::CC_X86StdCall, clang::CC_X86VectorCall, clang::LangOptionsBase::DCC_CDecl, clang::LangOptionsBase::DCC_FastCall, clang::LangOptionsBase::DCC_None, clang::LangOptionsBase::DCC_RegCall, clang::LangOptionsBase::DCC_RtdCall, clang::LangOptionsBase::DCC_StdCall, clang::LangOptionsBase::DCC_VectorCall, getTargetInfo(), and hasFeature().

Referenced by addBlockPointerConversion(), addFunctionPointerConversion(), compareConversionFunctions(), getCCForDeclaratorChunk(), getDummyLambdaType(), getImplicitMethodEPI(), getLambdaConversionFunctionCallConv(), and repeatForLambdaConversionFunctionCallingConvs().

◆ getDefaultOpenCLPointeeAddrSpace()

LangAS clang::ASTContext::getDefaultOpenCLPointeeAddrSpace ( )
inline

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

Definition at line 1596 of file ASTContext.h.

References clang::opencl_generic, and clang::opencl_private.

Referenced by AdjustFunctionParmAndArgTypesForDeduction(), deduceOpenCLPointeeAddrSpace(), clang::Sema::getDefaultCXXMethodAddrSpace(), and clang::Expr::isNullPointerConstant().

◆ getDependentAddressSpaceType()

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

◆ 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 5190 of file ASTContext.cpp.

References clang::Expr::isInstantiationDependent(), New, and clang::DependentBitIntType::Profile().

◆ getDependentNameType()

◆ 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 4416 of file ASTContext.cpp.

References getCanonicalType(), getQualifiedType(), clang::DependentSizedArrayType::getSizeExpr(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::DependentSizedArrayType::Profile(), clang::SplitQualType::Quals, clang::CanQual< T >::split(), and clang::SplitQualType::Ty.

Referenced by getAsArrayType(), getCommonNonSugarTypeNode(), getUnqualifiedArrayType(), getVariableArrayDecayedType(), and clang::InitializationSequence::Perform().

◆ 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 4748 of file ASTContext.cpp.

References getCanonicalType(), getDependentSizedExtVectorType(), New, and clang::DependentSizedExtVectorType::Profile().

Referenced by getCommonNonSugarTypeNode(), and getDependentSizedExtVectorType().

◆ 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 4820 of file ASTContext.cpp.

References getCanonicalType(), clang::MatrixType::getElementType(), clang::DependentSizedMatrixType::getRowExpr(), New, and clang::DependentSizedMatrixType::Profile().

Referenced by getCommonNonSugarTypeNode().

◆ 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 10407 of file ASTContext.cpp.

References clang::DependentTemplateStorage::Profile(), and clang::TemplateName.

Referenced by getCanonicalTemplateName().

◆ 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 4675 of file ASTContext.cpp.

References getCanonicalType(), getDependentVectorType(), New, and clang::DependentVectorType::Profile().

Referenced by getCommonNonSugarTypeNode(), and getDependentVectorType().

◆ getDiagAllocator()

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

Definition at line 852 of file ASTContext.h.

◆ getDiagnostics()

◆ getExceptionObjectType()

QualType ASTContext::getExceptionObjectType ( QualType T) const

Definition at line 8038 of file ASTContext.cpp.

References getDecayedType(), getVariableArrayDecayedType(), and clang::T.

◆ 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.

References toCharUnitsFromBits().

◆ getExternalSource()

◆ 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 1342 of file ASTContext.h.

References ExternalSource.

Referenced by clang::FrontendAction::BeginSourceFile().

◆ getExternCContextDecl()

ExternCContextDecl * ASTContext::getExternCContextDecl ( ) const

◆ 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 4715 of file ASTContext.cpp.

References clang::Type::castAs(), clang::Generic, getCanonicalType(), getExtVectorType(), clang::BitIntType::getNumBits(), clang::Type::isBitIntType(), clang::Type::isBuiltinType(), clang::QualType::isCanonical(), clang::Type::isDependentType(), New, and clang::VectorType::Profile().

Referenced by castVector(), CheckExtVectorComponent(), CheckVectorSelect(), checkVectorShift(), convertVector(), getCommonNonSugarTypeNode(), getExtVectorType(), LookupMemberExpr(), OpenCLConvertScalarsToVectors(), and SetElementTypeAsReturnType().

◆ 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.

References clang::cast(), clang::IndirectFieldDecl::chain(), and getFieldOffset().

Referenced by emitAddrOfZeroSizeField().

◆ getFILEType()

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

Retrieve the C FILE type.

Definition at line 2213 of file ASTContext.h.

References getTypeDeclType(), and clang::None.

Referenced by getGlobalStreamPointerByName(), libc_func_matchers::hasUnsafePrintfStringArg(), and isStdStreamVar().

◆ getFixedPointIBits()

unsigned char ASTContext::getFixedPointIBits ( QualType Ty) const

◆ getFixedPointMax()

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

Definition at line 14842 of file ASTContext.cpp.

References getFixedPointSemantics(), and clang::Type::isFixedPointType().

◆ getFixedPointMin()

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

Definition at line 14847 of file ASTContext.cpp.

References getFixedPointSemantics(), and clang::Type::isFixedPointType().

◆ getFixedPointScale()

unsigned char ASTContext::getFixedPointScale ( QualType Ty) const

◆ getFixedPointSemantics()

◆ 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 8147 of file ASTContext.cpp.

References getFloatingRank().

Referenced by clang::ento::SMTConv::doFloatTypeConversion(), getFloatingTypeSemanticOrder(), clang::StandardConversionSequence::getNarrowingKind(), handleComplexConversion(), handleFloatConversion(), handleFloatVectorBinOpConversion(), isArithmeticArgumentPromotion(), tryGCCVectorConvertAndSplat(), and tryVectorConvertAndSplat().

◆ 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 8158 of file ASTContext.cpp.

References getFloatingTypeOrder(), and getFloatTypeSemantics().

Referenced by AnalyzeCompoundAssignment(), and clang::Sema::CheckImplicitConversion().

◆ getFloatTypeSemantics()

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

◆ getFullLoc()

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

Definition at line 914 of file ASTContext.h.

Referenced by clang::CodeGen::CGCXXABI::ErrorUnsupportedABI().

◆ getFunctionFeatureMap() [1/2]

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

◆ getFunctionFeatureMap() [2/2]

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

◆ getFunctionNoProtoType() [1/2]

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

Definition at line 1742 of file ASTContext.h.

References getFunctionNoProtoType().

◆ getFunctionNoProtoType() [2/2]

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

◆ getFunctionType()

◆ 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.

References adjustType(), clang::Type::castAs(), and getFunctionType().

Referenced by adjustExceptionSpec(), extractPBaseFlags(), getPointerAuthTypeDiscriminator(), clang::CodeGen::CodeGenFunction::getUBSanFunctionTypeHash(), handleFunctionTypeAttr(), and hasSameFunctionTypeIgnoringExceptionSpec().

◆ 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.

References clang::FunctionProtoType::ExtProtoInfo::ExtParameterInfos, getFunctionType(), and clang::T.

Referenced by hasSameFunctionTypeIgnoringParamABI().

◆ 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.

References getFunctionNoProtoType(), getFunctionType(), removePtrSizeAddrSpace(), and clang::T.

Referenced by hasSameFunctionTypeIgnoringPtrSizes().

◆ GetGVALinkageForFunction()

◆ GetGVALinkageForVariable()

◆ GetHigherPrecisionFPType()

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

Definition at line 859 of file ASTContext.h.

References clang::cast(), DoubleTy, FloatTy, and LongDoubleTy.

Referenced by DetectPrecisionLossInComplexDivision().

◆ getHLSLAttributedResourceType()

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

◆ getHLSLInlineSpirvType()

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

Definition at line 5784 of file ASTContext.cpp.

References Allocate().

◆ getIncompleteArrayType()

◆ getInjectedTemplateArg()

◆ 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 8755 of file ASTContext.cpp.

References clang::First, clang::Redeclarable< decl_type >::getFirstDecl(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::isFileContext(), clang::VarDecl::isInline(), None, clang::VarDecl::redecls(), Strong, Weak, and WeakUnknown.

◆ 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 8328 of file ASTContext.cpp.

References getBaseElementType(), clang::Qualifiers::OCL_None, and clang::T.

◆ 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.

References getTemplateOrSpecializationInfo(), and clang::VarDecl::isStaticDataMember().

◆ getInstantiatedFromUnnamedFieldDecl()

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

Definition at line 1625 of file ASTContext.cpp.

Referenced by FindFieldDeclInstantiationPattern(), and isInstantiationOf().

◆ 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.

Referenced by isInstantiationOfUnresolvedUsingDecl().

◆ 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.

References buildImplicitTypedef(), and Int128Ty.

◆ 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 8357 of file ASTContext.cpp.

References getCanonicalType(), getIntegerTypeForEnum(), clang::CanQual< T >::getTypePtr(), and clang::Type::isUnsignedIntegerType().

Referenced by canConvertIntToOtherIntTy(), clang::ento::SMTConv::doIntTypeConversion(), handleIntegerConversion(), handleIntegerVectorBinOpConversion(), tryGCCVectorConvertAndSplat(), and tryVectorConvertAndSplat().

◆ getInterpContext()

◆ 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 6979 of file ASTContext.cpp.

Referenced by clang::analyze_scanf::ScanfSpecifier::getArgType().

◆ 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 7002 of file ASTContext.cpp.

Referenced by getUIntPtrType().

◆ getIntTypeForBitwidth()

◆ getIntWidth()

◆ getjmp_bufType()

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

Retrieve the C jmp_buf type.

Definition at line 2226 of file ASTContext.h.

References getTypeDeclType(), and clang::None.

◆ getLangASForBuiltinAddressSpace()

◆ getLangOpts()

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

Definition at line 891 of file ASTContext.h.

Referenced by AlignOfType(), areLaxCompatibleRVVTypes(), buildGlobalBlock(), buildImplicitRecord(), builtinCommonTypeImpl(), CalculateHiddenNames(), canAssignObjCInterfacesInBlockPointer(), CheckConstexprFunction(), checkFloatingPointResult(), CheckForIncompatibleAttributes(), CheckICE(), ClassifyBinaryOp(), ClassifyConditional(), ClassifyDecl(), ClassifyInternal(), ClassifyMemberExpr(), ClassifyUnnamed(), clang::RecordDecl::completeDefinition(), clang::computeDependence(), clang::LinkageComputer::computeLVForDecl(), clang::analyze_os_log::computeOSLogBufferLayout(), computeOverflowPatternExclusion(), constructDebugPieceForTrackedCondition(), clang::CXXThisExpr::Create(), createDataFixit(), createOverloadsForFixedParams(), clang::tooling::createRenameAtomicChanges(), clang::CodeGen::CodeGenModule::CreateRuntimeVariable(), createSpanTypeForVarDecl(), clang::CIRGen::CIRGenFunction::emitAutoVarAlloca(), EmitDeclDestroy(), EmitDeclInit(), emitMappingInformation(), EncodeBitField(), clang::Expr::EvaluateAsInitializer(), EvaluateComparisonBinaryOperator(), clang::SourceLocExpr::EvaluateInContext(), clang::ASTMergeAction::ExecuteAction(), fixParamWithSpan(), fixUPCAddressofArraySubscriptWithSpan(), fixVarDeclWithArray(), FixVarInitializerWithSpan(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), GenerateFixForUnusedDecl(), clang::index::generateUSRForDecl(), clang::index::generateUSRForType(), getActiveRoundingMode(), getAdjustedParameterType(), GetAlignOfType(), getASTRecordLayout(), GetBuiltinType(), getByrefLifetime(), getCanonicalParamType(), getCFConstantStringDecl(), getConstField(), getCXXABIKind(), clang::LinkageComputer::getDeclLinkageAndVisibility(), clang::ento::retaincountchecker::RefLeakReportVisitor::getEndPath(), DerefSimplePtrArithFixableGadget::getFixits(), UPCPreIncrementGadget::getFixits(), UUCAddAssignGadget::getFixits(), getFloatTypeSemantics(), clang::AnalysisDeclContext::getFunctionName(), GetGCAttrTypeForType(), clang::Expr::getIntegerConstantExpr(), clang::Decl::getLangOpts(), getLiteralInfo(), getLogicalOperationType(), clang::LinkageComputer::getLVForDecl(), getMacroName(), getMoreSpecialized(), clang::CXXRecordDecl::getMSVtorDispMode(), clang::StandardConversionSequence::getNarrowingKind(), getNSArrayObjects(), getObjCEncodingForBlock(), getObjCGCAttrKind(), getObjCMemberSelTypePtrAuth(), clang::DeclContext::getRedeclContext(), getStringLiteralArrayType(), getTagType(), getTypeInfoDataSizeInChars(), getVTableContext(), clang::ento::retaincountchecker::RetainCountChecker::handleAutoreleaseCounts(), handleBuiltinAliasAttr(), clang::Decl::hasLocalOwningModuleStorage(), clang::installapi::hasRTTI(), hasSameCudaAttrs(), hasSameFunctionTypeIgnoringExceptionSpec(), libc_func_matchers::hasUnsafeFormatOrSArg(), higherPrecisionElementTypeForComplexArithmetic(), ignoreUnsafeLibcCall(), clang::Expr::isCXX11ConstantExpr(), clang::ParmVarDecl::isDestroyedInCallee(), clang::ObjCMethodDecl::isDirectMethod(), clang::ObjCPropertyDecl::isDirectProperty(), IsEquivalentFriend(), clang::Expr::isIntegerConstantExpr(), clang::Type::isIntegralType(), clang::VarDecl::isKnownToBeDefined(), clang::Type::isLiteralType(), IsModifiable(), clang::VarDecl::isNoDestroy(), clang::QualType::isNonConstantStorage(), clang::Expr::isNullPointerConstant(), clang::Type::isPackedVectorBoolType(), isPromotableBitField(), isPromotableIntegerType(), isSameEntity(), isTypeSubstitutable(), clang::Expr::isUnusedResultAWarning(), clang::FunctionDecl::isUsableAsGlobalAllocationFunctionInConstantEvaluation(), clang::interp::isUserWritingOffTheEnd(), isUserWritingOffTheEnd(), clang::CodeGen::ABIInfo::isZeroLengthBitfieldPermittedInHomogeneousAggregate(), clang::CXXRecordDecl::lambdaIsDefaultConstructibleAndAssignable(), MarkUsedTemplateParameters(), matchesPostDecrInWhile(), mergeTagDefinitions(), mergeTypes(), namedTypeToLengthModifierKind(), needsConversionOfHalfVec(), clang::ento::ConditionBRVisitor::patternMatch(), PrintStats(), clang::ento::retaincountchecker::RetainCountChecker::processLeaks(), ProcessStmtAttribute(), reportAnalyzerFunctionMisuse(), resolveAllocationOverloadInterior(), clang::edit::rewriteObjCRedundantCallWithLiteral(), clang::edit::rewriteToObjCLiteralSyntax(), setInstantiatedFromUnnamedFieldDecl(), setObjCGCLValueClass(), shouldFunctionGenerateHereOnly(), shouldNotRewriteImmediateMessageArgs(), clang::shouldSkipCheckingODR(), shouldVarGenerateHereOnly(), clang::CodeGen::CodeGenModule::stopAutoInit(), typesAreCompatible(), UnwrapSimilarArrayTypes(), UnwrapSimilarTypes(), clang::QualType::UseExcessPrecision(), and useInlineVisibilityHidden().

◆ 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 9067 of file ASTContext.cpp.

References clang::Type::getAs(), getIntWidth(), IntTy, and UnsignedIntTy.

◆ 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 2456 of file ASTContext.h.

References clang::Qualifiers::addObjCLifetime(), getQualifiedType(), clang::Qualifiers::OCL_None, and clang::ast_matchers::type.

◆ 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.

References getRawCommentForDeclNoCache(), and clang::RawComment::parse().

Referenced by clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().

◆ getLogicalOperationType()

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

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

Definition at line 2260 of file ASTContext.h.

References BoolTy, getLangOpts(), and IntTy.

Referenced by checkArithmeticOrEnumeralCompare().

◆ getLValueReferenceType()

◆ getMacroQualifiedType()

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

Definition at line 6102 of file ASTContext.cpp.

References getCanonicalType(), and clang::QualType::isCanonical().

Referenced by adjustType(), and getCommonSugarTypeNode().

◆ getManglingNumber()

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

Definition at line 13338 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 13395 of file ASTContext.cpp.

References createMangleNumberingContext(), and DeclContext.

◆ getManglingNumberContext() [2/2]

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

Definition at line 13404 of file ASTContext.cpp.

References createMangleNumberingContext().

◆ getMemberPointerPathAdjustment()

◆ getMemberPointerType()

◆ 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.

References clang::TargetInfo::getMinGlobalAlign(), getTargetInfo(), clang::VarDecl::hasDefinition(), and clang::ValueDecl::isWeak().

Referenced by getAlignOfGlobalVar(), and getDeclAlign().

◆ 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.

Referenced by clang::TextNodeDumper::VisitImportDecl().

◆ 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.

References clang::cast(), and clang::Decl::getCanonicalDecl().

Referenced by clang::TextNodeDumper::Visit().

◆ getMSGuidDecl()

MSGuidDecl * ASTContext::getMSGuidDecl ( MSGuidDeclParts Parts) const

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

Definition at line 13487 of file ASTContext.cpp.

References getMSGuidType(), MSGuidTagDecl, New, clang::MSGuidDecl::Profile(), and clang::CanQual< T >::withConst().

Referenced by handleUuidAttr().

◆ getMSGuidTagDecl()

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

Retrieve the implicitly-predeclared 'struct _GUID' declaration.

Definition at line 2406 of file ASTContext.h.

References MSGuidTagDecl.

◆ getMSGuidType()

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

Retrieve the implicitly-predeclared 'struct _GUID' type.

Definition at line 2409 of file ASTContext.h.

References getCanonicalTagType(), and MSGuidTagDecl.

Referenced by getMSGuidDecl().

◆ getMSTypeInfoTagDecl()

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

Retrieve the implicitly-predeclared 'struct type_info' declaration.

Definition at line 2415 of file ASTContext.h.

References buildImplicitRecord(), clang::Class, and MSTypeInfoTagDecl.

◆ getNameForTemplate()

◆ getNewOMPTraitInfo()

OMPTraitInfo & ASTContext::getNewOMPTraitInfo ( )

◆ getNextLocalImport()

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

Definition at line 1144 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 3465 of file ASTContext.h.

◆ getNoSanitizeList()

◆ getNSCopyingName()

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

Retrieve the identifier 'NSCopying'.

Definition at line 2171 of file ASTContext.h.

References Idents.

Referenced by clang::Type::isBlockCompatibleObjCPointerType().

◆ getNSIntegerType()

CanQualType ASTContext::getNSIntegerType ( ) const

Definition at line 8704 of file ASTContext.cpp.

References LongLongTy, LongTy, and clang::T.

◆ getNSObjectName()

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

Retrieve the identifier 'NSObject'.

Definition at line 2162 of file ASTContext.h.

References Idents.

Referenced by clang::ObjCMethodDecl::definedInNSObject(), and clang::Type::isBlockCompatibleObjCPointerType().

◆ getNSUIntegerType()

CanQualType ASTContext::getNSUIntegerType ( ) const

Definition at line 8695 of file ASTContext.cpp.

References clang::T, UnsignedLongLongTy, and UnsignedLongTy.

◆ getObjCClassDecl()

TypedefDecl * ASTContext::getObjCClassDecl ( ) const

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

Definition at line 9846 of file ASTContext.cpp.

References buildImplicitTypedef(), getObjCObjectPointerType(), getObjCObjectType(), ObjCBuiltinClassTy, and clang::T.

Referenced by getObjCClassType().

◆ 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 2137 of file ASTContext.h.

References getObjCClassType().

Referenced by ShouldTryAgainWithRedefinitionType().

◆ 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 2350 of file ASTContext.h.

References getObjCClassDecl(), getTypedefType(), and clang::None.

Referenced by getObjCClassRedefinitionType(), isObjCClassType(), and LookupMemberExpr().

◆ getObjCConstantStringInterface()

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

Definition at line 2110 of file ASTContext.h.

◆ getObjCEncodingForBlock()

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

◆ 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 8837 of file ASTContext.cpp.

References charUnitsToString(), clang::Type::getCanonicalTypeInternal(), getObjCEncodingForType(), getObjCEncodingTypeSize(), clang::isa(), clang::Type::isFunctionType(), clang::CharUnits::isPositive(), clang::CharUnits::isZero(), and clang::CharUnits::Zero().

◆ getObjCEncodingForMethodDecl()

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

◆ 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 8878 of file ASTContext.cpp.

References getObjCEncodingForTypeQualifier(), and clang::T.

Referenced by getObjCEncodingForBlock(), and getObjCEncodingForMethodDecl().

◆ 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 8993 of file ASTContext.cpp.

References clang::ObjCPropertyDecl::Assign, clang::ObjCPropertyDecl::Copy, clang::ObjCPropertyImplDecl::Dynamic, clang::Selector::getAsString(), clang::ObjCPropertyDecl::getGetterName(), clang::NamedDecl::getNameAsString(), getObjCEncodingForPropertyType(), getObjCPropertyImplDeclForPropertyDecl(), clang::ObjCPropertyDecl::getPropertyAttributes(), clang::ObjCPropertyImplDecl::getPropertyIvarDecl(), clang::ObjCPropertyDecl::getSetterKind(), clang::ObjCPropertyDecl::getSetterName(), clang::ObjCPropertyDecl::getType(), clang::ObjCPropertyDecl::isOptional(), clang::ObjCPropertyDecl::isReadOnly(), clang::ObjCPropertyAttribute::kind_copy, clang::ObjCPropertyAttribute::kind_getter, clang::ObjCPropertyAttribute::kind_nonatomic, clang::ObjCPropertyAttribute::kind_retain, clang::ObjCPropertyAttribute::kind_setter, clang::ObjCPropertyAttribute::kind_weak, clang::ObjCPropertyDecl::Retain, and clang::ObjCPropertyDecl::Weak.

◆ 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 9094 of file ASTContext.cpp.

References clang::T.

Referenced by getObjCEncodingForPropertyDecl().

◆ 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 9079 of file ASTContext.cpp.

References clang::T.

Referenced by clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), extractStringLiteralCharacter(), clang::CodeGen::CodeGenModule::GetAddrOfConstantStringFromObjCEncode(), GetLValueBaseAsString(), getObjCEncodingForBlock(), and getObjCEncodingForFunctionDecl().

◆ getObjCEncodingForTypeQualifier()

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

◆ 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 8732 of file ASTContext.cpp.

References getTypeSizeInChars(), IntTy, clang::CharUnits::isPositive(), clang::ast_matchers::type, VoidPtrTy, and clang::CharUnits::Zero().

Referenced by getObjCEncodingForBlock(), getObjCEncodingForFunctionDecl(), and getObjCEncodingForMethodDecl().

◆ getObjCGCAttrKind()

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

◆ 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.

References clang::Qualifiers::addObjCGCAttr(), getCanonicalType(), clang::QualType::getObjCGCAttr(), getObjCGCQualType(), clang::Type::getPointeeType(), getPointerType(), clang::Qualifiers::hasObjCGCAttr(), clang::Type::isAnyPointerType(), clang::QualifierCollector::strip(), and clang::T.

Referenced by getObjCGCQualType(), handleObjCGCTypeAttr(), and mergeTypes().

◆ getObjCIdDecl()

TypedefDecl * ASTContext::getObjCIdDecl ( ) const

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

Definition at line 9829 of file ASTContext.cpp.

References buildImplicitTypedef(), getObjCObjectPointerType(), getObjCObjectType(), ObjCBuiltinIdTy, and clang::T.

Referenced by getObjCIdType().

◆ 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 2124 of file ASTContext.h.

References getObjCIdType().

Referenced by ShouldTryAgainWithRedefinitionType().

◆ 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 2324 of file ASTContext.h.

References getObjCIdDecl(), getTypedefType(), and clang::None.

Referenced by getObjCIdRedefinitionType(), getObjCInstanceTypeDecl(), isObjCIdType(), and TryContextuallyConvertToObjCPointer().

◆ 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.

References clang::cast().

◆ 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.

References clang::cast().

Referenced by clang::ObjCCategoryDecl::getImplementation(), and clang::ObjCInterfaceDecl::getImplementation().

◆ getObjCInstanceType()

QualType clang::ASTContext::getObjCInstanceType ( )
inline

Retrieve the Objective-C "instancetype" type.

Definition at line 2199 of file ASTContext.h.

References getObjCInstanceTypeDecl(), getTypedefType(), and clang::None.

Referenced by clang::ObjCMessageExpr::getCallReturnType().

◆ getObjCInstanceTypeDecl()

TypedefDecl * ASTContext::getObjCInstanceTypeDecl ( )

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

Definition at line 8713 of file ASTContext.cpp.

References buildImplicitTypedef(), and getObjCIdType().

Referenced by getObjCInstanceType(), and handleFormatArgAttr().

◆ 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 6559 of file ASTContext.cpp.

References Allocate(), and clang::T.

Referenced by areCommonBaseCompatible(), getNSNumberFactoryMethod(), getObjCProtoType(), clang::ObjCPropertyRefExpr::getReceiverType(), GetReturnType(), LookupMethodInReceiverType(), and setObjCConstantStringInterface().

◆ getObjCMemberSelTypePtrAuth()

PointerAuthQualifier ASTContext::getObjCMemberSelTypePtrAuth ( )

◆ 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.

References clang::DeclContext::lookup().

Referenced by setObjCMethodRedeclaration().

◆ getObjCNSStringType()

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

Definition at line 2114 of file ASTContext.h.

◆ getObjCObjectPointerType()

◆ getObjCObjectType() [1/2]

◆ getObjCObjectType() [2/2]

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

◆ 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.

References clang::Decl::getDeclContext().

Referenced by clang::edit::rewriteToObjCSubscriptSyntax().

◆ getObjCPropertyImplDeclForPropertyDecl()

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

Definition at line 8948 of file ASTContext.cpp.

References clang::cast().

Referenced by getObjCEncodingForPropertyDecl().

◆ getObjCProtocolDecl()

ObjCInterfaceDecl * ASTContext::getObjCProtocolDecl ( ) const

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

Definition at line 9855 of file ASTContext.cpp.

References clang::ObjCInterfaceDecl::Create(), getTranslationUnitDecl(), and Idents.

Referenced by getObjCProtoType().

◆ getObjCProtoType()

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

Retrieve the type of the Objective-C Protocol class.

Definition at line 2376 of file ASTContext.h.

References getObjCInterfaceType(), and getObjCProtocolDecl().

◆ getObjCSelDecl()

TypedefDecl * ASTContext::getObjCSelDecl ( ) const

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

Definition at line 9838 of file ASTContext.cpp.

References buildImplicitTypedef(), getPointerType(), ObjCBuiltinSelTy, and clang::T.

Referenced by getObjCSelType().

◆ 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 2150 of file ASTContext.h.

References getObjCSelType().

Referenced by LookupMemberExpr().

◆ getObjCSelType()

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

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

Definition at line 2335 of file ASTContext.h.

References getObjCSelDecl(), getTypedefType(), and clang::None.

Referenced by emitCmdValueForGetterSetterBody(), getObjCSelRedefinitionType(), and isObjCSelType().

◆ getObjCSuperType()

QualType ASTContext::getObjCSuperType ( ) const

Returns the C struct type for objc_super.

Definition at line 8498 of file ASTContext.cpp.

References clang::DeclContext::addDecl(), buildImplicitRecord(), getCanonicalTagType(), and getTranslationUnitDecl().

◆ getObjCTypeParamType()

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

◆ 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.

References CXXRecordDecl, getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), clang::ASTRecordLayout::getBaseSharingVBPtr(), and clang::CharUnits::Zero().

◆ getOpenCLTypeAddrSpace()

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

Get address space for OpenCL type.

Definition at line 8623 of file ASTContext.cpp.

References getOpenCLTypeKind(), and clang::T.

◆ getOpenCLTypeKind()

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

◆ 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.

References clang::TargetOptions::FeatureMap, getTargetInfo(), clang::TargetInfo::getTargetOpts(), and clang::T.

Referenced by emitAlignedClause(), GetAlignedMapping(), and clang::interp::Compiler< Emitter >::VisitUnaryExprOrTypeTraitExpr().

◆ getOverloadedTemplateName()

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

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

Definition at line 10345 of file ASTContext.cpp.

References Allocate(), clang::NamedDecl::getUnderlyingDecl(), clang::isa(), and clang::TemplateName.

◆ 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.

References clang::Method, overridden_methods_begin(), and overridden_methods_end().

Referenced by getCommentForDecl().

◆ 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 6195 of file ASTContext.cpp.

References clang::Type::containsUnexpandedParameterPack(), getCanonicalType(), getPackExpansionType(), clang::QualType::isCanonical(), and clang::T.

Referenced by CheckBindingsCount(), getCommonNonSugarTypeNode(), getInjectedTemplateArg(), and getPackExpansionType().

◆ getPackIndexingType()

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

◆ 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 13454 of file ASTContext.cpp.

◆ getParentMapContext()

ParentMapContext & ASTContext::getParentMapContext ( )

Returns the dynamic AST node parent map context.

Definition at line 917 of file ASTContext.cpp.

Referenced by getParents(), getParents(), matchesPostDecrInWhile(), and setTraversalScope().

◆ getParents() [1/2]

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

◆ getParents() [2/2]

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

◆ getParenType()

QualType ASTContext::getParenType ( QualType NamedType) const

◆ getPointerAuthType()

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

Return a type with the given __ptrauth qualifier.

Definition at line 2478 of file ASTContext.h.

References clang::QualType::getPointerAuth(), getQualifiedType(), and clang::Qualifiers::setPointerAuth().

Referenced by HandlePtrAuthQualifier().

◆ getPointerAuthTypeDiscriminator()

uint16_t ASTContext::getPointerAuthTypeDiscriminator ( QualType T)

◆ 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.

References createMangleContext(), CXXRecordDecl, and clang::CXXRecordDecl::isPolymorphic().

◆ 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 6967 of file ASTContext.cpp.

References getPredefinedSugarType(), and clang::Type::PtrdiffT.

Referenced by clang::ento::RangedConstraintManager::assumeSym(), clang::CodeGen::CodeGenFunction::EmitIvarOffsetAsPointerDiff(), clang::analyze_scanf::ScanfSpecifier::getArgType(), clang::ento::SMTConv::getBinExpr(), getItaniumDynamicCastFn(), getPreferredTypeAlign(), getPreferredTypeOfBinaryRHS(), and performTypeAdjustment().

◆ getPointerType() [1/2]

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

Definition at line 1525 of file ASTContext.h.

References clang::CanQual< Type >::CreateUnsafe(), getPointerType(), and clang::T.

◆ 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.

References getCanonicalType(), getPointerType(), New, clang::PointerType::Profile(), and clang::T.

Referenced by clang::hlsl::BuiltinTypeDeclBuilder::addAppendMethod(), clang::hlsl::BuiltinTypeDeclBuilder::addConsumeMethod(), clang::hlsl::BuiltinTypeDeclBuilder::addCreateFromBinding(), clang::hlsl::BuiltinTypeDeclBuilder::addCreateFromImplicitBinding(), addFunctionPointerConversion(), clang::hlsl::BuiltinTypeDeclBuilder::addHandleAccessFunction(), clang::hlsl::BuiltinTypeDeclBuilder::addHandleConstructorFromBinding(), clang::hlsl::BuiltinTypeDeclBuilder::addHandleConstructorFromImplicitBinding(), adjustCVQualifiersForCXXThisWithinLambda(), buildMemcpyForAssignmentOp(), builtinAllocaAddrSpace(), BuiltinCallWithStaticChain(), BuiltinLaunder(), clang::hlsl::BuiltinTypeMethodBuilder::callBuiltin(), castValueFromUintptr(), clang::CodeGen::CGOpenMPRuntime::checkAndEmitLastprivateConditional(), clang::SemaHLSL::CheckBuiltinFunctionCall(), checkConditionalBlockPointerCompatibility(), checkConditionalObjectPointersCompatibility(), checkConditionalPointerCompatibility(), clang::checkGenericCastToPtr(), clang::SemaARM::CheckNeonBuiltinFunctionCall(), CheckOperatorDeleteDeclaration(), clang::checkPipePacketType(), CheckTemplateArgumentAddressOfObjectOrFunction(), clang::ento::ExprEngine::computeObjectUnderConstruction(), clang::ento::SValBuilder::conjureSymbolVal(), clang::SYCLUniqueStableNameExpr::Create(), clang::SYCLUniqueStableNameExpr::CreateEmpty(), CreateFunctionRefExpr(), clang::CStyleCastPtrExpr(), clang::CIRGen::CIRGenTypes::deriveThisType(), clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), clang::CodeGen::CodeGenFunction::EmitCastLValue(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), emitDeclTargetVarDeclLValue(), clang::CodeGen::CodeGenFunction::EmitLambdaBlockInvokeBody(), clang::CodeGen::CodeGenFunction::EmitLambdaInAllocaCallOpBody(), clang::CodeGen::CodeGenFunction::EmitLambdaStaticInvokeBody(), clang::CodeGen::CodeGenFunction::EmitOMPUseDeviceAddrClause(), clang::CodeGen::CGOpenMPRuntimeGPU::emitParallelCall(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), EvaluateAsStringImpl(), EvaluateBooleanTypeTrait(), clang::Sema::FindCompositePointerType(), GeneralizeType(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedVars(), getArrayDecayedType(), getBlockDescriptorExtendedType(), getCanonicalParamType(), getCFConstantStringDecl(), getCommonNonSugarTypeNode(), clang::ento::SValBuilder::getCXXThis(), getDecayedType(), getDeclAlign(), clang::TypeName::getFullyQualifiedType(), getGlobalStreamPointerByName(), clang::ento::CXXInstanceCall::getInitialStackFrameContents(), clang::ento::FunctionCodeRegion::getLocationType(), clang::ento::TypedValueRegion::getLocationType(), getObjCGCQualType(), getObjCSelDecl(), getPointerType(), getPointerType(), getPreferredTypeOfUnaryArg(), GetTypeOfFunction(), getVariableArrayDecayedType(), GetVTablePointer(), handleCleanupAttr(), handleMSPointerTypeQualifierAttr(), HandleWebAssemblyFuncrefAttr(), InitBuiltinTypes(), IsStandardConversion(), LookupMemberExpr(), LookupStdSourceLocationImpl(), mergeTypes(), NoteSurrogateCandidate(), clang::CodeGen::CodeGenFunction::processInReduction(), recordFixedType(), RemoveAddressSpaceFromPtr(), removePtrSizeAddrSpace(), ResolveOverloadForDeduction(), tryObjCWritebackConversion(), clang::ConversionFixItGenerator::tryToFixConversion(), clang::ento::ExprEngine::VisitCast(), and clang::ento::ExprEngine::VisitDeclStmt().

◆ 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 13476 of file ASTContext.cpp.

References CharTy, clang::StringLiteral::Create(), getStringLiteralArrayType(), clang::Ordinary, and clang::Result.

Referenced by clang::SourceLocExpr::EvaluateInContext().

◆ getPredefinedSugarType()

◆ 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.

References clang::TypeInfo::Align, clang::TypeInfo::AlignRequirement, getASTRecordLayout(), getPointerDiffType(), getPreferredTypeAlign(), getTypeInfo(), getTypeSize(), clang::TypeInfo::isAlignRequired(), clang::Decl::isInvalidDecl(), clang::RequiredByTypedef, clang::T, and toBits().

◆ 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 2707 of file ASTContext.h.

References getPreferredTypeAlign(), and clang::T.

Referenced by AlignOfType(), getAlignOfGlobalVar(), GetAlignOfType(), getDeclAlign(), getPreferredTypeAlign(), getPreferredTypeAlign(), getPreferredTypeAlignInChars(), and getTypeAlignIfKnown().

◆ getPreferredTypeAlignInChars()

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

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

Definition at line 2675 of file ASTContext.h.

References getPreferredTypeAlign(), clang::T, and toCharUnitsFromBits().

◆ getPrimaryMergedDecl()

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

Definition at line 1154 of file ASTContext.h.

References clang::Result.

Referenced by clang::getPrimaryMergedDecl().

◆ getPrintingPolicy()

◆ 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 7012 of file ASTContext.cpp.

◆ getProfileList()

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

◆ 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 8285 of file ASTContext.cpp.

References clang::Type::getAs(), clang::Type::getAsEnumDecl(), getIntWidth(), getTypeSize(), IntTy, clang::QualType::isNull(), isPromotableIntegerType(), clang::Type::isSignedIntegerType(), clang::Type::isUnsignedIntegerType(), LongLongTy, LongTy, UnsignedIntTy, UnsignedLongLongTy, and UnsignedLongTy.

Referenced by checkArithmeticOrEnumeralThreeWayCompare(), clang::ento::SMTConv::doIntTypeConversion(), and isArithmeticArgumentPromotion().

◆ getQualifiedTemplateName()

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

◆ getQualifiedType() [1/3]

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

Return a type with additional qualifiers.

Definition at line 2447 of file ASTContext.h.

References clang::Qualifiers::getFastQualifiers(), clang::Qualifiers::hasNonFastQualifiers(), and clang::T.

◆ getQualifiedType() [2/3]

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

Return a type with additional qualifiers.

Definition at line 2438 of file ASTContext.h.

References clang::Qualifiers::getFastQualifiers(), clang::Qualifiers::hasNonFastQualifiers(), clang::QualifierCollector::strip(), and clang::T.

◆ getQualifiedType() [3/3]

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

◆ 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 2097 of file ASTContext.h.

References getTypedefType(), and clang::None.

◆ 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.

References adjustDeclToTemplate(), cacheRawCommentForDecl(), CommentlessRedeclChains, DeclRawComments, clang::Decl::getCanonicalDecl(), getRawCommentForDeclNoCache(), RedeclChainComments, and clang::Decl::redecls().

Referenced by getCommentForDecl(), clang::getCompletionComment(), clang::getParameterComment(), and clang::getPatternCompletionComment().

◆ 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.

References Comments, CommentsLoaded, ExternalSource, clang::File, getDeclLocsForCommentSearch(), and getRawCommentForDeclNoCacheImpl().

Referenced by clang::tooling::getAssociatedRange(), getLocalCommentForDeclUncached(), and getRawCommentForAnyRedecl().

◆ 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.

References Comments, clang::Invalid, clang::isa(), clang::RawComment::isDocumentation(), clang::SourceLocation::isFileID(), clang::SourceLocation::isInvalid(), clang::RawComment::isTrailingComment(), and clang::Text.

Referenced by attachCommentsToJustParsedDecls(), and getRawCommentForDeclNoCache().

◆ getReadPipeType()

QualType ASTContext::getReadPipeType ( QualType T) const

Return a read_only pipe type for the specified type.

Definition at line 5168 of file ASTContext.cpp.

References clang::T.

◆ 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 13304 of file ASTContext.cpp.

References clang::Double, DoubleTy, clang::Float, clang::Float128, Float128Ty, FloatTy, clang::TargetInfo::getRealTypeByWidth(), getTargetInfo(), clang::Half, HalfTy, clang::Ibm128, Ibm128Ty, clang::LongDouble, LongDoubleTy, and clang::NoFloat.

◆ 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 6633 of file ASTContext.cpp.

References getLValueReferenceType(), getRValueReferenceType(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::T, clang::VK_LValue, clang::VK_PRValue, and clang::VK_XValue.

Referenced by diagnoseUnsatisfiedRequirement(), clang::ObjCMessageExpr::getCallReturnType(), and clang::ento::CallEvent::getResultType().

◆ getRelocationInfoForCXXRecord()

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

Definition at line 1693 of file ASTContext.cpp.

References CXXRecordDecl, and clang::CXXRecordDecl::getDefinition().

Referenced by IsCXXReplaceableType().

◆ 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 1438 of file ASTContext.h.

References clang::Qualifiers::Restrict, and clang::T.

◆ getRValueReferenceType()

◆ 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 4586 of file ASTContext.cpp.

References getTypeSize().

Referenced by checkSizelessVectorShift().

◆ getSideTableAllocatedMemory()

size_t ASTContext::getSideTableAllocatedMemory ( ) const

Return the total memory used for various side tables.

Definition at line 13272 of file ASTContext.cpp.

◆ getsigjmp_bufType()

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

Retrieve the C sigjmp_buf type.

Definition at line 2239 of file ASTContext.h.

References getTypeDeclType(), and clang::None.

◆ 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 8032 of file ASTContext.cpp.

References getAdjustedParameterType(), getVariableArrayDecayedType(), and clang::T.

Referenced by encodeTypeForFunctionPointerAuth().

◆ getSignedSizeType()

QualType ASTContext::getSignedSizeType ( ) const

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

Definition at line 6961 of file ASTContext.cpp.

References getPredefinedSugarType(), and clang::Type::SignedSizeT.

Referenced by clang::analyze_scanf::ScanfSpecifier::getArgType(), and lowerArrayDtorCtorIntoLoop().

◆ 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 6990 of file ASTContext.cpp.

References WCharTy.

Referenced by getCorrespondingSignedType().

◆ 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 6951 of file ASTContext.cpp.

References getPredefinedSugarType(), and clang::Type::SizeT.

Referenced by actOnOMPReductionKindClause(), buildMemcpyForAssignmentOp(), buildSingleCopyAssignRecursively(), BuiltinTriviallyRelocate(), checkArraySize(), clang::checkOpenCLEnqueueLocalSizeArgs(), CheckOperatorNewDeclaration(), CheckOperatorNewDeleteTypes(), checkTupleLikeDecomposition(), DeduceFromInitializerList(), DeduceTemplateArgumentsByTypeMatch(), diagnoseListInit(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), clang::CIRGen::CIRGenFunction::emitCXXNewExpr(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitStructSetterCall(), EvaluateAsStringImpl(), clang::CallExpr::evaluateBytesReturnedByAllocSizeCall(), EvaluateSizeTTypeTrait(), clang::analyze_scanf::ScanfSpecifier::getArgType(), clang::Sema::GetDecompositionElementCount(), getIndex(), getPointerAndSize(), getTupleLikeElementType(), clang::ento::SymbolExtent::getType(), libc_func_matchers::hasUnsafeFormatOrSArg(), isNonPlacementDeallocationFunction(), isStandardRealloc(), clang::FunctionDecl::isUsableAsGlobalAllocationFunctionInConstantEvaluation(), matchesStlAllocatorFn(), clang::InitializationSequence::Perform(), TryInitializerListConstruction(), and TryListConversion().

◆ getSourceManager() [1/2]

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

Definition at line 798 of file ASTContext.h.

Referenced by clang::CodeGen::CodeGenModule::AddDeferredUnusedCoverageMapping(), clang::StmtSequence::contains(), createDataFixit(), createOverloadsForFixedParams(), clang::tooling::createRenameAtomicChanges(), createSpanTypeForVarDecl(), disambiguateSpellingInScope(), clang::Decl::dump(), clang::LocationContext::dumpStack(), clang::CodeGen::CodeGenModule::EmitAnnotationLineNo(), clang::CodeGen::CodeGenModule::EmitAnnotationUnit(), emitBody(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), emitMappingInformation(), emitTargetTeamsLoopCodegenStatus(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::SourceLocExpr::EvaluateInContext(), fixLocalVarDeclWithSpan(), fixParamWithSpan(), fixUPCAddressofArraySubscriptWithSpan(), fixVarDeclWithArray(), FixVarInitializerWithSpan(), GenerateFixForUnusedDecl(), getAsmSrcLocInfo(), getEnclosingStmtLocation(), getEntryInfoFromPresumedLoc(), getFixIts(), DerefSimplePtrArithFixableGadget::getFixits(), UPCPreIncrementGadget::getFixits(), UUCAddAssignGadget::getFixits(), clang::AnalysisDeclContext::getFunctionName(), getGlobalStreamPointerByName(), getIdentStringFromSourceLocation(), getLiteralInfo(), clang::CIRGen::CIRGenFunction::getLoc(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::ento::AnalysisManager::getSourceManager(), clang::Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(), isForbiddenTypeAllowed(), clang::ento::AnalysisManager::isInCodeFile(), isStandardDelete(), isStandardNew(), makeLocation(), clang::LocationContext::printJson(), clang::CodeGen::CodeGenModule::printPostfixForExternalizedDecl(), and timeTraceMetadata().

◆ getSourceManager() [2/2]

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

Definition at line 799 of file ASTContext.h.

◆ getStaticLocalNumber()

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

Definition at line 13363 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 13461 of file ASTContext.cpp.

References adjustStringLiteralBaseType(), clang::CPlusPlus, getConstantArrayType(), getLangOpts(), clang::Normal, and clang::QualType::withConst().

Referenced by getPredefinedStringLiteralFromCache().

◆ getSubstBuiltinTemplatePack()

◆ getSubstTemplateTemplateParm()

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

◆ getSubstTemplateTemplateParmPack()

◆ getSubstTemplateTypeParmPackType()

◆ getSubstTemplateTypeParmType()

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

Retrieve a substitution-result type.

Definition at line 5809 of file ASTContext.cpp.

References Allocate().

Referenced by getCommonSugarTypeNode().

◆ 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 15062 of file ASTContext.cpp.

References getCanonicalType(), SYCLKernels, and clang::T.

Referenced by clang::SemaSYCL::BuildSYCLKernelCallStmt().

◆ getTagType()

◆ getTargetAddressSpace()

◆ 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.

References clang::TargetInfo::getDefaultAlignForAttributeAligned(), and getTargetInfo().

◆ getTargetInfo()

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

Definition at line 856 of file ASTContext.h.

Referenced by clang::SemaHLSL::ActOnTopLevelFunction(), clang::CodeGen::CodeGenTypes::arrangeObjCMessageSendSignature(), AtomicUsesUnsupportedLibcall(), clang::Sema::BuildBitIntType(), canBuiltinBeRedeclared(), canPassInRegisters(), clang::ento::SMTConstraintManager::canReasonAbout(), captureInLambda(), ChangeIntegralSignedness(), CheckBuiltinTargetInSupported(), CheckBuiltinTargetNotInUnsupported(), CheckDeclarationCausesMultiVersioning(), checkDLLAttributeRedeclaration(), clang::SemaHLSL::CheckEntryPoint(), CheckFormatString(), checkForMultipleExportedDefaultConstructors(), checkInheritableAttr(), CheckMultiVersionAdditionalDecl(), CheckMultiVersionAdditionalRules(), CheckMultiVersionFunction(), CheckMultiVersionValue(), checkObjCMethodX86VectorTypes(), clang::interp::CheckPointerToIntegralCast(), checkVAStartABI(), clang::analyze_os_log::computeOSLogBufferLayout(), ConvertDeclSpecToType(), clang::AvailabilityInfo::createFromDecl(), DeclMustBeEmitted(), DetectPrecisionLossInComplexDivision(), DiagnoseObjCImplementedDeprecations(), clang::Sema::diagnoseUnavailableAlignedAllocation(), clang::interp::DoBitCast(), clang::interp::DoBitCastPtr(), DoEmitAvailabilityWarning(), DumpRecordLayout(), clang::CodeGen::CodeGenFunction::EmitAArch64MultiVersionResolver(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CIRGen::CIRGenFunction::emitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitMultiVersionResolver(), clang::CodeGen::CodeGenFunction::EmitRISCVMultiVersionResolver(), clang::CodeGen::CodeGenFunction::EmitX86MultiVersionResolver(), clang::SourceLocExpr::EvaluateInContext(), clang::HLSLFrontendAction::ExecuteAction(), clang::DeclSpec::Finish(), clang::analyze_printf::PrintfSpecifier::fixType(), clang::analyze_scanf::ScanfSpecifier::fixType(), funcHasParameterSizeMangling(), clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString(), clang::ASTNameGenerator::Implementation::getAllManglings(), clang::analyze_scanf::ScanfSpecifier::getArgType(), getASTRecordLayout(), getCCForDeclaratorChunk(), getCreateFlagValue(), getCurrentKeyFunction(), getCXXABIKind(), getDeclAlign(), getDefaultCallingConvention(), getFixedPointIBits(), getFixedPointScale(), getFixedPointSemantics(), GetFullTypeForDeclarator(), getInstrProfSection(), getIntTypeForBitwidth(), getLangASForBuiltinAddressSpace(), clang::CodeGen::swiftcall::getMaximumVoluntaryIntegerSize(), getMinGlobalAlignOfVar(), getOpenMPDefaultSimdAlign(), getRealTypeForBitwidth(), getTargetAddressSpace(), getTargetDefaultAlignForAttributeAligned(), getTargetNullPointerValue(), getTypeInfoLinkage(), handleAliasAttr(), HandleArmSveVectorBitsTypeAttr(), handleAvailabilityAttr(), handleBuiltinAliasAttr(), handleCodeModelAttr(), handleCPUSpecificAttr(), handleDeclspecThreadAttr(), handleDeviceKernelAttr(), handleDLLAttr(), clang::SemaARM::handleInterruptAttr(), handleInterruptAttr(), handleMSPointerTypeQualifierAttr(), handleNakedAttr(), HandleNeonVectorTypeAttr(), clang::SemaHLSL::handleNumThreadsAttr(), handlePackedAttr(), handlePatchableFunctionEntryAttr(), HandleRISCVRVVVectorBitsTypeAttr(), handleTargetClonesAttr(), handleTargetVersionAttr(), handleVisibilityAttr(), handleWeakImportAttr(), hasNewExtendedAlignment(), libc_func_matchers::hasUnsafeFormatOrSArg(), higherPrecisionElementTypeForComplexArithmetic(), InitDeviceMC(), clang::CodeGen::initializationPatternFor(), clang::interp::interp__builtin_atomic_lock_free(), clang::interp::interp__builtin_c11_atomic_is_lock_free(), clang::interp::interp__builtin_eh_return_data_regno(), clang::interp::interp__builtin_memcmp(), clang::interp::interp__builtin_nan(), isArc4RandomAvailable(), isDefaultStdCall(), clang::installapi::isInlined(), clang::CodeGen::swiftcall::isLegalIntegerType(), isMSStaticDataMemberInlineDefinition(), clang::FunctionDecl::isMSVCRTEntryPoint(), isNonViableMultiVersionOverload(), isPermittedNeonBaseType(), isStdBuiltin(), clang::Qualifiers::isTargetAddressSpaceSupersetOf(), isVarDeclStrongDefinition(), IsVectorConversion(), clang::FieldDecl::isZeroSize(), clang::MangleContext::mangleName(), MarkBaseDestructorsReferenced(), clang::SemaHLSL::mergeVkConstantIdAttr(), MultiVersionTypesCompatible(), needsConversionOfHalfVec(), parseModeAttrArg(), patchDefaultTargetVersion(), ProcessDeclAttribute(), ProcessStmtAttribute(), clang::interp::readPointerToBuffer(), ReferenceDllExportedMembers(), repeatForLambdaConversionFunctionCallingConvs(), ShouldDiagnoseAvailabilityInContext(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::TargetOMPContext::TargetOMPContext(), and clang::QualType::UseExcessPrecision().

◆ getTargetNullPointerValue()

uint64_t ASTContext::getTargetNullPointerValue ( QualType QT) const

◆ getTemplateOrSpecializationInfo()

◆ 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 13521 of file ASTContext.cpp.

References New, clang::TemplateParamObjectDecl::Profile(), clang::T, and V.

Referenced by getAsSimpleValueDeclRef().

◆ getTemplateSpecializationType() [1/2]

◆ getTemplateSpecializationType() [2/2]

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

Definition at line 5974 of file ASTContext.cpp.

References getTemplateSpecializationType(), clang::Keyword, and clang::Template.

◆ 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

◆ 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 5903 of file ASTContext.cpp.

References getTemplateTypeParmType().

Referenced by getCommonNonSugarTypeNode(), and getTemplateTypeParmType().

◆ getTranslationUnitDecl()

◆ getTraversalScope()

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

Definition at line 783 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.

References ASTContext(), CreateTypeSourceInfo(), clang::TypeSourceInfo::getTypeLoc(), clang::TypeLoc::initialize(), and clang::T.

Referenced by clang::SemaOpenMP::ActOnOpenMPDeclareMapperDirectiveVarDecl(), clang::SemaSYCL::ActOnUniqueStableNameExpr(), addBlockPointerConversion(), addFunctionPointerConversion(), clang::hlsl::BuiltinTypeDeclBuilder::addHandleMember(), clang::hlsl::BuiltinTypeDeclBuilder::addMemberVariable(), adjustObjCTypeParamBoundType(), buildDistanceFunc(), BuildExpressionFromIntegralTemplateArgumentValue(), BuildImplicitBaseInitializer(), buildImplicitTypedef(), buildPostUpdate(), buildSingleCopyAssignRecursively(), BuildStdClassTemplate(), buildVarDecl(), buildVarDecl(), builtinCommonTypeImpl(), CastForMoving(), castForMoving(), checkBuiltinTemplateIdType(), CheckDeducedPlaceholderConstraints(), checkOpenMPLoop(), createFieldForHostLayoutStruct(), createHostLayoutStruct(), clang::CStyleCastPtrExpr(), clang::hlsl::BuiltinTypeMethodBuilder::declareLocalVar(), emitOutlinedFunctionPrologue(), getCanonicalTemplateTemplateParmDecl(), getDummyLambdaType(), getTypeSourceInfoForStdAlignValT(), handlePreferredName(), clang::ASTImporter::Import(), clang::TypeOfTypeLoc::initializeLocal(), clang::UnaryTransformTypeLoc::initializeLocal(), lookupCoroutineHandleType(), lookupPromiseType(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), ProcessAPINotes(), RebuildDeclaratorInCurrentInstantiation(), and translateTemplateArgument().

◆ getTypeAlign() [1/2]

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

Definition at line 2648 of file ASTContext.h.

References clang::TypeInfo::Align, getTypeInfo(), and clang::T.

◆ getTypeAlign() [2/2]

◆ 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.

References getBaseElementType(), getPreferredTypeAlign(), getTypeAlign(), and clang::T.

Referenced by hasNewExtendedAlignment(), and isVarDeclStrongDefinition().

◆ getTypeAlignInChars() [1/2]

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

Definition at line 2662 of file ASTContext.cpp.

References getTypeAlign(), clang::T, and toCharUnitsFromBits().

◆ getTypeAlignInChars() [2/2]

◆ 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 5268 of file ASTContext.cpp.

References getCanonicalTagType(), getCanonicalUnresolvedUsingType(), getTypedefType(), and clang::None.

◆ 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]

◆ getTypedefNameForUnnamedTagDecl()

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

Definition at line 13437 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 5285 of file ASTContext.cpp.

References Allocate(), hasSameType(), clang::QualType::isNull(), clang::Keyword, NestedNameSpecifier, clang::None, and clang::TypedefType::Profile().

Referenced by CheckExtVectorComponent(), getBOOLType(), getBuiltinMSVaListType(), getBuiltinVaListType(), getCFConstantStringType(), getCommonSugarTypeNode(), clang::TypeName::getFullyQualifiedType(), getObjCClassType(), getObjCIdType(), getObjCInstanceType(), getObjCSelType(), getOpenCLTypedefType(), getRawCFConstantStringType(), getTypeDeclType(), getTypeDeclType(), handleFormatArgAttr(), and clang::RetainTypeChecker::visitTypedef().

◆ 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.

References clang::T.

Referenced by getPreferredTypeAlign(), getTypeAlign(), getTypeAlign(), getTypeAlignIfRequired(), getTypeInfoInChars(), getTypeSize(), getTypeSize(), and isAlignmentRequired().

◆ getTypeInfo() [2/2]

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

Definition at line 2610 of file ASTContext.h.

References getTypeInfo(), and clang::T.

Referenced by getTypeInfo().

◆ getTypeInfoDataSizeInChars()

◆ getTypeInfoInChars() [1/2]

◆ getTypeInfoInChars() [2/2]

TypeInfoChars ASTContext::getTypeInfoInChars ( QualType T) const

Definition at line 1974 of file ASTContext.cpp.

References getTypeInfoInChars(), and clang::T.

◆ 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 6586 of file ASTContext.cpp.

References getCanonicalType(), clang::Expr::getType(), clang::Expr::isTypeDependent(), clang::DependentTypeOfExprType::Profile(), and clang::Unqualified.

◆ 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 6622 of file ASTContext.cpp.

References getCanonicalType().

Referenced by getCommonSugarTypeNode().

◆ getTypes()

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

Definition at line 1360 of file ASTContext.h.

◆ getTypeSize() [1/2]

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

Definition at line 2617 of file ASTContext.h.

References getTypeInfo(), clang::T, and clang::TypeInfo::Width.

◆ getTypeSize() [2/2]

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

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

Definition at line 2616 of file ASTContext.h.

References getTypeInfo(), clang::T, and clang::TypeInfo::Width.

Referenced by areCompatibleRVVTypes(), areLaxCompatibleRVVTypes(), assertEqualBitWidths(), buildMemcpyForAssignmentOp(), buildSingleCopyAssignRecursively(), calculateOffset(), canConvertIntTyToFloatTy(), canElideOverflowCheck(), canPassInRegisters(), ChangeIntegralSignedness(), checkAPINotesReplacementType(), checkAVXParam(), CheckBitcastType(), CheckC23ConstexprInitStringLiteral(), clang::CheckInvalidVLENandLMUL(), checkSizelessVectorShift(), checkVectorResult(), checkVectorShift(), CompareStandardConversionSequences(), DeduceTemplateArgumentsByTypeMatch(), DiagnoseBadShiftValues(), DiagnoseDivisionSizeofPointerOrArray(), DiagnoseForRangeConstVariableCopies(), diagnoseListInit(), clang::ento::SMTConv::doFloatTypeConversion(), clang::ento::SMTConv::doIntTypeConversion(), clang::ento::SMTConv::doTypeConversion(), clang::CodeGen::CodeGenFunction::EmitAsmStmt(), EmitAsmStores(), EmitBinaryAtomicPost(), clang::CodeGen::CodeGenFunction::EmitCheckTypeDescriptor(), emitDispatchForLoopBounds(), clang::CodeGen::CodeGenFunction::EmitOMPDistributeLoop(), clang::CodeGen::CodeGenFunction::EmitOMPWorksharingLoop(), emitReplacement(), EmitX86BitTestIntrinsic(), enumerateData(), EvaluateAsStringImpl(), clang::CallExpr::evaluateBytesReturnedByAllocSizeCall(), EvaluateComparisonBinaryOperator(), expandStringLiteral(), extractStringLiteralCharacter(), clang::ento::SMTConv::fixAPSInt(), clang::ento::SMTConv::fromData(), getAlignOfGlobalVar(), clang::ento::SMTConv::getAPSIntType(), clang::ento::SMTConv::getCastExpr(), GetCFNumberSize(), getCharWidth(), getDeclAlign(), clang::Sema::GetDecompositionElementCount(), getEnumInfo(), getFieldSize(), getFixedPointSemantics(), getIntWidth(), getPreferredTypeAlign(), getPromotedIntegerType(), getRangeForType(), getScalableVectorType(), clang::ento::SMTConv::getSymExpr(), clang::ento::SMTConstraintManager::getSymVal(), getUnwidenedIntegerType(), clang::ento::SMTConv::getZeroExpr(), HandleArmSveVectorBitsTypeAttr(), HandleNeonVectorTypeAttr(), clang::SemaHLSL::handlePackOffsetAttr(), HandleRISCVRVVVectorBitsTypeAttr(), handleTransparentUnionAttr(), hasUniqueObjectRepresentations(), libc_func_matchers::hasUnsafeFormatOrSArg(), clang::Expr::IgnoreParenNoopCasts(), clang::interp::interp__builtin_memcmp(), clang::interp::interp__builtin_overflowop(), clang::CodeGen::ABIInfo::isHomogeneousAggregate(), isPromotableBitField(), clang::Type::isSignableIntegerType(), isZeroSized(), lowerArrayDtorCtorIntoLoop(), MakeAtomicCmpXchgValue(), MakeBinaryAtomicValue(), clang::MangleContext::mangleName(), OpenCLConvertScalarsToVectors(), clang::interp::pushInteger(), RecoverCastedSymbol(), rewriteToNumericBoxedExpression(), tryGCCVectorConvertAndSplat(), TryInitializerListConstruction(), and TryListConversion().

◆ getTypeSizeInChars() [1/2]

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

Definition at line 2653 of file ASTContext.cpp.

References getTypeInfoInChars(), clang::T, and clang::TypeInfoChars::Width.

◆ 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.

Definition at line 2650 of file ASTContext.cpp.

References getTypeInfoInChars(), clang::T, and clang::TypeInfoChars::Width.

Referenced by AtomicUsesUnsupportedLibcall(), buildMemcpyForAssignmentOp(), castValueToType(), CheckAtomicAlignment(), clang::SemaHLSL::CheckBuiltinFunctionCall(), clang::interp::computeFullDescSize(), computeOffset(), clang::interp::computePointerOffset(), clang::interp::DoBitCastPtr(), EmitArrayDelete(), clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(), emitArraySubscriptGEP(), emitArraySubscriptPtr(), EmitCXXNewAllocSize(), emitCXXNewAllocSize(), EmitDeclInvariant(), clang::CodeGen::CodeGenFunction::EmitDeleteCall(), EmitISOVolatileLoad(), EmitISOVolatileStore(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), emitNonZeroVLAInit(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), clang::CIRGen::CIRGenFunction::emitNullInitialization(), clang::CodeGen::CodeGenFunction::EmitOMPAggregateAssign(), EmitOMPAggregateInit(), EmitOMPAggregateReduction(), emitPointerArithmetic(), emitStructGetterCall(), emitStructSetterCall(), encodeTypeForFunctionPointerAuth(), EvaluateComparisonBinaryOperator(), getAlignmentAndOffsetFromBinAddOrSub(), getDerivedSymbolForBinding(), getExceedsMsgs(), clang::VarDecl::getFlexibleArrayInitChars(), getIndex(), clang::CodeGen::CodeGenModule::getMinimumObjectSize(), GetNumNonZeroBytesInInit(), getObjCEncodingForBlock(), getObjCEncodingForMethodDecl(), getObjCEncodingTypeSize(), clang::CodeGen::AggValueSlot::getPreferredSize(), getTypeSizeInCharsIfKnown(), HandleSizeof(), clang::interp::interp__builtin_memcmp(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_operator_new(), clang::interp::interp__builtin_strlen(), clang::interp::InterpretOffsetOf(), isOnePastTheEndOfCompleteObject(), clang::SemaOpenMP::isOpenMPCapturedByRef(), isSafeSpanTwoParamConstruct(), clang::interp::Pointer::toAPValue(), tryToInvalidateFReadBufferByElements(), clang::Value::Value(), and clang::interp::Compiler< Emitter >::VisitUnaryExprOrTypeTraitExpr().

◆ getTypeSizeInCharsIfKnown() [1/2]

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

Definition at line 2641 of file ASTContext.h.

References getTypeSizeInCharsIfKnown().

◆ getTypeSizeInCharsIfKnown() [2/2]

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

◆ getTypeUnadjustedAlign() [1/2]

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

◆ 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 2655 of file ASTContext.h.

References getTypeUnadjustedAlign(), and clang::T.

Referenced by getTypeUnadjustedAlign(), getTypeUnadjustedAlignInChars(), and getTypeUnadjustedAlignInChars().

◆ getTypeUnadjustedAlignInChars() [1/2]

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

Definition at line 2672 of file ASTContext.cpp.

References getTypeUnadjustedAlign(), clang::T, and toCharUnitsFromBits().

◆ 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.

References getTypeUnadjustedAlign(), clang::T, and toCharUnitsFromBits().

◆ getucontext_tType()

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

Retrieve the C ucontext_t type.

Definition at line 2252 of file ASTContext.h.

References getTypeDeclType(), and clang::None.

◆ getUInt128Decl()

TypedefDecl * ASTContext::getUInt128Decl ( ) const

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

Definition at line 1264 of file ASTContext.cpp.

References buildImplicitTypedef(), and UnsignedInt128Ty.

◆ 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 6984 of file ASTContext.cpp.

Referenced by clang::analyze_scanf::ScanfSpecifier::getArgType().

◆ getUIntPtrType()

◆ 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 6727 of file ASTContext.cpp.

References clang::QualType::getCanonicalType(), getUnaryTransformType(), clang::QualType::isCanonical(), and clang::QualType::isNull().

Referenced by getCommonNonSugarTypeNode(), getCommonSugarTypeNode(), and getUnaryTransformType().

◆ 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 6834 of file ASTContext.cpp.

References clang::Type::getAs(), getAutoType(), clang::Type::getContainedAutoType(), getQualifiedType(), clang::Type::isDependentType(), and clang::T.

Referenced by getCanonicalTemplateTemplateParmDecl(), and MatchTemplateParameterKind().

◆ 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 13504 of file ASTContext.cpp.

References New, and clang::UnnamedGlobalConstantDecl::Profile().

Referenced by clang::SourceLocExpr::EvaluateInContext().

◆ getUnqualifiedArrayType() [1/2]

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

Definition at line 2882 of file ASTContext.h.

References getUnqualifiedArrayType(), and clang::T.

◆ 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 7040 of file ASTContext.cpp.

References clang::Qualifiers::addConsistentQualifiers(), clang::cast(), clang::Qualifiers::empty(), getConstantArrayType(), getDependentSizedArrayType(), getIncompleteArrayType(), getUnqualifiedArrayType(), clang::Type::getUnqualifiedDesugaredType(), getVariableArrayType(), clang::SplitQualType::Quals, clang::SplitQualType::Ty, and clang::ast_matchers::type.

Referenced by CheckDeductionConsistency(), CompareQualificationConversions(), CompareStandardConversionSequences(), DeduceTemplateArgumentsByTypeMatch(), getUnqualifiedArrayType(), getUnqualifiedArrayType(), hasCvrSimilarType(), hasSimilarType(), isSubstitutedType(), removeAddrSpaceQualType(), TryReferenceInitialization(), TryReferenceListInitialization(), and withoutUnaligned().

◆ getUnqualifiedObjCPointerType()

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

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

Definition at line 2468 of file ASTContext.h.

References getQualifiedType(), clang::Qualifiers::removeObjCLifetime(), and clang::ast_matchers::type.

Referenced by clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVar(), and clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplate().

◆ getUnresolvedUsingType()

◆ 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 6974 of file ASTContext.cpp.

References clang::Default.

Referenced by clang::SemaOpenMP::ActOnOpenMPCanonicalLoop(), and clang::analyze_scanf::ScanfSpecifier::getArgType().

◆ 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 6997 of file ASTContext.cpp.

References UnsignedIntTy.

Referenced by getCorrespondingUnsignedType().

◆ getUsingType()

◆ 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 10306 of file ASTContext.cpp.

References getBuiltinVaListDecl(), and VaListTagDecl.

Referenced by clang::ASTImporterLookupTable::ASTImporterLookupTable(), and isImportedDeclContext().

◆ 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.

References clang::cast(), getAtomicType(), getConstantArrayType(), getDependentSizedArrayType(), getLValueReferenceType(), getPointeeType(), getPointerType(), getQualifiedType(), getRValueReferenceType(), clang::Type::getTypeClass(), getVariableArrayDecayedType(), getVariableArrayType(), clang::Normal, clang::SplitQualType::Quals, clang::Star, clang::SplitQualType::Ty, and clang::ast_matchers::type.

Referenced by getCanonicalParamType(), getExceptionObjectType(), getSignatureParameterType(), and getVariableArrayDecayedType().

◆ 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 4388 of file ASTContext.cpp.

References getCanonicalType(), getQualifiedType(), getVariableArrayType(), clang::QualType::hasLocalQualifiers(), clang::QualType::isCanonical(), New, clang::SplitQualType::Quals, clang::CanQual< T >::split(), and clang::SplitQualType::Ty.

Referenced by actOnOMPReductionKindClause(), getAsArrayType(), getUnqualifiedArrayType(), getVariableArrayDecayedType(), and getVariableArrayType().

◆ 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 4643 of file ASTContext.cpp.

References clang::Type::castAs(), getCanonicalType(), clang::BitIntType::getNumBits(), getVectorType(), clang::Type::isBitIntType(), clang::Type::isBuiltinType(), clang::QualType::isCanonical(), New, and clang::VectorType::Profile().

Referenced by convertVector(), getCommonNonSugarTypeNode(), getCorrespondingSignedType(), getCorrespondingUnsignedType(), getVectorType(), HandleArmSveVectorBitsTypeAttr(), HandleNeonVectorTypeAttr(), HandleRISCVRVVVectorBitsTypeAttr(), and clang::CodeGen::ABIInfo::isHomogeneousAggregate().

◆ 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 1447 of file ASTContext.h.

References clang::T, and clang::Qualifiers::Volatile.

Referenced by AddBuiltinAssignmentOperatorCandidates(), and makeQualifiedLValueReferenceType().

◆ getVTableContext()

◆ 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 2046 of file ASTContext.h.

References WCharTy.

Referenced by clang::interp::interp__builtin_memcmp(), clang::interp::interp__builtin_memcpy(), and clang::interp::interp__builtin_strlen().

◆ 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 4572 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 2051 of file ASTContext.h.

References WideCharTy.

Referenced by clang::analyze_scanf::ScanfSpecifier::getArgType().

◆ 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 2065 of file ASTContext.h.

References WIntTy.

◆ getWritePipeType()

QualType ASTContext::getWritePipeType ( QualType T) const

Return a write_only pipe type for the specified type.

Definition at line 5172 of file ASTContext.cpp.

References clang::T.

Referenced by HandleOpenCLAccessAttr().

◆ getXRayFilter()

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

Definition at line 906 of file ASTContext.h.

Referenced by clang::CodeGen::CodeGenModule::imbueXRayAttrs().

◆ hasAnyFunctionEffects()

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

Definition at line 3146 of file ASTContext.h.

Referenced by clang::CodeGen::CodeGenFunction::StartFunction().

◆ hasCvrSimilarType()

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

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

Definition at line 7204 of file ASTContext.cpp.

References getUnqualifiedArrayType(), hasSameType(), clang::Qualifiers::removeCVRQualifiers(), and UnwrapSimilarTypes().

◆ 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 10716 of file ASTContext.cpp.

References Paren.

Referenced by captureInBlock(), and handleObjCOwnershipTypeAttr().

◆ hasSameExpr()

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

Determine whether the given expressions X and Y are equivalent.

Definition at line 13604 of file ASTContext.cpp.

References clang::Stmt::Profile(), and X.

Referenced by getCommonNonSugarTypeNode(), getCommonSizeExpr(), and getCommonSugarTypeNode().

◆ 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.

References clang::EST_None, getFunctionTypeWithExceptionSpec(), getLangOpts(), hasSameType(), and clang::T.

Referenced by isSameEntity().

◆ 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.

References getFunctionTypeWithoutParamABIs(), hasSameType(), and clang::T.

◆ 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.

References getFunctionTypeWithoutPtrSizes(), hasSameType(), and clang::T.

◆ hasSameNullabilityTypeQualifier()

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

◆ 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 7391 of file ASTContext.cpp.

References getCanonicalTemplateName(), and X.

Referenced by DeduceTemplateArguments(), and isSameDefaultTemplateArgument().

◆ hasSameType() [1/2]

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

Definition at line 2861 of file ASTContext.h.

References getCanonicalType().

◆ 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 2858 of file ASTContext.h.

References getCanonicalType().

Referenced by adjustBlockReturnsToEnum(), areCompatibleRVVTypes(), areCompatibleVectorTypes(), buildCounterInit(), buildCounterUpdate(), buildDeclareReductionRef(), buildUserDefinedMapperRef(), builtinCommonTypeImpl(), BuiltinInvoke(), BuiltinMaskedLoad(), BuiltinMaskedStore(), castToBase(), checkConditionalPointerCompatibility(), CheckDeductionConsistency(), checkLiteralOperatorTemplateParameterList(), checkOpenMPLoop(), clang::checkPipePacketType(), checkTypeParamListConsistency(), CheckUnicodeArithmeticConversions(), CompareDerivedToBaseConversions(), CompareStandardConversionSequences(), clang::ConvertQualTypeToKind(), DeduceTemplateArgumentsByTypeMatch(), DiagnoseBadDeduction(), diagnoseVarDeclTypeMismatch(), clang::CodeGen::CodeGenFunction::EmitBuiltinNewDeleteCall(), filterNonConflictingPreviousTypedefDecls(), findDecomposableBaseClass(), forEachMultiversionedFunctionVersion(), getCommonSugaredType(), getCommonSugarTypeNode(), getCommonTemplateArgument(), getFixedEnumPromtion(), getTypedefType(), getUsingType(), handleVecTypeHint(), hasCvrSimilarType(), hasSameFunctionTypeIgnoringExceptionSpec(), hasSameFunctionTypeIgnoringParamABI(), hasSameFunctionTypeIgnoringPtrSizes(), hasSimilarType(), hasUserDefinedMapper(), isGRealloc(), clang::sema::isNormalAssignmentOperator(), IsOverloadOrOverrideImpl(), isRelevantAttr(), isSameDefaultTemplateArgument(), isSameEntity(), isSameTemplateArgument(), isStandardRealloc(), isSubstitutedType(), clang::FunctionDecl::isUsableAsGlobalAllocationFunctionInConstantEvaluation(), isValidInteropVariable(), loadToBegin(), matchesStlAllocatorFn(), MatchTemplateParameterKind(), ObjCMethodsAreEqual(), clang::InitializationSequence::Perform(), rewriteToNumberLiteral(), sameFunctionParameterTypeLists(), sameObjCTypeArgs(), TryConstructorInitialization(), TryReferenceInitializationCore(), TryRefInitWithConversionFunction(), TryUserDefinedConversion(), and typesAreCompatible().

◆ hasSameUnqualifiedType()

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

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

Definition at line 2889 of file ASTContext.h.

References getCanonicalType(), and clang::CanQual< T >::getTypePtr().

Referenced by AddSuperSendCompletion(), AnalyzeComparison(), areCompatibleVectorTypes(), CheckAllArgsHaveSameType(), clang::CheckAllArgsHaveSameType(), CheckArgTypeMatches(), checkArithmeticOrEnumeralThreeWayCompare(), CheckBoolSelect(), checkBuiltinVectorMathArgTypes(), checkBuiltinVectorMathMixedEnums(), checkEnumTypesInSwitchStmt(), CheckMethodOverrideParam(), CheckMethodOverrideReturn(), CheckMoveOnConstruction(), CheckScalarOrVector(), CheckTautologicalComparison(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentPointerToMember(), CheckVectorSelect(), CheckWaveActive(), CompareDerivedToBaseConversions(), CompareImplicitConversionSequences(), CopyObject(), createObjCPropertyGetter(), DeduceTemplateArgumentsByTypeMatch(), diagnoseArithmeticOnTwoFunctionPointers(), DiagnoseDivisionSizeofPointerOrArray(), doRewriteToUTF8StringBoxedExpressionHelper(), EmitAtomicCmpXchgForMSIntrin(), EmitBinaryAtomicPost(), EvaluateBuiltinStrLen(), clang::hlsl::BuiltinTypeMethodBuilder::finalize(), FindBaseInitializer(), FunctionsCorrespond(), getCommonSugaredType(), getExistingLazyBinding(), getParamType(), clang::CastExpr::getTargetFieldForToUnionCast(), HandleConstructorCall(), HandleVirtualDispatch(), hasCopyOrMoveCtorParam(), HasNonDeletedDefaultedEqualityComparison(), clang::Expr::IgnoreParenNoopCasts(), clang::InitializationSequence::InitializeFrom(), clang::interp::interp__builtin_elementwise_countzeroes(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_strcmp(), isAllowableExplicitConversion(), isNonPlacementDeallocationFunction(), isNullPointerValueTemplateArgument(), IsStandardConversion(), IsUserDefinedConversion(), IsVectorConversion(), IsVectorElementConversion(), LookupMemberExpr(), MakeBinaryAtomicValue(), clang::OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed(), ShouldDiagnoseSwitchCaseNotInEnum(), TryConstructorInitialization(), TryImplicitConversion(), TryListConversion(), TryListInitialization(), and TryUserDefinedConversion().

◆ hasSeenTypeAwareOperatorNewOrDelete()

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

Definition at line 3432 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 7192 of file ASTContext.cpp.

References getUnqualifiedArrayType(), hasSameType(), and UnwrapSimilarTypes().

Referenced by clang::interp::CheckNewTypeMismatch(), and clang::interp::PtrPtrCast().

◆ hasUniqueObjectRepresentations()

◆ 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.

References AccumTy, clang::DeclContext::addDecl(), ARCUnbridgedCastTy, ArraySectionTy, BFloat16Ty, BoolTy, BoundMemberTy, buildImplicitRecord(), BuiltinFnTy, Char16Ty, Char32Ty, Char8Ty, CharTy, DependentTy, DoubleTy, Float128Ty, Float16Ty, FloatTy, FractTy, getCanonicalType(), getPointerType(), getQualifiedType(), getTranslationUnitDecl(), HalfTy, Ibm128Ty, IncompleteMatrixIdxTy, Int128Ty, IntTy, isAddrSpaceMapManglingEnabled(), clang::TargetInfo::isTypeSigned(), LongAccumTy, LongDoubleTy, LongFractTy, LongLongTy, LongTy, MSGuidTagDecl, NullPtrTy, ObjCBuiltinBoolTy, ObjCBuiltinClassTy, ObjCBuiltinIdTy, ObjCBuiltinSelTy, OCLClkEventTy, OCLEventTy, OCLQueueTy, OCLReserveIDTy, OCLSamplerTy, OMPArrayShapingTy, OMPIteratorTy, clang::opencl_generic, OverloadTy, PseudoObjectTy, SatAccumTy, SatFractTy, SatLongAccumTy, SatLongFractTy, SatShortAccumTy, SatShortFractTy, SatUnsignedAccumTy, SatUnsignedFractTy, SatUnsignedLongAccumTy, SatUnsignedLongFractTy, SatUnsignedShortAccumTy, SatUnsignedShortFractTy, ShortAccumTy, ShortFractTy, ShortTy, SignedCharTy, UnknownAnyTy, UnresolvedTemplateTy, UnsignedAccumTy, UnsignedCharTy, UnsignedFractTy, UnsignedInt128Ty, UnsignedIntTy, UnsignedLongAccumTy, UnsignedLongFractTy, UnsignedLongLongTy, UnsignedLongTy, UnsignedShortAccumTy, UnsignedShortFractTy, UnsignedShortTy, VaListTagDecl, VoidPtrTy, VoidTy, WCharTy, WideCharTy, and WIntTy.

◆ 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.

References clang::TypeInfo::AlignRequirement, getTypeInfo(), clang::None, and clang::T.

Referenced by isAlignmentRequired(), and isVarDeclStrongDefinition().

◆ isAlignmentRequired() [2/2]

bool ASTContext::isAlignmentRequired ( QualType T) const

Definition at line 2020 of file ASTContext.cpp.

References isAlignmentRequired(), and clang::T.

◆ isDependenceAllowed()

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

Definition at line 897 of file ASTContext.h.

◆ isDestroyingOperatorDelete()

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

◆ 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.

Referenced by CollectEnclosingNamespace(), isImportingModuleUnitFromSameModule(), and isSameEntity().

◆ isMSStaticDataMemberInlineDefinition()

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

◆ isNearlyEmpty()

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

Definition at line 13200 of file ASTContext.cpp.

References CXXRecordDecl.

◆ isObjCClassType()

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

Definition at line 3183 of file ASTContext.h.

References getObjCClassType(), and clang::T.

◆ isObjCIdType()

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

Definition at line 3181 of file ASTContext.h.

References getObjCIdType(), and clang::T.

Referenced by maybeAdjustInterfaceForSubscriptingCheck().

◆ isObjCNSObjectType()

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

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

Definition at line 2596 of file ASTContext.h.

References clang::Type::isObjCNSObjectType().

Referenced by BlockRequiresCopying().

◆ isObjCSelType()

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

Definition at line 3185 of file ASTContext.h.

References getObjCSelType(), and clang::T.

◆ 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 8222 of file ASTContext.cpp.

References clang::CPlusPlus, getLangOpts(), clang::Expr::getSourceBitField(), clang::Expr::getType(), getTypeSize(), IntTy, clang::Type::isBitIntType(), clang::Type::isEnumeralType(), clang::Type::isSignedIntegerType(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and UnsignedIntTy.

◆ isPromotableIntegerType()

bool ASTContext::isPromotableIntegerType ( QualType T) const

◆ 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 5613 of file ASTContext.cpp.

References getIntWidth(), and clang::T.

Referenced by computeEnumBits().

◆ 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 7398 of file ASTContext.cpp.

References clang::AssociatedConstraint::ArgPackSubstIndex, clang::AssociatedConstraint::ConstraintExpr, and isSameConstraintExpr().

Referenced by isSameEntity().

◆ 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 7407 of file ASTContext.cpp.

References clang::Stmt::Profile().

Referenced by isSameAssociatedConstraint(), isSameEntity(), isSameTemplateParameter(), isSameTemplateParameterList(), and isSameTypeConstraint().

◆ 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 7503 of file ASTContext.cpp.

References clang::cast(), clang::TemplateArgument::getAsTemplate(), hasSameTemplateName(), hasSameType(), clang::Expr::IgnoreImpCasts(), isSameTemplateParameter(), clang::Stmt::Profile(), and X.

◆ isSameEntity()

◆ isSameTemplateArgument()

◆ 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 7461 of file ASTContext.cpp.

References clang::cast(), clang::Decl::getKind(), isSameConstraintExpr(), isSameTemplateParameterList(), isSameTypeConstraint(), and X.

Referenced by isSameDefaultTemplateArgument(), and isSameTemplateParameterList().

◆ 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 7491 of file ASTContext.cpp.

References clang::TemplateParameterList::getParam(), clang::TemplateParameterList::getRequiresClause(), isSameConstraintExpr(), isSameTemplateParameter(), clang::TemplateParameterList::size(), and X.

Referenced by FunctionsCorrespond(), isSameEntity(), and isSameTemplateParameter().

◆ isSameTypeConstraint()

◆ isSentinelNullExpr()

◆ isTypeAwareOperatorNewOrDelete()

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

◆ 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.

References clang::QualType::getAsString(), getPrintingPolicy(), and clang::QualType::getUnqualifiedType().

◆ local_imports()

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

Definition at line 1150 of file ASTContext.h.

◆ lookupFieldBitOffset()

◆ MakeIntValue()

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

◆ mayExternalize()

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

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

Definition at line 15088 of file ASTContext.cpp.

References basicGVALinkageForFunction(), basicGVALinkageForVariable(), clang::cast(), clang::Decl::getAttr(), clang::GVA_Internal, clang::Decl::hasAttr(), and clang::isa().

Referenced by shouldExternalize().

◆ 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.

References clang::cast(), getASTMutationListener(), clang::Decl::getCanonicalDecl(), clang::Decl::isUnconditionallyVisible(), and Listener.

◆ mergeExceptionSpecs()

◆ 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 12060 of file ASTContext.cpp.

References clang::FunctionProtoType::getExtParameterInfo(), clang::FunctionProtoType::getExtParameterInfos(), clang::FunctionProtoType::hasExtParameterInfos(), clang::FunctionType::ExtParameterInfo::isNoEscape(), and clang::FunctionType::ExtParameterInfo::withIsNoEscape().

Referenced by mergeFunctionTypes().

◆ 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 11383 of file ASTContext.cpp.

References clang::QualType::isNull(), mergeTransparentUnionType(), mergeTypes(), and clang::Unqualified.

Referenced by mergeFunctionTypes().

◆ mergeFunctionTypes()

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

Definition at line 11402 of file ASTContext.cpp.

References clang::Type::castAs(), clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::FunctionProtoType::ExtProtoInfo::ExtParameterInfos, FloatTy, clang::FunctionProtoType::ExtProtoInfo::FunctionEffects, clang::Type::getAsEnumDecl(), getCanonicalType(), clang::FunctionType::ExtInfo::getCC(), clang::FunctionType::getExtInfo(), clang::FunctionProtoType::getExtProtoInfo(), getFunctionNoProtoType(), getFunctionType(), clang::FunctionType::ExtInfo::getHasRegParm(), clang::FunctionEffectSet::getIntersection(), clang::FunctionType::ExtInfo::getNoCallerSavedRegs(), clang::FunctionType::ExtInfo::getNoCfCheck(), clang::FunctionType::ExtInfo::getNoReturn(), clang::FunctionProtoType::getNumParams(), clang::FunctionProtoType::getParamType(), clang::FunctionProtoType::getParamTypes(), clang::FunctionType::ExtInfo::getProducesResult(), clang::FunctionType::ExtInfo::getRegParm(), clang::FunctionType::getReturnType(), clang::FunctionEffectSet::getUnion(), clang::CanQual< T >::getUnqualifiedType(), clang::QualType::getUnqualifiedType(), clang::FunctionProtoType::hasExceptionSpec(), clang::QualType::hasQualifiers(), clang::QualType::isNull(), isPromotableIntegerType(), clang::FunctionProtoType::isVariadic(), mergeExtParameterInfo(), mergeFunctionParameterTypes(), mergeTypes(), clang::nullptr, clang::Unqualified, and clang::FunctionType::ExtInfo::withNoReturn().

Referenced by clang::SemaOpenMP::ActOnOpenMPCall(), clang::SemaOpenMP::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(), instantiateOMPDeclareVariantAttr(), and mergeTypes().

◆ mergeObjCGCQualifiers()

◆ mergeTagDefinitions()

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

◆ 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 11363 of file ASTContext.cpp.

References clang::RecordDecl::fields(), clang::RecordDecl::getMostRecentDecl(), clang::Decl::hasAttr(), clang::QualType::isNull(), mergeTypes(), clang::T, and clang::Unqualified.

Referenced by mergeFunctionParameterTypes().

◆ mergeTypes()

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

Definition at line 11668 of file ASTContext.cpp.

References areCompatMatrixTypes(), areCompatVectorTypes(), canAssignObjCInterfaces(), canAssignObjCInterfacesInBlockPointer(), clang::Type::castAs(), clang::Qualifiers::getAddressSpace(), clang::Type::getAs(), getAsArrayType(), clang::Type::getAsCanonical(), getAsConstantArrayType(), clang::Qualifiers::getAsOpaqueValue(), getAsVariableArrayType(), getAtomicType(), getBlockPointerType(), getCanonicalType(), getConstantArrayType(), clang::Qualifiers::getCVRQualifiers(), clang::ArrayType::getElementType(), getIncompleteArrayType(), clang::Expr::getIntegerConstantExpr(), getLangOpts(), clang::QualType::getLocalQualifiers(), clang::Qualifiers::getObjCGCAttr(), getObjCGCQualType(), clang::Qualifiers::getObjCLifetime(), clang::ReferenceType::getPointeeType(), getPointeeType(), clang::Qualifiers::getPointerAuth(), getPointerType(), clang::QualType::getQualifiers(), clang::ConstantArrayType::getSize(), clang::ConstantArrayType::getSizeExpr(), clang::VariableArrayType::getSizeExpr(), clang::Type::getTypeClass(), clang::QualType::getTypePtr(), clang::QualType::getUnqualifiedType(), clang::ConstantArrayType::getZExtSize(), clang::Qualifiers::hasUnaligned(), clang::Qualifiers::isAddressSpaceSupersetOf(), clang::Type::isBlockPointerType(), clang::PointerAuthQualifier::isEquivalent(), clang::QualType::isNull(), clang::Type::isObjCIdType(), clang::Type::isObjCObjectPointerType(), isUnsigned(), mergeEnumWithInteger(), mergeFunctionTypes(), mergeTagDefinitions(), mergeTypes(), clang::OpenCL, clang::Qualifiers::removeAddressSpace(), clang::Qualifiers::Strong, clang::Unqualified, and clang::Qualifiers::Weak.

Referenced by checkConditionalPointerCompatibility(), mergeFunctionParameterTypes(), mergeFunctionTypes(), mergeTransparentUnionType(), mergeTypes(), typesAreBlockPointerCompatible(), and typesAreCompatible().

◆ ObjCMethodsAreEqual()

◆ 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 6463 of file ASTContext.cpp.

References clang::ObjCInterfaceDecl::ClassImplementsProtocol(), clang::Type::getAs(), and clang::Type::isObjCQualifiedIdType().

Referenced by CheckObjCBridgeNSCast().

◆ ObjCQualifiedClassTypesAreCompatible()

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

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

Definition at line 10757 of file ASTContext.cpp.

References clang::ast_matchers::match(), ProtocolCompatibleWithProtocol(), and clang::ObjCObjectPointerType::quals().

Referenced by canAssignObjCInterfaces().

◆ ObjCQualifiedIdTypesAreCompatible()

◆ operator=()

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

References ASTContext().

◆ overridden_methods()

◆ overridden_methods_begin()

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

◆ overridden_methods_end()

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

◆ overridden_methods_size()

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

Definition at line 1652 of file ASTContext.cpp.

References clang::Method, and overridden_methods().

Referenced by clang::CXXMethodDecl::size_overridden_methods().

◆ PrintStats()

◆ propertyTypesAreCompatible()

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

Definition at line 11352 of file ASTContext.cpp.

References typesAreCompatible().

Referenced by SelectPropertyForSynthesisFromProtocols().

◆ ProtocolCompatibleWithProtocol()

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

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

Definition at line 10745 of file ASTContext.cpp.

References clang::declaresSameEntity(), ProtocolCompatibleWithProtocol(), and clang::ObjCProtocolDecl::protocols().

Referenced by ObjCQualifiedClassTypesAreCompatible(), ObjCQualifiedIdTypesAreCompatible(), ProtocolCompatibleWithProtocol(), and QIdProtocolsAdoptObjCObjectProtocols().

◆ 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 6482 of file ASTContext.cpp.

References CollectInheritedProtocols(), clang::Type::getAs(), clang::ObjCInterfaceDecl::hasDefinition(), clang::Type::isObjCQualifiedIdType(), and ProtocolCompatibleWithProtocol().

Referenced by CheckObjCBridgeCFCast().

◆ 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 15040 of file ASTContext.cpp.

References BuildSYCLKernelInfo(), clang::declaresSameEntity(), clang::Decl::getAttr(), getCanonicalType(), clang::Decl::isInvalidDecl(), clang::Decl::isTemplated(), and SYCLKernels.

Referenced by clang::SemaSYCL::CheckSYCLEntryPointFunctionDecl().

◆ 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.

References clang::Qualifiers::getFastQualifiers(), getUnqualifiedArrayType(), clang::Qualifiers::hasNonFastQualifiers(), clang::Qualifiers::removeAddressSpace(), clang::QualifierCollector::strip(), and clang::T.

Referenced by DeduceTemplateArgumentsByTypeMatch(), DiagnoseImpCast(), handleMSPointerTypeQualifierAttr(), HandleWebAssemblyFuncrefAttr(), and removePtrSizeAddrSpace().

◆ 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.

References clang::QualType::getAddressSpace(), clang::Type::getPointeeType(), getPointerType(), clang::isPtrSizeAddressSpace(), removeAddrSpaceQualType(), and clang::T.

Referenced by getFunctionTypeWithoutPtrSizes().

◆ ResetObjCLayout()

void ASTContext::ResetObjCLayout ( const ObjCInterfaceDecl * D)

◆ 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 1351 of file ASTContext.h.

References Listener.

Referenced by clang::FrontendAction::BeginSourceFile(), and clang::CompilerInstance::createASTReader().

◆ 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.

References CanThrow(), and clang::Decl::hasAttr().

Referenced by checkEscapingByref().

◆ setBOOLDecl()

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

Save declaration of 'BOOL' typedef.

Definition at line 2365 of file ASTContext.h.

◆ setCFConstantStringType()

void ASTContext::setCFConstantStringType ( QualType T)

Definition at line 8507 of file ASTContext.cpp.

References clang::cast(), and clang::T.

◆ setcudaConfigureCallDecl()

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

Definition at line 1601 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.

References clang::Module::isNamedModule().

Referenced by clang::Sema::ActOnModuleDecl().

◆ 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.

References ExternalSource.

Referenced by clang::FrontendAction::BeginSourceFile(), clang::CompilerInstance::createASTReader(), and clang::IncrementalSyntaxOnlyAction::ExecuteAction().

◆ setFILEDecl()

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

Set the type for the C FILE type.

Definition at line 2210 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.

References clang::VarDecl::isStaticDataMember(), and setTemplateOrSpecializationInfo().

Referenced by clang::VarDecl::setInstantiationOfStaticDataMember().

◆ setInstantiatedFromUnnamedFieldDecl()

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

◆ 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.

References clang::isa().

◆ 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 )

◆ setIsTypeAwareOperatorNewOrDelete()

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

◆ setjmp_bufDecl()

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

Set the type for the C jmp_buf type.

Definition at line 2221 of file ASTContext.h.

◆ setManglingNumber()

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

Definition at line 13328 of file ASTContext.cpp.

References Listener.

◆ 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.

References clang::LazyOffsetPtr< T, OffsT, Get >::get(), getExternalSource(), and clang::Method.

◆ setObjCClassRedefinitionType()

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

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

Definition at line 2144 of file ASTContext.h.

◆ setObjCConstantStringInterface()

void ASTContext::setObjCConstantStringInterface ( ObjCInterfaceDecl * Decl)

Definition at line 10335 of file ASTContext.cpp.

References getObjCInterfaceType().

◆ setObjCIdRedefinitionType()

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

Set the user-written type that redefines id.

Definition at line 2131 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 )

◆ setObjCMethodRedeclaration()

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

Definition at line 3139 of file ASTContext.cpp.

References getObjCMethodRedeclaration().

Referenced by clang::ObjCMethodDecl::setAsRedeclaration().

◆ setObjCNSStringType()

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

Definition at line 2118 of file ASTContext.h.

References clang::T.

◆ setObjCSelRedefinitionType()

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

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

Definition at line 2157 of file ASTContext.h.

◆ setObjCSuperType()

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

Definition at line 2093 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 13450 of file ASTContext.cpp.

◆ setPrimaryMergedDecl()

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

Definition at line 1158 of file ASTContext.h.

◆ setPrintingPolicy()

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

◆ setRelocationInfoForCXXRecord()

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

◆ setsigjmp_bufDecl()

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

Set the type for the C sigjmp_buf type.

Definition at line 2234 of file ASTContext.h.

◆ setStaticLocalNumber()

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

Definition at line 13353 of file ASTContext.cpp.

References Listener.

◆ setTemplateOrSpecializationInfo()

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

◆ setTraversalScope()

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

Definition at line 1004 of file ASTContext.cpp.

References clang::ParentMapContext::clear(), and getParentMapContext().

◆ setucontext_tDecl()

void clang::ASTContext::setucontext_tDecl ( TypeDecl * ucontext_tDecl)
inline

Set the type for the C ucontext_t type.

Definition at line 2247 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 15106 of file ASTContext.cpp.

References clang::cast(), CUDADeviceVarODRUsedByHost, clang::Decl::hasAttr(), and mayExternalize().

Referenced by getMangledNameImpl().

◆ toBits()

◆ toCharUnitsFromBits()

◆ typesAreBlockPointerCompatible()

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

◆ 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 11344 of file ASTContext.cpp.

References clang::CPlusPlus, getLangOpts(), hasSameType(), clang::QualType::isNull(), and mergeTypes().

Referenced by checkObjCPointerTypesForAssignment(), checkPointerTypesForAssignment(), IsStandardConversion(), and propertyTypesAreCompatible().

◆ 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 7099 of file ASTContext.cpp.

References clang::CPlusPlus20, getAsArrayType(), getLangOpts(), and clang::isa().

Referenced by UnwrapSimilarTypes().

◆ 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 7150 of file ASTContext.cpp.

References clang::Type::getAs(), getLangOpts(), clang::ObjCObjectPointerType::getPointeeType(), clang::PointerType::getPointeeType(), clang::Type::getPointeeType(), clang::ObjC, and UnwrapSimilarArrayTypes().

Referenced by hasCvrSimilarType(), and hasSimilarType().

◆ useAbbreviatedThunkName()

◆ ASTDeclReader

friend class ASTDeclReader
friend

Definition at line 516 of file ASTContext.h.

References ASTDeclReader.

Referenced by ASTDeclReader.

◆ ASTReader

friend class ASTReader
friend

Definition at line 517 of file ASTContext.h.

References ASTReader.

Referenced by ASTReader.

◆ ASTWriter

friend class ASTWriter
friend

Definition at line 518 of file ASTContext.h.

References ASTWriter.

Referenced by ASTWriter.

◆ CXXRecordDecl

◆ DeclarationNameTable

friend class DeclarationNameTable
friend

Definition at line 3651 of file ASTContext.h.

References DeclarationNameTable.

Referenced by DeclarationNameTable.

◆ DeclContext

friend class DeclContext
friend

Definition at line 3652 of file ASTContext.h.

References DeclContext.

Referenced by DeclContext, and getManglingNumberContext().

◆ IncrementalParser

friend class IncrementalParser
friend

Definition at line 521 of file ASTContext.h.

References IncrementalParser.

Referenced by IncrementalParser.

◆ NestedNameSpecifier

◆ serialization::AbstractTypeReader

template<class>
friend class serialization::AbstractTypeReader
friend

Definition at line 519 of file ASTContext.h.

Member Data Documentation

◆ AccumTy

◆ ARCUnbridgedCastTy

CanQualType clang::ASTContext::ARCUnbridgedCastTy

Definition at line 1250 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ ArraySectionTy

CanQualType clang::ASTContext::ArraySectionTy

Definition at line 1259 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ AutoDeductTy

QualType clang::ASTContext::AutoDeductTy
mutable

Definition at line 1282 of file ASTContext.h.

Referenced by getAutoDeductType().

◆ AutoRRefDeductTy

QualType clang::ASTContext::AutoRRefDeductTy
mutable

Definition at line 1283 of file ASTContext.h.

Referenced by getAutoRRefDeductType().

◆ BFloat16Ty

CanQualType clang::ASTContext::BFloat16Ty

Definition at line 1244 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ BoolTy

◆ BoundMemberTy

CanQualType clang::ASTContext::BoundMemberTy

Definition at line 1247 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ BuiltinFnTy

CanQualType clang::ASTContext::BuiltinFnTy

◆ BuiltinInfo

◆ Char16Ty

CanQualType clang::ASTContext::Char16Ty

Definition at line 1226 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ Char32Ty

CanQualType clang::ASTContext::Char32Ty

Definition at line 1227 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ Char8Ty

CanQualType clang::ASTContext::Char8Ty

Definition at line 1225 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ CharTy

◆ 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 949 of file ASTContext.h.

Referenced by cacheRawCommentForDecl(), and getRawCommentForAnyRedecl().

◆ Comments

RawCommentList clang::ASTContext::Comments

All comments in this translation unit.

Definition at line 924 of file ASTContext.h.

Referenced by addComment(), ASTContext(), attachCommentsToJustParsedDecls(), getRawCommentForDeclNoCache(), and getRawCommentForDeclNoCacheImpl().

◆ CommentsLoaded

bool clang::ASTContext::CommentsLoaded = false
mutable

True if comments are already loaded from ExternalASTSource.

Definition at line 927 of file ASTContext.h.

Referenced by getRawCommentForDeclNoCache().

◆ 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 2556 of file ASTContext.h.

Referenced by 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 1299 of file ASTContext.h.

Referenced by MarkVarDeclODRUsed(), and shouldExternalize().

◆ 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 1303 of file ASTContext.h.

Referenced by clang::SemaCUDA::CheckCall(), and MarkVarDeclODRUsed().

◆ 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 1307 of file ASTContext.h.

Referenced by clang::SemaCUDA::RecordImplicitHostDeviceFuncUsedByDevice().

◆ DeclarationNames

◆ 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 933 of file ASTContext.h.

Referenced by attachCommentsToJustParsedDecls(), cacheRawCommentForDecl(), and getRawCommentForAnyRedecl().

◆ DependentTy

◆ DoubleTy

◆ ExternalSource

◆ Float128Ty

CanQualType clang::ASTContext::Float128Ty

Definition at line 1231 of file ASTContext.h.

Referenced by getRealTypeForBitwidth(), and InitBuiltinTypes().

◆ Float16Ty

CanQualType clang::ASTContext::Float16Ty

Definition at line 1245 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ FloatTy

◆ FractTy

◆ HalfTy

CanQualType clang::ASTContext::HalfTy

◆ Ibm128Ty

CanQualType clang::ASTContext::Ibm128Ty

Definition at line 1231 of file ASTContext.h.

Referenced by getRealTypeForBitwidth(), and InitBuiltinTypes().

◆ Idents

IdentifierTable& clang::ASTContext::Idents

Definition at line 737 of file ASTContext.h.

Referenced by clang::SemaOpenMP::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(), clang::SemaHLSL::ActOnStartRootSignatureDecl(), addFunctionPointerConversion(), clang::hlsl::BuiltinTypeDeclBuilder::addLoadMethods(), clang::hlsl::BuiltinTypeDeclBuilder::addMemberVariable(), clang::hlsl::TemplateParameterListBuilder::addTypeParameter(), ASTContext(), buildCapture(), buildImplicitMapper(), buildImplicitRecord(), buildImplicitTypedef(), buildMemcpyForAssignmentOp(), buildSingleCopyAssignRecursively(), BuiltinInvoke(), clang::hlsl::BuiltinTypeDeclBuilder::BuiltinTypeDeclBuilder(), clang::hlsl::BuiltinTypeMethodBuilder::BuiltinTypeMethodBuilder(), CheckKeyForObjCARCConversion(), CheckProtocolMethodDefs(), configureBlocksRuntimeObject(), CXXRecordMembersNamed(), clang::hlsl::BuiltinTypeMethodBuilder::declareLocalVar(), DiagnoseDirectIsaAccess(), clang::CodeGen::CodeGenFunction::EmitAndRegisterVariableArrayDimensions(), clang::CodeGen::CodeGenFunction::EmitBlockCopyAndAutorelease(), emitOutlinedFunctionPrologue(), emitReplacement(), findOMPAllocatorHandleT(), clang::CodeGen::CodeGenFunction::generateBuiltinOSLogHelperFunction(), getBlockDescriptorExtendedType(), getBlockDescriptorType(), getBoolName(), getCFConstantStringDecl(), clang::ObjCPropertyDecl::getDefaultSynthIvarName(), getGlobalStreamPointerByName(), getHostLayoutStructName(), clang::getKeywordSelector(), getLambdaStaticInvokers(), getNSCopyingName(), getNSNumberFactoryMethod(), getNSObjectName(), clang::GetNullarySelector(), getObjCProtocolDecl(), getOpenCLEnumType(), getOpenCLTypedefType(), getPredefinedSugarType(), clang::GetUnarySelector(), handleAvailabilityAttr(), handleFormatAttrCommon(), hasMember(), clang::HLSLExternalSemaSource::InitializeSema(), clang::SemaObjC::isCFStringType(), isImplicitMapperNeeded(), isMacroDefined(), clang::SemaObjC::isNSStringType(), isNSStringType(), isValidInteropVariable(), lookupCXXRecordDecl(), clang::LookupNamed(), clang::LookupNamespace(), lookupStdNamespace(), markUsedForAliasOrIfunc(), mergeDeclAttribute(), ProcessAPINotes(), processImplicitMapsWithDefaultMappers(), shouldRunOnFunctionOrMethod(), and transferARCOwnershipToDeclaratorChunk().

◆ IncompleteMatrixIdxTy

CanQualType clang::ASTContext::IncompleteMatrixIdxTy

Definition at line 1258 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ Int128Ty

◆ 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 1318 of file ASTContext.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitLValueForLambdaField().

◆ Listener

◆ LongAccumTy

◆ LongDoubleTy

◆ LongFractTy

◆ LongLongTy

◆ LongTy

◆ MSGuidTagDecl

TagDecl* clang::ASTContext::MSGuidTagDecl = nullptr
mutable

Definition at line 1290 of file ASTContext.h.

Referenced by getMSGuidDecl(), getMSGuidTagDecl(), getMSGuidType(), and InitBuiltinTypes().

◆ MSTypeInfoTagDecl

TagDecl* clang::ASTContext::MSTypeInfoTagDecl = nullptr
mutable

Definition at line 1293 of file ASTContext.h.

Referenced by getMSTypeInfoTagDecl().

◆ NullPtrTy

CanQualType clang::ASTContext::NullPtrTy

Definition at line 1246 of file ASTContext.h.

Referenced by DeduceNullPtrTemplateArgument(), and InitBuiltinTypes().

◆ NumImplicitCopyAssignmentOperators

unsigned clang::ASTContext::NumImplicitCopyAssignmentOperators = 0

The number of implicitly-declared copy assignment operators.

Definition at line 3534 of file ASTContext.h.

Referenced by PrintStats().

◆ NumImplicitCopyAssignmentOperatorsDeclared

unsigned clang::ASTContext::NumImplicitCopyAssignmentOperatorsDeclared = 0

The number of implicitly-declared copy assignment operators for which declarations were built.

Definition at line 3538 of file ASTContext.h.

Referenced by PrintStats().

◆ NumImplicitCopyConstructors

unsigned clang::ASTContext::NumImplicitCopyConstructors = 0

The number of implicitly-declared copy constructors.

Definition at line 3520 of file ASTContext.h.

Referenced by PrintStats().

◆ NumImplicitCopyConstructorsDeclared

unsigned clang::ASTContext::NumImplicitCopyConstructorsDeclared = 0

The number of implicitly-declared copy constructors for which declarations were built.

Definition at line 3524 of file ASTContext.h.

Referenced by PrintStats().

◆ NumImplicitDefaultConstructors

unsigned clang::ASTContext::NumImplicitDefaultConstructors = 0

The number of implicitly-declared default constructors.

Definition at line 3513 of file ASTContext.h.

Referenced by PrintStats().

◆ NumImplicitDefaultConstructorsDeclared

unsigned clang::ASTContext::NumImplicitDefaultConstructorsDeclared = 0

The number of implicitly-declared default constructors for which declarations were built.

Definition at line 3517 of file ASTContext.h.

Referenced by PrintStats().

◆ NumImplicitDestructors

unsigned clang::ASTContext::NumImplicitDestructors = 0

The number of implicitly-declared destructors.

Definition at line 3548 of file ASTContext.h.

Referenced by PrintStats().

◆ NumImplicitDestructorsDeclared

unsigned clang::ASTContext::NumImplicitDestructorsDeclared = 0

The number of implicitly-declared destructors for which declarations were built.

Definition at line 3552 of file ASTContext.h.

Referenced by PrintStats().

◆ NumImplicitMoveAssignmentOperators

unsigned clang::ASTContext::NumImplicitMoveAssignmentOperators = 0

The number of implicitly-declared move assignment operators.

Definition at line 3541 of file ASTContext.h.

Referenced by PrintStats().

◆ NumImplicitMoveAssignmentOperatorsDeclared

unsigned clang::ASTContext::NumImplicitMoveAssignmentOperatorsDeclared = 0

The number of implicitly-declared move assignment operators for which declarations were built.

Definition at line 3545 of file ASTContext.h.

Referenced by PrintStats().

◆ NumImplicitMoveConstructors

unsigned clang::ASTContext::NumImplicitMoveConstructors = 0

The number of implicitly-declared move constructors.

Definition at line 3527 of file ASTContext.h.

Referenced by PrintStats().

◆ NumImplicitMoveConstructorsDeclared

unsigned clang::ASTContext::NumImplicitMoveConstructorsDeclared = 0

The number of implicitly-declared move constructors for which declarations were built.

Definition at line 3531 of file ASTContext.h.

Referenced by PrintStats().

◆ ObjCBuiltinBoolTy

CanQualType clang::ASTContext::ObjCBuiltinBoolTy

Definition at line 1252 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ ObjCBuiltinClassTy

CanQualType clang::ASTContext::ObjCBuiltinClassTy

Definition at line 1251 of file ASTContext.h.

Referenced by applyObjCProtocolQualifiers(), getObjCClassDecl(), and InitBuiltinTypes().

◆ ObjCBuiltinIdTy

CanQualType clang::ASTContext::ObjCBuiltinIdTy

◆ ObjCBuiltinSelTy

CanQualType clang::ASTContext::ObjCBuiltinSelTy

Definition at line 1251 of file ASTContext.h.

Referenced by getObjCSelDecl(), and InitBuiltinTypes().

◆ OCLClkEventTy

CanQualType clang::ASTContext::OCLClkEventTy

Definition at line 1256 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ OCLEventTy

CanQualType clang::ASTContext::OCLEventTy

Definition at line 1256 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ OCLQueueTy

CanQualType clang::ASTContext::OCLQueueTy

◆ OCLReserveIDTy

CanQualType clang::ASTContext::OCLReserveIDTy

◆ OCLSamplerTy

CanQualType clang::ASTContext::OCLSamplerTy

Definition at line 1256 of file ASTContext.h.

Referenced by InitBuiltinTypes(), and clang::InitializationSequence::Perform().

◆ OMPArrayShapingTy

CanQualType clang::ASTContext::OMPArrayShapingTy

Definition at line 1260 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ OMPIteratorTy

CanQualType clang::ASTContext::OMPIteratorTy

Definition at line 1260 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ OverloadTy

◆ ParsedComments

llvm::DenseMap<const Decl *, comments::FullComment *> clang::ASTContext::ParsedComments
mutable

Mapping from declarations to parsed comments attached to any redeclaration.

Definition at line 953 of file ASTContext.h.

Referenced by attachCommentsToJustParsedDecls(), and getCommentForDecl().

◆ PseudoObjectTy

CanQualType clang::ASTContext::PseudoObjectTy

Definition at line 1250 of file ASTContext.h.

Referenced by BuildMSPropertyRefExpr(), InitBuiltinTypes(), and LookupMemberExpr().

◆ 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 940 of file ASTContext.h.

Referenced by cacheRawCommentForDecl(), and getRawCommentForAnyRedecl().

◆ SatAccumTy

◆ SatFractTy

◆ SatLongAccumTy

◆ SatLongFractTy

◆ SatShortAccumTy

◆ SatShortFractTy

◆ SatUnsignedAccumTy

CanQualType clang::ASTContext::SatUnsignedAccumTy

◆ SatUnsignedFractTy

CanQualType clang::ASTContext::SatUnsignedFractTy

◆ SatUnsignedLongAccumTy

CanQualType clang::ASTContext::SatUnsignedLongAccumTy

◆ SatUnsignedLongFractTy

CanQualType clang::ASTContext::SatUnsignedLongFractTy

◆ SatUnsignedShortAccumTy

CanQualType clang::ASTContext::SatUnsignedShortAccumTy

◆ SatUnsignedShortFractTy

CanQualType clang::ASTContext::SatUnsignedShortFractTy

◆ SectionInfos

llvm::StringMap<SectionInfo> clang::ASTContext::SectionInfos

Definition at line 3702 of file ASTContext.h.

◆ Selectors

◆ ShortAccumTy

◆ ShortFractTy

◆ ShortTy

◆ SignedCharTy

◆ 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 1312 of file ASTContext.h.

Referenced by findSYCLKernelInfo(), getSYCLKernelInfo(), and registerSYCLEntryPointFunction().

◆ TUKind

const TranslationUnitKind clang::ASTContext::TUKind

Definition at line 740 of file ASTContext.h.

Referenced by addTranslationUnitDecl(), and ASTContext().

◆ UnknownAnyTy

CanQualType clang::ASTContext::UnknownAnyTy

Definition at line 1248 of file ASTContext.h.

Referenced by ClassifyInternal(), ClassifyMemberExpr(), and InitBuiltinTypes().

◆ UnresolvedTemplateTy

CanQualType clang::ASTContext::UnresolvedTemplateTy

Definition at line 1247 of file ASTContext.h.

Referenced by InitBuiltinTypes().

◆ UnsignedAccumTy

CanQualType clang::ASTContext::UnsignedAccumTy

◆ UnsignedCharTy

◆ UnsignedFractTy

CanQualType clang::ASTContext::UnsignedFractTy

◆ UnsignedInt128Ty

CanQualType clang::ASTContext::UnsignedInt128Ty

◆ UnsignedIntTy

◆ UnsignedLongAccumTy

CanQualType clang::ASTContext::UnsignedLongAccumTy

◆ UnsignedLongFractTy

CanQualType clang::ASTContext::UnsignedLongFractTy

◆ UnsignedLongLongTy

◆ UnsignedLongTy

◆ UnsignedShortAccumTy

CanQualType clang::ASTContext::UnsignedShortAccumTy

◆ UnsignedShortFractTy

CanQualType clang::ASTContext::UnsignedShortFractTy

◆ UnsignedShortTy

◆ VaListTagDecl

◆ VoidPtrTy

◆ VoidTy

◆ WCharTy

CanQualType clang::ASTContext::WCharTy

Definition at line 1222 of file ASTContext.h.

Referenced by getSignedWCharType(), getWCharType(), and InitBuiltinTypes().

◆ WideCharTy

CanQualType clang::ASTContext::WideCharTy

Definition at line 1223 of file ASTContext.h.

Referenced by getIndex(), getWideCharType(), and InitBuiltinTypes().

◆ WIntTy

CanQualType clang::ASTContext::WIntTy

Definition at line 1224 of file ASTContext.h.

Referenced by getWIntType(), and InitBuiltinTypes().


The documentation for this class was generated from the following files: