clang  14.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for clang::ASTContext:
Collaboration graph
[legend]

Classes

struct  BuiltinVectorTypeInfo
 
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  InlineVariableDefinitionKind { InlineVariableDefinitionKind::None, InlineVariableDefinitionKind::Weak, InlineVariableDefinitionKind::WeakUnknown, InlineVariableDefinitionKind::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 = llvm::PointerUnion< VarTemplateDecl *, MemberSpecializationInfo * >
 A type synonym for the TemplateOrInstantiation mapping. More...
 
using overridden_cxx_method_iterator = CXXMethodVector::const_iterator
 
using overridden_method_range = llvm::iterator_range< overridden_cxx_method_iterator >
 
using import_range = llvm::iterator_range< import_iterator >
 

Public Member Functions

interp::ContextgetInterpContext ()
 Returns the clang bytecode interpreter context. More...
 
ParentMapContextgetParentMapContext ()
 Returns the dynamic AST node parent map context. More...
 
std::vector< 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. More...
 
const clang::PrintingPolicygetPrintingPolicy () const
 
void setPrintingPolicy (const clang::PrintingPolicy &Policy)
 
SourceManagergetSourceManager ()
 
const SourceManagergetSourceManager () const
 
llvm::BumpPtrAllocator & getAllocator () const
 
void * Allocate (size_t Size, unsigned Align=8) const
 
template<typename T >
T * Allocate (size_t Num=1) const
 
void Deallocate (void *Ptr) const
 
DeclListNodeAllocateDeclListNode (clang::NamedDecl *ND)
 Allocates a DeclListNode or returns one from the ListNodeFreeList pool. More...
 
void DeallocateDeclListNode (DeclListNode *N)
 Deallcates a DeclListNode by returning it to the ListNodeFreeList pool. More...
 
size_t getASTAllocatedMemory () const
 Return the total amount of physical memory allocated for representing AST nodes and type information. More...
 
size_t getSideTableAllocatedMemory () const
 Return the total memory used for various side tables. More...
 
PartialDiagnostic::DiagStorageAllocatorgetDiagAllocator ()
 
const TargetInfogetTargetInfo () const
 
const TargetInfogetAuxTargetInfo () const
 
QualType getIntTypeForBitwidth (unsigned DestWidth, unsigned Signed) const
 getIntTypeForBitwidth - sets integer QualTy according to specified details: bitwidth, signed/unsigned. More...
 
QualType getRealTypeForBitwidth (unsigned DestWidth, bool ExplicitIEEE) const
 getRealTypeForBitwidth - sets floating point QualTy according to specified bitwidth. More...
 
bool AtomicUsesUnsupportedLibcall (const AtomicExpr *E) const
 
const LangOptionsgetLangOpts () const
 
bool isDependenceAllowed () const
 
const NoSanitizeListgetNoSanitizeList () const
 
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. More...
 
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. More...
 
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. More...
 
void addComment (const RawComment &RC)
 
const RawCommentgetRawCommentForAnyRedecl (const Decl *D, const Decl **OriginalDecl=nullptr) const
 Return the documentation comment attached to a given declaration. More...
 
void attachCommentsToJustParsedDecls (ArrayRef< Decl * > Decls, const Preprocessor *PP)
 Searches existing comments for doc comments that should be attached to Decls. More...
 
comments::FullCommentgetCommentForDecl (const Decl *D, const Preprocessor *PP) const
 Return parsed documentation comment attached to a given declaration. More...
 
comments::FullCommentgetLocalCommentForDeclUncached (const Decl *D) const
 Return parsed documentation comment attached to a given declaration. More...
 
comments::FullCommentcloneFullComment (comments::FullComment *FC, const Decl *D) const
 
comments::CommandTraitsgetCommentCommandTraits () const
 
AttrVecgetDeclAttrs (const Decl *D)
 Retrieve the attributes for the given declaration. More...
 
void eraseDeclAttrs (const Decl *D)
 Erase the attributes corresponding to the given declaration. More...
 
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. More...
 
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. More...
 
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. More...
 
void setInstantiatedFromUsingDecl (NamedDecl *Inst, NamedDecl *Pattern)
 Remember that the using decl Inst is an instantiation of the using decl Pattern of a class template. More...
 
UsingEnumDeclgetInstantiatedFromUsingEnumDecl (UsingEnumDecl *Inst)
 If the given using-enum decl Inst is an instantiation of another using-enum decl, return it. More...
 
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. More...
 
UsingShadowDeclgetInstantiatedFromUsingShadowDecl (UsingShadowDecl *Inst)
 
void setInstantiatedFromUsingShadowDecl (UsingShadowDecl *Inst, UsingShadowDecl *Pattern)
 
FieldDeclgetInstantiatedFromUnnamedFieldDecl (FieldDecl *Field)
 
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. More...
 
void getOverriddenMethods (const NamedDecl *Method, SmallVectorImpl< const NamedDecl * > &Overridden) const
 Return C++ or ObjC overridden methods for the given Method. More...
 
void addedLocalImportDecl (ImportDecl *Import)
 Notify the AST context that a new import declaration has been parsed or implicitly created within this translation unit. More...
 
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. More...
 
void deduplicateMergedDefinitonsFor (NamedDecl *ND)
 Clean up the merged definition list. More...
 
ArrayRef< Module * > getModulesWithMergedDefinition (const NamedDecl *Def)
 Get the additional modules in which the definition Def has been merged. More...
 
void addModuleInitializer (Module *M, Decl *Init)
 Add a declaration to the list of declarations that are initialized for a module. More...
 
void addLazyModuleInitializers (Module *M, ArrayRef< uint32_t > IDs)
 
ArrayRef< Decl * > getModuleInitializers (Module *M)
 Get the initializations to perform when importing a module, if any. More...
 
TranslationUnitDeclgetTranslationUnitDecl () const
 
void addTranslationUnitDecl ()
 
ExternCContextDeclgetExternCContextDecl () const
 
BuiltinTemplateDeclgetMakeIntegerSeqDecl () const
 
BuiltinTemplateDeclgetTypePackElementDecl () 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. More...
 
ExternalASTSourcegetExternalSource () const
 Retrieve a pointer to the external AST source associated with this AST context, if any. More...
 
void setASTMutationListener (ASTMutationListener *Listener)
 Attach an AST mutation listener to the AST context. More...
 
ASTMutationListenergetASTMutationListener () const
 Retrieve a pointer to the AST mutation listener associated with this AST context, if any. More...
 
void PrintStats () const
 
const SmallVectorImpl< Type * > & getTypes () const
 
BuiltinTemplateDeclbuildBuiltinTemplateDecl (BuiltinTemplateKind BTK, const IdentifierInfo *II) const
 
RecordDeclbuildImplicitRecord (StringRef Name, RecordDecl::TagKind TK=TTK_Struct) const
 Create a new implicit TU-level CXXRecordDecl or RecordDecl declaration. More...
 
TypedefDeclbuildImplicitTypedef (QualType T, StringRef Name) const
 Create a new implicit TU-level typedef declaration. More...
 
TypedefDeclgetInt128Decl () const
 Retrieve the declaration for the 128-bit signed integer type. More...
 
TypedefDeclgetUInt128Decl () const
 Retrieve the declaration for the 128-bit unsigned integer type. More...
 
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. More...
 
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) More...
 
QualType applyObjCProtocolQualifiers (QualType type, ArrayRef< ObjCProtocolDecl * > protocols, bool &hasError, bool allowOnPointerType=false) const
 Apply Objective-C protocol qualifiers to the given type. More...
 
QualType getObjCGCQualType (QualType T, Qualifiers::GC gcAttr) const
 Return the uniqued reference to the type for an Objective-C gc-qualified type. More...
 
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. More...
 
QualType getRestrictType (QualType T) const
 Return the uniqued reference to the type for a restrict qualified type. More...
 
QualType getVolatileType (QualType T) const
 Return the uniqued reference to the type for a volatile qualified type. More...
 
QualType getConstType (QualType T) const
 Return the uniqued reference to the type for a const qualified type. More...
 
const FunctionTypeadjustFunctionType (const FunctionType *Fn, FunctionType::ExtInfo EInfo)
 Change the ExtInfo on a function type. More...
 
CanQualType getCanonicalFunctionResultType (QualType ResultType) const
 Adjust the given function result type. More...
 
void adjustDeducedFunctionResultType (FunctionDecl *FD, QualType ResultType)
 Change the result type of a function type once it is deduced. More...
 
QualType getFunctionTypeWithExceptionSpec (QualType Orig, const FunctionProtoType::ExceptionSpecInfo &ESI)
 Get a function type and produce the equivalent function type with the specified exception specification. More...
 
bool hasSameFunctionTypeIgnoringExceptionSpec (QualType T, QualType U)
 Determine whether two function types are the same, ignoring exception specifications in cases where they're part of the type. More...
 
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. More...
 
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 tyeps are replaced with the default address space. More...
 
bool hasSameFunctionTypeIgnoringPtrSizes (QualType T, QualType U)
 Determine whether two function types are the same, ignoring pointer sizes in the return type and parameter types. More...
 
QualType getComplexType (QualType T) const
 Return the uniqued reference to the type for a complex number with the specified element type. More...
 
CanQualType getComplexType (CanQualType T) const
 
QualType getPointerType (QualType T) const
 Return the uniqued reference to the type for a pointer to the specified type. More...
 
CanQualType getPointerType (CanQualType T) const
 
QualType getAdjustedType (QualType Orig, QualType New) const
 Return the uniqued reference to a type adjusted from the original type to a new type. More...
 
CanQualType getAdjustedType (CanQualType Orig, CanQualType New) const
 
QualType getDecayedType (QualType T) const
 Return the uniqued reference to the decayed version of the given type. More...
 
CanQualType getDecayedType (CanQualType T) const
 
QualType getAtomicType (QualType T) const
 Return the uniqued reference to the atomic type for the specified type. More...
 
QualType getBlockPointerType (QualType T) const
 Return the uniqued reference to the type for a block of the specified type. More...
 
QualType getBlockDescriptorType () const
 Gets the struct used to keep track of the descriptor for pointer to blocks. More...
 
QualType getReadPipeType (QualType T) const
 Return a read_only pipe type for the specified type. More...
 
QualType getWritePipeType (QualType T) const
 Return a write_only pipe type for the specified type. More...
 
QualType getExtIntType (bool Unsigned, unsigned NumBits) const
 Return an extended integer type with the specified signedness and bit count. More...
 
QualType getDependentExtIntType (bool Unsigned, Expr *BitsExpr) const
 Return a dependent extended integer type with the specified signedness and bit count. More...
 
QualType getBlockDescriptorExtendedType () const
 Gets the struct used to keep track of the extended descriptor for pointer to blocks. More...
 
OpenCLTypeKind getOpenCLTypeKind (const Type *T) const
 Map an AST Type to an OpenCLTypeKind enum value. More...
 
LangAS getOpenCLTypeAddrSpace (const Type *T) const
 Get address space for OpenCL type. More...
 
LangAS getDefaultOpenCLPointeeAddrSpace ()
 Returns default address space based on OpenCL version and enabled features. More...
 
void setcudaConfigureCallDecl (FunctionDecl *FD)
 
FunctionDeclgetcudaConfigureCallDecl ()
 
bool BlockRequiresCopying (QualType Ty, const VarDecl *D)
 Returns true iff we need copy/dispose helpers for the given type. More...
 
bool getByrefLifetime (QualType Ty, Qualifiers::ObjCLifetime &Lifetime, bool &HasByrefExtendedLayout) const
 Returns true, if given type has a known lifetime. More...
 
QualType getLValueReferenceType (QualType T, bool SpelledAsLValue=true) const
 Return the uniqued reference to the type for an lvalue reference to the specified type. More...
 
QualType getRValueReferenceType (QualType T) const
 Return the uniqued reference to the type for an rvalue reference to the specified type. More...
 
QualType getMemberPointerType (QualType T, const Type *Cls) const
 Return the uniqued reference to the type for a member pointer to the specified type in the specified class. More...
 
QualType getVariableArrayType (QualType EltTy, Expr *NumElts, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals, SourceRange Brackets) const
 Return a non-unique reference to the type for a variable array of the specified element type. More...
 
QualType getDependentSizedArrayType (QualType EltTy, Expr *NumElts, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals, SourceRange Brackets) const
 Return a non-unique reference to the type for a dependently-sized array of the specified element type. More...
 
QualType getIncompleteArrayType (QualType EltTy, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals) const
 Return a unique reference to the type for an incomplete array of the specified element type. More...
 
QualType getConstantArrayType (QualType EltTy, const llvm::APInt &ArySize, const Expr *SizeExpr, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals) const
 Return the unique reference to the type for a constant array of the specified element type. More...
 
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. More...
 
QualType getVariableArrayDecayedType (QualType Ty) const
 Returns a vla type where known sizes are replaced with [*]. More...
 
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. More...
 
QualType getScalableVectorType (QualType EltTy, unsigned NumElts) const
 Return the unique reference to a scalable vector type of the specified element type and scalable number of elements. More...
 
QualType getVectorType (QualType VectorType, unsigned NumElts, VectorType::VectorKind VecKind) const
 Return the unique reference to a vector type of the specified element type and size. More...
 
QualType getDependentVectorType (QualType VectorType, Expr *SizeExpr, SourceLocation AttrLoc, VectorType::VectorKind VecKind) const
 Return the unique reference to the type for a dependently sized vector of the specified element type. More...
 
QualType getExtVectorType (QualType VectorType, unsigned NumElts) const
 Return the unique reference to an extended vector type of the specified element type and size. More...
 
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. More...
 
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. More...
 
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()'. More...
 
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. More...
 
QualType adjustStringLiteralBaseType (QualType StrLTy) const
 
