clang 10.0.0git

Public Member Functions | List of all members
clang::CodeGen::CodeGenTypes Class Reference

This class organizes the cross-module state that is used while lowering AST types to LLVM types. More...

`#include "/work/www-prereleases/10.0.0/rc1/docsbuild/clang/lib/CodeGen/CodeGenTypes.h"`

## 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
unsigned | ClangCallConvToLLVMCallConv (CallingConv CC)
| Convert clang calling convention to LLVM callilng convention. More...
CanQualType | DeriveThisType (const CXXRecordDecl *RD, const CXXMethodDecl *MD)
| Derives the 'this' type for codegen purposes, i.e. More...
llvm::Type * | ConvertType (QualType T)
| ConvertType - Convert type T into a 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)
| 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 (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. 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 & | arrangeUnprototypedMustTailThunk (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

## Detailed Description

This class organizes the cross-module state that is used while lowering AST types to LLVM types.

Definition at line 59 of file CodeGenTypes.h.

## Constructor & Destructor Documentation

## ◆ CodeGenTypes()

CodeGenTypes::CodeGenTypes | ( | CodeGenModule & | cgm | ) |

Definition at line 31 of file CodeGenTypes.cpp.

## ◆ ~CodeGenTypes()

CodeGenTypes::~CodeGenTypes | ( |  | ) |

Definition at line 38 of file CodeGenTypes.cpp.

## Member Function Documentation

## ◆ addRecordTypeName()

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 50 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 ConvertRecordDeclType().

## ◆ arrangeBlockFunctionCall()

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 621 of file CGCall.cpp.

References arrangeFreeFunctionLikeCall().

## ◆ arrangeBlockFunctionDeclaration()

const CGFunctionInfo & CodeGenTypes::arrangeBlockFunctionDeclaration | ( | const FunctionProtoType * | type,
|  | const FunctionArgList & | args
| ) |  |

Block invocation functions are C functions with an implicit parameter.

Definition at line 628 of file CGCall.cpp.

References arrangeLLVMFunctionInfo(), clang::CodeGen::RequiredArgs::forPrototypePlus(), getArgTypesForDeclaration(), clang::FunctionType::getExtInfo(), getExtParameterInfosForCall(), GetReturnType(), and clang::FunctionType::getReturnType().

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

## ◆ arrangeBuiltinFunctionCall()

const CGFunctionInfo & CodeGenTypes::arrangeBuiltinFunctionCall | ( | QualType | resultType,
|  | const CallArgList & | args
| ) |  |

Definition at line 640 of file CGCall.cpp.

References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), clang::ASTContext::getCanonicalParamType(), and GetReturnType().

Referenced by emitAtomicLibcall(), emitCPPObjectAtomicGetterCall(), emitCPPObjectAtomicSetterCall(), and emitStructSetterCall().

## ◆ arrangeBuiltinFunctionDeclaration() [1/2]

const CGFunctionInfo & CodeGenTypes::arrangeBuiltinFunctionDeclaration | ( | QualType | resultType,
|  | const FunctionArgList & | args
| ) |  |

A builtin function is a freestanding function using the default C conventions.

Definition at line 653 of file CGCall.cpp.

References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), getArgTypesForDeclaration(), and GetReturnType().

