|
clang
5.0.0
|
This class organizes the cross-module state that is used while lowering AST types to LLVM types. More...
Public Member Functions | |
| CodeGenTypes (CodeGenModule &cgm) | |
| ~CodeGenTypes () | |
| const llvm::DataLayout & | getDataLayout () const |
| ASTContext & | getContext () const |
| const ABIInfo & | getABIInfo () const |
| const TargetInfo & | getTarget () const |
| CGCXXABI & | getCXXABI () const |
| llvm::LLVMContext & | getLLVMContext () |
| const CodeGenOptions & | getCodeGenOpts () const |
| llvm::Type * | ConvertType (QualType T) |
| ConvertType - Convert type T into a llvm::Type. More... | |
| llvm::Type * | ConvertFunctionType (QualType FT, const FunctionDecl *FD=nullptr) |
| Converts the GlobalDecl into an llvm::Type. More... | |
| llvm::Type * | ConvertTypeForMem (QualType T) |
| ConvertTypeForMem - Convert type T into a llvm::Type. More... | |
| llvm::FunctionType * | GetFunctionType (const CGFunctionInfo &Info) |
| GetFunctionType - Get the LLVM function type for. More... | |
| 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. More... | |
| 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. More... | |
| bool | inheritingCtorHasParams (const InheritedConstructor &Inherited, CXXCtorType Type) |
| Determine if a C++ inheriting constructor should have parameters matching those of its inherited constructor. More... | |
| llvm::Type * | GetFunctionTypeForVTable (GlobalDecl GD) |
| GetFunctionTypeForVTable - Get the LLVM function type for use in a vtable, given a CXXMethodDecl. More... | |
| const CGRecordLayout & | getCGRecordLayout (const RecordDecl *) |
| getCGRecordLayout - Return record layout info for the given record decl. More... | |
| 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. More... | |
| void | RefreshTypeCacheForClass (const CXXRecordDecl *RD) |
| Remove stale types from the type cache when an inheritance model gets assigned to a class. More... | |
| 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. More... | |
| const CGFunctionInfo & | arrangeFunctionDeclaration (const FunctionDecl *FD) |
| Free functions are functions that are compatible with an ordinary C function pointer type. More... | |
| 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. More... | |
| const CGFunctionInfo & | arrangeFreeFunctionType (CanQual< FunctionProtoType > Ty, const FunctionDecl *FD) |
| Arrange the argument and result information for a value of the given freestanding function type. More... | |
| const CGFunctionInfo & | arrangeFreeFunctionType (CanQual< FunctionNoProtoType > Ty) |
| Arrange the argument and result information for a value of the given unprototyped freestanding function type. More... | |
| const CGFunctionInfo & | arrangeNullaryFunction () |
| A nullary function is a freestanding function of type 'void ()'. More... | |
| const CGFunctionInfo & | arrangeBuiltinFunctionDeclaration (QualType resultType, const FunctionArgList &args) |
| A builtin function is a freestanding function using the default C conventions. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| const CGFunctionInfo & | arrangeBlockFunctionCall (const CallArgList &args, const FunctionType *type) |
| A block function is essentially a free function with an extra implicit argument. More... | |
| const CGFunctionInfo & | arrangeCXXMethodDeclaration (const CXXMethodDecl *MD) |
| C++ methods have some special rules and also have implicit parameters. More... | |
| const CGFunctionInfo & | arrangeCXXStructorDeclaration (const CXXMethodDecl *MD, StructorType Type) |
| 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. More... | |
| const CGFunctionInfo & | arrangeCXXMethodCall (const CallArgList &args, const FunctionProtoType *type, RequiredArgs required, unsigned numPrefixArgs) |
| Arrange a call to a C++ method, passing the given arguments. More... | |
| const CGFunctionInfo & | arrangeMSMemberPointerThunk (const CXXMethodDecl *MD) |
| Arrange a thunk that takes 'this' as the first parameter followed by varargs. More... | |
| 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. More... | |
| const CGFunctionInfo & | arrangeLLVMFunctionInfo (CanQualType returnType, bool instanceMethod, bool chainCall, 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. More... | |
| CGRecordLayout * | ComputeRecordLayout (const RecordDecl *D, llvm::StructType *Ty) |
| Compute a new LLVM record layout object for the given record. More... | |
| 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. More... | |
| llvm::StructType * | ConvertRecordDeclType (const RecordDecl *TD) |
| ConvertRecordDeclType - Lay out a tagged decl type like struct or union. More... | |
| void | getExpandedTypes (QualType Ty, SmallVectorImpl< llvm::Type * >::iterator &TI) |
| getExpandedTypes - Expand the type More... | |
| bool | isZeroInitializable (QualType T) |
| IsZeroInitializable - Return whether a type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer. More... | |
| bool | isPointerZeroInitializable (QualType T) |
| Check if the pointer type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer. More... | |
| bool | isZeroInitializable (const RecordDecl *RD) |
| IsZeroInitializable - Return whether a record type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer. More... | |
| bool | isRecordLayoutComplete (const Type *Ty) const |
| isRecordLayoutComplete - Return true if the specified type is already completely laid out. More... | |
| bool | noRecordsBeingLaidOut () const |
| bool | isRecordBeingLaidOut (const Type *Ty) const |
This class organizes the cross-module state that is used while lowering AST types to LLVM types.
Definition at line 120 of file CodeGenTypes.h.
| CodeGenTypes::CodeGenTypes | ( | CodeGenModule & | cgm | ) |
Definition at line 32 of file CodeGenTypes.cpp.
| CodeGenTypes::~CodeGenTypes | ( | ) |
Definition at line 39 of file CodeGenTypes.cpp.
| 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 51 of file CodeGenTypes.cpp.
References clang::Decl::getDeclContext(), clang::NamedDecl::getIdentifier(), clang::TagDecl::getKindName(), clang::TagDecl::getTypedefNameForAnonDecl(), clang::NamedDecl::printName(), and clang::NamedDecl::printQualifiedName().
Referenced by ComputeRecordLayout(), and ConvertRecordDeclType().
| const CGFunctionInfo & CodeGenTypes::arrangeBlockFunctionCall | ( | const CallArgList & | args, |
| const FunctionType * | fnType | ||
| ) |
A block function is essentially a free function with an extra implicit argument.
Definition at line 603 of file CGCall.cpp.
References arrangeFreeFunctionLikeCall().
Referenced by clang::CodeGen::CodeGenFunction::EmitBlockCallExpr().
| const CGFunctionInfo & CodeGenTypes::arrangeBlockFunctionDeclaration | ( | const FunctionProtoType * | type, |
| const FunctionArgList & | args | ||
| ) |
Block invocation functions are C functions with an implicit parameter.
Definition at line 610 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), Context, getArgTypesForDeclaration(), clang::FunctionType::getExtInfo(), getExtParameterInfosForCall(), GetReturnType(), and clang::FunctionType::getReturnType().
Referenced by clang::CodeGen::CodeGenFunction::GenerateBlockFunction().
| const CGFunctionInfo & CodeGenTypes::arrangeBuiltinFunctionCall | ( | QualType | resultType, |
| const CallArgList & | args | ||
| ) |
Definition at line 623 of file CGCall.cpp.
References clang::All, arrangeLLVMFunctionInfo(), Context, clang::ASTContext::getCanonicalParamType(), and GetReturnType().
Referenced by emitAtomicLibcall(), emitCPPObjectAtomicGetterCall(), emitCPPObjectAtomicSetterCall(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), emitStructGetterCall(), and emitStructSetterCall().
| const CGFunctionInfo & CodeGenTypes::arrangeBuiltinFunctionDeclaration | ( | QualType | resultType, |
| const FunctionArgList & | args | ||
| ) |
A builtin function is a freestanding function using the default C conventions.
Definition at line 636 of file CGCall.cpp.
References clang::All, arrangeLLVMFunctionInfo(), Context, getArgTypesForDeclaration(), and GetReturnType().
Referenced by createOffloadingBinaryDescriptorFunction(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), emitCopyToScratchpad(), emitDestructorsFunction(), emitInterWarpCopyFunction(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitReduceScratchpadFunction(), emitShuffleAndReduceFunction(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), generateByrefCopyHelper(), generateByrefDisposeHelper(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateDestroyHelper(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), and clang::CodeGen::CodeGenFunction::startOutlinedSEHHelper().
| const CGFunctionInfo & CodeGenTypes::arrangeBuiltinFunctionDeclaration | ( | CanQualType | resultType, |
| ArrayRef< CanQualType > | argTypes | ||
| ) |
Definition at line 646 of file CGCall.cpp.
References clang::All, and arrangeLLVMFunctionInfo().
| 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 685 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::allowsOptionalArgs(), clang::CodeGen::CGFunctionInfo::arg_size(), arrangeLLVMFunctionInfo(), Context, getArgTypesForCall(), clang::CodeGen::CGFunctionInfo::getExtInfo(), clang::CodeGen::CGFunctionInfo::getExtParameterInfos(), clang::CodeGen::CGFunctionInfo::getRequiredArgs(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::CodeGen::CGFunctionInfo::isChainCall(), and clang::CodeGen::CGFunctionInfo::isInstanceMethod().
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 378 of file CGCall.cpp.
References addExtParameterInfosForCall(), arrangeLLVMFunctionInfo(), Context, clang::ASTContext::getCanonicalParamType(), GetFormalType(), clang::CanQual< T >::getTypePtr(), and clang::ASTContext::VoidTy.
Referenced by canEmitDelegateCallArgs(), and clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall().
| 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 658 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), Context, getArgTypesForCall(), clang::FunctionType::getExtInfo(), getExtParameterInfosForCall(), GetReturnType(), and clang::FunctionType::getReturnType().
Referenced by clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorCall(), and clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr().
| 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 263 of file CGCall.cpp.
References arrangeCXXMethodType(), arrangeFreeFunctionType(), GetFormalType(), clang::CodeGen::CGCXXABI::getThisArgumentTypeForMethod(), clang::CanQual< T >::getTypePtr(), and clang::CXXMethodDecl::isInstance().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), 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.
(Zero value of 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 242 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), clang::CanQual< T >::getAs(), clang::Type::getCanonicalTypeUnqualified(), GetThisType(), and clang::ASTContext::VoidPtrTy.
Referenced by arrangeCXXMethodDeclaration(), clang::CodeGen::arrangeCXXMethodType(), and clang::CodeGen::CGCXXABI::EmitLoadOfMemberFunctionPointer().
| const CGFunctionInfo & CodeGenTypes::arrangeCXXStructorDeclaration | ( | const CXXMethodDecl * | MD, |
| StructorType | Type | ||
| ) |
Definition at line 288 of file CGCall.cpp.
References appendParameterTypes(), clang::CodeGen::CGCXXABI::buildStructorSignature(), GetFormalType(), clang::CXXMethodDecl::getParent(), GetThisType(), inheritingCtorHasParams(), clang::CodeGen::CGCXXABI::AddedStructorArgs::Prefix, clang::CodeGen::CGCXXABI::AddedStructorArgs::Suffix, clang::CodeGen::toCXXCtorType(), and clang::CodeGen::toCXXDtorType().
Referenced by clang::CodeGen::CodeGenFunction::BuildAppleKextVirtualDestructorCall(), clang::CodeGen::CodeGenModule::codegenCXXStructor(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(), and clang::CodeGen::CodeGenModule::getAddrOfCXXStructor().
| 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 593 of file CGCall.cpp.
References arrangeFreeFunctionLikeCall().
Referenced by EmitNewDeleteCall().
| const CGFunctionInfo & CodeGenTypes::arrangeFreeFunctionType | ( | CanQual< FunctionProtoType > | FTP, |
| const FunctionDecl * | FD | ||
| ) |
Arrange the argument and result information for a value of the given freestanding function type.
Definition at line 187 of file CGCall.cpp.
References arrangeLLVMFunctionInfo().
Referenced by arrangeCXXMethodDeclaration(), clang::CodeGen::arrangeFreeFunctionType(), and ConvertFunctionType().
| const CGFunctionInfo & CodeGenTypes::arrangeFreeFunctionType | ( | CanQual< FunctionNoProtoType > | FTNP | ) |
Arrange the argument and result information for a value of the given unprototyped freestanding function type.
Definition at line 95 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), clang::CanQual< T >::getUnqualifiedType(), and clang::None.
| 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 419 of file CGCall.cpp.
References clang::All, clang::CodeGen::arrangeFreeFunctionType(), arrangeLLVMFunctionInfo(), clang::CanQual< T >::castAs(), clang::CanQual< T >::getAs(), clang::Type::getCanonicalTypeUnqualified(), clang::ValueDecl::getType(), and clang::None.
Referenced by clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups().
| const CGFunctionInfo & CodeGenTypes::arrangeGlobalDeclaration | ( | GlobalDecl | GD | ) |
Definition at line 493 of file CGCall.cpp.
References clang::GlobalDecl::getCtorType(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::CodeGen::getFromCtorType(), and clang::CodeGen::getFromDtorType().
Referenced by clang::CodeGen::CodeGenModule::EmitGlobal(), clang::CodeGen::CodeGenFunction::generateThunk(), and clang::CodeGen::CodeGenModule::GetAddrOfGlobal().
| const CGFunctionInfo & CodeGenTypes::arrangeLLVMFunctionInfo | ( | CanQualType | resultType, |
| bool | instanceMethod, | ||
| bool | chainCall, | ||
| 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 720 of file CGCall.cpp.
References clang::CodeGen::ABIArgInfo::canHaveCoerceToType(), clang::CC_Swift, clang::CodeGen::swiftcall::computeABIInfo(), clang::CodeGen::computeSPIRKernelABIInfo(), clang::serialized_diags::create(), clang::FunctionType::ExtInfo::getCC(), clang::CodeGen::ABIArgInfo::getCoerceToType(), I, ID, and clang::CodeGen::ABIArgInfo::setCoerceToType().
Referenced by clang::CodeGen::arrangeFreeFunctionCall(), arrangeFreeFunctionLikeCall(), arrangeFreeFunctionType(), and arrangeLLVMFunctionInfo().
| const CGFunctionInfo & CodeGenTypes::arrangeMSCtorClosure | ( | const CXXConstructorDecl * | CD, |
| CXXCtorType | CT | ||
| ) |
Definition at line 522 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), Context, clang::Ctor_CopyingClosure, clang::Ctor_DefaultClosure, clang::ASTContext::getDefaultCallingConvention(), GetFormalType(), clang::CXXRecordDecl::getNumVBases(), clang::CXXMethodDecl::getParent(), GetThisType(), clang::ASTContext::IntTy, and clang::ASTContext::VoidTy.
| const CGFunctionInfo & CodeGenTypes::arrangeMSMemberPointerThunk | ( | 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 512 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), Context, GetFormalType(), clang::CXXMethodDecl::getParent(), GetThisType(), clang::CXXMethodDecl::isVirtual(), 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 678 of file CGCall.cpp.
References clang::All, arrangeLLVMFunctionInfo(), and clang::None.
Referenced by clang::CodeGen::CodeGenFunction::createAtExitStub().
| 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 455 of file CGCall.cpp.
References clang::All, arrangeLLVMFunctionInfo(), Context, getCallingConventionForDecl(), clang::ASTContext::getCanonicalParamType(), clang::ASTContext::getObjCSelType(), GetReturnType(), clang::ObjCMethodDecl::getReturnType(), clang::Decl::hasAttr(), I, clang::ObjCMethodDecl::isVariadic(), clang::ObjCMethodDecl::parameters(), clang::FunctionType::ExtInfo::withCallingConv(), and clang::FunctionType::ExtInfo::withProducesResult().
Referenced by clang::CodeGen::arrangeObjCMessageSendSignature(), 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 442 of file CGCall.cpp.
References clang::CodeGen::arrangeObjCMessageSendSignature(), clang::ObjCMethodDecl::getSelfDecl(), and clang::ValueDecl::getType().
Referenced by clang::CodeGen::CodeGenFunction::StartObjCMethod().
| const CGFunctionInfo & CodeGenTypes::arrangeUnprototypedObjCMessageSend | ( | QualType | returnType, |
| const CallArgList & | args | ||
| ) |
Definition at line 482 of file CGCall.cpp.
References clang::All, arrangeLLVMFunctionInfo(), Context, getArgTypesForCall(), and GetReturnType().
Referenced by clang::CodeGen::CGObjCRuntime::getMessageSendInfo().
| CGRecordLayout * CodeGenTypes::ComputeRecordLayout | ( | const RecordDecl * | D, |
| llvm::StructType * | Ty | ||
| ) |
Compute a new LLVM record layout object for the given record.
Definition at line 685 of file CGRecordLayoutBuilder.cpp.
References addRecordTypeName(), Builder, clang::serialized_diags::create(), clang::Decl::dump(), clang::RecordDecl::field_begin(), clang::ASTContext::getASTRecordLayout(), clang::CodeGen::CGRecordLayout::getBitFieldInfo(), clang::FieldDecl::getBitWidthValue(), getContext(), getDataLayout(), clang::NamedDecl::getDeclName(), clang::ASTRecordLayout::getFieldCount(), clang::ASTRecordLayout::getFieldOffset(), getLLVMContext(), clang::CodeGen::CGRecordLayout::getLLVMFieldNo(), clang::CodeGen::CGRecordLayout::getLLVMType(), clang::ASTRecordLayout::getNonVirtualSize(), clang::ASTRecordLayout::getSize(), clang::Decl::hasAttr(), clang::FieldDecl::isBitField(), clang::TagDecl::isUnion(), clang::CodeGen::CGBitFieldInfo::Offset, clang::CodeGen::CGRecordLayout::print(), clang::CodeGen::CGBitFieldInfo::Size, clang::CodeGen::CGBitFieldInfo::StorageSize, clang::ASTContext::toBits(), and clang::CodeGen::Type.
Referenced by ConvertRecordDeclType().
| llvm::Type * CodeGenTypes::ConvertFunctionType | ( | QualType | FT, |
| const FunctionDecl * | FD = nullptr |
||
| ) |
Converts the GlobalDecl into an llvm::Type.
This should be used when we know the target of the function we want to convert. This is because some functions (explicitly, those with pass_object_size parameters) may not have the same signature as their type portrays, and can only be called directly.
Definition at line 312 of file CodeGenTypes.cpp.
References arrangeFreeFunctionType(), ConvertRecordDeclType(), clang::Type::getAs(), GetFunctionType(), getLLVMContext(), clang::FunctionType::getReturnType(), clang::QualType::getTypePtr(), clang::QualType::isCanonical(), isFuncTypeConvertible(), and clang::CodeGen::Type.
Referenced by clang::CodeGen::convertFreeFunctionType(), ConvertType(), and clang::CodeGen::CodeGenModule::GetAddrOfFunction().
| llvm::StructType * CodeGenTypes::ConvertRecordDeclType | ( | const RecordDecl * | TD | ) |
ConvertRecordDeclType - Lay out a tagged decl type like struct or union.
Definition at line 662 of file CodeGenTypes.cpp.
References addRecordTypeName(), ComputeRecordLayout(), clang::serialized_diags::create(), clang::RecordDecl::getDefinition(), getLLVMContext(), clang::ASTContext::getTagDeclType(), clang::QualType::getTypePtr(), I, clang::TagDecl::isCompleteDefinition(), and isSafeToConvert().
Referenced by ConvertFunctionType(), 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 383 of file CodeGenTypes.cpp.
References clang::Auto, ConvertFunctionType(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CGOpenCLRuntime::convertOpenCLSpecificType(), ConvertRecordDeclType(), ConvertTypeForMem(), clang::serialized_diags::create(), clang::ASTContext::getCanonicalType(), getCXXABI(), clang::ArrayType::getElementType(), clang::VectorType::getElementType(), clang::ASTContext::getFloatTypeSemantics(), clang::ArrayType::getIndexTypeCVRQualifiers(), clang::EnumDecl::getIntegerType(), getKind(), clang::ASTContext::getLangOpts(), getLLVMContext(), clang::VectorType::getNumElements(), clang::CodeGen::CodeGenModule::getOpenCLRuntime(), clang::CodeGen::CGOpenCLRuntime::getPipeType(), clang::PointerType::getPointeeType(), clang::ReferenceType::getPointeeType(), clang::ConstantArrayType::getSize(), clang::ASTContext::getTargetAddressSpace(), clang::Type::getTypeClass(), getTypeForFormat(), clang::QualType::getTypePtr(), clang::ASTContext::getTypeSize(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::TagDecl::isCompleteDefinition(), clang::EnumDecl::isFixed(), clang::CodeGen::CGCXXABI::isMemberPointerConvertible(), and clang::CodeGen::Type.
Referenced by clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), buildBlockDescriptor(), buildGlobalBlock(), computeBlockInfo(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CodeGenFunction::ConvertType(), ConvertTypeForMem(), clang::CodeGen::CGOpenMPRuntimeNVPTX::createNVPTXRuntimeFunction(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), clang::CodeGen::CodeGenModule::EmitConstantValue(), EmitDeclDestroy(), EmitFunctionDeclPointer(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitSynthesizedCXXCopyCtorCall(), clang::CodeGen::CodeGenFunction::GenerateObjCCtorDtorMethod(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString(), clang::CodeGen::CodeGenModule::getBlockDescriptorType(), clang::CodeGen::CGCXXABI::GetBogusMemberPointer(), clang::CodeGen::CodeGenModule::GetConstantArrayFromStringLiteral(), getGuardAcquireFn(), clang::CodeGen::CodeGenModule::GetNonVirtualBaseClassOffset(), and UpdateCompletedType().
| 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.
Definition at line 87 of file CodeGenTypes.cpp.
References ConvertType(), getLLVMContext(), clang::ASTContext::getTypeSize(), and clang::CodeGen::Type.
Referenced by computeBlockInfo(), ConvertType(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::convertTypeForMemory(), clang::CodeGen::CodeGenModule::EmitConstantExpr(), clang::CodeGen::CodeGenModule::EmitConstantInit(), clang::CodeGen::CodeGenModule::EmitConstantValue(), clang::CodeGen::CodeGenModule::EmitConstantValueForMemory(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), EmitGlobalVarDeclLValue(), clang::CodeGen::CodeGenModule::EmitNullConstant(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalTemporary(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalVar(), clang::CodeGen::CodeGenModule::getOrCreateStaticVarDecl(), clang::CodeGen::CodeGenModule::GetWeakRefReference(), and clang::CodeGen::CGBitFieldInfo::MakeInfo().
|
inline |
Definition at line 177 of file CodeGenTypes.h.
| const CGRecordLayout & CodeGenTypes::getCGRecordLayout | ( | const RecordDecl * | RD | ) |
getCGRecordLayout - Return record layout info for the given record decl.
Definition at line 727 of file CodeGenTypes.cpp.
References ConvertRecordDeclType(), clang::ASTContext::getTagDeclType(), and clang::QualType::getTypePtr().
Referenced by emitAddrOfFieldStorage(), EmitNullConstant(), EmitNullConstantForBase(), and isZeroInitializable().
| const CodeGenOptions & CodeGenTypes::getCodeGenOpts | ( | ) | const |
Definition at line 47 of file CodeGenTypes.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts().
Referenced by clang::CodeGen::ABIInfo::getCodeGenOpts().
|
inline |
Definition at line 176 of file CodeGenTypes.h.
Referenced by appendParameterTypes(), arrangeFreeFunctionLikeCall(), ComputeRecordLayout(), clang::CodeGen::ABIInfo::getContext(), isSafeToConvert(), and clang::CodeGen::CGBitFieldInfo::MakeInfo().
|
inline |
Definition at line 179 of file CodeGenTypes.h.
Referenced by ConvertType(), clang::CodeGen::ABIInfo::getCXXABI(), isFuncParamTypeConvertible(), and isZeroInitializable().
|
inline |
Definition at line 173 of file CodeGenTypes.h.
Referenced by ComputeRecordLayout(), clang::CodeGen::ABIInfo::getDataLayout(), and clang::CodeGen::CGBitFieldInfo::MakeInfo().
| void CodeGenTypes::getExpandedTypes | ( | QualType | Ty, |
| SmallVectorImpl< llvm::Type * >::iterator & | TI | ||
| ) |
getExpandedTypes - Expand the type
Definition at line 962 of file CGCall.cpp.
References Context, and getTypeExpansion().
| llvm::FunctionType * CodeGenTypes::GetFunctionType | ( | const CGFunctionInfo & | Info | ) |
GetFunctionType - Get the LLVM function type for.
Definition at line 1519 of file CGCall.cpp.
References clang::CodeGen::CGFunctionInfo::arg_begin(), clang::CodeGen::CGFunctionInfo::getArgStruct(), clang::CodeGen::ABIArgInfo::getCanBeFlattened(), clang::CodeGen::ABIArgInfo::getCoerceAndExpandTypeSequence(), clang::CodeGen::ABIArgInfo::getCoerceToType(), clang::CodeGen::ABIArgInfo::getInAllocaSRet(), clang::CodeGen::ABIArgInfo::getKind(), clang::CodeGen::CGFunctionInfo::getNumRequiredArgs(), clang::CodeGen::ABIArgInfo::getPaddingType(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::ASTContext::getTargetAddressSpace(), clang::CodeGen::ABIArgInfo::getUnpaddedCoerceAndExpandType(), clang::CodeGen::CGFunctionInfoArgInfo::info, clang::CodeGen::ABIArgInfo::isDirect(), clang::CodeGen::CGFunctionInfo::isVariadic(), and clang::CodeGen::CGFunctionInfoArgInfo::type.
Referenced by clang::CodeGen::CodeGenFunction::BuildAppleKextVirtualDestructorCall(), ConvertFunctionType(), createOffloadingBinaryDescriptorFunction(), emitAtomicLibcall(), clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), emitCopyToScratchpad(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(), emitDestructorsFunction(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), clang::CodeGen::CodeGenModule::EmitGlobal(), emitInterWarpCopyFunction(), clang::CodeGen::CGCXXABI::EmitLoadOfMemberFunctionPointer(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitReduceScratchpadFunction(), emitShuffleAndReduceFunction(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), generateByrefCopyHelper(), generateByrefDisposeHelper(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateDestroyHelper(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateThunk(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), clang::CodeGen::CodeGenModule::getAddrOfCXXStructor(), clang::CodeGen::CodeGenModule::GetAddrOfGlobal(), clang::CodeGen::CGObjCRuntime::getMessageSendInfo(), clang::CodeGen::CodeGenFunction::startOutlinedSEHHelper(), and clang::CodeGen::CodeGenModule::TryEmitDefinitionAsAlias().
| llvm::FunctionType * CodeGenTypes::GetFunctionType | ( | GlobalDecl | GD | ) |
Definition at line 1513 of file CGCall.cpp.
| 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 1647 of file CGCall.cpp.
References clang::Type::getAs(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::CodeGen::getFromDtorType(), and clang::ValueDecl::getType().
Referenced by clang::CodeGen::CodeGenModule::GetAddrOfThunk().
|
inline |
Definition at line 180 of file CodeGenTypes.h.
Referenced by ComputeRecordLayout(), ConvertFunctionType(), ConvertRecordDeclType(), ConvertType(), ConvertTypeForMem(), and clang::CodeGen::ABIInfo::getVMContext().
|
inline |
Definition at line 178 of file CodeGenTypes.h.
Referenced by clang::CodeGen::ABIInfo::getTarget(), and occupiesMoreThan().
| 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 278 of file CGCall.cpp.
References clang::ConstructorUsingShadowDecl::constructsVirtualBase(), clang::Ctor_Complete, clang::TargetInfo::getCXXABI(), clang::InheritedConstructor::getShadowDecl(), and clang::TargetCXXABI::hasConstructorVariants().
Referenced by arrangeCXXStructorDeclaration(), clang::CodeGen::CodeGenFunction::BuildFunctionArgList(), and clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall().
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, as well as whether we've temporarily deferred expanding the type because we're in a recursive context.
Definition at line 195 of file CodeGenTypes.cpp.
References clang::Type::getAs(), getCXXABI(), clang::RecordType::getDecl(), clang::Type::isIncompleteType(), clang::CodeGen::CGCXXABI::isMemberPointerConvertible(), and isSafeToConvert().
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 229 of file CodeGenTypes.cpp.
References clang::FunctionType::getReturnType(), and isFuncParamTypeConvertible().
Referenced by ConvertFunctionType().
Check if the pointer type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
Definition at line 743 of file CodeGenTypes.cpp.
References clang::Type::isAnyPointerType(), clang::Type::isBlockPointerType(), and isZeroInitializable().
Referenced by isSimpleZero().
Definition at line 371 of file CodeGenTypes.h.
Referenced by isSafeToConvert().
isRecordLayoutComplete - Return true if the specified type is already completely laid out.
Definition at line 102 of file CodeGenTypes.cpp.
References I.
Referenced by isSafeToConvert().
IsZeroInitializable - Return whether a type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
Definition at line 748 of file CodeGenTypes.cpp.
References clang::Type::getAs(), clang::ASTContext::getAsArrayType(), clang::ASTContext::getBaseElementType(), clang::ASTContext::getConstantArrayElementCount(), getCXXABI(), clang::ASTContext::getTargetNullPointerValue(), and clang::CodeGen::CGCXXABI::isZeroInitializable().
Referenced by clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), GetNumNonZeroBytesInInit(), isPointerZeroInitializable(), and isSimpleZero().
| 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 776 of file CodeGenTypes.cpp.
References getCGRecordLayout(), and clang::CodeGen::CGRecordLayout::isZeroInitializable().
|
inline |
Definition at line 368 of file CodeGenTypes.h.
Referenced by isSafeToConvert().
| 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 279 of file CodeGenTypes.cpp.
References clang::ASTContext::getCanonicalType(), clang::ASTContext::getRecordType(), and clang::QualType::getTypePtr().
Referenced by clang::CodeGen::CodeGenModule::RefreshTypeCacheForClass().
| 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 243 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().
1.8.6