QualType getTypeDeclType (const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
 Return the unique reference to the type for the specified type declaration. More...
 
QualType getTypedefType (const TypedefNameDecl *Decl, QualType Underlying=QualType()) const
 Return the unique reference to the type for the specified typedef-name decl. More...
 
QualType getRecordType (const RecordDecl *Decl) const
 
QualType getEnumType (const EnumDecl *Decl) const
 
QualType getInjectedClassNameType (CXXRecordDecl *Decl, QualType TST) const
 getInjectedClassNameType - Return the unique reference to the injected class name type for the specified templated declaration. More...
 
QualType getAttributedType (attr::Kind attrKind, QualType modifiedType, QualType equivalentType)
 
QualType getSubstTemplateTypeParmType (const TemplateTypeParmType *Replaced, QualType Replacement) const
 Retrieve a substitution-result type. More...
 
QualType getSubstTemplateTypeParmPackType (const TemplateTypeParmType *Replaced, const TemplateArgument &ArgPack)
 Retrieve a. More...
 
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. More...
 
QualType getTemplateSpecializationType (TemplateName T, ArrayRef< TemplateArgument > Args, QualType Canon=QualType()) const
 
QualType getCanonicalTemplateSpecializationType (TemplateName T, ArrayRef< TemplateArgument > Args) const
 
QualType getTemplateSpecializationType (TemplateName T, const TemplateArgumentListInfo &Args, QualType Canon=QualType()) const
 
TypeSourceInfogetTemplateSpecializationTypeInfo (TemplateName T, SourceLocation TLoc, const TemplateArgumentListInfo &Args, QualType Canon=QualType()) const
 
QualType getParenType (QualType NamedType) const
 
QualType getMacroQualifiedType (QualType UnderlyingTy, const IdentifierInfo *MacroII) const
 
QualType getElaboratedType (ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType, TagDecl *OwnedTagDecl=nullptr) const
 
QualType getDependentNameType (ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, QualType Canon=QualType()) const
 
QualType getDependentTemplateSpecializationType (ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, const TemplateArgumentListInfo &Args) const
 
QualType getDependentTemplateSpecializationType (ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, ArrayRef< TemplateArgument > Args) const
 
TemplateArgument getInjectedTemplateArg (NamedDecl *ParamDecl)
 
void getInjectedTemplateArgs (const TemplateParameterList *Params, SmallVectorImpl< TemplateArgument > &Args)
 Get a template argument list with one argument per template parameter in a template parameter list, such as for the injected class name of a class template. More...
 
QualType getPackExpansionType (QualType Pattern, Optional< unsigned > NumExpansions, bool ExpectPackInType=true)
 Form a pack expansion type with the given pattern. More...
 
QualType getObjCInterfaceType (const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl=nullptr) const
 getObjCInterfaceType - Return the unique reference to the type for the specified ObjC interface decl. More...
 
QualType getObjCObjectType (QualType Base, ObjCProtocolDecl *const *Protocols, unsigned NumProtocols) const
 Legacy interface: cannot provide type arguments or __kindof. More...
 
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. More...
 
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. More...
 
QualType getObjCObjectPointerType (QualType OIT) const
 Return a ObjCObjectPointerType type for the given ObjCObjectType. More...
 
QualType getTypeOfExprType (Expr *e) const
 GCC extension. More...
 
QualType getTypeOfType (QualType t) const
 getTypeOfType - Unlike many "get<Type>" functions, we don't unique TypeOfType nodes. More...
 
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. More...
 
QualType getDecltypeType (Expr *e, QualType UnderlyingType) const
 C++11 decltype. More...
 
QualType getUnaryTransformType (QualType BaseType, QualType UnderlyingType, UnaryTransformType::UTTKind UKind) const
 Unary type transforms. More...
 
QualType getAutoType (QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent, bool IsPack=false, ConceptDecl *TypeConstraintConcept=nullptr, ArrayRef< TemplateArgument > TypeConstraintArgs={}) const
 C++11 deduced auto type. More...
 
QualType getAutoDeductType () const
 C++11 deduction pattern for 'auto' type. More...
 
QualType getAutoRRefDeductType () const
 C++11 deduction pattern for 'auto &&' type. More...
 
QualType getDeducedTemplateSpecializationType (TemplateName Template, QualType DeducedType, bool IsDependent) const
 C++17 deduced class template specialization type. More...
 
QualType getTagDeclType (const TagDecl *Decl) const
 Return the unique reference to the type for the specified TagDecl (struct/union/class/enum) decl. More...
 
CanQualType getSizeType () const
 Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>. More...
 
CanQualType getSignedSizeType () const
 Return the unique signed counterpart of the integer type corresponding to size_t. More...
 
CanQualType getIntMaxType () const
 Return the unique type for "intmax_t" (C99 7.18.1.5), defined in <stdint.h>. More...
 
CanQualType getUIntMaxType () const
 Return the unique type for "uintmax_t" (C99 7.18.1.5), defined in <stdint.h>. More...
 
QualType getWCharType () const
 Return the unique wchar_t type available in C++ (and available as __wchar_t as a Microsoft extension). More...
 
QualType getWideCharType () const
 Return the type of wide characters. More...
 
QualType getSignedWCharType () const
 Return the type of "signed wchar_t". More...
 
QualType getUnsignedWCharType () const
 Return the type of "unsigned wchar_t". More...
 
QualType getWIntType () const
 In C99, this returns a type compatible with the type defined in <stddef.h> as defined by the target. More...
 
QualType getIntPtrType () const
 Return a type compatible with "intptr_t" (C99 7.18.1.4), as defined by the target. More...
 
QualType getUIntPtrType () const
 Return a type compatible with "uintptr_t" (C99 7.18.1.4), as defined by the target. More...
 
QualType getPointerDiffType () const
 Return the unique type for "ptrdiff_t" (C99 7.17) defined in <stddef.h>. More...
 
QualType getUnsignedPointerDiffType () const
 Return the unique unsigned counterpart of "ptrdiff_t" integer type. More...
 
QualType getProcessIDType () const
 Return the unique type for "pid_t" defined in <sys/types.h>. More...
 
QualType getCFConstantStringType () const
 Return the C structure type used to represent constant CFStrings. More...
 
QualType getObjCSuperType () const
 Returns the C struct type for objc_super. More...
 
void setObjCSuperType (QualType ST)
 
QualType getRawCFConstantStringType () const
 Get the structure type used to representation CFStrings, or NULL if it hasn't yet been built. More...
 
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. More...
 
void setObjCIdRedefinitionType (QualType RedefType)
 Set the user-written type that redefines id. More...
 
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. More...
 
void setObjCClassRedefinitionType (QualType RedefType)
 Set the user-written type that redefines 'SEL'. More...
 
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. More...
 
void setObjCSelRedefinitionType (QualType RedefType)
 Set the user-written type that redefines 'SEL'. More...
 
IdentifierInfogetNSObjectName () const
 Retrieve the identifier 'NSObject'. More...
 
IdentifierInfogetNSCopyingName ()
 Retrieve the identifier 'NSCopying'. More...
 
CanQualType getNSUIntegerType () const
 
CanQualType getNSIntegerType () const
 
IdentifierInfogetBoolName () const
 Retrieve the identifier 'bool'. More...
 
IdentifierInfogetMakeIntegerSeqName () const
 
IdentifierInfogetTypePackElementName () const
 
QualType getObjCInstanceType ()
 Retrieve the Objective-C "instancetype" type, if already known; otherwise, returns a NULL type;. More...
 
TypedefDeclgetObjCInstanceTypeDecl ()
 Retrieve the typedef declaration corresponding to the Objective-C "instancetype" type. More...
 
void setFILEDecl (TypeDecl *FILEDecl)
 Set the type for the C FILE type. More...
 
QualType getFILEType () const
 Retrieve the C FILE type. More...
 
void setjmp_bufDecl (TypeDecl *jmp_bufDecl)
 Set the type for the C jmp_buf type. More...
 
QualType getjmp_bufType () const
 Retrieve the C jmp_buf type. More...
 
void setsigjmp_bufDecl (TypeDecl *sigjmp_bufDecl)
 Set the type for the C sigjmp_buf type. More...
 
QualType getsigjmp_bufType () const
 Retrieve the C sigjmp_buf type. More...
 
void setucontext_tDecl (TypeDecl *ucontext_tDecl)
 Set the type for the C ucontext_t type. More...
 
QualType getucontext_tType () const
 Retrieve the C ucontext_t type. More...
 
QualType getLogicalOperationType () const
 The result type of logical operations, '<', '>', '!=', etc. More...
 
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. More...
 
void getObjCEncodingForPropertyType (QualType T, std::string &S) const
 Emit the Objective-C property type encoding for the given type T into S. More...
 
void getLegacyIntegralTypeEncoding (QualType &t) const
 getLegacyIntegralTypeEncoding - Another legacy compatibility encoding: 32-bit longs are encoded as 'l' or 'L' , but not always. More...
 
void getObjCEncodingForTypeQualifier (Decl::ObjCDeclQualifier QT, std::string &S) const
 Put the string version of the type qualifiers QT into S. More...
 
std::string getObjCEncodingForFunctionDecl (const FunctionDecl *Decl) const
 Emit the encoded type for the function Decl into S. More...
 
std::string getObjCEncodingForMethodDecl (const ObjCMethodDecl *Decl, bool Extended=false) const
 Emit the encoded type for the method declaration Decl into S. More...
 
std::string getObjCEncodingForBlock (const BlockExpr *blockExpr) const
 Return the encoded type for this block declaration. More...
 
std::string getObjCEncodingForPropertyDecl (const ObjCPropertyDecl *PD, const Decl *Container) const
 getObjCEncodingForPropertyDecl - Return the encoded type for this method declaration. More...
 
bool ProtocolCompatibleWithProtocol (ObjCProtocolDecl *lProto, ObjCProtocolDecl *rProto) const
 ProtocolCompatibleWithProtocol - return 'true' if 'lProto' is in the inheritance hierarchy of 'rProto'. More...
 
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. More...
 
TypedefDeclgetObjCIdDecl () const
 Retrieve the typedef corresponding to the predefined id type in Objective-C. More...
 
QualType getObjCIdType () const
 Represents the Objective-CC id type. More...
 
TypedefDeclgetObjCSelDecl () const
 Retrieve the typedef corresponding to the predefined 'SEL' type in Objective-C. More...
 
QualType getObjCSelType () const
 Retrieve the type that corresponds to the predefined Objective-C 'SEL' type. More...
 
TypedefDeclgetObjCClassDecl () const
 Retrieve the typedef declaration corresponding to the predefined Objective-C 'Class' type. More...
 
QualType getObjCClassType () const
 Represents the Objective-C Class type. More...
 
ObjCInterfaceDeclgetObjCProtocolDecl () const
 Retrieve the Objective-C class declaration corresponding to the predefined Protocol class. More...
 
TypedefDeclgetBOOLDecl () const
 Retrieve declaration of 'BOOL' typedef. More...
 
void setBOOLDecl (TypedefDecl *TD)
 Save declaration of 'BOOL' typedef. More...
 
QualType getBOOLType () const
 type of 'BOOL' type. More...
 
QualType getObjCProtoType () const
 Retrieve the type of the Objective-C Protocol class. More...
 
TypedefDeclgetBuiltinVaListDecl () const
 Retrieve the C type declaration corresponding to the predefined __builtin_va_list type. More...
 
QualType getBuiltinVaListType () const
 Retrieve the type of the __builtin_va_list type. More...
 
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. More...
 
TypedefDeclgetBuiltinMSVaListDecl () const
 Retrieve the C type declaration corresponding to the predefined __builtin_ms_va_list type. More...
 
QualType getBuiltinMSVaListType () const
 Retrieve the type of the __builtin_ms_va_list type. More...
 
TagDeclgetMSGuidTagDecl () const
 Retrieve the implicitly-predeclared 'struct _GUID' declaration. More...
 
QualType getMSGuidType () const
 Retrieve the implicitly-predeclared 'struct _GUID' type. More...
 
bool canBuiltinBeRedeclared (const FunctionDecl *) const
 Return whether a declaration to a builtin is allowed to be overloaded/redeclared. More...
 
QualType getCVRQualifiedType (QualType T, unsigned CVR) const
 Return a type with additional const, volatile, or restrict qualifiers. More...
 
QualType getQualifiedType (SplitQualType split) const
 Un-split a SplitQualType. More...
 
QualType getQualifiedType (QualType T, Qualifiers Qs) const
 Return a type with additional qualifiers. More...
 
QualType getQualifiedType (const Type *T, Qualifiers Qs) const
 Return a type with additional qualifiers. More...
 
QualType getLifetimeQualifiedType (QualType type, Qualifiers::ObjCLifetime lifetime)
 Return a type with the given lifetime qualifier. More...
 
QualType getUnqualifiedObjCPointerType (QualType type) const
 getUnqualifiedObjCPointerType - Returns version of Objective-C pointer type with lifetime qualifier removed. More...
 
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. More...
 
TemplateName getAssumedTemplateName (DeclarationName Name) const
 Retrieve a template name representing an unqualified-id that has been assumed to name a template for ADL purposes. More...
 
TemplateName getQualifiedTemplateName (NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateDecl *Template) const
 Retrieve the template name that represents a qualified template name such as std::vector. More...
 
TemplateName getDependentTemplateName (NestedNameSpecifier *NNS, const IdentifierInfo *Name) const
 Retrieve the template name that represents a dependent template name such as MetaFun::template apply. More...
 
TemplateName getDependentTemplateName (NestedNameSpecifier *NNS, OverloadedOperatorKind Operator) const
 Retrieve the template name that represents a dependent template name such as MetaFun::template operator+. More...
 
TemplateName getSubstTemplateTemplateParm (TemplateTemplateParmDecl *param, TemplateName replacement) const
 
TemplateName getSubstTemplateTemplateParmPack (TemplateTemplateParmDecl *Param, const TemplateArgument &ArgPack) const
 
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. More...
 
Qualifiers::GC getObjCGCAttrKind (QualType Ty) const
 Return one of the GCNone, Weak or Strong Objective-C garbage collection attributes. More...
 
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. More...
 
bool areCompatibleSveTypes (QualType FirstType, QualType SecondType)
 Return true if the given types are an SVE builtin and a VectorType that is a fixed-length representation of the SVE builtin for a specific vector-length. More...
 
bool areLaxCompatibleSveTypes (QualType FirstType, QualType SecondType)
 Return true if the given vector types are lax-compatible SVE vector types, false otherwise. More...
 
bool hasDirectOwnershipQualifier (QualType Ty) const
 Return true if the type has been explicitly qualified with ObjC ownership. More...
 
const llvm::fltSemantics & getFloatTypeSemantics (QualType T) const
 Return the APFloat 'semantics' for the specified scalar floating point type. More...
 
TypeInfo getTypeInfo (const Type *T) const
 Get the size and alignment of the specified complete type in bits. More...
 
TypeInfo getTypeInfo (QualType T) const
 
unsigned getOpenMPDefaultSimdAlign (QualType T) const
 Get default simd alignment of the specified complete type in bits. More...
 
uint64_t getTypeSize (QualType T) const
 Return the size of the specified (complete) type T, in bits. More...
 
uint64_t getTypeSize (const Type *T) const
 
uint64_t getCharWidth () const
 Return the size of the character type, in bits. More...
 
CharUnits toCharUnitsFromBits (int64_t BitSize) const
 Convert a size in bits to a size in characters. More...
 
int64_t toBits (CharUnits CharSize) const
 Convert a size in characters to a size in bits. More...
 
CharUnits getTypeSizeInChars (QualType T) const
 Return the size of the specified (complete) type T, in characters. More...
 
CharUnits getTypeSizeInChars (const Type *T) const
 
Optional< CharUnitsgetTypeSizeInCharsIfKnown (QualType Ty) const
 
Optional< CharUnitsgetTypeSizeInCharsIfKnown (const Type *Ty) const
 
unsigned getTypeAlign (QualType T) const
 Return the ABI-specified alignment of a (complete) type T, in bits. More...
 
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. More...
 
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). More...
 