Referenced by clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), emitDestructorsFunction(), emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), emitInterWarpCopyFunction(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitOutlinedFunctionCall(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitReductionCombiner(), emitShuffleAndReduceFunction(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::emitThreadPrivateVarInit(), clang::CodeGen::emitUserDefinedMapper(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateDestroyHelper(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), and clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction().

## ◆ arrangeBuiltinFunctionDeclaration() [2/2]

const CGFunctionInfo & CodeGenTypes::arrangeBuiltinFunctionDeclaration | ( | CanQualType | resultType,
|  | ArrayRef< CanQualType > | argTypes
| ) |  |

Definition at line 663 of file CGCall.cpp.

References clang::CodeGen::RequiredArgs::All, and arrangeLLVMFunctionInfo().

## ◆ arrangeCall()

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 702 of file CGCall.cpp.

References clang::CodeGen::RequiredArgs::allowsOptionalArgs(), clang::CodeGen::CGFunctionInfo::arg_size(), arrangeLLVMFunctionInfo(), clang::CodeGen::computeSPIRKernelABIInfo(), 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().

## ◆ arrangeCXXConstructorCall()

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 390 of file CGCall.cpp.

References addExtParameterInfosForCall(), clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), clang::CodeGen::RequiredArgs::forPrototypePlus(), clang::ASTContext::getCanonicalParamType(), clang::CodeGen::CodeGenModule::getContext(), GetFormalType(), clang::CanQual< T >::getTypePtr(), clang::CodeGen::CGCXXABI::hasMostDerivedReturn(), clang::CodeGen::CGCXXABI::HasThisReturn(), clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.

Referenced by canEmitDelegateCallArgs(), and decomposeTypeForEH().

## ◆ arrangeCXXMethodCall()

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 675 of file CGCall.cpp.

References arrangeLLVMFunctionInfo(), getArgTypesForCall(), clang::FunctionType::getExtInfo(), getExtParameterInfosForCall(), GetReturnType(), and clang::FunctionType::getReturnType().

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

## ◆ arrangeCXXMethodDeclaration()

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 279 of file CGCall.cpp.

References arrangeCXXMethodType(), arrangeFreeFunctionType(), clang::CanQual< T >::getAs(), GetFormalType(), clang::CodeGen::CGCXXABI::getThisArgumentTypeForMethod(), clang::CXXMethodDecl::isInstance(), and setCUDAKernelCallingConvention().

Referenced by arrangeFunctionDeclaration(), and clang::CodeGen::CodeGenModule::GetAddrOfGlobal().

## ◆ arrangeCXXMethodType()

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 251 of file CGCall.cpp.

References arrangeLLVMFunctionInfo(), DeriveThisType(), clang::CanQual< T >::getAs(), and clang::Type::getCanonicalTypeUnqualified().

Referenced by arrangeCXXMethodDeclaration(), clang::CodeGen::arrangeCXXMethodType(), and clang::CodeGen::CGCXXABI::EmitLoadOfMemberFunctionPointer().

## ◆ arrangeCXXStructorDeclaration()

const CGFunctionInfo & CodeGenTypes::arrangeCXXStructorDeclaration | ( | GlobalDecl | GD | ) |

Definition at line 306 of file CGCall.cpp.

References clang::CodeGen::RequiredArgs::All, appendParameterTypes(), arrangeLLVMFunctionInfo(), clang::CodeGen::CGCXXABI::buildStructorSignature(), DeriveThisType(), clang::CodeGen::CodeGenModule::getContext(), clang::GlobalDecl::getCtorType(), clang::GlobalDecl::getDecl(), GetFormalType(), clang::CodeGen::CGCXXABI::hasMostDerivedReturn(), clang::CodeGen::CGCXXABI::HasThisReturn(), inheritingCtorHasParams(), clang::CodeGen::CGCXXABI::AddedStructorArgs::Prefix, clang::CodeGen::CGCXXABI::AddedStructorArgs::Suffix, clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.

Referenced by arrangeGlobalDeclaration(), clang::CodeGen::CodeGenModule::codegenCXXStructor(), and clang::CodeGen::CodeGenModule::getAddrAndTypeOfCXXStructor().

## ◆ arrangeFreeFunctionCall()

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 611 of file CGCall.cpp.

References arrangeFreeFunctionLikeCall().

Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), and EmitNewDeleteCall().

## ◆ arrangeFreeFunctionType() [1/2]

const CGFunctionInfo & CodeGenTypes::arrangeFreeFunctionType | ( | CanQual< FunctionProtoType > | FTP | ) |

Arrange the argument and result information for a value of the given freestanding function type.

Definition at line 194 of file CGCall.cpp.

References arrangeLLVMFunctionInfo().

Referenced by arrangeCXXMethodDeclaration(), clang::CodeGen::arrangeFreeFunctionType(), arrangeFunctionDeclaration(), and getTypeForFormat().

## ◆ arrangeFreeFunctionType() [2/2]

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 104 of file CGCall.cpp.

References arrangeLLVMFunctionInfo(), and clang::CanQual< T >::getUnqualifiedType().

## ◆ 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 434 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(), and setCUDAKernelCallingConvention().

Referenced by arrangeGlobalDeclaration(), and clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups().

## ◆ arrangeGlobalDeclaration()

const CGFunctionInfo & CodeGenTypes::arrangeGlobalDeclaration | ( | GlobalDecl | GD | ) |

Definition at line 513 of file CGCall.cpp.

References arrangeCXXStructorDeclaration(), arrangeFunctionDeclaration(), and clang::GlobalDecl::getDecl().

Referenced by clang::CodeGen::CodeGenModule::EmitGlobal(), clang::CodeGen::CodeGenModule::emitOpenMPDeviceFunctionRedefinition(), clang::CodeGen::CodeGenModule::GetAddrOfGlobal(), GetFunctionType(), clang::CodeGen::CodeGenModule::HandleCXXStaticMemberVarInstantiation(), and clang::CodeGen::CGOpenMPRuntime::tryEmitDeclareVariant().

## ◆ arrangeLLVMFunctionInfo()

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.

Parameters

  argTypes | - must all actually be canonical as params

This is the method which all of the above functions ultimately defer to.

Definition at line 737 of file CGCall.cpp.

References clang::CodeGen::ABIArgInfo::canHaveCoerceToType(), clang::CC_Swift, ClangCallConvToLLVMCallConv(), clang::CodeGen::swiftcall::computeABIInfo(), clang::CodeGen::ABIInfo::computeInfo(), clang::CodeGen::computeSPIRKernelABIInfo(), ConvertType(), clang::CodeGen::CGFunctionInfo::create(), getABIInfo(), clang::FunctionType::ExtInfo::getCC(), clang::CodeGen::ABIArgInfo::getCoerceToType(), clang::CanQual< T >::isCanonicalAsParam(), clang::CodeGen::CGFunctionInfo::Profile(), and clang::CodeGen::ABIArgInfo::setCoerceToType().

Referenced by arrangeBlockFunctionDeclaration(), arrangeBuiltinFunctionCall(), arrangeBuiltinFunctionDeclaration(), arrangeCall(), arrangeCXXConstructorCall(), arrangeCXXMethodCall(), arrangeCXXStructorDeclaration(), clang::CodeGen::arrangeFreeFunctionCall(), arrangeFreeFunctionLikeCall(), arrangeFreeFunctionType(), arrangeFunctionDeclaration(), arrangeLLVMFunctionInfo(), arrangeMSCtorClosure(), arrangeNullaryFunction(), arrangeObjCMessageSendSignature(), arrangeUnprototypedMustTailThunk(), and arrangeUnprototypedObjCMessageSend().

## ◆ arrangeMSCtorClosure()

const CGFunctionInfo & CodeGenTypes::arrangeMSCtorClosure | ( | const CXXConstructorDecl * | CD,
|  | CXXCtorType | CT
| ) |  |

Definition at line 540 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, and clang::ASTContext::VoidTy.

Referenced by decomposeTypeForEH().

## ◆ arrangeNullaryFunction()

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 695 of file CGCall.cpp.

References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), and getContext().

Referenced by clang::CodeGen::CodeGenFunction::createAtExitStub(), clang::CodeGen::emitDeclareTargetVarDefinition(), emitGlobalDtorWithTLRegDtor(), clang::CodeGen::emitRequiresDirectiveRegFun(), getMasterThreadID(), and getThreadLocalWrapperLinkage().

## ◆ arrangeObjCMessageSendSignature()

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 471 of file CGCall.cpp.

References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), getCallingConventionForDecl(), clang::ASTContext::getCanonicalParamType(), getContext(), clang::ASTContext::getObjCSelType(), GetReturnType(), clang::ObjCMethodDecl::getReturnType(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::Decl::hasAttr(), clang::ObjCMethodDecl::isVariadic(), 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().

## ◆ arrangeObjCMethodDeclaration()

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 458 of file CGCall.cpp.

References arrangeObjCMessageSendSignature(), clang::ObjCMethodDecl::getSelfDecl(), and clang::ValueDecl::getType().

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

## ◆ arrangeUnprototypedMustTailThunk()

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 530 of file CGCall.cpp.

References arrangeLLVMFunctionInfo(), DeriveThisType(), GetFormalType(), clang::CXXMethodDecl::getParent(), clang::CXXMethodDecl::isVirtual(), and clang::ASTContext::VoidTy.

## ◆ arrangeUnprototypedObjCMessageSend()

const CGFunctionInfo & CodeGenTypes::arrangeUnprototypedObjCMessageSend | ( | QualType | returnType,
|  | const CallArgList & | args
| ) |  |

Definition at line 502 of file CGCall.cpp.

References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), getArgTypesForCall(), and GetReturnType().

