clang 20.0.0git
|
This class organizes the cross-module state that is used while lowering AST types to LLVM types. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/CodeGenTypes.h"
Public Member Functions | |
CodeGenTypes (CodeGenModule &cgm) | |
~CodeGenTypes () | |
const llvm::DataLayout & | getDataLayout () const |
CodeGenModule & | getCGM () const |
ASTContext & | getContext () const |
const TargetInfo & | getTarget () const |
CGCXXABI & | getCXXABI () const |
llvm::LLVMContext & | getLLVMContext () |
const CodeGenOptions & | getCodeGenOpts () const |
unsigned | ClangCallConvToLLVMCallConv (CallingConv CC) |
Convert clang calling convention to LLVM callilng convention. | |
CanQualType | DeriveThisType (const CXXRecordDecl *RD, const CXXMethodDecl *MD) |
Derives the 'this' type for codegen purposes, i.e. | |
llvm::Type * | ConvertType (QualType T) |
ConvertType - Convert type T into a llvm::Type. | |
llvm::Type * | ConvertTypeForMem (QualType T) |
ConvertTypeForMem - Convert type T into a llvm::Type. | |
bool | typeRequiresSplitIntoByteArray (QualType ASTTy, llvm::Type *LLVMTy=nullptr) |
Check whether the given type needs to be laid out in memory using an opaque byte-array type because its load/store type does not have the correct alloc size in the LLVM data layout. | |
llvm::Type * | convertTypeForLoadStore (QualType T, llvm::Type *LLVMTy=nullptr) |
Given that T is a scalar type, return the IR type that should be used for load and store operations. | |
llvm::FunctionType * | GetFunctionType (const CGFunctionInfo &Info) |
GetFunctionType - Get the LLVM function type for. | |
llvm::FunctionType * | GetFunctionType (GlobalDecl GD) |
bool | isFuncTypeConvertible (const FunctionType *FT) |
isFuncTypeConvertible - Utility to check whether a function type can be converted to an LLVM type (i.e. | |
bool | isFuncParamTypeConvertible (QualType Ty) |
isFuncParamTypeConvertible - Return true if the specified type in a function parameter or result position can be converted to an IR type at this point. | |
bool | inheritingCtorHasParams (const InheritedConstructor &Inherited, CXXCtorType Type) |
Determine if a C++ inheriting constructor should have parameters matching those of its inherited constructor. | |
llvm::Type * | GetFunctionTypeForVTable (GlobalDecl GD) |
GetFunctionTypeForVTable - Get the LLVM function type for use in a vtable, given a CXXMethodDecl. | |
const CGRecordLayout & | getCGRecordLayout (const RecordDecl *) |
getCGRecordLayout - Return record layout info for the given record decl. | |
void | UpdateCompletedType (const TagDecl *TD) |
UpdateCompletedType - When we find the full definition for a TagDecl, replace the 'opaque' type we previously made for it if applicable. | |
void | RefreshTypeCacheForClass (const CXXRecordDecl *RD) |
Remove stale types from the type cache when an inheritance model gets assigned to a class. | |
const CGFunctionInfo & | arrangeGlobalDeclaration (GlobalDecl GD) |
const CGFunctionInfo & | arrangeCall (const CGFunctionInfo &declFI, const CallArgList &args) |
Given a function info for a declaration, return the function info for a call with the given arguments. | |
const CGFunctionInfo & | arrangeFunctionDeclaration (const FunctionDecl *FD) |
Free functions are functions that are compatible with an ordinary C function pointer type. | |
const CGFunctionInfo & | arrangeFreeFunctionCall (const CallArgList &Args, const FunctionType *Ty, bool ChainCall) |
Figure out the rules for calling a function with the given formal type using the given arguments. | |
const CGFunctionInfo & | arrangeFreeFunctionType (CanQual< FunctionProtoType > Ty) |
Arrange the argument and result information for a value of the given freestanding function type. | |
const CGFunctionInfo & | arrangeFreeFunctionType (CanQual< FunctionNoProtoType > Ty) |
Arrange the argument and result information for a value of the given unprototyped freestanding function type. | |
const CGFunctionInfo & | arrangeNullaryFunction () |
A nullary function is a freestanding function of type 'void ()'. | |
const CGFunctionInfo & | arrangeBuiltinFunctionDeclaration (QualType resultType, const FunctionArgList &args) |
A builtin function is a freestanding function using the default C conventions. | |
const CGFunctionInfo & | arrangeBuiltinFunctionDeclaration (CanQualType resultType, ArrayRef< CanQualType > argTypes) |
const CGFunctionInfo & | arrangeBuiltinFunctionCall (QualType resultType, const CallArgList &args) |
const CGFunctionInfo & | arrangeObjCMethodDeclaration (const ObjCMethodDecl *MD) |
Objective-C methods are C functions with some implicit parameters. | |
const CGFunctionInfo & | arrangeObjCMessageSendSignature (const ObjCMethodDecl *MD, QualType receiverType) |
Arrange the argument and result information for the function type through which to perform a send to the given Objective-C method, using the given receiver type. | |
const CGFunctionInfo & | arrangeUnprototypedObjCMessageSend (QualType returnType, const CallArgList &args) |
const CGFunctionInfo & | arrangeBlockFunctionDeclaration (const FunctionProtoType *type, const FunctionArgList &args) |
Block invocation functions are C functions with an implicit parameter. | |
const CGFunctionInfo & | arrangeBlockFunctionCall (const CallArgList &args, const FunctionType *type) |
A block function is essentially a free function with an extra implicit argument. | |
const CGFunctionInfo & | arrangeCXXMethodDeclaration (const CXXMethodDecl *MD) |
C++ methods have some special rules and also have implicit parameters. | |
const CGFunctionInfo & | arrangeCXXStructorDeclaration (GlobalDecl GD) |
const CGFunctionInfo & | arrangeCXXConstructorCall (const CallArgList &Args, const CXXConstructorDecl *D, CXXCtorType CtorKind, unsigned ExtraPrefixArgs, unsigned ExtraSuffixArgs, bool PassProtoArgs=true) |
Arrange a call to a C++ method, passing the given arguments. | |
const CGFunctionInfo & | arrangeCXXMethodCall (const CallArgList &args, const FunctionProtoType *type, RequiredArgs required, unsigned numPrefixArgs) |
Arrange a call to a C++ method, passing the given arguments. | |
const CGFunctionInfo & | arrangeUnprototypedMustTailThunk (const CXXMethodDecl *MD) |
Arrange a thunk that takes 'this' as the first parameter followed by varargs. | |
const CGFunctionInfo & | arrangeMSCtorClosure (const CXXConstructorDecl *CD, CXXCtorType CT) |
const CGFunctionInfo & | arrangeCXXMethodType (const CXXRecordDecl *RD, const FunctionProtoType *FTP, const CXXMethodDecl *MD) |
Arrange the argument and result information for a call to an unknown C++ non-static member function of the given abstract type. | |
const CGFunctionInfo & | arrangeLLVMFunctionInfo (CanQualType returnType, FnInfoOpts opts, ArrayRef< CanQualType > argTypes, FunctionType::ExtInfo info, ArrayRef< FunctionProtoType::ExtParameterInfo > paramInfos, RequiredArgs args) |
"Arrange" the LLVM information for a call or type with the given signature. | |
std::unique_ptr< CGRecordLayout > | ComputeRecordLayout (const RecordDecl *D, llvm::StructType *Ty) |
Compute a new LLVM record layout object for the given record. | |
void | addRecordTypeName (const RecordDecl *RD, llvm::StructType *Ty, StringRef suffix) |
addRecordTypeName - Compute a name from the given record decl with an optional suffix and name the given LLVM type using it. | |
llvm::StructType * | ConvertRecordDeclType (const RecordDecl *TD) |
ConvertRecordDeclType - Lay out a tagged decl type like struct or union. | |
void | getExpandedTypes (QualType Ty, SmallVectorImpl< llvm::Type * >::iterator &TI) |
getExpandedTypes - Expand the type | |
bool | isZeroInitializable (QualType T) |
IsZeroInitializable - Return whether a type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer. | |
bool | isPointerZeroInitializable (QualType T) |
Check if the pointer type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer. | |
bool | isZeroInitializable (const RecordDecl *RD) |
IsZeroInitializable - Return whether a record type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer. | |
bool | isLongDoubleReferenced () const |
bool | isRecordLayoutComplete (const Type *Ty) const |
isRecordLayoutComplete - Return true if the specified type is already completely laid out. | |
unsigned | getTargetAddressSpace (QualType T) const |
This class organizes the cross-module state that is used while lowering AST types to LLVM types.
Definition at line 54 of file CodeGenTypes.h.
CodeGenTypes::CodeGenTypes | ( | CodeGenModule & | cgm | ) |
Definition at line 33 of file CodeGenTypes.cpp.
CodeGenTypes::~CodeGenTypes | ( | ) |
Definition at line 40 of file CodeGenTypes.cpp.
References E.
void CodeGenTypes::addRecordTypeName | ( | const RecordDecl * | RD, |
llvm::StructType * | Ty, | ||
StringRef | suffix | ||
) |
addRecordTypeName - Compute a name from the given record decl with an optional suffix and name the given LLVM type using it.
Definition at line 52 of file CodeGenTypes.cpp.
References clang::Decl::getASTContext(), clang::Decl::getDeclContext(), clang::NamedDecl::getIdentifier(), clang::TagDecl::getKindName(), clang::ASTContext::getPrintingPolicy(), clang::TagDecl::getTypedefNameForAnonDecl(), clang::TagDecl::printName(), clang::NamedDecl::printQualifiedName(), clang::PrintingPolicy::SuppressInlineNamespace, and clang::TypeName.
Referenced by ComputeRecordLayout(), and ConvertRecordDeclType().
const CGFunctionInfo & CodeGenTypes::arrangeBlockFunctionCall | ( | const CallArgList & | args, |
const FunctionType * | type | ||
) |
A block function is essentially a free function with an extra implicit argument.
Definition at line 648 of file CGCall.cpp.
References arrangeFreeFunctionLikeCall().
const CGFunctionInfo & CodeGenTypes::arrangeBlockFunctionDeclaration | ( | const FunctionProtoType * | type, |
const FunctionArgList & | args | ||
) |
Block invocation functions are C functions with an implicit parameter.
Definition at line 655 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), clang::CodeGen::RequiredArgs::forPrototypePlus(), getArgTypesForDeclaration(), clang::FunctionType::getExtInfo(), getExtParameterInfosForCall(), clang::FunctionType::getReturnType(), GetReturnType(), and clang::CodeGen::None.
const CGFunctionInfo & CodeGenTypes::arrangeBuiltinFunctionCall | ( | QualType | resultType, |
const CallArgList & | args | ||
) |
Definition at line 667 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), clang::ASTContext::getCanonicalParamType(), GetReturnType(), and clang::CodeGen::None.
Referenced by emitAtomicLibcall(), emitCPPObjectAtomicGetterCall(), emitCPPObjectAtomicSetterCall(), emitStructGetterCall(), and emitStructSetterCall().
const CGFunctionInfo & CodeGenTypes::arrangeBuiltinFunctionDeclaration | ( | CanQualType | resultType, |
ArrayRef< CanQualType > | argTypes | ||
) |
Definition at line 689 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), and clang::CodeGen::None.
const CGFunctionInfo & CodeGenTypes::arrangeBuiltinFunctionDeclaration | ( | QualType | resultType, |
const FunctionArgList & | args | ||
) |
A builtin function is a freestanding function using the default C conventions.
Definition at line 679 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), getArgTypesForDeclaration(), GetReturnType(), and clang::CodeGen::None.
Referenced by emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), emitDestructorsFunction(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), clang::CodeGen::CGOpenMPRuntime::emitReductionFunction(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper(), generateByrefCopyHelper(), generateByrefDisposeHelper(), and getClangCallTerminateFn().
const CGFunctionInfo & CodeGenTypes::arrangeCall | ( | const CGFunctionInfo & | declFI, |
const CallArgList & | args | ||
) |
Given a function info for a declaration, return the function info for a call with the given arguments.
Often this will be able to simply return the declaration info.
Definition at line 728 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::allowsOptionalArgs(), clang::CodeGen::CGFunctionInfo::arg_size(), arrangeLLVMFunctionInfo(), getArgTypesForCall(), clang::CodeGen::CGFunctionInfo::getExtInfo(), clang::CodeGen::CGFunctionInfo::getExtParameterInfos(), clang::CodeGen::CGFunctionInfo::getRequiredArgs(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::CodeGen::CGFunctionInfo::isChainCall(), clang::CodeGen::IsChainCall, clang::CodeGen::CGFunctionInfo::isDelegateCall(), clang::CodeGen::IsDelegateCall, clang::CodeGen::CGFunctionInfo::isInstanceMethod(), clang::CodeGen::IsInstanceMethod, and clang::CodeGen::None.
Referenced by clang::CodeGen::CGObjCRuntime::getMessageSendInfo().
const CGFunctionInfo & CodeGenTypes::arrangeCXXConstructorCall | ( | const CallArgList & | args, |
const CXXConstructorDecl * | D, | ||
CXXCtorType | CtorKind, | ||
unsigned | ExtraPrefixArgs, | ||
unsigned | ExtraSuffixArgs, | ||
bool | PassProtoArgs = true |
||
) |
Arrange a call to a C++ method, passing the given arguments.
ExtraPrefixArgs is the number of ABI-specific args passed after the this
parameter. ExtraSuffixArgs is the number of ABI-specific args passed at the end of args. PassProtoArgs indicates whether args
has args for the parameters in the given CXXConstructorDecl.
Definition at line 419 of file CGCall.cpp.
References addExtParameterInfosForCall(), clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), D, clang::CodeGen::RequiredArgs::forPrototypePlus(), clang::ASTContext::getCanonicalParamType(), clang::CodeGen::CodeGenModule::getContext(), getCXXABI(), GetFormalType(), clang::CanQual< T >::getTypePtr(), clang::CodeGen::CGCXXABI::hasMostDerivedReturn(), clang::CodeGen::CGCXXABI::HasThisReturn(), clang::CodeGen::IsInstanceMethod, clang::Required, clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.
Referenced by canEmitDelegateCallArgs().
const CGFunctionInfo & CodeGenTypes::arrangeCXXMethodCall | ( | const CallArgList & | args, |
const FunctionProtoType * | proto, | ||
RequiredArgs | required, | ||
unsigned | numPrefixArgs | ||
) |
Arrange a call to a C++ method, passing the given arguments.
numPrefixArgs is the number of ABI-specific prefix arguments we have. It does not count this
.
Definition at line 701 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), getArgTypesForCall(), clang::FunctionType::getExtInfo(), getExtParameterInfosForCall(), clang::FunctionType::getReturnType(), GetReturnType(), and clang::CodeGen::IsInstanceMethod.
const CGFunctionInfo & CodeGenTypes::arrangeCXXMethodDeclaration | ( | const CXXMethodDecl * | MD | ) |
C++ methods have some special rules and also have implicit parameters.
Arrange the argument and result information for a declaration or definition of the given C++ non-static member function.
The member function must be an ordinary function, i.e. not a constructor or destructor.
Definition at line 307 of file CGCall.cpp.
References arrangeCXXMethodType(), arrangeFreeFunctionType(), clang::CanQual< T >::getAs(), getCXXABI(), GetFormalType(), clang::CodeGen::CGCXXABI::getThisArgumentTypeForMethod(), clang::CXXMethodDecl::isImplicitObjectMemberFunction(), and setCUDAKernelCallingConvention().
Referenced by arrangeFunctionDeclaration(), and clang::CodeGen::CodeGenModule::GetAddrOfGlobal().
const CGFunctionInfo & CodeGenTypes::arrangeCXXMethodType | ( | const CXXRecordDecl * | RD, |
const FunctionProtoType * | FTP, | ||
const CXXMethodDecl * | MD | ||
) |
Arrange the argument and result information for a call to an unknown C++ non-static member function of the given abstract type.
(A null RD means we don't have any meaningful "this" argument type, so fall back to a generic pointer type). The member function must be an ordinary function, i.e. not a constructor or destructor.
Definition at line 279 of file CGCall.cpp.
References DeriveThisType(), clang::CanQual< T >::getAs(), and clang::Type::getCanonicalTypeUnqualified().
Referenced by arrangeCXXMethodDeclaration(), and clang::CodeGen::arrangeCXXMethodType().
const CGFunctionInfo & CodeGenTypes::arrangeCXXStructorDeclaration | ( | GlobalDecl | GD | ) |
Definition at line 335 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::All, appendParameterTypes(), arrangeLLVMFunctionInfo(), clang::CodeGen::CGCXXABI::buildStructorSignature(), DeriveThisType(), clang::CodeGen::CodeGenModule::getContext(), clang::GlobalDecl::getCtorType(), getCXXABI(), clang::GlobalDecl::getDecl(), GetFormalType(), clang::CodeGen::CGCXXABI::getThisArgumentTypeForMethod(), clang::CodeGen::CGCXXABI::hasMostDerivedReturn(), clang::CodeGen::CGCXXABI::HasThisReturn(), inheritingCtorHasParams(), clang::CodeGen::IsInstanceMethod, clang::CodeGen::CGCXXABI::AddedStructorArgCounts::Prefix, clang::CodeGen::CGCXXABI::AddedStructorArgCounts::Suffix, clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.
Referenced by arrangeGlobalDeclaration(), clang::CodeGen::CodeGenModule::codegenCXXStructor(), and clang::CodeGen::CodeGenModule::getAddrAndTypeOfCXXStructor().
const CGFunctionInfo & CodeGenTypes::arrangeFreeFunctionCall | ( | const CallArgList & | args, |
const FunctionType * | fnType, | ||
bool | chainCall | ||
) |
Figure out the rules for calling a function with the given formal type using the given arguments.
The arguments are necessary because the function might be unprototyped, in which case it's target-dependent in crazy ways.
Definition at line 638 of file CGCall.cpp.
References arrangeFreeFunctionLikeCall().
Referenced by EmitNewDeleteCall().
const CGFunctionInfo & CodeGenTypes::arrangeFreeFunctionType | ( | CanQual< FunctionNoProtoType > | Ty | ) |
Arrange the argument and result information for a value of the given unprototyped freestanding function type.
Definition at line 117 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), clang::CanQual< T >::getUnqualifiedType(), and clang::CodeGen::None.
const CGFunctionInfo & CodeGenTypes::arrangeFreeFunctionType | ( | CanQual< FunctionProtoType > | Ty | ) |
Arrange the argument and result information for a value of the given freestanding function type.
Definition at line 206 of file CGCall.cpp.
Referenced by arrangeCXXMethodDeclaration(), clang::CodeGen::arrangeFreeFunctionType(), and arrangeFunctionDeclaration().
const CGFunctionInfo & CodeGenTypes::arrangeFunctionDeclaration | ( | const FunctionDecl * | FD | ) |
Free functions are functions that are compatible with an ordinary C function pointer type.
Arrange the argument and result information for the declaration or definition of the given function.
Definition at line 462 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::All, arrangeCXXMethodDeclaration(), arrangeFreeFunctionType(), arrangeLLVMFunctionInfo(), clang::CanQual< T >::castAs(), clang::CanQual< T >::getAs(), clang::Type::getCanonicalTypeUnqualified(), clang::ValueDecl::getType(), clang::CodeGen::None, and setCUDAKernelCallingConvention().
Referenced by arrangeGlobalDeclaration().
const CGFunctionInfo & CodeGenTypes::arrangeGlobalDeclaration | ( | GlobalDecl | GD | ) |
Definition at line 542 of file CGCall.cpp.
References arrangeCXXStructorDeclaration(), arrangeFunctionDeclaration(), and clang::GlobalDecl::getDecl().
Referenced by clang::CodeGen::CodeGenModule::EmitGlobal(), clang::CodeGen::CodeGenModule::GetAddrOfGlobal(), and GetFunctionType().
const CGFunctionInfo & CodeGenTypes::arrangeLLVMFunctionInfo | ( | CanQualType | resultType, |
FnInfoOpts | opts, | ||
ArrayRef< CanQualType > | argTypes, | ||
FunctionType::ExtInfo | info, | ||
ArrayRef< FunctionProtoType::ExtParameterInfo > | paramInfos, | ||
RequiredArgs | required | ||
) |
"Arrange" the LLVM information for a call or type with the given signature.
Arrange the argument and result information for an abstract value of a given function type.
This is largely an internal method; other clients should use one of the above routines, which ultimately defer to this.
argTypes | - must all actually be canonical as params |
This is the method which all of the above functions ultimately defer to.
Definition at line 765 of file CGCall.cpp.
References clang::CodeGen::CGFunctionInfo::arguments(), clang::CodeGen::ABIArgInfo::canHaveCoerceToType(), clang::CC_Swift, clang::CC_SwiftAsync, ClangCallConvToLLVMCallConv(), clang::CodeGen::swiftcall::computeABIInfo(), clang::CodeGen::ABIInfo::computeInfo(), clang::CodeGen::computeSPIRKernelABIInfo(), ConvertType(), clang::CodeGen::CGFunctionInfo::create(), clang::CodeGen::CodeGenModule::getABIInfo(), clang::FunctionType::ExtInfo::getCC(), clang::CodeGen::ABIArgInfo::getCoerceToType(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::CodeGen::IsChainCall, clang::CodeGen::IsDelegateCall, clang::isInstanceMethod(), clang::CodeGen::IsInstanceMethod, clang::CodeGen::CGFunctionInfo::Profile(), clang::CodeGen::ABIArgInfo::setCoerceToType(), and clang::T.
Referenced by arrangeBlockFunctionDeclaration(), arrangeBuiltinFunctionCall(), arrangeBuiltinFunctionDeclaration(), arrangeCall(), arrangeCXXConstructorCall(), arrangeCXXMethodCall(), arrangeCXXStructorDeclaration(), clang::CodeGen::arrangeFreeFunctionCall(), arrangeFreeFunctionLikeCall(), arrangeFreeFunctionType(), arrangeFunctionDeclaration(), arrangeLLVMFunctionInfo(), arrangeMSCtorClosure(), arrangeNullaryFunction(), arrangeObjCMessageSendSignature(), arrangeUnprototypedMustTailThunk(), and arrangeUnprototypedObjCMessageSend().
const CGFunctionInfo & CodeGenTypes::arrangeMSCtorClosure | ( | const CXXConstructorDecl * | CD, |
CXXCtorType | CT | ||
) |
Definition at line 568 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), clang::Ctor_CopyingClosure, clang::Ctor_DefaultClosure, DeriveThisType(), clang::ASTContext::getDefaultCallingConvention(), GetFormalType(), clang::CXXRecordDecl::getNumVBases(), clang::CXXMethodDecl::getParent(), clang::ASTContext::IntTy, clang::CodeGen::IsInstanceMethod, and clang::ASTContext::VoidTy.
const CGFunctionInfo & CodeGenTypes::arrangeNullaryFunction | ( | ) |
A nullary function is a freestanding function of type 'void ()'.
This method works for both calls and declarations.
Definition at line 721 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), getContext(), and clang::CodeGen::None.
Referenced by createGlobalInitOrCleanupFn(), and clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition().
const CGFunctionInfo & CodeGenTypes::arrangeObjCMessageSendSignature | ( | const ObjCMethodDecl * | MD, |
QualType | receiverType | ||
) |
Arrange the argument and result information for the function type through which to perform a send to the given Objective-C method, using the given receiver type.
The receiver type is not always the 'self' type of the method or even an Objective-C pointer type. This is not the right method for actually performing such a message send, due to the possibility of optional arguments.
Definition at line 499 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), getCallingConventionForDecl(), clang::ASTContext::getCanonicalParamType(), getContext(), clang::ASTContext::getObjCSelType(), clang::ObjCMethodDecl::getReturnType(), GetReturnType(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::Decl::hasAttr(), clang::ObjCMethodDecl::isDirectMethod(), clang::ObjCMethodDecl::isVariadic(), clang::CodeGen::None, clang::ObjCMethodDecl::parameters(), clang::FunctionType::ExtInfo::withCallingConv(), clang::FunctionType::ExtParameterInfo::withIsNoEscape(), and clang::FunctionType::ExtInfo::withProducesResult().
Referenced by clang::CodeGen::arrangeObjCMessageSendSignature(), arrangeObjCMethodDeclaration(), and clang::CodeGen::CGObjCRuntime::getMessageSendInfo().
const CGFunctionInfo & CodeGenTypes::arrangeObjCMethodDeclaration | ( | const ObjCMethodDecl * | MD | ) |
Objective-C methods are C functions with some implicit parameters.
Arrange the argument and result information for the declaration or definition of an Objective-C method.
Definition at line 486 of file CGCall.cpp.
References arrangeObjCMessageSendSignature(), clang::ObjCMethodDecl::getSelfDecl(), and clang::ValueDecl::getType().
const CGFunctionInfo & CodeGenTypes::arrangeUnprototypedMustTailThunk | ( | const CXXMethodDecl * | MD | ) |
Arrange a thunk that takes 'this' as the first parameter followed by varargs.
Return a void pointer, regardless of the actual return type. The body of the thunk will end in a musttail call to a function of the correct type, and the caller will bitcast the function to the correct prototype.
Definition at line 559 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), DeriveThisType(), GetFormalType(), clang::CXXMethodDecl::getParent(), clang::CXXMethodDecl::isVirtual(), clang::CodeGen::None, and clang::ASTContext::VoidTy.
const CGFunctionInfo & CodeGenTypes::arrangeUnprototypedObjCMessageSend | ( | QualType | returnType, |
const CallArgList & | args | ||
) |
Definition at line 532 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), getArgTypesForCall(), GetReturnType(), and clang::CodeGen::None.
Referenced by clang::CodeGen::CGObjCRuntime::getMessageSendInfo().
unsigned CodeGenTypes::ClangCallConvToLLVMCallConv | ( | CallingConv | CC | ) |
Convert clang calling convention to LLVM callilng convention.
Definition at line 50 of file CGCall.cpp.
References clang::CC_AAPCS, clang::CC_AAPCS_VFP, clang::CC_AArch64SVEPCS, clang::CC_AArch64VectorCall, clang::CC_AMDGPUKernelCall, clang::CC_IntelOclBicc, clang::CC_M68kRTD, clang::CC_OpenCLKernel, clang::CC_PreserveAll, clang::CC_PreserveMost, clang::CC_PreserveNone, clang::CC_RISCVVectorCall, clang::CC_SpirFunction, clang::CC_Swift, clang::CC_SwiftAsync, clang::CC_Win64, clang::CC_X86_64SysV, clang::CC_X86FastCall, clang::CC_X86Pascal, clang::CC_X86RegCall, clang::CC_X86StdCall, clang::CC_X86ThisCall, clang::CC_X86VectorCall, clang::CodeGen::TargetCodeGenInfo::getOpenCLKernelCallingConv(), and clang::CodeGen::CodeGenModule::getTargetCodeGenInfo().
Referenced by arrangeLLVMFunctionInfo(), and clang::CodeGen::TargetCodeGenInfo::createEnqueuedBlockKernel().
std::unique_ptr< CGRecordLayout > CodeGenTypes::ComputeRecordLayout | ( | const RecordDecl * | D, |
llvm::StructType * | Ty | ||
) |
Compute a new LLVM record layout object for the given record.
Definition at line 1087 of file CGRecordLayoutBuilder.cpp.
References addRecordTypeName(), D, clang::Decl::dump(), clang::ASTContext::getASTRecordLayout(), getContext(), getDataLayout(), clang::NamedDecl::getDeclName(), clang::ASTRecordLayout::getFieldCount(), clang::ASTRecordLayout::getFieldOffset(), getLLVMContext(), clang::ASTRecordLayout::getNonVirtualSize(), clang::ASTRecordLayout::getSize(), clang::FieldDecl::isBitField(), clang::CodeGen::isEmptyFieldForLayout(), clang::CodeGen::CGBitFieldInfo::Offset, clang::CodeGen::CGBitFieldInfo::Size, clang::CodeGen::CGBitFieldInfo::StorageSize, clang::ASTContext::toBits(), and clang::CodeGen::CGBitFieldInfo::VolatileStorageSize.
Referenced by ConvertRecordDeclType().
llvm::StructType * CodeGenTypes::ConvertRecordDeclType | ( | const RecordDecl * | TD | ) |
ConvertRecordDeclType - Lay out a tagged decl type like struct or union.
Definition at line 797 of file CodeGenTypes.cpp.
References addRecordTypeName(), ComputeRecordLayout(), ConvertRecordDeclType(), clang::RecordType::getDecl(), clang::RecordDecl::getDefinition(), getLLVMContext(), clang::ASTContext::getTagDeclType(), clang::QualType::getTypePtr(), and clang::TagDecl::isCompleteDefinition().
Referenced by ConvertRecordDeclType(), ConvertType(), getCGRecordLayout(), and UpdateCompletedType().
llvm::Type * CodeGenTypes::ConvertType | ( | QualType | T | ) |
ConvertType - Convert type T into a llvm::Type.
ConvertType - Convert the specified type to its LLVM form.
Definition at line 347 of file CodeGenTypes.cpp.
References clang::C, clang::CodeGen::CGHLSLRuntime::convertHLSLSpecificType(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CGOpenCLRuntime::convertOpenCLSpecificType(), ConvertRecordDeclType(), ConvertType(), ConvertTypeForMem(), clang::ASTContext::BuiltinVectorTypeInfo::EC, clang::ASTContext::BuiltinVectorTypeInfo::ElementType, clang::QualType::getAddressSpace(), clang::ASTContext::getBuiltinVectorTypeInfo(), clang::ASTContext::getCanonicalType(), clang::CodeGen::TargetCodeGenInfo::getCUDADeviceBuiltinSurfaceDeviceType(), clang::CodeGen::TargetCodeGenInfo::getCUDADeviceBuiltinTextureDeviceType(), getCXXABI(), clang::ArrayType::getElementType(), clang::MatrixType::getElementType(), clang::ASTContext::getFloatTypeSemantics(), clang::CodeGen::CodeGenModule::getHLSLRuntime(), clang::ArrayType::getIndexTypeCVRQualifiers(), clang::EnumDecl::getIntegerType(), getKind(), clang::ASTContext::getLangOpts(), getLLVMContext(), clang::ConstantMatrixType::getNumColumns(), clang::ConstantMatrixType::getNumRows(), clang::CodeGen::CodeGenModule::getOpenCLRuntime(), clang::CodeGen::CGOpenCLRuntime::getPipeType(), clang::Type::getPointeeType(), clang::PointerType::getPointeeType(), clang::ReferenceType::getPointeeType(), clang::ASTContext::getTargetAddressSpace(), getTargetAddressSpace(), clang::CodeGen::CodeGenModule::getTargetCodeGenInfo(), clang::ASTContext::getTargetInfo(), clang::Type::getTypeClass(), getTypeForFormat(), clang::ASTContext::getTypeSize(), clang::ConstantArrayType::getZExtSize(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::TagDecl::isCompleteDefinition(), clang::Type::isCUDADeviceBuiltinSurfaceType(), clang::Type::isCUDADeviceBuiltinTextureType(), clang::EnumDecl::isFixed(), clang::ASTContext::BuiltinVectorTypeInfo::NumVectors, clang::T, and clang::TargetInfo::useFP16ConversionIntrinsics().
Referenced by clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), addX86InterruptAttrs(), arrangeLLVMFunctionInfo(), buildBlockDescriptor(), buildGlobalBlock(), clang::CodeGen::DefaultABIInfo::classifyArgumentType(), computeBlockInfo(), clang::CodeGen::convertFreeFunctionType(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), ConvertType(), convertTypeForLoadStore(), ConvertTypeForMem(), clang::CodeGen::CGOpenMPRuntime::emitKmpRoutineEntryT(), clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString(), clang::CodeGen::CodeGenModule::GetAddrOfFunction(), getAllocatorVal(), clang::CodeGen::CodeGenModule::getBlockDescriptorType(), clang::CodeGen::CGCXXABI::GetBogusMemberPointer(), getExpandedTypes(), getGuardAcquireFn(), clang::CodeGen::CodeGenModule::GetNonVirtualBaseClassOffset(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), typeRequiresSplitIntoByteArray(), and UpdateCompletedType().
llvm::Type * CodeGenTypes::convertTypeForLoadStore | ( | QualType | T, |
llvm::Type * | LLVMTy = nullptr |
||
) |
Given that T is a scalar type, return the IR type that should be used for load and store operations.
For example, this might be i8 for _Bool or i96 for _BitInt(65). The store size of the load/store type (as reported by LLVM's data layout) is always the same as the alloc size of the memory representation type returned by ConvertTypeForMem.
As an optimization, if you already know the scalar value type for T (as would be returned by ConvertType), you can pass it as the second argument so that it does not need to be recomputed in common cases where the value type and load/store type are the same.
Definition at line 159 of file CodeGenTypes.cpp.
References ConvertType(), ConvertTypeForMem(), getLLVMContext(), clang::CharUnits::getQuantity(), clang::ASTContext::getTypeSize(), clang::ASTContext::getTypeSizeInChars(), clang::Type::isBitIntType(), clang::Type::isExtVectorBoolType(), and clang::T.
Referenced by clang::CodeGen::ConstantEmitter::emitForMemory().
llvm::Type * CodeGenTypes::ConvertTypeForMem | ( | QualType | T | ) |
ConvertTypeForMem - Convert type T into a llvm::Type.
This differs from ConvertType in that it is used to convert to the memory representation for a type. For example, the scalar representation for _Bool is i1, but the memory representation is usually i8 or i32, depending on the target.
This differs from ConvertType in that it is used to convert to the memory representation for a type. For example, the scalar representation for _Bool is i1, but the memory representation is usually i8 or i32, depending on the target.
We generally assume that the alloc size of this type under the LLVM data layout is the same as the size of the AST type. The alignment does not have to match: Clang should always use explicit alignments and packed structs as necessary to produce the layout it needs. But the size does need to be exactly right or else things like struct layout will break.
Definition at line 101 of file CodeGenTypes.cpp.
References ConvertType(), clang::ASTContext::getCanonicalType(), clang::MatrixType::getElementType(), getLLVMContext(), clang::ConstantMatrixType::getNumColumns(), clang::ConstantMatrixType::getNumRows(), clang::CharUnits::getQuantity(), clang::CanQual< T >::getTypePtr(), clang::ASTContext::getTypeSize(), clang::ASTContext::getTypeSizeInChars(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::Type::isBitIntType(), clang::Type::isConstantMatrixType(), clang::Type::isExtVectorBoolType(), clang::T, and typeRequiresSplitIntoByteArray().
Referenced by computeBlockInfo(), ConvertType(), convertTypeForLoadStore(), clang::CodeGen::convertTypeForMemory(), emitConstantObjCStringLiteral(), clang::CodeGen::ConstantEmitter::emitForMemory(), EmitGlobalVarDeclLValue(), clang::CodeGen::CodeGenModule::EmitOMPAllocateDecl(), clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalTemporary(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalVar(), clang::CodeGen::CodeGenModule::GetAddrOfMSGuidDecl(), clang::CodeGen::CodeGenModule::getOrCreateStaticVarDecl(), clang::CodeGen::CodeGenModule::GetWeakRefReference(), and clang::CodeGen::CGOpenMPRuntime::registerTargetGlobalVariable().
CanQualType CodeGenTypes::DeriveThisType | ( | const CXXRecordDecl * | RD, |
const CXXMethodDecl * | MD | ||
) |
Derives the 'this' type for codegen purposes, i.e.
ignoring method CVR qualification.
ignoring method CVR qualification. Either or both of RD and MD may be null. A null RD indicates that there is no meaningful 'this' type, and a null MD can occur when calling a method pointer.
Definition at line 87 of file CGCall.cpp.
References clang::CanQual< Type >::CreateUnsafe(), clang::Qualifiers::getAddressSpace(), clang::ASTContext::getAddrSpaceQualType(), clang::Type::getCanonicalTypeInternal(), clang::CXXMethodDecl::getMethodQualifiers(), clang::ASTContext::getPointerType(), clang::ASTContext::getTagDeclType(), and clang::ASTContext::VoidTy.
Referenced by arrangeCXXMethodType(), arrangeCXXStructorDeclaration(), arrangeMSCtorClosure(), arrangeUnprototypedMustTailThunk(), and commonEmitCXXMemberOrOperatorCall().
|
inline |
Definition at line 102 of file CodeGenTypes.h.
Referenced by getCXXABI().
const CGRecordLayout & CodeGenTypes::getCGRecordLayout | ( | const RecordDecl * | RD | ) |
getCGRecordLayout - Return record layout info for the given record decl.
Definition at line 840 of file CodeGenTypes.cpp.
References ConvertRecordDeclType(), clang::ASTContext::getTagDeclType(), and clang::QualType::getTypePtr().
Referenced by emitAddrOfFieldStorage(), EmitNullConstant(), EmitNullConstantForBase(), emitPreserveStructAccess(), getGEPIndicesToField(), clang::CodeGen::getLLVMFieldNumber(), isZeroInitializable(), and setUsedBits().
const CodeGenOptions & CodeGenTypes::getCodeGenOpts | ( | ) | const |
Definition at line 48 of file CodeGenTypes.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts().
Referenced by emitGlobalDtorWithCXAAtExit(), and clang::CodeGen::ABIInfo::getCodeGenOpts().
|
inline |
Definition at line 103 of file CodeGenTypes.h.
Referenced by appendParameterTypes(), arrangeFreeFunctionLikeCall(), arrangeNullaryFunction(), arrangeObjCMessageSendSignature(), ComputeRecordLayout(), clang::CodeGen::ABIInfo::getContext(), GetFunctionType(), and getTargetAddressSpace().
CGCXXABI & CodeGenTypes::getCXXABI | ( | ) | const |
Definition at line 46 of file CodeGenTypes.cpp.
References getCGM(), and clang::CodeGen::CodeGenModule::getCXXABI().
Referenced by arrangeCXXConstructorCall(), arrangeCXXMethodDeclaration(), arrangeCXXStructorDeclaration(), ConvertType(), clang::CodeGen::ABIInfo::getCXXABI(), isFuncParamTypeConvertible(), and isZeroInitializable().
|
inline |
Definition at line 99 of file CodeGenTypes.h.
Referenced by ComputeRecordLayout(), clang::CodeGen::ABIInfo::getDataLayout(), getTargetAddressSpace(), and typeRequiresSplitIntoByteArray().
void CodeGenTypes::getExpandedTypes | ( | QualType | Ty, |
SmallVectorImpl< llvm::Type * >::iterator & | TI | ||
) |
getExpandedTypes - Expand the type
Definition at line 1013 of file CGCall.cpp.
References ConvertType(), getExpandedTypes(), and getTypeExpansion().
Referenced by getExpandedTypes(), and GetFunctionType().
llvm::FunctionType * CodeGenTypes::GetFunctionType | ( | const CGFunctionInfo & | Info | ) |
GetFunctionType - Get the LLVM function type for.
Definition at line 1606 of file CGCall.cpp.
References clang::CodeGen::CGFunctionInfo::arg_begin(), clang::CodeGen::ABIArgInfo::CoerceAndExpand, clang::CodeGen::ABIArgInfo::Direct, clang::CodeGen::ABIArgInfo::Expand, clang::CodeGen::ABIArgInfo::Extend, clang::CodeGen::ABIArgInfo::getCanBeFlattened(), clang::CodeGen::ABIArgInfo::getCoerceAndExpandTypeSequence(), clang::CodeGen::ABIArgInfo::getCoerceToType(), getContext(), clang::CodeGen::CodeGenModule::getDataLayout(), getExpandedTypes(), clang::CodeGen::ABIArgInfo::getInAllocaSRet(), clang::CodeGen::ABIArgInfo::getIndirectAddrSpace(), clang::CodeGen::ABIArgInfo::getKind(), getLLVMContext(), clang::CodeGen::CGFunctionInfo::getNumRequiredArgs(), clang::CodeGen::ABIArgInfo::getPaddingType(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), getTargetAddressSpace(), clang::CodeGen::CodeGenModule::getTypes(), clang::CodeGen::ABIArgInfo::getUnpaddedCoerceAndExpandType(), clang::CodeGen::ABIArgInfo::Ignore, clang::CodeGen::ABIArgInfo::InAlloca, clang::CodeGen::ABIArgInfo::Indirect, clang::CodeGen::ABIArgInfo::IndirectAliased, clang::CodeGen::CGFunctionInfoArgInfo::info, clang::CodeGen::ABIArgInfo::isDirect(), clang::CodeGen::CGFunctionInfo::isVariadic(), and clang::CodeGen::CGFunctionInfoArgInfo::type.
Referenced by emitAtomicLibcall(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), emitDestructorsFunction(), clang::CodeGen::CodeGenModule::EmitGlobal(), EmitHipStdParUnsupportedBuiltin(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), clang::CodeGen::CGOpenMPRuntime::emitReductionFunction(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper(), generateByrefCopyHelper(), generateByrefDisposeHelper(), clang::CodeGen::CodeGenModule::getAddrAndTypeOfCXXStructor(), clang::CodeGen::CodeGenModule::GetAddrOfGlobal(), getClangCallTerminateFn(), GetFunctionType(), GetFunctionTypeForVTable(), and clang::CodeGen::CodeGenModule::TryEmitBaseDestructorAsAlias().
llvm::FunctionType * CodeGenTypes::GetFunctionType | ( | GlobalDecl | GD | ) |
Definition at line 1600 of file CGCall.cpp.
References arrangeGlobalDeclaration(), and GetFunctionType().
llvm::Type * CodeGenTypes::GetFunctionTypeForVTable | ( | GlobalDecl | GD | ) |
GetFunctionTypeForVTable - Get the LLVM function type for use in a vtable, given a CXXMethodDecl.
If the method to has an incomplete return type, and/or incomplete argument types, this will return the opaque type.
Definition at line 1733 of file CGCall.cpp.
References clang::Type::castAs(), clang::GlobalDecl::getDecl(), GetFunctionType(), getLLVMContext(), clang::ValueDecl::getType(), and isFuncTypeConvertible().
|
inline |
Definition at line 106 of file CodeGenTypes.h.
Referenced by ComputeRecordLayout(), ConvertRecordDeclType(), ConvertType(), convertTypeForLoadStore(), ConvertTypeForMem(), GetFunctionType(), GetFunctionTypeForVTable(), and clang::CodeGen::ABIInfo::getVMContext().
|
inline |
Definition at line 104 of file CodeGenTypes.h.
Referenced by clang::CodeGen::ABIInfo::appendAttributeMangling(), clang::CodeGen::ABIInfo::getTarget(), and clang::CodeGen::SwiftABIInfo::occupiesMoreThan().
Definition at line 894 of file CodeGenTypes.cpp.
References getContext(), getDataLayout(), clang::ASTContext::getTargetAddressSpace(), clang::Type::isFunctionType(), and clang::T.
Referenced by ConvertType(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), GetFunctionType(), and clang::CodeGen::CGOpenMPRuntimeGPU::getParameterAddress().
bool CodeGenTypes::inheritingCtorHasParams | ( | const InheritedConstructor & | Inherited, |
CXXCtorType | Type | ||
) |
Determine if a C++ inheriting constructor should have parameters matching those of its inherited constructor.
Definition at line 325 of file CGCall.cpp.
References clang::ConstructorUsingShadowDecl::constructsVirtualBase(), clang::Ctor_Complete, and clang::InheritedConstructor::getShadowDecl().
Referenced by arrangeCXXStructorDeclaration().
isFuncParamTypeConvertible - Return true if the specified type in a function parameter or result position can be converted to an IR type at this point.
This boils down to being whether it is complete.
Definition at line 189 of file CodeGenTypes.cpp.
References clang::Type::getAs(), getCXXABI(), clang::Type::isIncompleteType(), and clang::CodeGen::CGCXXABI::isMemberPointerConvertible().
Referenced by isFuncTypeConvertible().
bool CodeGenTypes::isFuncTypeConvertible | ( | const FunctionType * | FT | ) |
isFuncTypeConvertible - Utility to check whether a function type can be converted to an LLVM type (i.e.
Code to verify a given function type is complete, i.e.
doesn't depend on an incomplete tag type).
the return type and all of the parameter types are complete. Also check to see if we are in a RS_StructPointer context, and if so whether any struct types have been pended. If so, we don't want to ask the ABI lowering code to handle a type that cannot be converted to an IR type.
Definition at line 209 of file CodeGenTypes.cpp.
References clang::FunctionType::getReturnType(), and isFuncParamTypeConvertible().
Referenced by GetFunctionTypeForVTable().
|
inline |
Definition at line 312 of file CodeGenTypes.h.
Check if the pointer type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
Definition at line 857 of file CodeGenTypes.cpp.
References clang::Type::isAnyPointerType(), clang::Type::isBlockPointerType(), isZeroInitializable(), and clang::T.
Referenced by isSimpleZero().
isRecordLayoutComplete - Return true if the specified type is already completely laid out.
Definition at line 180 of file CodeGenTypes.cpp.
bool CodeGenTypes::isZeroInitializable | ( | const RecordDecl * | RD | ) |
IsZeroInitializable - Return whether a record type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
Definition at line 890 of file CodeGenTypes.cpp.
References getCGRecordLayout(), and clang::CodeGen::CGRecordLayout::isZeroInitializable().
IsZeroInitializable - Return whether a type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
Definition at line 862 of file CodeGenTypes.cpp.
References clang::Type::getAs(), clang::ASTContext::getAsArrayType(), clang::ASTContext::getBaseElementType(), clang::ASTContext::getConstantArrayElementCount(), getCXXABI(), clang::ASTContext::getTargetNullPointerValue(), clang::CodeGen::CGCXXABI::isZeroInitializable(), isZeroInitializable(), and clang::T.
Referenced by GetNumNonZeroBytesInInit(), isPointerZeroInitializable(), isSimpleZero(), and isZeroInitializable().
void CodeGenTypes::RefreshTypeCacheForClass | ( | const CXXRecordDecl * | RD | ) |
Remove stale types from the type cache when an inheritance model gets assigned to a class.
Definition at line 259 of file CodeGenTypes.cpp.
References clang::ASTContext::getCanonicalType(), clang::ASTContext::getRecordType(), and clang::T.
Referenced by clang::CodeGen::CodeGenModule::RefreshTypeCacheForClass().
Check whether the given type needs to be laid out in memory using an opaque byte-array type because its load/store type does not have the correct alloc size in the LLVM data layout.
If this is false, the load/store type (convertTypeForLoadStore) and memory representation type (ConvertTypeForMem) will be the same type.
Definition at line 148 of file CodeGenTypes.cpp.
References ConvertType(), clang::CharUnits::fromQuantity(), getDataLayout(), getTypeAllocSize(), and clang::ASTContext::getTypeSizeInChars().
Referenced by ConvertTypeForMem(), and clang::CodeGen::ConstantEmitter::emitForMemory().
void CodeGenTypes::UpdateCompletedType | ( | const TagDecl * | TD | ) |
UpdateCompletedType - When we find the full definition for a TagDecl, replace the 'opaque' type we previously made for it if applicable.
Definition at line 223 of file CodeGenTypes.cpp.
References ConvertRecordDeclType(), ConvertType(), clang::CodeGen::CodeGenModule::getModuleDebugInfo(), clang::ASTContext::getTagDeclType(), clang::QualType::getTypePtr(), and clang::TagDecl::isDependentType().
Referenced by clang::CodeGen::CodeGenModule::UpdateCompletedType().