CharUnits getTypeAlignInChars (QualType T) const
 Return the ABI-specified alignment of a (complete) type T, in characters. More...
 
CharUnits getTypeAlignInChars (const Type *T) const
 
CharUnits getPreferredTypeAlignInChars (QualType T) const
 Return the PreferredAlignment of a (complete) type T, in characters. More...
 
CharUnits getTypeUnadjustedAlignInChars (QualType T) const
 getTypeUnadjustedAlignInChars - Return the ABI-specified alignment of a type, in characters, before alignment adjustments. More...
 
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. More...
 
bool isAlignmentRequired (QualType T) const
 
unsigned getPreferredTypeAlign (QualType T) const
 Return the "preferred" alignment of the specified type T for the current target, in bits. More...
 
unsigned getPreferredTypeAlign (const Type *T) const
 getPreferredTypeAlign - Return the "preferred" alignment of the specified type for the current target in bits. More...
 
unsigned getTargetDefaultAlignForAttributeAligned () const
 Return the default alignment for attribute((aligned)) on this target, to be used if no alignment value is specified. More...
 
unsigned getAlignOfGlobalVar (QualType T) const
 Return the alignment in bits that should be given to a global variable with type T. More...
 
CharUnits getAlignOfGlobalVarInChars (QualType T) const
 Return the alignment in characters that should be given to a global variable with type T. More...
 
CharUnits getDeclAlign (const Decl *D, bool ForAlignof=false) const
 Return a conservative estimate of the alignment of the specified decl D. More...
 
CharUnits getExnObjectAlignment () const
 Return the alignment (in bytes) of the thrown exception object. More...
 
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. More...
 
const ASTRecordLayoutgetASTObjCInterfaceLayout (const ObjCInterfaceDecl *D) const
 Get or compute information about the layout of the specified Objective-C interface. More...
 
void DumpRecordLayout (const RecordDecl *RD, raw_ostream &OS, bool Simple=false) const
 
const ASTRecordLayoutgetASTObjCImplementationLayout (const ObjCImplementationDecl *D) const
 Get or compute information about the layout of the specified Objective-C implementation. More...
 
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. More...
 
void setNonKeyFunction (const CXXMethodDecl *method)
 Observe that the given method cannot be a key function. More...
 
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. More...
 
uint64_t getFieldOffset (const ValueDecl *FD) const
 Get the offset of a FieldDecl or IndirectFieldDecl, in bits. More...
 
uint64_t lookupFieldBitOffset (const ObjCInterfaceDecl *OID, const ObjCImplementationDecl *ID, const ObjCIvarDecl *Ivar) const
 Get the offset of an ObjCIvarDecl in bits. More...
 
CharUnits getMemberPointerPathAdjustment (const APValue &MP) const
 Find the 'this' offset for the member path in a pointer-to-member APValue. More...
 
bool isNearlyEmpty (const CXXRecordDecl *RD) const
 
VTableContextBasegetVTableContext ()
 
MangleContextcreateMangleContext (const TargetInfo *T=nullptr)
 If T is null pointer, assume the target in ASTContext. More...
 
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. More...
 
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. More...
 
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. More...
 
bool hasUniqueObjectRepresentations (QualType Ty) const
 Return true if the specified type has unique object representations according to (C++17 [meta.unary.prop]p9) More...
 
CanQualType getCanonicalType (QualType T) const
 Return the canonical (structural) type corresponding to the specified potentially non-canonical type T. More...
 
const TypegetCanonicalType (const Type *T) const
 
CanQualType getCanonicalParamType (QualType T) const
 Return the canonical parameter type corresponding to the specific potentially non-canonical one. More...
 
bool hasSameType (QualType T1, QualType T2) const
 Determine whether the given types T1 and T2 are equivalent. More...
 
bool hasSameType (const Type *T1, const Type *T2) const
 
QualType getUnqualifiedArrayType (QualType T, Qualifiers &Quals)
 Return this type as a completely-unqualified array type, capturing the qualifiers in Quals. More...
 
bool hasSameUnqualifiedType (QualType T1, QualType T2) const
 Determine whether the given types are equivalent after cvr-qualifiers have been removed. More...
 
bool hasSameNullabilityTypeQualifier (QualType SubT, QualType SuperT, bool IsParam) const
 
bool ObjCMethodsAreEqual (const ObjCMethodDecl *MethodDecl, const ObjCMethodDecl *MethodImp)
 
bool UnwrapSimilarTypes (QualType &T1, QualType &T2)
 Attempt to unwrap two types that may be similar (C++ [conv.qual]). More...
 
void UnwrapSimilarArrayTypes (QualType &T1, QualType &T2)
 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]. More...
 
bool hasSimilarType (QualType T1, QualType T2)
 Determine if two types are similar, according to the C++ rules. More...
 
bool hasCvrSimilarType (QualType T1, QualType T2)
 Determine if two types are similar, ignoring only CVR qualifiers. More...
 
NestedNameSpecifiergetCanonicalNestedNameSpecifier (NestedNameSpecifier *NNS) const
 Retrieves the "canonical" nested name specifier for a given nested name specifier. More...
 
CallingConv getDefaultCallingConvention (bool IsVariadic, bool IsCXXMethod, bool IsBuiltin=false) const
 Retrieves the default calling convention for the current target. More...
 
TemplateName getCanonicalTemplateName (TemplateName Name) const
 Retrieves the "canonical" template name that refers to a given template. More...
 
bool hasSameTemplateName (TemplateName X, TemplateName Y)
 Determine whether the given template names refer to the same template. More...
 
TemplateArgument getCanonicalTemplateArgument (const TemplateArgument &Arg) const
 Retrieve the "canonical" template argument. More...
 
const ArrayTypegetAsArrayType (QualType T) const
 Type Query functions. More...
 
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. More...
 