Referenced by clang::CodeGen::CGObjCRuntime::getMessageSendInfo().

## ◆ ClangCallConvToLLVMCallConv()

unsigned CodeGenTypes::ClangCallConvToLLVMCallConv | ( | CallingConv | CC | ) |

Convert clang calling convention to LLVM callilng convention.

Definition at line 45 of file CGCall.cpp.

References AttributeLangSupport::C, clang::CC_AAPCS, clang::CC_AAPCS_VFP, clang::CC_AArch64VectorCall, clang::CC_IntelOclBicc, clang::CC_OpenCLKernel, clang::CC_PreserveAll, clang::CC_PreserveMost, clang::CC_SpirFunction, clang::CC_Swift, 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::CGOpenCLRuntime::emitOpenCLEnqueuedBlock().

## ◆ ComputeRecordLayout()

CGRecordLayout * CodeGenTypes::ComputeRecordLayout | ( | const RecordDecl * | D,
|  | llvm::StructType * | Ty
| ) |  |

Compute a new LLVM record layout object for the given record.

Definition at line 732 of file CGRecordLayoutBuilder.cpp.

Referenced by ConvertRecordDeclType().

## ◆ ConvertRecordDeclType()

llvm::StructType * CodeGenTypes::ConvertRecordDeclType | ( | const RecordDecl * | TD | ) |

ConvertRecordDeclType - Lay out a tagged decl type like struct or union.

Definition at line 712 of file CodeGenTypes.cpp.

References addRecordTypeName(), ComputeRecordLayout(), clang::serialized_diags::create(), clang::RecordDecl::getDefinition(), getLLVMContext(), clang::ASTContext::getTagDeclType(), clang::QualType::getTypePtr(), clang::TagDecl::isCompleteDefinition(), and isSafeToConvert().

Referenced by clang::CodeGen::CGOpenMPRuntime::CGOpenMPRuntime(), ConvertType(), getCGRecordLayout(), getTypeForFormat(), and UpdateCompletedType().

## ◆ ConvertType()

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 381 of file CodeGenTypes.cpp.

References clang::CodeGen::CGOpenCLRuntime::convertOpenCLSpecificType(), ConvertRecordDeclType(), clang::DiagnosticsEngine::Error, clang::ASTContext::getCanonicalType(), clang::DiagnosticsEngine::getCustomDiagID(), clang::CodeGen::CodeGenModule::getDiags(), clang::ASTContext::getFloatTypeSemantics(), getKind(), clang::ASTContext::getLangOpts(), getLLVMContext(), clang::CodeGen::CodeGenModule::getOpenCLRuntime(), clang::ASTContext::getTargetInfo(), clang::Type::getTypeClass(), getTypeForFormat(), clang::QualType::getTypePtr(), clang::ASTContext::getTypeSize(), clang::CodeGen::Type, and clang::TargetInfo::useFP16ConversionIntrinsics().