QualType getBaseElementType (QualType QT) const
 Return the innermost element type of a type (which needn't actually be an array type). More...
 
uint64_t getConstantArrayElementCount (const ConstantArrayType *CA) const
 Return number of constant array elements. More...
 
QualType getAdjustedParameterType (QualType T) const
 Perform adjustment on the parameter type of a function. More...
 
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. More...
 
QualType getExceptionObjectType (QualType T) const
 
QualType getArrayDecayedType (QualType T) const
 Return the properly qualified result of decaying the specified array type to a pointer. More...
 
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. More...
 
Qualifiers::ObjCLifetime getInnerObjCOwnership (QualType T) const
 Recurses in pointer/array types until it finds an Objective-C retainable type and returns its ownership. More...
 
QualType isPromotableBitField (Expr *E) const
 Whether this is a promotable bitfield reference according to C99 6.3.1.1p2, bullet 2 (and GCC extensions). More...
 
int getIntegerTypeOrder (QualType LHS, QualType RHS) const
 Return the highest ranked integer type, see C99 6.3.1.8p1. More...
 
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. More...
 
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. More...
 
QualType getFloatingTypeOfSizeWithinDomain (QualType typeSize, QualType typeDomain) const
 Return a real floating point or a complex type (based on typeDomain/typeSize). More...
 
unsigned getTargetAddressSpace (QualType T) const
 
unsigned getTargetAddressSpace (Qualifiers Q) const
 
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. More...
 
bool addressSpaceMapManglingFor (LangAS AS) const
 
bool typesAreCompatible (QualType T1, QualType T2, bool CompareUnqualified=false)
 Compatibility predicates used to check assignment expressions. More...
 
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. More...
 
bool ObjCQualifiedClassTypesAreCompatible (const ObjCObjectPointerType *LHS, const ObjCObjectPointerType *RHS)
 ObjCQualifiedClassTypesAreCompatible - compare Class<pr,...> and Class<pr1, ...>. More...
 
bool canAssignObjCInterfaces (const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
 canAssignObjCInterfaces - Return true if the two interface types are compatible for assignment from RHS to LHS. More...
 
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. More...
 
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)
 
QualType mergeFunctionTypes (QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false, bool AllowCXX=false)
 
QualType mergeFunctionParameterTypes (QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
 mergeFunctionParameterTypes - merge two types which appear as function parameter types More...
 
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() More...
 
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. More...
 
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. More...
 
void ResetObjCLayout (const ObjCContainerDecl *CD)
 
unsigned getIntWidth (QualType T) const
 
QualType getCorrespondingUnsignedType (QualType T) const
 
QualType getCorrespondingSignedType (QualType T) const
 
QualType getCorrespondingSaturatedType (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. More...
 
bool isSentinelNullExpr (const Expr *E)
 
ObjCImplementationDeclgetObjCImplementation (ObjCInterfaceDecl *D)
 Get the implementation of the ObjCInterfaceDecl D, or nullptr if none exists. More...
 
ObjCCategoryImplDeclgetObjCImplementation (ObjCCategoryDecl *D)
 Get the implementation of the ObjCCategoryDecl D, or nullptr if none exists. More...
 
bool AnyObjCImplementation ()
 Return true if there is at least one @implementation in the TU. More...
 
void setObjCImplementation (ObjCInterfaceDecl *IFaceD, ObjCImplementationDecl *ImplD)
 Set the implementation of ObjCInterfaceDecl. More...
 
void setObjCImplementation (ObjCCategoryDecl *CatD, ObjCCategoryImplDecl *ImplD)
 Set the implementation of ObjCCategoryDecl. More...
 
const ObjCMethodDeclgetObjCMethodRedeclaration (const ObjCMethodDecl *MD) const
 Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists. More...
 
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. More...
 
void setBlockVarCopyInit (const VarDecl *VD, Expr *CopyExpr, bool CanThrow)
 Set the copy initialization expression of a block var decl. More...
 
BlockVarCopyInit getBlockVarCopyInit (const VarDecl *VD) const
 Get the copy initialization expression of the VarDecl VD, or nullptr if none exists. More...
 
TypeSourceInfoCreateTypeSourceInfo (QualType T, unsigned Size=0) const
 Allocate an uninitialized TypeSourceInfo. More...
 
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. More...
 
void AddDeallocation (void(*Callback)(void *), void *Data) const
 Add a deallocation callback that will be invoked when the ASTContext is destroyed. More...
 
template<typename T >
void addDestruction (T *Ptr) const
 If T isn't trivially destructible, calls AddDeallocation to register it for destruction. More...
 
GVALinkage GetGVALinkageForFunction (const FunctionDecl *FD) const
 
GVALinkage GetGVALinkageForVariable (const VarDecl *VD)
 
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. More...
 
void forEachMultiversionedFunctionVersion (const FunctionDecl *FD, llvm::function_ref< void(FunctionDecl *)> Pred) const
 Visits all versions of a multiversioned function with the passed predicate. More...
 
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) const
 
void setStaticLocalNumber (const VarDecl *VD, unsigned Number)
 
unsigned getStaticLocalNumber (const VarDecl *VD) const
 
MangleNumberingContextgetManglingNumberContext (const DeclContext *DC)
 Retrieve the context for computing mangling numbers in the given DeclContext. More...
 
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. More...
 
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. More...
 
StringLiteralgetPredefinedStringLiteralFromCache (StringRef Key) const
 Return a string representing the human readable name for the specified function declaration or file name. More...
 
MSGuidDeclgetMSGuidDecl (MSGuidDeclParts Parts) const
 Return a declaration for the global GUID object representing the given GUID value. More...
 
TemplateParamObjectDeclgetTemplateParamObjectDecl (QualType T, const APValue &V) const
 Return the template parameter object of the given type with the given value. More...
 
ParsedTargetAttr filterFunctionTargetAttrs (const TargetAttr *TD) const
 Parses the target attributes passed in, and returns only the ones that are valid feature names. More...
 
void getFunctionFeatureMap (llvm::StringMap< bool > &FeatureMap, const FunctionDecl *) const
 
void getFunctionFeatureMap (llvm::StringMap< bool > &FeatureMap, GlobalDecl GD) const
 
void InitBuiltinTypes (const TargetInfo &Target, const TargetInfo *AuxTarget=nullptr)
 Initialize built-in types. More...
 
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. More...
 
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. More...
 
InlineVariableDefinitionKind getInlineVariableDefinitionKind (const VarDecl *VD) const
 Determine whether a definition of this inline variable should be treated as a weak or strong definition. More...
 
OMPTraitInfogetNewOMPTraitInfo ()
 Return a new OMPTraitInfo object owned by this context. More...
 
bool mayExternalizeStaticVar (const Decl *D) const
 Whether a C++ static variable may be externalized. More...
 
bool shouldExternalizeStaticVar (const Decl *D) const
 Whether a C++ static variable should be externalized. More...
 
StringRef getCUIDHash () const
 
void AddSYCLKernelNamingDecl (const CXXRecordDecl *RD)
 
bool IsSYCLKernelNamingDecl (const NamedDecl *RD) const
 
unsigned GetSYCLKernelNamingIndex (const NamedDecl *RD)
 
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. More...
 

Public Attributes

IdentifierTableIdents
 
SelectorTableSelectors
 
Builtin::ContextBuiltinInfo
 
const TranslationUnitKind TUKind
 
DeclarationNameTable DeclarationNames
 
IntrusiveRefCntPtr< ExternalASTSourceExternalSource
 
ASTMutationListenerListener = nullptr
 
RawCommentList Comments
 All comments in this translation unit. More...
 
bool CommentsLoaded = false
 True if comments are already loaded from ExternalASTSource. More...
 
llvm::DenseMap< const Decl *, const RawComment * > DeclRawComments
 Mapping from declaration to directly attached comment. More...
 
llvm::DenseMap< const Decl *, const Decl * > RedeclChainComments
 Mapping from canonical declaration to the first redeclaration in chain that has a comment attached. More...
 
llvm::DenseMap< const Decl *, const Decl * > CommentlessRedeclChains
 Keeps track of redeclaration chains that don't have any comment attached. More...
 
llvm::DenseMap< const Decl *, comments::FullComment * > ParsedComments
 Mapping from declarations to parsed comments attached to any redeclaration. More...
 
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 FloatComplexTy
 
CanQualType DoubleComplexTy
 
CanQualType LongDoubleComplexTy
 
CanQualType Float128ComplexTy
 
CanQualType VoidPtrTy
 
CanQualType NullPtrTy
 
CanQualType DependentTy
 
CanQualType OverloadTy
 
CanQualType BoundMemberTy
 
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 OMPArraySectionTy
 
CanQualType OMPArrayShapingTy
 
CanQualType OMPIteratorTy
 
QualType AutoDeductTy
 
QualType AutoRRefDeductTy
 
DeclVaListTagDecl = nullptr
 
TagDeclMSGuidTagDecl = nullptr
 
llvm::DenseSet< const VarDecl * > CUDADeviceVarODRUsedByHost
 Keep track of CUDA/HIP device-side variables ODR-used by host code. More...
 
ComparisonCategories CompCategories
 Types and expressions required to build C++2a three-way comparisons using operator<=>, including the values return by builtin <=> operators. More...
 
unsigned NumImplicitDefaultConstructors = 0
 The number of implicitly-declared default constructors. More...
 
unsigned NumImplicitDefaultConstructorsDeclared = 0
 The number of implicitly-declared default constructors for which declarations were built. More...
 
unsigned NumImplicitCopyConstructors = 0
 The number of implicitly-declared copy constructors. More...
 
unsigned NumImplicitCopyConstructorsDeclared = 0
 The number of implicitly-declared copy constructors for which declarations were built. More...
 
unsigned NumImplicitMoveConstructors = 0
 The number of implicitly-declared move constructors. More...
 
unsigned NumImplicitMoveConstructorsDeclared = 0
 The number of implicitly-declared move constructors for which declarations were built. More...
 
unsigned NumImplicitCopyAssignmentOperators = 0
 The number of implicitly-declared copy assignment operators. More...
 
unsigned NumImplicitCopyAssignmentOperatorsDeclared = 0
 The number of implicitly-declared copy assignment operators for which declarations were built. More...
 
unsigned NumImplicitMoveAssignmentOperators = 0
 The number of implicitly-declared move assignment operators. More...
 
unsigned NumImplicitMoveAssignmentOperatorsDeclared = 0
 The number of implicitly-declared move assignment operators for which declarations were built. More...
 
unsigned NumImplicitDestructors = 0
 The number of implicitly-declared destructors. More...
 
unsigned NumImplicitDestructorsDeclared = 0
 The number of implicitly-declared destructors for which declarations were built. More...
 
llvm::StringMap< SectionInfoSectionInfos
 
llvm::MapVector< const SYCLUniqueStableNameExpr *, std::stringSYCLUniqueStableNameEvaluatedValues
 A SourceLocation to store whether we have evaluated a kernel name already, and where it happened. More...
 

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

Member Typedef Documentation

◆ import_range

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

Definition at line 1011 of file ASTContext.h.

◆ overridden_cxx_method_iterator

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

Definition at line 973 of file ASTContext.h.

◆ overridden_method_range

Definition at line 983 of file ASTContext.h.

◆ TemplateOrSpecializationInfo

A type synonym for the TemplateOrInstantiation mapping.

Definition at line 476 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 2150 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 3153 of file ASTContext.h.

◆ NeedExtraManglingDecl_t

Enumerator
NeedExtraManglingDecl 

Definition at line 2995 of file ASTContext.h.

◆ PragmaSectionFlag

Enumerator
PSF_None 
PSF_Read 
PSF_Write 
PSF_Execute 
PSF_Implicit 
PSF_ZeroInit 
PSF_Invalid 

Definition at line 3207 of file ASTContext.h.

Constructor & Destructor Documentation

◆ ASTContext() [1/2]

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

Definition at line 973 of file ASTContext.cpp.

References addTranslationUnitDecl().

◆ ASTContext() [2/2]

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

◆ ~ASTContext()

ASTContext::~ASTContext ( )

Definition at line 993 of file ASTContext.cpp.

Member Function Documentation

◆ addComment()

void ASTContext::addComment ( const RawComment RC)

◆ addCopyConstructorForExceptionObject()

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

◆ AddDeallocation()

void ASTContext::AddDeallocation ( void(*)(void *)  Callback,
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 1032 of file ASTContext.cpp.

Referenced by addDestruction().

◆ addDeclaratorForUnnamedTagDecl()

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

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

References AddDeallocation(), and V.

Referenced by clang::MSGuidDecl::getAsAPValue(), clang::LifetimeExtendedTemporaryDecl::getOrCreateValue(), clang::ConstantExpr::MoveIntoResult(), 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 1685 of file ASTContext.cpp.

References clang::Decl::isFromASTFile().

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

◆ addLazyModuleInitializers()

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

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

Referenced by clang::Sema::ActOnModuleImport(), and clang::Sema::BuildModuleInclude().

◆ addOverriddenMethod()

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

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

Definition at line 1659 of file ASTContext.cpp.

References clang::Decl::isCanonicalDecl().

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

◆ addressSpaceMapManglingFor()

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

Definition at line 2728 of file ASTContext.h.

References clang::isTargetAddressSpace().

◆ AddSYCLKernelNamingDecl()

void ASTContext::AddSYCLKernelNamingDecl ( const CXXRecordDecl RD)

◆ addTranslationUnitDecl()

void clang::ASTContext::addTranslationUnitDecl ( )
inline

◆ addTypedefNameForUnnamedTagDecl()

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

Definition at line 11342 of file ASTContext.cpp.

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

◆ adjustDeducedFunctionResultType()

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

◆ adjustExceptionSpec()

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

◆ adjustFunctionType()

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

◆ adjustObjCTypeParamBoundType()

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

◆ adjustStringLiteralBaseType()

QualType ASTContext::adjustStringLiteralBaseType ( QualType  StrLTy) const

◆ Allocate() [1/2]

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

Definition at line 704 of file ASTContext.h.

References Allocate().

◆ Allocate() [2/2]

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

Definition at line 701 of file ASTContext.h.

Referenced by Allocate(), clang::CXXOperatorCallExpr::Create(), clang::OMPArrayShapingExpr::Create(), clang::CXXMemberCallExpr::Create(), clang::ObjCAtTryStmt::Create(), clang::CUDAKernelCallExpr::Create(), clang::OMPIteratorExpr::Create(), clang::UserDefinedLiteral::Create(), clang::ObjCTypeParamList::create(), clang::DependentFunctionTemplateSpecializationInfo::Create(), clang::ConstantExpr::Create(), clang::DeclRefExpr::Create(), clang::CXXConstructExpr::Create(), clang::CaseStmt::Create(), clang::CXXTemporaryObjectExpr::Create(), clang::StringLiteral::Create(), clang::FunctionDecl::DefaultedFunctionInfo::Create(), clang::LambdaExpr::Create(), clang::IfStmt::Create(), clang::SwitchStmt::Create(), clang::CXXNewExpr::Create(), clang::WhileStmt::Create(), clang::ReturnStmt::Create(), clang::CallExpr::Create(), clang::UnresolvedLookupExpr::Create(), clang::DependentScopeDeclRefExpr::Create(), clang::CXXDependentScopeMemberExpr::Create(), clang::ParenListExpr::Create(), clang::GenericSelectionExpr::Create(), clang::PseudoObjectExpr::Create(), clang::RecoveryExpr::Create(), clang::TemplateArgumentList::CreateCopy(), clang::CapturedStmt::CreateDeserialized(), clang::CXXOperatorCallExpr::CreateEmpty(), clang::OMPArrayShapingExpr::CreateEmpty(), clang::CXXMemberCallExpr::CreateEmpty(), clang::ObjCAtTryStmt::CreateEmpty(), clang::CUDAKernelCallExpr::CreateEmpty(), clang::OMPIteratorExpr::CreateEmpty(), clang::UserDefinedLiteral::CreateEmpty(), clang::ConstantExpr::CreateEmpty(), clang::DeclRefExpr::CreateEmpty(), clang::CXXConstructExpr::CreateEmpty(), clang::CaseStmt::CreateEmpty(), clang::CXXTemporaryObjectExpr::CreateEmpty(), clang::StringLiteral::CreateEmpty(), clang::IfStmt::CreateEmpty(), clang::SwitchStmt::CreateEmpty(), clang::CXXNewExpr::CreateEmpty(), clang::WhileStmt::CreateEmpty(), clang::ReturnStmt::CreateEmpty(), clang::CallExpr::CreateEmpty(), clang::UnresolvedLookupExpr::CreateEmpty(), clang::DependentScopeDeclRefExpr::CreateEmpty(), clang::MemberExpr::CreateEmpty(), clang::CXXDependentScopeMemberExpr::CreateEmpty(), clang::ParenListExpr::CreateEmpty(), clang::GenericSelectionExpr::CreateEmpty(), clang::RecoveryExpr::CreateEmpty(), getAutoType(), getCanonicalTemplateSpecializationType(), getConstantArrayType(), getDeclAttrs(), getElaboratedType(), clang::ASTReader::GetExternalCXXBaseSpecifiers(), getObjCInterfaceType(), getObjCObjectPointerType(), getObjCObjectType(), getObjCTypeParamType(), getOverloadedTemplateName(), getTemplateSpecializationType(), clang::NestedNameSpecifierLocBuilder::getWithLocInContext(), clang::Decl::operator new(), clang::Sema::SaveNestedNameSpecifierAnnotation(), and clang::TemplateArgument::TemplateArgument().

◆ AllocateDeclListNode()

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

Allocates a DeclListNode or returns one from the ListNodeFreeList pool.

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

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

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

References clang::ObjCObjectType::getBaseType(), getObjCObjectPointerType(), getObjCObjectType(), getObjCTypeParamType(), clang::ObjCObjectType::getTypeArgsAsWritten(), clang::ObjCObjectType::isKindOfTypeAsWritten(), ObjCBuiltinClassTy, ObjCBuiltinIdTy, clang::ObjCProtocolQualifiers< T >::qual_begin(), clang::ObjCProtocolQualifiers< T >::qual_end(), and clang::ast_matchers::type.

Referenced by clang::Sema::BuildObjCObjectType(), clang::Sema::BuildObjCTypeParamType(), and getObjCTypeParamType().

◆ areCommonBaseCompatible()

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

◆ areComparableObjCPointerTypes()

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

Definition at line 9448 of file ASTContext.cpp.

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

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

◆ areCompatibleSveTypes()

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

◆ areCompatibleVectorTypes()

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

◆ areLaxCompatibleSveTypes()

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

◆ AtomicUsesUnsupportedLibcall()

bool ASTContext::AtomicUsesUnsupportedLibcall ( const AtomicExpr E) const

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

References adjustDeclToTemplate(), cacheRawCommentForDecl(), Comments, DeclRawComments, clang::RawCommentList::empty(), clang::File, clang::RawCommentList::getCommentsInFile(), getDeclLocForCommentSearch(), clang::SourceManager::getDecomposedLoc(), getRawCommentForDeclNoCacheImpl(), clang::SourceLocation::isFileID(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isValid(), and ParsedComments.

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

◆ BlockRequiresCopying()

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

◆ buildBuiltinTemplateDecl()

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

◆ buildImplicitRecord()

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

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

References CommentlessRedeclChains, clang::LangOptions::CommentOpts, DeclRawComments, clang::Decl::getCanonicalDecl(), clang::RawComment::isDocumentation(), clang::CommentOptions::ParseAllComments, 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 9069 of file ASTContext.cpp.

References 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 mergeTypes().

◆ canBindObjCObjectType()

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

◆ canBuiltinBeRedeclared()

bool ASTContext::canBuiltinBeRedeclared ( const FunctionDecl FD) const

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

Definition at line 8467 of file ASTContext.cpp.

References BuiltinInfo, clang::Builtin::Context::canBeRedeclared(), and clang::FunctionDecl::getBuiltinID().

◆ cloneFullComment()

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

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

References clang::ObjCInterfaceDecl::getSuperClass().

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

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

References clang::ItaniumMangleContext::create(), clang::MicrosoftMangleContext::create(), clang::TargetInfo::getCXXABI(), getDiagnostics(), and clang::TargetCXXABI::getKind().

Referenced by InitDeviceMC().

◆ createMangleContext()

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

◆ createMangleNumberingContext()

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

Definition at line 11325 of file ASTContext.cpp.

Referenced by 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 2938 of file ASTContext.cpp.

References clang::TypeLoc::getFullDataSizeForType().

Referenced by clang::Sema::ActOnBlockArguments(), clang::Sema::actOnObjCProtocolQualifierType(), clang::Sema::CheckTypenameType(), and getTrivialTypeSourceInfo().

◆ Deallocate()

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

◆ DeallocateDeclListNode()

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

Deallcates a DeclListNode by returning it to the ListNodeFreeList pool.

Definition at line 722 of file ASTContext.h.

◆ DeclMustBeEmitted()

bool ASTContext::DeclMustBeEmitted ( const Decl D)

◆ DecodeTypeStr()

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

Definition at line 10712 of file ASTContext.cpp.

References DecodeTypeFromStr().

Referenced by DecodePPCMMATypeFromStr().

◆ deduplicateMergedDefinitonsFor()

void ASTContext::deduplicateMergedDefinitonsFor ( NamedDecl ND)

Clean up the merged definition list.

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

Definition at line 1111 of file ASTContext.cpp.

References clang::Decl::getCanonicalDecl(), and clang::transformer::remove().

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

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

◆ DumpRecordLayout()

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

◆ eraseDeclAttrs()

void ASTContext::eraseDeclAttrs ( const Decl D)

Erase the attributes corresponding to the given declaration.

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

References string().

Referenced by clang::CodeGen::CodeGenFunction::checkTargetFeatures(), and getFunctionFeatureMap().

◆ forEachMultiversionedFunctionVersion()

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

◆ getAddrSpaceQualType()

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

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

References getDecayedType(), clang::Type::isArrayType(), and clang::Type::isFunctionType().

Referenced by clang::Sema::BuildFunctionType(), and getSignatureParameterType().

◆ getAdjustedType() [1/2]

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

Definition at line 1316 of file ASTContext.h.

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

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

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

Referenced by clang::Sema::adjustMemberFunctionCC(), and getAdjustedType().

◆ getAlignOfGlobalVar()

unsigned ASTContext::getAlignOfGlobalVar ( QualType  T) 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.

Definition at line 2543 of file ASTContext.cpp.

References getPreferredTypeAlign(), getTargetInfo(), clang::QualType::getTypePtr(), getTypeSize(), and max().

Referenced by getAlignOfGlobalVarInChars().

◆ getAlignOfGlobalVarInChars()

CharUnits ASTContext::getAlignOfGlobalVarInChars ( QualType  T) 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.

Definition at line 2551 of file ASTContext.cpp.

References getAlignOfGlobalVar(), and toCharUnitsFromBits().

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

◆ getAllocator()

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

Definition at line 697 of file ASTContext.h.

Referenced by clang::Decl::getID(), clang::Stmt::getID(), and clang::RawComment::parse().

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

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

Referenced by clang::Sema::ActOnStringLiteral(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), clang::Sema::BuildVAArgExpr(), clang::Sema::CheckSpecifiedExceptionType(), DecodeTypeFromStr(), clang::Sema::DeduceTemplateArguments(), clang::Sema::DefaultFunctionArrayConversion(), clang::Sema::DiagnoseAssignmentResult(), doRewriteToUTF8StringBoxedExpressionHelper(), GetBuiltinType(), getCanonicalParamType(), getDecayedType(), clang::StandardConversionSequence::isPointerConversionToVoidPointer(), and clang::Sema::PerformImplicitConversion().

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

References clang::Qualifiers::empty(), clang::QualType::getCanonicalType(), getConstantArrayType(), getDependentSizedArrayType(), getIncompleteArrayType(), getQualifiedType(), clang::QualType::getSplitDesugaredType(), getVariableArrayType(), clang::QualType::hasLocalQualifiers(), clang::SplitQualType::Quals, and clang::SplitQualType::Ty.

Referenced by clang::Sema::CheckAllocatedType(), clang::Sema::CheckStaticArrayArgument(), clang::Sema::deduceOpenCLAddressSpace(), clang::CodeGen::CodeGenFunction::emitArrayLength(), clang::CodeGen::CodeGenFunction::emitDestroy(), clang::CodeGen::ReductionCodeGen::emitInitialization(), emitPartialArrayDestroy(), EvaluateArrayTypeTrait(), clang::Sema::FillInlineAsmIdentifierInfo(), getArrayDecayedType(), getAsConstantArrayType(), getAsDependentSizedArrayType(), getAsIncompleteArrayType(), getAsVariableArrayType(), getDeclAlign(), clang::CFGImplicitDtor::getDestructorDecl(), getLValueType(), clang::ento::MemRegionManager::getStaticSize(), isDesignatorAtObjectEnd(), isSafeToConvert(), IsStringInit(), clang::CodeGen::CodeGenTypes::isZeroInitializable(), mergeTypes(), clang::Sema::MergeVarDeclTypes(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), TypeRequiresBuiltinLaunderImp(), unwrapCastAwayConstnessLevel(), and UnwrapSimilarArrayTypes().

◆ getAsConstantArrayType()

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

◆ getAsDependentSizedArrayType()

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

Definition at line 2630 of file ASTContext.h.

References getAsArrayType().

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

Referenced by clang::ASTImporter::Import().

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

◆ getASTMutationListener()

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

◆ getASTObjCImplementationLayout()

const ASTRecordLayout & ASTContext::getASTObjCImplementationLayout ( const ObjCImplementationDecl D) const

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

This may differ from the interface if synthesized ivars are present.

Definition at line 2965 of file ASTContext.cpp.

References clang::ObjCImplDecl::getClassInterface().

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

Referenced by getTypeUnadjustedAlign().

◆ 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 3246 of file RecordLayoutBuilder.cpp.

References clang::ExternalASTSource::CompleteType(), clang::RecordDecl::getDefinition(), getExternalSource(), clang::DeclContext::hasExternalLexicalStorage(), clang::TagDecl::isCompleteDefinition(), clang::Decl::isInvalidDecl(), and isMsLayout().

Referenced by AddIndirectPrimaryBases(), clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), BitsContainNoUserData(), clang::CodeGen::CGCXXABI::buildThisParam(), classifyType(), clang::RecordDecl::completeDefinition(), clang::CodeGen::CodeGenModule::computeNonVirtualBaseClassOffset(), DiagnoseReinterpretUpDownCast(), DumpRecordLayout(), clang::CodeGen::CodeGenFunction::EmitAsanPrologueOrEpilogue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), EmitNullBaseClassInitialization(), EmitNullConstant(), clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), clang::CodeGen::CodeGenFunction::GetAddressOfDirectBaseInCompleteClass(), getBaseAlignmentAndOffsetFromLValue(), getBaseAlignmentAndOffsetFromPtr(), clang::CodeGen::CodeGenModule::getClassPointerAlignment(), getDeclAlign(), getDerivedToBaseAlignmentAndOffset(), clang::CodeGen::CodeGenModule::getDynamicOffsetAlignment(), getMemberPointerPathAdjustment(), clang::CodeGen::CodeGenModule::getMinimumClassObjectSize(), getOffsetOfBaseWithVBPtr(), getOffsetOfFullPath(), clang::CodeGen::CodeGenFunction::getOverlapForBaseInit(), clang::CodeGen::CodeGenFunction::getOverlapForFieldInit(), getPreferredTypeAlign(), getTypeInfoDataSizeInChars(), getTypeUnadjustedAlign(), clang::CodeGen::CodeGenModule::getVBaseAlignment(), clang::CodeGen::CodeGenFunction::GetVTTParameter(), isDesignatorAtObjectEnd(), isIntegerLikeType(), setUsedBits(), and structHasUniqueObjectRepresentations().

◆ getAsVariableArrayType()

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

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

References getCanonicalType(), clang::QualType::isCanonical(), clang::AtomicType::Profile(), and clang::TypeAlignment.

Referenced by clang::Sema::BuildAtomicType(), getVariableArrayDecayedType(), clang::Sema::Initialize(), mergeTypes(), and clang::ASTNodeImporter::VisitAtomicType().

◆ getAttributedType()

QualType ASTContext::getAttributedType ( attr::Kind  attrKind,
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 5684 of file ASTContext.cpp.

References clang::Auto, AutoDeductTy, clang::QualType::isNull(), clang::XRayInstrKind::None, and clang::TypeAlignment.

Referenced by clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::buildLambdaInitCaptureInitialization(), getAutoRRefDeductType(), and getAutoType().

◆ getAutoRRefDeductType()

QualType ASTContext::getAutoRRefDeductType ( ) const

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

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

Definition at line 5695 of file ASTContext.cpp.

References AutoRRefDeductTy, getAutoDeductType(), getRValueReferenceType(), and clang::QualType::isNull().

◆ getAutoType()

QualType ASTContext::getAutoType ( QualType  DeducedType,
AutoTypeKeyword  Keyword,
bool  IsDependent,
bool  IsPack = false,
ConceptDecl 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 5601 of file ASTContext.cpp.

References Allocate(), clang::Auto, getAutoDeductType(), clang::XRayInstrKind::None, clang::AutoType::Profile(), and clang::TypeAlignment.

Referenced by clang::TreeTransform< Derived >::RebuildAutoType(), clang::TreeTransform< Derived >::RebuildQualifiedType(), and clang::ASTNodeImporter::VisitAutoType().

◆ getAuxTargetInfo()

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

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

References clang::ArrayType::getElementType().

Referenced by clang::Sema::ActOnInitializerError(), clang::Sema::ActOnOpenMPCopyinClause(), clang::Sema::ActOnOpenMPCopyprivateClause(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPLastprivateClause(), clang::Sema::ActOnUninitializedDecl(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildArrayType(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::BuildCXXTypeConstructExpr(), BuildImplicitMemberInitializer(), CheckAggExprForMemSetUse(), clang::Sema::CheckAllocatedType(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckNontrivialField(), clang::Sema::CheckUnaryExprOrTypeTraitOperand(), clang::Sema::CollectIvarsToConstructOrDestruct(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), diagnoseOpenCLTypes(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), EmitMemberInitializer(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), FieldHasTrivialDestructorBody(), clang::Sema::FindAllocationFunctions(), getDeclAlign(), clang::CFGImplicitDtor::getDestructorDecl(), getInnerObjCOwnership(), clang::CodeGen::CodeGenModule::getNaturalTypeAlignment(), getTypeAlignIfKnown(), hasUniqueObjectRepresentations(), clang::Sema::inferCUDATargetForImplicitSpecialMember(), clang::Sema::isAbstractType(), isConstNotMutableType(), clang::QualType::isCXX98PODType(), clang::arcmt::trans::MigrationContext::isGCOwnedNonObjC(), clang::QualType::isTriviallyCopyableType(), clang::QualType::isTrivialType(), clang::CodeGen::CodeGenModule::isTypeConstant(), clang::CodeGen::CodeGenTypes::isZeroInitializable(), clang::Sema::MarkBaseAndMemberDestructorsReferenced(), clang::ento::ExprEngine::ProcessDeleteDtor(), clang::Sema::RequireLiteralType(), clang::Sema::RequireNonAbstractType(), clang::Sema::RequireStructuralType(), clang::Sema::SetIvarInitializers(), setUsedBits(), clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit(), TypeRequiresBuiltinLaunderImp(), and clang::UsedDeclVisitor< Derived >::VisitCXXDeleteExpr().

◆ getBaseElementType() [2/2]

QualType ASTContext::getBaseElementType ( QualType  QT) const

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

Definition at line 6289 of file ASTContext.cpp.

References clang::Qualifiers::addConsistentQualifiers(), clang::Type::getAsArrayTypeUnsafe(), clang::ArrayType::getElementType(), getQualifiedType(), clang::SplitQualType::Quals, and clang::SplitQualType::Ty.

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

References getCanonicalType(), clang::QualType::isCanonical(), clang::Type::isFunctionType(), clang::BlockPointerType::Profile(), and clang::TypeAlignment.

Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::BuildBlockPointerType(), clang::Sema::DeduceReturnType(), mergeTypes(), clang::Sema::PerformImplicitConversion(), and clang::ASTNodeImporter::VisitBlockPointerType().

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

Referenced by clang::Sema::ActOnObjCBoolLiteral(), and getBOOLType().

◆ getBoolName()

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

Retrieve the identifier 'bool'.

Definition at line 1848 of file ASTContext.h.

References clang::IdentifierTable::get(), and Idents.

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

◆ getBOOLType()

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

type of 'BOOL' type.

Definition at line 2028 of file ASTContext.h.

References getBOOLDecl(), and getTypeDeclType().

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

◆ getBuiltinMSVaListDecl()

TypedefDecl * ASTContext::getBuiltinMSVaListDecl ( ) const

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

Definition at line 8460 of file ASTContext.cpp.

References CreateMSVaListDecl().

Referenced by getBuiltinMSVaListType(), getPredefinedDecl(), and clang::Sema::Initialize().

◆ getBuiltinMSVaListType()

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

Retrieve the type of the __builtin_ms_va_list type.

Definition at line 2056 of file ASTContext.h.

References getBuiltinMSVaListDecl(), and getTypeDeclType().

Referenced by clang::Sema::BuildVAArgExpr(), and Desugar().

◆ GetBuiltinType()

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

◆ getBuiltinVaListDecl()

TypedefDecl * ASTContext::getBuiltinVaListDecl ( ) const

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

Definition at line 8442 of file ASTContext.cpp.

References CreateVaListDecl(), clang::TargetInfo::getBuiltinVaListKind(), and clang::Decl::isImplicit().

Referenced by getBuiltinVaListType(), getPredefinedDecl(), getVaListTagDecl(), and clang::Sema::Initialize().

◆ getBuiltinVaListType()

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

Retrieve the type of the __builtin_va_list type.

Definition at line 2042 of file ASTContext.h.

References getBuiltinVaListDecl(), and getTypeDeclType().

Referenced by clang::Sema::BuildVAArgExpr(), DecodeTypeFromStr(), and Desugar().

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

References BFloat16Ty, BoolTy, DoubleTy, FloatTy, clang::BuiltinType::getKind(), HalfTy, SVE_ELTTY, and SVE_INT_ELTTY.

Referenced by areCompatibleSveTypes(), clang::CodeGen::CodeGenTypes::ConvertType(), and clang::Type::getSveEltType().

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

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

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

◆ getCanonicalFunctionResultType()

CanQualType ASTContext::getCanonicalFunctionResultType ( QualType  ResultType) const

◆ getCanonicalNestedNameSpecifier()

NestedNameSpecifier * ASTContext::getCanonicalNestedNameSpecifier ( NestedNameSpecifier NNS) const

Retrieves the "canonical" nested name specifier for a given nested name specifier.

The canonical nested name specifier is a nested name specifier that uniquely identifies a type or namespace within the type system. For example, given:

namespace N {
struct S {
template<typename T> struct X { typename T* type; };
};
}
template<typename T> struct Y {
};

Here, the nested-name-specifier for N::S::X<T>:: will be S::X<template-param-0-0>, since 'S' and 'X' are uniquely defined by declarations in the type system and the canonical type for the template type parameter 'T' is template-param-0-0.

Definition at line 6115 of file ASTContext.cpp.

References clang::NestedNameSpecifier::Create(), clang::Type::getAs(), clang::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getAsNamespace(), clang::NestedNameSpecifier::getAsNamespaceAlias(), clang::NestedNameSpecifier::getAsType(), getCanonicalType(), clang::NestedNameSpecifier::getKind(), clang::NamespaceAliasDecl::getNamespace(), clang::NamespaceDecl::getOriginalNamespace(), clang::NestedNameSpecifier::getPrefix(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::Identifier, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::NestedNameSpecifier::Super, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.

Referenced by clang::Sema::CheckUsingDeclRedeclaration(), clang::NamedDecl::declarationReplaces(), and getDependentTemplateName().

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

References clang::CanQual< Type >::CreateUnsafe(), getArrayDecayedType(), getCanonicalType(), getPointerType(), clang::QualType::getTypePtr(), and getVariableArrayDecayedType().

Referenced by clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionCall(), clang::CodeGen::CodeGenTypes::arrangeCXXConstructorCall(), arrangeFreeFunctionLikeCall(), clang::CodeGen::CodeGenTypes::arrangeObjCMessageSendSignature(), getArgTypesForCall(), and getArgTypesForDeclaration().

◆ getCanonicalTemplateArgument()

TemplateArgument ASTContext::getCanonicalTemplateArgument ( const TemplateArgument Arg) const

◆ getCanonicalTemplateName()

TemplateName ASTContext::getCanonicalTemplateName ( TemplateName  Name) 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 6015 of file ASTContext.cpp.

Referenced by getCanonicalTemplateArgument(), getCanonicalTemplateSpecializationType(), hasSameTemplateName(), clang::Sema::isMoreSpecializedThanPrimary(), isSameTemplateArg(), and clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs().

◆ getCanonicalTemplateSpecializationType()

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

◆ getCanonicalType() [1/2]

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

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

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

Referenced by clang::Sema::ActOnConversionDeclarator(), clang::Sema::ActOnCXXTryBlock(), clang::Sema::AttachBaseSpecifiers(), clang::Sema::BuildReferenceType(), BuildSimilarlyQualifiedPointerType(), clang::Sema::BuildStdInitializerList(), clang::Sema::ImplicitExceptionSpecification::CalledDecl(), clang::ento::StoreManager::castRegion(), CastsAwayConstness(), clang::Sema::CheckAssignmentConstraints(), clang::Sema::CheckConstructor(), clang::Sema::CheckObjCARCUnavailableWeakConversion(), CheckOperatorDeleteDeclaration(), CheckOperatorNewDeclaration(), CheckOperatorNewDeleteTypes(), clang::Sema::CheckPtrComparisonWithNullChar(), clang::Sema::CheckSubtractionOperands(), clang::Sema::CheckTemplateArgument(), CollectVRQualifiers(), clang::Sema::CompareReferenceRelationship(), clang::Sema::computeDeclContext(), clang::cross_tu::containsConst(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::Sema::CXXCheckConditionalOperands(), clang::Sema::DeclareImplicitDefaultConstructor(), clang::Sema::DeclareImplicitDestructor(), clang::Sema::DeduceAutoType(), clang::Sema::DeduceTemplateArguments(), clang::Sema::DiagnosePropertyAccessorMismatch(), clang::Sema::DiagnosePropertyMismatch(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), clang::ento::SValBuilder::evalCast(), clang::ento::SValBuilder::evalCastSubKind(), clang::Sema::ExtractUnqualifiedFunctionType(), clang::Sema::FindCompositeObjCPointerType(), clang::CodeGen::CodeGenFunction::GetAddressOfDerivedClass(), getAddrSpaceQualType(), getAdjustedType(), getAtomicType(), getAttributedType(), clang::CodeGen::CodeGenTBAA::getBaseTypeInfo(), getBlockPointerType(), getCanonicalFunctionResultType(), getCanonicalNestedNameSpecifier(), getCanonicalParamType(), getCanonicalTemplateArgument(), getComplexType(), getConstantArrayType(), getConstantMatrixType(), getConstructors(), getDecayedType(), getDecltypeType(), getDependentAddressSpaceType(), getDependentSizedArrayType(), getDependentSizedExtVectorType(), getDependentSizedMatrixType(), getDependentVectorType(), getElaboratedType(), clang::ento::MemRegionManager::getElementRegion(), getExtVectorType(), getIncompleteArrayType(), getIntegerTypeOrder(), GetKeyForBase(), getLValueReferenceType(), getMacroQualifiedType(), getMemberPointerType(), getObjCGCQualType(), getObjCObjectPointerType(), getObjCObjectType(), getObjCTypeParamType(), getPackExpansionType(), getParenType(), getPointerType(), getRValueReferenceType(), getSubstTemplateTypeParmPackType(), clang::CodeGen::CodeGenTBAA::getTBAAStructInfo(), clang::Sema::getTemplateInstantiationArgs(), getTemplateSpecializationType(), getTypedefType(), clang::CodeGen::CodeGenTBAA::getTypeInfo(), getTypeOfExprType(), getTypeOfType(), getUnaryTransformType(), getVariableArrayType(), getVectorType(), hasSameType(), hasSameUnqualifiedType(), clang::ento::SValBuilder::haveSameType(), clang::Sema::ImpCastExprToType(), clang::ASTImporter::Import(), InitBuiltinTypes(), InitCatchParam(), clang::Sema::IsFunctionConversion(), IsModifiable(), clang::Sema::isObjCPointerConversion(), clang::Sema::IsOverload(), clang::Sema::IsQualificationConversion(), clang::Sema::isSameOrCompatibleFunctionType(), isSameTemplateArg(), IsStringInit(), IsStructurallyEquivalent(), clang::Expr::isUnusedResultAWarning(), clang::Sema::LookupConstructors(), clang::Sema::LookupSpecialMember(), MarkUsedTemplateParameters(), matchTypes(), clang::Sema::MaybeBindToTemporary(), mergeFunctionTypes(), mergeObjCGCQualifiers(), mergeTypes(), NoteIndirectBases(), clang::Sema::ProcessPropertyDecl(), clang::CodeGen::CodeGenTypes::RefreshTypeCacheForClass(), clang::LookupResult::resolveKind(), rewriteToObjCProperty(), TryConstCast(), TryReinterpretCast(), TryStaticCast(), TryStaticPointerDowncast(), TryStaticReferenceDowncast(), clang::Sema::UsualArithmeticConversions(), clang::ento::ExprEngine::VisitBlockExpr(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::ento::ExprEngine::VisitInitListExpr(), and clang::ASTNodeImporter::VisitTemplateSpecializationType().

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

References buildImplicitRecord(), and clang::TagDecl::startDefinition().

Referenced by getCFConstantStringTagDecl(), getCFConstantStringType(), getPredefinedDecl(), and clang::Sema::Initialize().

◆ getCFConstantStringTagDecl()

RecordDecl * ASTContext::getCFConstantStringTagDecl ( ) const

Definition at line 6689 of file ASTContext.cpp.

References getCFConstantStringDecl().

Referenced by getPredefinedDecl().

◆ getCFConstantStringType()

QualType ASTContext::getCFConstantStringType ( ) const

Return the C structure type used to represent constant CFStrings.

Definition at line 6696 of file ASTContext.cpp.

References getCFConstantStringDecl(), and getTypedefType().

Referenced by DecodeTypeFromStr(), and clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString().

◆ getCharWidth()

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

◆ getCommentCommandTraits()

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

◆ getCommentForDecl()

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

Return parsed documentation comment attached to a given declaration.

Returns nullptr if no comment is attached.

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

Definition at line 557 of file ASTContext.cpp.

References addRedeclaredMethods(), adjustDeclToTemplate(), clang::AS_public, cloneFullComment(), clang::ObjCPropertyDecl::findPropertyDecl(), clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::Decl::getCanonicalDecl(), getOverriddenMethods(), getRawCommentForAnyRedecl(), clang::Decl::isInvalidDecl(), clang::QualType::isNull(), clang::RawComment::parse(), and ParsedComments.

◆ getComplexType() [1/2]

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

Definition at line 1302 of file ASTContext.h.

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

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

References getCanonicalType(), clang::QualType::isCanonical(), clang::ComplexType::Profile(), and clang::TypeAlignment.

Referenced by clang::Sema::ActOnNumericConstant(), DecodeTypeFromStr(), getComplexType(), InitBuiltinTypes(), and clang::ASTNodeImporter::VisitComplexType().

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

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

Referenced by clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), clang::CodeGen::CodeGenTypes::isZeroInitializable(), and setUsedBits().

◆ getConstantArrayType()

QualType ASTContext::getConstantArrayType ( QualType  EltTy,
const llvm::APInt &  ArySize,
const Expr SizeExpr,
ArrayType::ArraySizeModifier  ASM,
unsigned  IndexTypeQuals 
) const

◆ getConstantMatrixType()

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

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

References clang::QualType::withConst().

◆ getCopyConstructorForExceptionObject()

const CXXConstructorDecl * ASTContext::getCopyConstructorForExceptionObject ( CXXRecordDecl RD)

◆ getCorrespondingSaturatedType()

QualType ASTContext::getCorrespondingSaturatedType ( QualType  Ty) const

◆ getCorrespondingSignedFixedPointType()

QualType ASTContext::getCorrespondingSignedFixedPointType ( QualType  Ty) const

◆ getCorrespondingSignedType()

QualType ASTContext::getCorrespondingSignedType ( QualType  T) const

◆ getCorrespondingUnsignedType()

QualType ASTContext::getCorrespondingUnsignedType ( QualType  T) const

◆ getcudaConfigureCallDecl()

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

Definition at line 1375 of file ASTContext.h.

◆ 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 3338 of file RecordLayoutBuilder.cpp.

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

Referenced by clang::Sema::ActOnFinishFunctionBody(), DeclMustBeEmitted(), clang::Sema::DefineUsedVTables(), clang::CodeGen::CodeGenModule::getVTableLinkage(), clang::CodeGen::CodeGenVTables::isVTableExternal(), and clang::ASTDeclWriter::VisitCXXRecordDecl().

◆ getCVRQualifiedType()

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

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

Definition at line 2075 of file ASTContext.h.

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

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

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

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

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

◆ getDecayedType() [1/2]

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

Definition at line 1325 of file ASTContext.h.

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

◆ getDecayedType() [2/2]

QualType ASTContext::getDecayedType ( QualType  T) const

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

References clang::TypeInfo::Align, clang::ast_matchers::arrayType, clang::ASTRecordLayout::getAlignment(), clang::Type::getAs(), getAsArrayType(), getASTRecordLayout(), getBaseElementType(), clang::TargetInfo::getCharWidth(), clang::ASTRecordLayout::getFieldOffset(), clang::TargetInfo::getLargeArrayAlign(), clang::TargetInfo::getLargeArrayMinWidth(), clang::TargetInfo::getMaxAlignedAttribute(), clang::Decl::getMaxAlignment(), clang::Type::getPointeeType(), getPointerType(), getPreferredTypeAlign(), clang::QualType::getQualifiers(), getTargetInfo(), clang::QualType::getTypePtr(), getTypeSize(), clang::Decl::hasAttr(), clang::Qualifiers::hasUnaligned(), clang::Type::isFunctionType(), clang::Type::isIncompleteType(), max(), min(), Offset, Parent, clang::SC_Static, toBits(), and toCharUnitsFromBits().

Referenced by clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CGOpenMPRuntime::emitDeclareTargetVarDefinition(), EmitFunctionDeclLValue(), EmitGlobalVarDeclLValue(), emitOutlinedFunctionPrologue(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), clang::Sema::FinalizeDeclaration(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), getBaseAlignmentAndOffsetFromLValue(), clang::CodeGen::CodeGenFunction::getBlockByrefInfo(), clang::Sema::getNamedReturnInfo(), clang::CodeGen::CodeGenModule::GetWeakRefReference(), clang::Sema::isOpenMPCapturedByRef(), and clang::Sema::RefersToMemberWithReducedAlignment().

◆ getDeclaratorForUnnamedTagDecl()

DeclaratorDecl * ASTContext::getDeclaratorForUnnamedTagDecl ( const TagDecl TD)

Definition at line 11357 of file ASTContext.cpp.

◆ getDeclAttrs()

AttrVec & ASTContext::getDeclAttrs ( const Decl D)

Retrieve the attributes for the given declaration.

Definition at line 1505 of file ASTContext.cpp.

References Allocate().

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

References getCanonicalType(), clang::Expr::isInstantiationDependent(), clang::DependentDecltypeType::Profile(), and clang::TypeAlignment.

Referenced by clang::Sema::BuildDecltypeType(), and clang::ASTNodeImporter::VisitDecltypeType().

◆ getDeducedTemplateSpecializationType()

QualType ASTContext::getDeducedTemplateSpecializationType ( 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 5636 of file ASTContext.cpp.

References clang::DeducedTemplateSpecializationType::Profile(), and clang::TypeAlignment.

Referenced by clang::TreeTransform< Derived >::RebuildDeducedTemplateSpecializationType(), and clang::ASTNodeImporter::VisitDeducedTemplateSpecializationType().

◆ getDefaultCallingConvention()

CallingConv ASTContext::getDefaultCallingConvention ( bool  IsVariadic,
bool  IsCXXMethod,
bool  IsBuiltin = false 
) const

◆ getDefaultOpenCLPointeeAddrSpace()

LangAS clang::ASTContext::getDefaultOpenCLPointeeAddrSpace ( )
inline

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

Definition at line 1366 of file ASTContext.h.

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

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

◆ getDependentAddressSpaceType()

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

◆ getDependentExtIntType()

QualType ASTContext::getDependentExtIntType ( bool  Unsigned,
Expr BitsExpr 
) const

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

Definition at line 4501 of file ASTContext.cpp.

References clang::Expr::isInstantiationDependent(), clang::DependentExtIntType::Profile(), and clang::TypeAlignment.

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

◆ getDependentNameType()

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

◆ getDependentSizedArrayType()

QualType ASTContext::getDependentSizedArrayType ( QualType  EltTy,
Expr NumElts,
ArrayType::ArraySizeModifier  ASM,
unsigned  IndexTypeQuals,
SourceRange  Brackets 
) 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 3698 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(), clang::SplitQualType::Ty, and clang::TypeAlignment.

Referenced by clang::Sema::BuildArrayType(), getAsArrayType(), getUnqualifiedArrayType(), getVariableArrayDecayedType(), and clang::ASTNodeImporter::VisitDependentSizedArrayType().

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

References getCanonicalType(), clang::DependentSizedExtVectorType::Profile(), and clang::TypeAlignment.

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

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

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

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

◆ getDependentTemplateName() [1/2]

TemplateName ASTContext::getDependentTemplateName ( NestedNameSpecifier NNS,
const IdentifierInfo Name 
) const

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

Definition at line 8537 of file ASTContext.cpp.

Referenced by getDependentTemplateName(), and clang::ASTImporter::Import().

◆ getDependentTemplateName() [2/2]

TemplateName ASTContext::getDependentTemplateName ( NestedNameSpecifier NNS,
OverloadedOperatorKind  Operator 
) const

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

Definition at line 8573 of file ASTContext.cpp.

References getCanonicalNestedNameSpecifier(), getDependentTemplateName(), clang::NestedNameSpecifier::isDependent(), and clang::DependentTemplateName::Profile().

◆ getDependentTemplateSpecializationType() [1/2]

QualType ASTContext::getDependentTemplateSpecializationType ( ElaboratedTypeKeyword  Keyword,
NestedNameSpecifier NNS,
const IdentifierInfo Name,
ArrayRef< TemplateArgument Args 
) const

Definition at line 4969 of file ASTContext.cpp.

◆ getDependentTemplateSpecializationType() [2/2]

QualType ASTContext::getDependentTemplateSpecializationType ( ElaboratedTypeKeyword  Keyword,
NestedNameSpecifier NNS,
const IdentifierInfo Name,
const TemplateArgumentListInfo Args 
) const

◆ getDependentVectorType()

QualType ASTContext::getDependentVectorType ( QualType  VectorType,
Expr SizeExpr,
SourceLocation  AttrLoc,
VectorType::VectorKind  VecKind 
) const

Return the unique reference to the type for a dependently sized vector of the specified element type.

Definition at line 4001 of file ASTContext.cpp.

References getCanonicalType(), clang::DependentVectorType::Profile(), and clang::TypeAlignment.

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

◆ getDiagAllocator()

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

Definition at line 736 of file ASTContext.h.

Referenced by clang::Sema::EmitCurrentDiagnostic(), and clang::Sema::PDiag().

◆ getDiagnostics()

DiagnosticsEngine & ASTContext::getDiagnostics ( ) const

◆ getElaboratedType()

QualType ASTContext::getElaboratedType ( ElaboratedTypeKeyword  Keyword,
NestedNameSpecifier NNS,
QualType  NamedType,
TagDecl OwnedTagDecl = nullptr 
) const

◆ getEnumType()

QualType ASTContext::getEnumType ( const EnumDecl Decl) const

◆ getExceptionObjectType()

QualType ASTContext::getExceptionObjectType ( QualType  T) const

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

References clang::TargetInfo::getExnObjectAlignment(), and toCharUnitsFromBits().

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

◆ getExternalSource()

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

◆ getExternCContextDecl()

ExternCContextDecl * ASTContext::getExternCContextDecl ( ) const

Definition at line 1194 of file ASTContext.cpp.

References clang::ExternCContextDecl::Create(), and getTranslationUnitDecl().

Referenced by getPredefinedDecl().

◆ getExtIntType()

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

Return an extended integer type with the specified signedness and bit count.

Definition at line 4487 of file ASTContext.cpp.

References clang::ExtIntType::Profile(), and clang::TypeAlignment.

Referenced by clang::Sema::BuildExtIntType(), getCorrespondingSignedType(), and getCorrespondingUnsignedType().

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

References clang::VectorType::GenericVector, getCanonicalType(), clang::Type::isBuiltinType(), clang::QualType::isCanonical(), clang::Type::isDependentType(), clang::VectorType::Profile(), and clang::TypeAlignment.

Referenced by clang::Sema::BuildExtVectorType(), clang::Sema::CheckVectorConditionalTypes(), DecodeTypeFromStr(), clang::Sema::GetSignedVectorType(), and clang::ASTNodeImporter::VisitExtVectorType().

◆ getFieldOffset()

uint64_t ASTContext::getFieldOffset ( const ValueDecl FD) const

◆ getFILEType()

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

Retrieve the C FILE type.

Definition at line 1880 of file ASTContext.h.

References getTypeDeclType().

Referenced by DecodeTypeFromStr().

◆ getFixedPointIBits()

unsigned char ASTContext::getFixedPointIBits ( QualType  Ty) const

◆ getFixedPointMax()

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

◆ getFixedPointMin()

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

Definition at line 11663 of file ASTContext.cpp.

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

◆ getFixedPointScale()

unsigned char ASTContext::getFixedPointScale ( QualType  Ty) const

◆ getFixedPointSemantics()

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

◆ getFloatingTypeOfSizeWithinDomain()

QualType ASTContext::getFloatingTypeOfSizeWithinDomain ( QualType  Size,
QualType  Domain 
) const

Return a real floating point or a complex type (based on typeDomain/typeSize).

getFloatingTypeOfSizeWithinDomain - Returns a real floating point or a complex type (based on typeDomain/typeSize).

Parameters
typeDomaina real floating point or complex type.
typeSizea real floating point or complex type.

'typeDomain' is a real floating point or complex type. 'typeSize' is a real floating point or complex type.

Definition at line 6338 of file ASTContext.cpp.

References BFloat16Rank, BFloat16Ty, DoubleComplexTy, DoubleRank, DoubleTy, Float128ComplexTy, Float128Rank, Float128Ty, Float16Rank, FloatComplexTy, FloatRank, FloatTy, getFloatingRank(), HalfRank, HalfTy, Ibm128Rank, Ibm128Ty, clang::Type::isComplexType(), clang::Type::isRealFloatingType(), LongDoubleComplexTy, LongDoubleRank, and LongDoubleTy.

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

References getFloatingRank().

Referenced by clang::ento::SMTConv::doFloatTypeConversion(), getFloatingTypeSemanticOrder(), and clang::StandardConversionSequence::getNarrowingKind().

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

References getFloatingTypeOrder(), and getFloatTypeSemantics().

◆ getFloatTypeSemantics()

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

◆ getFullLoc()

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

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

References getFunctionNoProtoType().

◆ getFunctionNoProtoType() [2/2]

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

◆ getFunctionType()

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

◆ getFunctionTypeWithExceptionSpec()

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

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

References clang::Type::castAs(), getAttributedType(), getFunctionType(), getMacroQualifiedType(), and getParenType().

Referenced by adjustExceptionSpec(), clang::CodeGen::CodeGenFunction::EmitCall(), extractPBaseFlags(), hasSameFunctionTypeIgnoringExceptionSpec(), clang::Sema::IsFunctionConversion(), and clang::CodeGen::CodeGenFunction::StartFunction().

◆ 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 tyeps are replaced with the default address space.

Definition at line 3170 of file ASTContext.cpp.

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

Referenced by hasSameFunctionTypeIgnoringPtrSizes().

◆ GetGVALinkageForFunction()

GVALinkage ASTContext::GetGVALinkageForFunction ( const FunctionDecl FD) const

◆ GetGVALinkageForVariable()

GVALinkage ASTContext::GetGVALinkageForVariable ( const VarDecl VD)

◆ getIncompleteArrayType()

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

◆ getInjectedClassNameType()

QualType ASTContext::getInjectedClassNameType ( CXXRecordDecl Decl,
QualType  TST 
) const

getInjectedClassNameType - Return the unique reference to the injected class name type for the specified templated declaration.

Definition at line 4535 of file ASTContext.cpp.

References clang::Decl::getPreviousDecl(), NeedsInjectedClassNameType(), and clang::TypeAlignment.

◆ getInjectedTemplateArg()

TemplateArgument ASTContext::getInjectedTemplateArg ( NamedDecl ParamDecl)

◆ getInjectedTemplateArgs()

void ASTContext::getInjectedTemplateArgs ( const TemplateParameterList Params,
SmallVectorImpl< TemplateArgument > &  Args 
)

Get a template argument list with one argument per template parameter in a template parameter list, such as for the injected class name of a class template.

Definition at line 5061 of file ASTContext.cpp.

References getInjectedTemplateArg(), and clang::TemplateParameterList::size().

Referenced by clang::ClassTemplateDecl::getInjectedClassNameSpecialization(), clang::FunctionTemplateDecl::getInjectedTemplateArgs(), clang::Sema::isMoreSpecializedThanPrimary(), and clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs().

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

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

Referenced by basicGVALinkageForVariable(), and clang::CodeGen::CodeGenModule::EmitGlobal().

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

References clang::Type::getAs(), getBaseElementType(), clang::QualType::getObjCLifetime(), clang::Type::getPointeeType(), clang::Type::isArrayType(), clang::QualType::isNull(), and clang::Qualifiers::OCL_None.

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

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

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

◆ getInstantiatedFromUnnamedFieldDecl()

FieldDecl * ASTContext::getInstantiatedFromUnnamedFieldDecl ( FieldDecl Field)

Definition at line 1615 of file ASTContext.cpp.

Referenced by isInstantiationOf(), and clang::ASTDeclWriter::VisitFieldDecl().

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

Referenced by isInstantiationOfUnresolvedUsingDecl(), and clang::ASTDeclWriter::VisitUsingDecl().

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

Referenced by clang::ASTDeclWriter::VisitUsingEnumDecl().

◆ getInstantiatedFromUsingShadowDecl()

UsingShadowDecl * ASTContext::getInstantiatedFromUsingShadowDecl ( UsingShadowDecl Inst)

Definition at line 1599 of file ASTContext.cpp.

Referenced by clang::ASTDeclWriter::VisitUsingShadowDecl().

◆ getInt128Decl()

TypedefDecl * ASTContext::getInt128Decl ( ) const

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

Definition at line 1254 of file ASTContext.cpp.

References buildImplicitTypedef(), and Int128Ty.

Referenced by getPredefinedDecl(), and clang::Sema::Initialize().

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

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

Referenced by clang::ento::SMTConv::doIntTypeConversion().

◆ getInterpContext()

interp::Context & ASTContext::getInterpContext ( )

Returns the clang bytecode interpreter context.

Definition at line 915 of file ASTContext.cpp.

◆ getIntMaxType()

CanQualType ASTContext::getIntMaxType ( ) const

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

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

Definition at line 5725 of file ASTContext.cpp.

References clang::TargetInfo::getIntMaxType().

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

References clang::TargetInfo::getIntPtrType().

Referenced by clang::CodeGen::CodeGenFunction::EmitAtomicExpr(), getUIntPtrType(), and clang::Sema::Initialize().

◆ getIntTypeForBitwidth()

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

◆ getIntWidth()

unsigned ASTContext::getIntWidth ( QualType  T) const

◆ getjmp_bufType()

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

Retrieve the C jmp_buf type.

Definition at line 1892 of file ASTContext.h.

References getTypeDeclType().

Referenced by DecodeTypeFromStr().

◆ getLangASForBuiltinAddressSpace()

LangAS ASTContext::getLangASForBuiltinAddressSpace ( unsigned  AS) const

◆ getLangOpts()

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

Definition at line 757 of file ASTContext.h.

Referenced by clang::Sema::ActOnStartOfObjCMethodDef(), AddOverloadParameterChunks(), clang::arcmt::trans::MigrationContext::addPropertyAttribute(), AddSYCLKernelNamingDecl(), adjustGVALinkageForAttributes(), AllowOverloadingOfFunction(), clang::arcmt::MigrationProcess::applyTransform(), areLaxCompatibleSveTypes(), basicGVALinkageForFunction(), buildGlobalBlock(), clang::Sema::BuildMatrixType(), clang::arcmt::trans::canApplyWeak(), canAssignObjCInterfacesInBlockPointer(), CastsAwayConstness(), clang::arcmt::checkForManualIssues(), CheckICE(), clang::Sema::CheckLogicalOperands(), ClassifyBinaryOp(), ClassifyConditional(), ClassifyDecl(), ClassifyInternal(), ClassifyMemberExpr(), ClassifyUnnamed(), clang::RecordDecl::completeDefinition(), clang::computeDependence(), computeKeyFunction(), clang::LinkageComputer::computeLVForDecl(), clang::analyze_os_log::computeOSLogBufferLayout(), clang::CodeGen::CodeGenTypes::ConvertType(), CreateAAPCSABIBuiltinVaListDecl(), clang::Sema::CreateBuiltinUnaryOp(), clang::Sema::CreateRecoveryExpr(), DecodeTypeFromStr(), clang::FunctionDecl::doesDeclarationForceExternallyVisibleDefinition(), clang::Stmt::dumpPretty(), clang::LocationContext::dumpStack(), clang::CodeGen::CodeGenFunction::EmitAutoVarInit(), EmitDeclDestroy(), EmitDeclInit(), emitMappingInformation(), clang::ento::BasicValueFactory::evalAPSInt(), clang::Expr::EvaluateAsInitializer(), clang::SourceLocExpr::EvaluateInContext(), clang::ASTMergeAction::ExecuteAction(), FastEvaluateAsRValue(), clang::arcmt::trans::findSemiAfterLocation(), GCRewriteFinalize(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), GenerateFixForUnusedDecl(), clang::tooling::getAssociatedRange(), getAttrForPlatform(), clang::FunctionDecl::getBuiltinID(), GetBuiltinType(), getByrefLifetime(), getCallingConvMangling(), clang::ASTNameGenerator::Implementation::getClassSymbolPrefix(), clang::ento::SValBuilder::getConditionType(), getCXXABIKind(), getDeclLanguageLinkage(), clang::LinkageComputer::getDeclLinkageAndVisibility(), clang::ento::retaincountchecker::RefLeakReportVisitor::getEndPath(), getFloatTypeSemantics(), clang::AnalysisDeclContext::getFunctionName(), GetGCAttrTypeForType(), clang::Expr::getIntegerConstantExpr(), clang::index::IndexingContext::getLangOpts(), clang::interp::Context::getLangOpts(), clang::ento::CheckerContext::getLangOpts(), clang::interp::State::getLangOpts(), clang::Decl::getLangOpts(), clang::ASTWriter::getLangOpts(), getLiteralInfo(), clang::CodeGen::CodeGenModule::getLLVMLinkageForDeclarator(), getLogicalOperationType(), clang::LinkageComputer::getLVForDecl(), clang::CXXRecordDecl::getMSVtorDispMode(), clang::StandardConversionSequence::getNarrowingKind(), clang::QualType::getNonLValueExprType(), getNSArrayObjects(), clang::NSAPI::GetNSIntegralKind(), getObjCGCAttrKind(), clang::Sema::getPrintingPolicy(), getRealizedPlatform(), clang::DeclContext::getRedeclContext(), getStringLiteralArrayType(), getSVETypeSize(), GetSYCLKernelNamingIndex(), clang::tooling::getText(), getTypeInfoDataSizeInChars(), getVTableContext(), clang::CodeGen::CodeGenModule::getVTableLinkage(), clang::Sema::handleTagNumbering(), clang::Decl::hasLocalOwningModuleStorage(), hasSameFunctionTypeIgnoringExceptionSpec(), clang::Sema::isAcceptableNestedNameSpecifier(), clang::Expr::isCXX11ConstantExpr(), clang::ObjCMethodDecl::isDirectMethod(), clang::ObjCPropertyDecl::isDirectProperty(), clang::FunctionDecl::isInlineDefinitionExternallyVisible(), clang::Expr::isIntegerConstantExpr(), clang::Type::isIntegralType(), clang::VarDecl::isKnownToBeDefined(), clang::Sema::isLaxVectorConversion(), clang::Type::isLiteralType(), clang::FunctionDecl::isMain(), IsModifiable(), clang::VarDecl::isNoDestroy(), clang::QualType::isNonWeakInMRRWithObjCWeak(), clang::Expr::isNullPointerConstant(), isOutOfScopePreviousDeclaration(), clang::QualType::isPODType(), isPromotableBitField(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), IsStringInit(), IsSYCLKernelNamingDecl(), clang::CodeGen::CodeGenModule::isTypeConstant(), isTypeSubstitutable(), clang::Expr::isUnusedResultAWarning(), clang::VarDecl::isUsableInConstantExpressions(), IsWideCharCompatible(), clang::CXXRecordDecl::lambdaIsDefaultConstructibleAndAssignable(), LocPropertyAttribute(), MarkUsedTemplateParameters(), clang::Sema::MaybeBindToTemporary(), mergeTypes(), needsConversionOfHalfVec(), clang::ento::ConditionBRVisitor::patternMatch(), printExprAsWritten(), clang::ProgramPoint::printJson(), clang::LocationContext::printJson(), printNode(), PrintStats(), clang::ento::retaincountchecker::RetainCountChecker::processLeaks(), clang::CodeGen::CodeGenModule::Release(), clang::edit::rewriteObjCRedundantCallWithLiteral(), clang::arcmt::trans::MigrationContext::rewritePropertyAttribute(), clang::edit::rewriteToObjCLiteralSyntax(), setObjCGCLValueClass(), shouldNotRewriteImmediateMessageArgs(), ShouldUseExternalRTTIDescriptor(), clang::CodeGen::CodeGenModule::stopAutoInit(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), typesAreCompatible(), UnwrapSimilarTypes(), useInlineVisibilityHidden(), clang::FunctionCallFilterCCC::ValidateCandidate(), clang::ASTNodeImporter::VisitBinaryOperator(), clang::ASTNodeImporter::VisitBuiltinType(), and clang::ASTNodeImporter::VisitCompoundAssignOperator().

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

References clang::Type::getAs(), getIntWidth(), clang::QualType::getTypePtr(), 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 2103 of file ASTContext.h.

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

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

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

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

Referenced by clang::ASTNodeTraverser< ASTDumper, TextNodeDumper >::Visit().

◆ getLogicalOperationType()

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

◆ getLValueReferenceType()

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

◆ getMacroQualifiedType()

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

◆ getMakeIntegerSeqDecl()

BuiltinTemplateDecl * ASTContext::getMakeIntegerSeqDecl ( ) const

◆ getMakeIntegerSeqName()

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

Definition at line 1854 of file ASTContext.h.

References clang::IdentifierTable::get(), and Idents.

Referenced by getMakeIntegerSeqDecl().

◆ getManglingNumber()

unsigned ASTContext::getManglingNumber ( const NamedDecl ND) const

◆ getManglingNumberContext() [1/2]

MangleNumberingContext & ASTContext::getManglingNumberContext ( const DeclContext DC)

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

Definition at line 11306 of file ASTContext.cpp.

References createMangleNumberingContext().

Referenced by clang::Sema::getCurrentMangleNumberContext(), clang::Sema::handleLambdaNumbering(), and clang::Sema::handleTagNumbering().

◆ getManglingNumberContext() [2/2]

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

Definition at line 11315 of file ASTContext.cpp.

References createMangleNumberingContext().

◆ getMemberPointerPathAdjustment()

CharUnits ASTContext::getMemberPointerPathAdjustment ( const APValue MP) const

◆ getMemberPointerType()

QualType ASTContext::getMemberPointerType ( QualType  T,
const Type Cls 
) const

◆ getModuleInitializers()

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

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

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

References clang::Decl::getCanonicalDecl().

Referenced by clang::Sema::diagnoseMissingImport(), clang::Sema::hasMergedDefinitionInCurrentModule(), clang::Sema::hasVisibleMergedDefinition(), and 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 11398 of file ASTContext.cpp.

References getMSGuidType(), MSGuidTagDecl, clang::MSGuidDecl::Profile(), and clang::QualType::withConst().

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

◆ getMSGuidTagDecl()

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

Retrieve the implicitly-predeclared 'struct _GUID' declaration.

Definition at line 2061 of file ASTContext.h.

References MSGuidTagDecl.

Referenced by getPredefinedDecl().

◆ getMSGuidType()

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

Retrieve the implicitly-predeclared 'struct _GUID' type.

Definition at line 2064 of file ASTContext.h.

References getTagDeclType(), and MSGuidTagDecl.

Referenced by clang::Sema::ActOnCXXUuidof(), and getMSGuidDecl().

◆ getNameForTemplate()

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

Definition at line 5962 of file ASTContext.cpp.

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

◆ getNewOMPTraitInfo()

OMPTraitInfo & ASTContext::getNewOMPTraitInfo ( )

Return a new OMPTraitInfo object owned by this context.

Definition at line 11764 of file ASTContext.cpp.

Referenced by clang::ASTRecordReader::readOMPTraitInfo().

◆ getNextLocalImport()

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

Definition at line 1007 of file ASTContext.h.

◆ getNoSanitizeList()

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

◆ getNSCopyingName()

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

Retrieve the identifier 'NSCopying'.

Definition at line 1835 of file ASTContext.h.

References clang::IdentifierTable::get(), and Idents.

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

◆ getNSIntegerType()

CanQualType ASTContext::getNSIntegerType ( ) const

Definition at line 6905 of file ASTContext.cpp.

References clang::TargetInfo::getTriple(), LongLongTy, and LongTy.

◆ getNSObjectName()

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

Retrieve the identifier 'NSObject'.

Definition at line 1826 of file ASTContext.h.

References clang::IdentifierTable::get(), and Idents.

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

◆ getNSUIntegerType()

CanQualType ASTContext::getNSUIntegerType ( ) const

◆ getObjCClassDecl()

TypedefDecl * ASTContext::getObjCClassDecl ( ) const

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

Definition at line 8030 of file ASTContext.cpp.

References buildImplicitTypedef(), getObjCObjectPointerType(), getObjCObjectType(), and ObjCBuiltinClassTy.

Referenced by getObjCClassType(), getPredefinedDecl(), and clang::Sema::Initialize().

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

References getObjCClassType().

Referenced by clang::Sema::CheckAssignmentConstraints(), and clang::Sema::FindCompositeObjCPointerType().

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

References getObjCClassDecl(), and getTypeDeclType().

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

◆ getObjCConstantStringInterface()

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

Definition at line 1774 of file ASTContext.h.

◆ getObjCEncodingForBlock()

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

Return the encoded type for this block declaration.

getObjCEncodingForBlock - Return the encoded type for this block declaration.

Definition at line 6982 of file ASTContext.cpp.

References string().

Referenced by buildBlockDescriptor().

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

References string().

◆ getObjCEncodingForMethodDecl()

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

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

getObjCEncodingForMethodDecl - Return the encoded type for this method declaration.

Definition at line 7096 of file ASTContext.cpp.

References string().

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

◆ getObjCEncodingForPropertyDecl()

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

getObjCEncodingForPropertyDecl - Return the encoded type for this method declaration.

getObjCEncodingForPropertyDecl - Return the encoded type for this property declaration.

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

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

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

Definition at line 7193 of file ASTContext.cpp.

◆ getObjCEncodingForPropertyType()

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

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

Definition at line 7291 of file ASTContext.cpp.

◆ getObjCEncodingForType()

void ASTContext::getObjCEncodingForType ( QualType  T,
std::string S,
const FieldDecl Field = nullptr,
QualType NotEncodedT = nullptr 
) const

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

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

Definition at line 7276 of file ASTContext.cpp.

Referenced by clang::Sema::BuildObjCEncodeExpression(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), and clang::CodeGen::CodeGenModule::GetAddrOfConstantStringFromObjCEncode().

◆ getObjCEncodingForTypeQualifier()

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

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

Definition at line 7997 of file ASTContext.cpp.

◆ getObjCEncodingTypeSize()

CharUnits ASTContext::getObjCEncodingTypeSize ( QualType  T) const

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

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

Definition at line 6933 of file ASTContext.cpp.

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

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

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

Referenced by mergeTypes().

◆ getObjCIdDecl()

TypedefDecl * ASTContext::getObjCIdDecl ( ) const

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

Definition at line 8013 of file ASTContext.cpp.

References buildImplicitTypedef(), getObjCObjectPointerType(), getObjCObjectType(), and ObjCBuiltinIdTy.

Referenced by getObjCIdType(), getPredefinedDecl(), and clang::Sema::Initialize().

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

References getObjCIdType().

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

◆ getObjCIdType()

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

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

◆ getObjCImplementation() [2/2]

ObjCImplementationDecl * ASTContext::getObjCImplementation ( ObjCInterfaceDecl D)

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

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

Definition at line 2862 of file ASTContext.cpp.

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

◆ getObjCInstanceType()

QualType clang::ASTContext::getObjCInstanceType ( )
inline

◆ getObjCInstanceTypeDecl()

TypedefDecl * ASTContext::getObjCInstanceTypeDecl ( )

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

Definition at line 6914 of file ASTContext.cpp.

References buildImplicitTypedef(), and getObjCIdType().

Referenced by getObjCInstanceType(), and getPredefinedDecl().

◆ getObjCInterfaceType()

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

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

Referenced by setObjCMethodRedeclaration(), and clang::ASTDeclWriter::VisitObjCMethodDecl().

◆ getObjCNSStringType()

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

Definition at line 1778 of file ASTContext.h.

◆ getObjCObjectPointerType()

QualType ASTContext::getObjCObjectPointerType ( QualType  OIT) const

◆ getObjCObjectType() [1/2]

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

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

◆ getObjCProtocolDecl()

ObjCInterfaceDecl * ASTContext::getObjCProtocolDecl ( ) const

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

Definition at line 8039 of file ASTContext.cpp.

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

Referenced by getObjCProtoType(), getPredefinedDecl(), and clang::Sema::Initialize().

◆ getObjCProtoType()

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

Retrieve the type of the Objective-C Protocol class.

Definition at line 2033 of file ASTContext.h.

References getObjCInterfaceType(), and getObjCProtocolDecl().

Referenced by Desugar(), and clang::Sema::ParseObjCProtocolExpression().

◆ getObjCSelDecl()

TypedefDecl * ASTContext::getObjCSelDecl ( ) const

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

Definition at line 8022 of file ASTContext.cpp.

References buildImplicitTypedef(), getPointerType(), and ObjCBuiltinSelTy.

Referenced by getObjCSelType(), getPredefinedDecl(), and clang::Sema::Initialize().

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

References getObjCSelType().

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

◆ getObjCSelType()

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

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

Definition at line 1997 of file ASTContext.h.

References getObjCSelDecl(), and getTypeDeclType().

Referenced by clang::CodeGen::CodeGenTypes::arrangeObjCMessageSendSignature(), DecodeTypeFromStr(), Desugar(), getObjCSelRedefinitionType(), isObjCSelType(), and clang::Sema::ParseObjCSelectorExpression().

◆ getObjCSuperType()

QualType ASTContext::getObjCSuperType ( ) const

Returns the C struct type for objc_super.

Definition at line 6700 of file ASTContext.cpp.

References clang::DeclContext::addDecl(), buildImplicitRecord(), getTagDeclType(), getTranslationUnitDecl(), and clang::QualType::isNull().

Referenced by DecodeTypeFromStr().

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

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

◆ getOpenCLTypeAddrSpace()

LangAS ASTContext::getOpenCLTypeAddrSpace ( const Type T) const

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

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

Referenced by emitAlignedClause().

◆ getOverloadedTemplateName()

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

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

Definition at line 8481 of file ASTContext.cpp.

References Allocate(), Begin, End, and clang::NamedDecl::getUnderlyingDecl().

Referenced by clang::ASTImporter::Import().

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

References overridden_methods_begin(), and overridden_methods_end().

Referenced by getCommentForDecl().

◆ getPackExpansionType()

QualType ASTContext::getPackExpansionType ( QualType  Pattern,
Optional< unsigned NumExpansions,
bool  ExpectPackInType = true 
)

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

References clang::Type::containsUnexpandedParameterPack(), getCanonicalType(), clang::QualType::isCanonical(), clang::PackExpansionType::Profile(), and clang::TypeAlignment.

Referenced by clang::Sema::buildLambdaInitCaptureInitialization(), clang::Sema::CheckPackExpansion(), getInjectedTemplateArg(), clang::TreeTransform< Derived >::TransformExceptionSpec(), and clang::ASTNodeImporter::VisitPackExpansionType().

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

◆ getParentMapContext()

ParentMapContext & ASTContext::getParentMapContext ( )

Returns the dynamic AST node parent map context.

Definition at line 922 of file ASTContext.cpp.

Referenced by getParents(), 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

Forwards to get node parents from the ParentMapContext.

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

Definition at line 133 of file ParentMapContext.h.

References getParentMapContext(), clang::ParentMapContext::getParents(), and Node.

◆ getParenType()

QualType ASTContext::getParenType ( QualType  NamedType) const

◆ getPointerDiffType()

QualType ASTContext::getPointerDiffType ( ) const

◆ getPointerType() [1/2]

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

Definition at line 1309 of file ASTContext.h.

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

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

References getCanonicalType(), clang::QualType::isCanonical(), clang::PointerType::Profile(), and clang::TypeAlignment.

Referenced by clang::Sema::ActOnAddrLabel(), clang::Sema::ActOnCapturedRegionStart(), clang::Sema::ActOnIndirectGotoStmt(), clang::Sema::ActOnOpenMPRegionStart(), clang::Sema::AddAnnotationAttr(), AddDirectArgument(), adjustCVQualifiersForCXXThisWithinLambda(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildCallExpr(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), clang::Sema::BuildObjCArrayLiteral(), clang::Sema::BuildObjCBoxedExpr(), clang::Sema::BuildObjCDictionaryLiteral(), clang::Sema::BuildPointerType(), clang::Sema::BuildResolvedCallExpr(), BuildSimilarlyQualifiedPointerType(), clang::Sema::CallExprUnaryConversions(), clang::Sema::CheckAddressOfOperand(), clang::CodeGen::CGOpenMPRuntime::checkAndEmitLastprivateConditional(), clang::Sema::CheckConversionDeclarator(), clang::Sema::checkOpenMPDeclareVariantFunction(), CheckOperatorDeleteDeclaration(), clang::Sema::CheckPlaceholderExpr(), clang::Sema::CheckPointerToMemberOperands(), clang::Sema::CheckSpecifiedExceptionType(), clang::ento::ExprEngine::computeObjectUnderConstruction(), clang::SYCLUniqueStableNameExpr::Create(), CreateAAPCSABIBuiltinVaListDecl(), CreateAArch64ABIBuiltinVaListDecl(), clang::SYCLUniqueStableNameExpr::CreateEmpty(), CreateHexagonBuiltinVaListDecl(), clang::Sema::CreateOverloadedBinOp(), CreatePowerABIBuiltinVaListDecl(), CreateSystemZBuiltinVaListDecl(), CreateVoidPtrBuiltinVaListDecl(), CreateX86_64ABIBuiltinVaListDecl(), clang::Sema::DeclareGlobalNewDelete(), DecodePPCMMATypeFromStr(), DecodeTypeFromStr(),