Referenced by addBaseAndFieldSizes(), clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), arrangeLLVMFunctionInfo(), buildBlockDescriptor(), buildGlobalBlock(), CanUseSingleInheritance(), computeBlockInfo(), ComputeVMIClassTypeInfoFlags(), clang::CodeGen::convertFreeFunctionType(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CodeGenFunction::ConvertType(), ConvertTypeForMem(), clang::CodeGen::CGOpenMPRuntimeNVPTX::createNVPTXRuntimeFunction(), EmitDeclDestroy(), clang::CodeGen::CodeGenFunction::EmitExtVectorElementLValue(), EmitFunctionDeclPointer(), clang::CodeGen::emitKmpRoutineEntryT(), clang::CodeGen::CodeGenFunction::EmitLoadOfGlobalRegLValue(), clang::CodeGen::CodeGenFunction::EmitStoreThroughGlobalRegLValue(), EmitX86_64VAArgFromMemory(), extractPBaseFlags(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString(), clang::CodeGen::CodeGenModule::GetAddrOfFunction(), clang::CodeGen::CGCXXABI::GetBogusMemberPointer(), clang::CodeGen::CodeGenModule::GetConstantArrayFromStringLiteral(), getExpandedTypes(), GetFunctionType(), GetGCAttrTypeForType(), getGuardAcquireFn(), clang::CodeGen::CodeGenModule::GetNonVirtualBaseClassOffset(), getTypeString(), GetX86_64ByValArgumentPair(), isRecordWithSSEVectorType(), isWeakLinkedClass(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), and UpdateCompletedType().

## ◆ ConvertTypeForMem()

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 86 of file CodeGenTypes.cpp.

References ConvertType(), getLLVMContext(), clang::ASTContext::getTypeSize(), and clang::CodeGen::Type.

Referenced by clang::CodeGen::CGOpenMPRuntimeNVPTX::clear(), computeBlockInfo(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::convertTypeForMemory(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), clang::CodeGen::ConstantEmitter::emitForMemory(), emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), EmitGlobalVarDeclLValue(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::emitUserDefinedMapper(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), clang::CodeGen::getAddrOfDeclareTargetVar(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalVar(), GetFunctionType(), clang::CodeGen::CodeGenModule::GetWeakRefReference(), clang::CodeGen::CodeGenModule::HandleCXXStaticMemberVarInstantiation(), isRecordWithSSEVectorType(), clang::CodeGen::CodeGenModule::maybeSetTrivialComdat(), and clang::CodeGen::registerTargetFirstprivateCopy().

## ◆ DeriveThisType()

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 74 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().

## ◆ getABIInfo()

const ABIInfo& clang::CodeGen::CodeGenTypes::getABIInfo | ( |  | ) | const
| inline

Definition at line 117 of file CodeGenTypes.h.

Referenced by arrangeLLVMFunctionInfo().

## ◆ getCGRecordLayout()

const CGRecordLayout & CodeGenTypes::getCGRecordLayout | ( | const RecordDecl * | RD | ) |

getCGRecordLayout - Return record layout info for the given record decl.

Definition at line 776 of file CodeGenTypes.cpp.

References ConvertRecordDeclType(), clang::ASTContext::getTagDeclType(), and clang::QualType::getTypePtr().

Referenced by createConstantGlobalStructAndAddToParent(), emitAddrOfFieldStorage(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), EmitNullConstant(), EmitNullConstantForBase(), emitPreserveStructAccess(), clang::CodeGen::getLLVMFieldNumber(), and isZeroInitializable().

## ◆ getCodeGenOpts()

const CodeGenOptions & CodeGenTypes::getCodeGenOpts | ( |  | ) | const

Definition at line 46 of file CodeGenTypes.cpp.

References clang::CodeGen::CodeGenModule::getCodeGenOpts().

Referenced by emitGlobalDtorWithCXAAtExit(), and clang::CodeGen::ABIInfo::getCodeGenOpts().

## ◆ getContext()

ASTContext& clang::CodeGen::CodeGenTypes::getContext | ( |  | ) | const
| inline

Definition at line 116 of file CodeGenTypes.h.

Referenced by appendParameterTypes(), arrangeFreeFunctionLikeCall(), arrangeNullaryFunction(), arrangeObjCMessageSendSignature(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), clang::CodeGen::CodeGenFunction::EmitCallArgs(), clang::CodeGen::CodeGenFunction::EmitNonNullArgCheck(), forConstantArrayExpansion(), clang::CodeGen::ABIInfo::getContext(), GetFunctionType(), and isSafeToConvert().

## ◆ getCXXABI()

CGCXXABI& clang::CodeGen::CodeGenTypes::getCXXABI | ( |  | ) | const
| inline

Definition at line 119 of file CodeGenTypes.h.

Referenced by clang::CodeGen::ABIInfo::getCXXABI(), getTypeString(), isFuncParamTypeConvertible(), and isZeroInitializable().

## ◆ getDataLayout()

const llvm::DataLayout& clang::CodeGen::CodeGenTypes::getDataLayout | ( |  | ) | const
| inline

Definition at line 113 of file CodeGenTypes.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitLoadOfGlobalRegLValue(), clang::CodeGen::CodeGenFunction::EmitStoreThroughGlobalRegLValue(), and clang::CodeGen::ABIInfo::getDataLayout().

## ◆ getExpandedTypes()

void CodeGenTypes::getExpandedTypes | ( | QualType | Ty,
|  | SmallVectorImpl< llvm::Type *>::iterator & | TI
| ) |  |

getExpandedTypes - Expand the type

- Ty into the LLVM argument types it would be passed as. See ABIArgInfo::Expand.

Definition at line 980 of file CGCall.cpp.

References ConvertType(), getTypeExpansion(), and clang::CodeGen::Type.

Referenced by GetFunctionType().

## ◆ GetFunctionType() [1/2]

llvm::FunctionType * CodeGenTypes::GetFunctionType | ( | const CGFunctionInfo & | Info | ) |

GetFunctionType - Get the LLVM function type for.

- Info.

Definition at line 1556 of file CGCall.cpp.

References clang::CodeGen::CGFunctionInfo::arg_begin(), clang::CodeGen::ABIArgInfo::CoerceAndExpand, ConvertType(), ConvertTypeForMem(), clang::CodeGen::ABIArgInfo::Direct, clang::CodeGen::ABIArgInfo::Expand, clang::CodeGen::ABIArgInfo::Extend, clang::CodeGen::CGFunctionInfo::getArgStruct(), clang::CodeGen::ABIArgInfo::getCanBeFlattened(), clang::CodeGen::ABIArgInfo::getCoerceAndExpandTypeSequence(), clang::CodeGen::ABIArgInfo::getCoerceToType(), getContext(), getExpandedTypes(), clang::CodeGen::ABIArgInfo::getInAllocaSRet(), clang::CodeGen::ABIArgInfo::getKind(), getLLVMContext(), 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::ABIArgInfo::Ignore, clang::CodeGen::ABIArgInfo::InAlloca, clang::CodeGen::ABIArgInfo::Indirect, clang::CodeGen::CGFunctionInfoArgInfo::info, clang::CodeGen::ABIArgInfo::isDirect(), clang::CodeGen::CGFunctionInfo::isVariadic(), Ret(), clang::CodeGen::Type, and clang::CodeGen::CGFunctionInfoArgInfo::type.

Referenced by decomposeTypeForEH(), emitAtomicLibcall(), clang::CodeGen::CodeGenFunction::EmitCall(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), clang::CodeGen::emitDeclareTargetVarDefinition(), emitDestructorsFunction(), clang::CodeGen::CodeGenModule::EmitGlobal(), emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), emitInterWarpCopyFunction(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CGCXXABI::EmitLoadOfMemberFunctionPointer(), clang::CodeGen::CodeGenModule::emitOpenMPDeviceFunctionRedefinition(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitOutlinedFunctionCall(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitReductionCombiner(), clang::CodeGen::emitRequiresDirectiveRegFun(), emitShuffleAndReduceFunction(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::emitThreadPrivateVarInit(), clang::CodeGen::emitUserDefinedMapper(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), 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::getAddrAndTypeOfCXXStructor(), clang::CodeGen::CodeGenModule::GetAddrOfGlobal(), GetFunctionType(), GetFunctionTypeForVTable(), getMasterThreadID(), clang::CodeGen::CGObjCRuntime::getMessageSendInfo(), getTypeForFormat(), clang::CodeGen::CodeGenModule::HandleCXXStaticMemberVarInstantiation(), and clang::CodeGen::CGOpenMPRuntime::tryEmitDeclareVariant().

## ◆ GetFunctionType() [2/2]

llvm::FunctionType * CodeGenTypes::GetFunctionType | ( | GlobalDecl | GD | ) |

Definition at line 1550 of file CGCall.cpp.

References arrangeGlobalDeclaration(), and GetFunctionType().

## ◆ GetFunctionTypeForVTable()

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 1684 of file CGCall.cpp.

References clang::Type::getAs(), clang::GlobalDecl::getDecl(), GetFunctionType(), getLLVMContext(), clang::ValueDecl::getType(), and isFuncTypeConvertible().

Referenced by clang::CodeGen::CodeGenVTables::EmitThunks().

## ◆ getLLVMContext()

llvm::LLVMContext& clang::CodeGen::CodeGenTypes::getLLVMContext | ( |  | ) |
| inline

Definition at line 120 of file CodeGenTypes.h.

References clang::CodeGen::arrangeCXXMethodType(), clang::CodeGen::arrangeFreeFunctionCall(), clang::CodeGen::arrangeFreeFunctionType(), arrangeLLVMFunctionInfo(), and clang::CodeGen::arrangeObjCMessageSendSignature().

Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList(), ConvertRecordDeclType(), ConvertType(), ConvertTypeForMem(), GetFunctionType(), GetFunctionTypeForVTable(), getTypeForFormat(), and clang::CodeGen::ABIInfo::getVMContext().

## ◆ getTarget()

const TargetInfo& clang::CodeGen::CodeGenTypes::getTarget | ( |  | ) | const
| inline

Definition at line 118 of file CodeGenTypes.h.

Referenced by clang::CodeGen::ABIInfo::getTarget(), occupiesMoreThan(), clang::CodeGen::CodeGenModule::ReturnTypeUsesFP2Ret(), and clang::CodeGen::CodeGenModule::ReturnTypeUsesFPRet().

## ◆ inheritingCtorHasParams()

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 296 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()

bool CodeGenTypes::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.

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 194 of file CodeGenTypes.cpp.

References clang::Type::getAs(), getCXXABI(), clang::RecordType::getDecl(), clang::Type::isIncompleteType(), clang::CodeGen::CGCXXABI::isMemberPointerConvertible(), and isSafeToConvert().

Referenced by isFuncTypeConvertible().

## ◆ 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 228 of file CodeGenTypes.cpp.

References clang::FunctionType::getReturnType(), and isFuncParamTypeConvertible().

Referenced by GetFunctionTypeForVTable(), and getTypeForFormat().

## ◆ isPointerZeroInitializable()

bool CodeGenTypes::isPointerZeroInitializable | ( | QualType | T | ) |

Check if the pointer type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer.

Definition at line 792 of file CodeGenTypes.cpp.

References clang::Type::isAnyPointerType(), clang::Type::isBlockPointerType(), and isZeroInitializable().

Referenced by isSimpleZero().

## ◆ isRecordBeingLaidOut()

bool clang::CodeGen::CodeGenTypes::isRecordBeingLaidOut | ( | const Type * | Ty | ) | const
| inline

Definition at line 309 of file CodeGenTypes.h.

Referenced by isSafeToConvert().

## ◆ isRecordLayoutComplete()

bool CodeGenTypes::isRecordLayoutComplete | ( | const Type * | Ty | ) | const

isRecordLayoutComplete - Return true if the specified type is already completely laid out.

Definition at line 101 of file CodeGenTypes.cpp.

References isSafeToConvert().

Referenced by isSafeToConvert().

## ◆ isZeroInitializable() [1/2]

bool CodeGenTypes::isZeroInitializable | ( | QualType | T | ) |

IsZeroInitializable - Return whether a type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer.

Definition at line 797 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::EmitNullInitialization(), GetNumNonZeroBytesInInit(), isPointerZeroInitializable(), isSimpleZero(), and isTrivialFiller().

## ◆ isZeroInitializable() [2/2]

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 825 of file CodeGenTypes.cpp.

References getCGRecordLayout(), and clang::CodeGen::CGRecordLayout::isZeroInitializable().

## ◆ noRecordsBeingLaidOut()

bool clang::CodeGen::CodeGenTypes::noRecordsBeingLaidOut | ( |  | ) | const
| inline

Definition at line 306 of file CodeGenTypes.h.

Referenced by isSafeToConvert().

## ◆ RefreshTypeCacheForClass()

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 278 of file CodeGenTypes.cpp.

References clang::ASTContext::getCanonicalType(), clang::ASTContext::getRecordType(), and clang::QualType::getTypePtr().

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

## ◆ UpdateCompletedType()

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 242 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().

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

- lib/CodeGen/CodeGenTypes.h
- lib/CodeGen/CGCall.cpp
- lib/CodeGen/CGRecordLayoutBuilder.cpp
- lib/CodeGen/CodeGenTypes.cpp