clang API Documentation
#include <CodeGenTypes.h>
CodeGenTypes - This class organizes the cross-module state that is used while lowering AST types to LLVM types.
Definition at line 117 of file CodeGenTypes.h.
CodeGenTypes::CodeGenTypes | ( | CodeGenModule & | cgm | ) |
Definition at line 32 of file CodeGenTypes.cpp.
Definition at line 40 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 48 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 call is essentially a free-function call with an extra implicit argument.
Definition at line 388 of file CGCall.cpp.
References arrangeFreeFunctionLikeCall().
const CGFunctionInfo & CodeGenTypes::arrangeCXXConstructorCall | ( | const CallArgList & | Args, |
const CXXConstructorDecl * | D, | ||
CXXCtorType | CtorKind, | ||
unsigned | ExtraArgs | ||
) |
Arrange a call to a C++ method, passing the given arguments.
Definition at line 227 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), clang::CodeGen::RequiredArgs::forPrototypePlus(), clang::ASTContext::getCanonicalParamType(), clang::CodeGen::CodeGenModule::getContext(), GetFormalType(), clang::CodeGen::CGCXXABI::hasMostDerivedReturn(), clang::CodeGen::CGCXXABI::HasThisReturn(), clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall().
const CGFunctionInfo & CodeGenTypes::arrangeCXXMethodCall | ( | const CallArgList & | args, |
const FunctionProtoType * | type, | ||
RequiredArgs | required | ||
) |
Arrange a call to a C++ method, passing the given arguments.
Definition at line 408 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), clang::ASTContext::getCanonicalParamType(), clang::FunctionType::getExtInfo(), GetReturnType(), and clang::FunctionType::getReturnType().
Referenced by clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), and clang::CodeGen::CodeGenFunction::EmitSynthesizedCXXCopyCtorCall().
const CGFunctionInfo & CodeGenTypes::arrangeCXXMethodDeclaration | ( | const CXXMethodDecl * | MD | ) |
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 175 of file CGCall.cpp.
References arrangeCXXMethodType(), arrangeFreeFunctionType(), GetFormalType(), clang::CodeGen::CGCXXABI::getThisArgumentTypeForMethod(), clang::CanQual< T >::getTypePtr(), and clang::CXXMethodDecl::isInstance().
Referenced by arrangeFunctionDeclaration(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallee(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), and GetFunctionTypeForVTable().
const CGFunctionInfo & CodeGenTypes::arrangeCXXMethodType | ( | const CXXRecordDecl * | RD, |
const FunctionProtoType * | FTP | ||
) |
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 155 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), clang::CanQual< T >::getAs(), clang::Type::getCanonicalTypeUnqualified(), GetThisType(), and clang::ASTContext::VoidPtrTy.
Referenced by arrangeCXXMethodDeclaration(), clang::CodeGen::CodeGenABITypes::arrangeCXXMethodType(), and clang::CodeGen::CGCXXABI::EmitLoadOfMemberFunctionPointer().
const CGFunctionInfo & CodeGenTypes::arrangeCXXStructorDeclaration | ( | const CXXMethodDecl * | MD, |
StructorType | Type | ||
) |
Definition at line 191 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), clang::CodeGen::CGCXXABI::buildStructorSignature(), clang::CodeGen::CodeGenModule::getContext(), GetFormalType(), clang::CXXMethodDecl::getParent(), GetThisType(), clang::CodeGen::CGCXXABI::hasMostDerivedReturn(), clang::CodeGen::CGCXXABI::HasThisReturn(), clang::FunctionDecl::isVariadic(), clang::CodeGen::toCXXCtorType(), clang::CodeGen::toCXXDtorType(), clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.
Referenced by arrangeGlobalDeclaration(), clang::CodeGen::CodeGenFunction::BuildAppleKextVirtualDestructorCall(), clang::CodeGen::CodeGenModule::codegenCXXStructor(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXStructorCall(), clang::CodeGen::CodeGenFunction::EmitDelegateCXXConstructorCall(), clang::CodeGen::CodeGenModule::getAddrOfCXXStructor(), and GetFunctionTypeForVTable().
const CGFunctionInfo & CodeGenTypes::arrangeFreeFunctionCall | ( | const CallArgList & | args, |
const FunctionType * | fnType | ||
) |
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 380 of file CGCall.cpp.
References arrangeFreeFunctionLikeCall().
Referenced by arrangeFreeFunctionLikeCall(), clang::CodeGen::CodeGenFunction::EmitAtomicExpr(), emitAtomicLibcall(), clang::CodeGen::CodeGenFunction::EmitCall(), emitCPPObjectAtomicGetterCall(), emitCPPObjectAtomicSetterCall(), EmitNewDeleteCall(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), emitStructGetterCall(), emitStructSetterCall(), and clang::CodeGen::CGObjCRuntime::getMessageSendInfo().
const CGFunctionInfo & CodeGenTypes::arrangeFreeFunctionCall | ( | QualType | ResTy, |
const CallArgList & | args, | ||
FunctionType::ExtInfo | info, | ||
RequiredArgs | required | ||
) |
Definition at line 394 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), clang::ASTContext::getCanonicalParamType(), and GetReturnType().
const CGFunctionInfo & CodeGenTypes::arrangeFreeFunctionDeclaration | ( | QualType | ResTy, |
const FunctionArgList & | Args, | ||
const FunctionType::ExtInfo & | Info, | ||
bool | isVariadic | ||
) |
Definition at line 421 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), clang::ASTContext::getCanonicalParamType(), and GetReturnType().
Referenced by generateByrefCopyHelper(), generateByrefDisposeHelper(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::generateDestroyHelper(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), and clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction().
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 108 of file CGCall.cpp.
References arrangeLLVMFunctionInfo().
Referenced by arrangeCXXMethodDeclaration(), clang::CodeGen::CodeGenABITypes::arrangeFreeFunctionType(), arrangeFunctionDeclaration(), and ConvertType().
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 82 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), and clang::CanQual< T >::getUnqualifiedType().
const CGFunctionInfo & CodeGenTypes::arrangeFunctionDeclaration | ( | const FunctionDecl * | FD | ) |
Arrange the argument and result information for the declaration or definition of the given function.
Definition at line 252 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::All, arrangeCXXMethodDeclaration(), arrangeFreeFunctionType(), arrangeLLVMFunctionInfo(), clang::CanQual< T >::getAs(), clang::Type::getCanonicalTypeUnqualified(), and clang::ValueDecl::getType().
Referenced by arrangeGlobalDeclaration(), and clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups().
const CGFunctionInfo & CodeGenTypes::arrangeGlobalDeclaration | ( | GlobalDecl | GD | ) |
Definition at line 315 of file CGCall.cpp.
References arrangeCXXStructorDeclaration(), arrangeFunctionDeclaration(), 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 GetFunctionType().
const CGFunctionInfo & CodeGenTypes::arrangeLLVMFunctionInfo | ( | CanQualType | resultType, |
bool | IsInstanceMethod, | ||
ArrayRef< CanQualType > | argTypes, | ||
FunctionType::ExtInfo | info, | ||
RequiredArgs | required | ||
) |
"Arrange" the LLVM information for a call or type with the given signature. 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 |
Arrange the argument and result information for an abstract value of a given function type. This is the method which all of the above functions ultimately defer to.
Definition at line 444 of file CGCall.cpp.
References clang::CodeGen::CGFunctionInfo::arguments(), clang::CodeGen::ABIArgInfo::canHaveCoerceToType(), ClangCallConvToLLVMCallConv(), clang::ABIInfo::computeInfo(), ConvertType(), clang::serialized_diags::create(), getABIInfo(), clang::FunctionType::ExtInfo::getCC(), clang::CodeGen::ABIArgInfo::getCoerceToType(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::CodeGen::CGFunctionInfo::Profile(), and clang::CodeGen::ABIArgInfo::setCoerceToType().
Referenced by arrangeCXXConstructorCall(), arrangeCXXMethodCall(), arrangeCXXMethodType(), arrangeCXXStructorDeclaration(), clang::CodeGen::CodeGenABITypes::arrangeFreeFunctionCall(), arrangeFreeFunctionCall(), arrangeFreeFunctionDeclaration(), arrangeFreeFunctionType(), arrangeFunctionDeclaration(), arrangeLLVMFunctionInfo(), arrangeMSMemberPointerThunk(), arrangeNullaryFunction(), and arrangeObjCMessageSendSignature().
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 334 of file CGCall.cpp.
References arrangeLLVMFunctionInfo(), GetFormalType(), clang::CXXMethodDecl::getParent(), GetThisType(), clang::CXXMethodDecl::isVirtual(), and clang::ASTContext::VoidTy.
const CGFunctionInfo & CodeGenTypes::arrangeNullaryFunction | ( | ) |
getNullaryFunctionInfo - Get the function info for a void() function with standard CC.
Definition at line 435 of file CGCall.cpp.
References clang::CodeGen::RequiredArgs::All, arrangeLLVMFunctionInfo(), and getContext().
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 289 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::params(), clang::FunctionType::ExtInfo::withCallingConv(), and clang::FunctionType::ExtInfo::withProducesResult().
Referenced by clang::CodeGen::CodeGenABITypes::arrangeObjCMessageSendSignature(), arrangeObjCMethodDeclaration(), and clang::CodeGen::CGObjCRuntime::getMessageSendInfo().
const CGFunctionInfo & CodeGenTypes::arrangeObjCMethodDeclaration | ( | const ObjCMethodDecl * | MD | ) |
Arrange the argument and result information for the declaration or definition of an Objective-C method.
Definition at line 276 of file CGCall.cpp.
References arrangeObjCMessageSendSignature(), clang::ObjCMethodDecl::getSelfDecl(), and clang::ValueDecl::getType().
Referenced by clang::CodeGen::CodeGenFunction::StartObjCMethod().
CGRecordLayout * CodeGenTypes::ComputeRecordLayout | ( | const RecordDecl * | D, |
llvm::StructType * | Ty | ||
) |
Compute a new LLVM record layout object for the given record.
Definition at line 669 of file CGRecordLayoutBuilder.cpp.
References addRecordTypeName(), Builder, clang::serialized_diags::create(), clang::Decl::dump(), 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, and clang::ASTContext::toBits().
Referenced by ConvertRecordDeclType().
llvm::StructType * CodeGenTypes::ConvertRecordDeclType | ( | const RecordDecl * | TD | ) |
ConvertRecordDeclType - Lay out a tagged decl type like struct or union.
Definition at line 632 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 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 296 of file CodeGenTypes.cpp.
References arrangeFreeFunctionType(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CGOpenCLRuntime::convertOpenCLSpecificType(), ConvertRecordDeclType(), ConvertTypeForMem(), clang::serialized_diags::create(), clang::Type::getAs(), clang::ASTContext::getCanonicalType(), getCXXABI(), clang::ArrayType::getElementType(), clang::VectorType::getElementType(), getElementType(), clang::ASTContext::getFloatTypeSemantics(), GetFunctionType(), clang::ArrayType::getIndexTypeCVRQualifiers(), clang::EnumDecl::getIntegerType(), getKind(), clang::ASTContext::getLangOpts(), getLLVMContext(), clang::VectorType::getNumElements(), clang::CodeGen::CodeGenModule::getOpenCLRuntime(), clang::PointerType::getPointeeType(), clang::ReferenceType::getPointeeType(), clang::FunctionType::getReturnType(), 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(), isFuncTypeConvertible(), NULL, and Record.
Referenced by arrangeLLVMFunctionInfo(), buildBlockDescriptor(), buildGlobalBlock(), computeBlockInfo(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CodeGenFunction::ConvertType(), ConvertTypeForMem(), clang::CodeGen::CodeGenVTables::CreateVTableInitializer(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenModule::EmitConstantValue(), EmitDeclDestroy(), clang::CodeGen::CodeGenFunction::EmitExtVectorElementLValue(), clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::CodeGen::CodeGenFunction::EmitLoadOfGlobalRegLValue(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitStoreThroughGlobalRegLValue(), clang::CodeGen::CodeGenFunction::EmitSynthesizedCXXCopyCtorCall(), clang::CodeGen::CodeGenFunction::GenerateObjCCtorDtorMethod(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString(), clang::CodeGen::CodeGenModule::GetAddrOfConstantString(), clang::CodeGen::CodeGenModule::GetAddrOfFunction(), clang::CodeGen::CodeGenModule::getBlockDescriptorType(), clang::CodeGen::CGCXXABI::GetBogusMemberPointer(), clang::CodeGen::CodeGenModule::GetConstantArrayFromStringLiteral(), getExpandedTypes(), GetFunctionType(), getGuardAcquireFn(), clang::CodeGen::CodeGenModule::GetNonVirtualBaseClassOffset(), initializeForBlockHeader(), 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 84 of file CodeGenTypes.cpp.
References ConvertType(), getLLVMContext(), and clang::ASTContext::getTypeSize().
Referenced by computeBlockInfo(), ConvertType(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CodeGenFunction::EmitAtomicLoad(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenModule::EmitConstantExpr(), clang::CodeGen::CodeGenModule::EmitConstantInit(), clang::CodeGen::CodeGenModule::EmitConstantValue(), clang::CodeGen::CodeGenModule::EmitConstantValueForMemory(), EmitGlobalVarDeclLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenModule::EmitNullConstant(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalTemporary(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalVar(), GetFunctionType(), clang::CodeGen::CodeGenModule::getOrCreateStaticVarDecl(), clang::CodeGen::CodeGenModule::GetWeakRefReference(), and clang::CodeGen::CGBitFieldInfo::MakeInfo().
const ABIInfo& clang::CodeGen::CodeGenTypes::getABIInfo | ( | ) | const [inline] |
Definition at line 172 of file CodeGenTypes.h.
Referenced by arrangeLLVMFunctionInfo(), and clang::CodeGen::CodeGenFunction::EmitVAArg().
const CGRecordLayout & CodeGenTypes::getCGRecordLayout | ( | const RecordDecl * | RD | ) |
getCGRecordLayout - Return record layout info for the given record decl.
Definition at line 696 of file CodeGenTypes.cpp.
References ConvertRecordDeclType(), clang::ASTContext::getTagDeclType(), and clang::QualType::getTypePtr().
Referenced by clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitLValueForFieldInitialization(), EmitNullConstant(), EmitNullConstantForBase(), and isZeroInitializable().
ASTContext& clang::CodeGen::CodeGenTypes::getContext | ( | ) | const [inline] |
Definition at line 171 of file CodeGenTypes.h.
Referenced by arrangeNullaryFunction(), arrangeObjCMessageSendSignature(), ComputeRecordLayout(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallArg(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), GetFunctionType(), isSafeToConvert(), and clang::CodeGen::CGBitFieldInfo::MakeInfo().
CGCXXABI& clang::CodeGen::CodeGenTypes::getCXXABI | ( | ) | const [inline] |
Definition at line 174 of file CodeGenTypes.h.
Referenced by ConvertType(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), isFuncParamTypeConvertible(), and isZeroInitializable().
const llvm::DataLayout& clang::CodeGen::CodeGenTypes::getDataLayout | ( | ) | const [inline] |
Definition at line 170 of file CodeGenTypes.h.
Referenced by ComputeRecordLayout(), clang::CodeGen::CodeGenFunction::EmitLoadOfGlobalRegLValue(), clang::CodeGen::CodeGenFunction::EmitStoreThroughGlobalRegLValue(), and clang::CodeGen::CGBitFieldInfo::MakeInfo().
void CodeGenTypes::getExpandedTypes | ( | QualType | Ty, |
SmallVectorImpl< llvm::Type * >::iterator & | TI | ||
) |
getExpandedTypes - Expand the type
Definition at line 665 of file CGCall.cpp.
References ConvertType(), and getTypeExpansion().
Referenced by GetFunctionType().
llvm::FunctionType * CodeGenTypes::GetFunctionType | ( | const CGFunctionInfo & | Info | ) |
GetFunctionType - Get the LLVM function type for.
Definition at line 1203 of file CGCall.cpp.
References clang::CodeGen::CGFunctionInfo::arg_begin(), 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::getCoerceToType(), getContext(), getExpandedTypes(), clang::CodeGen::ABIArgInfo::getInAllocaSRet(), clang::CodeGen::ABIArgInfo::getIndirectAlign(), 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::Ignore, clang::CodeGen::ABIArgInfo::InAlloca, clang::CodeGen::ABIArgInfo::Indirect, clang::CodeGen::ABIArgInfo::isDirect(), and clang::CodeGen::CGFunctionInfo::isVariadic().
Referenced by clang::CodeGen::CodeGenFunction::BuildAppleKextVirtualDestructorCall(), ConvertType(), clang::CodeGen::CodeGenFunction::EmitAtomicExpr(), emitAtomicLibcall(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallee(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), clang::CodeGen::CodeGenModule::EmitGlobal(), clang::CodeGen::CGCXXABI::EmitLoadOfMemberFunctionPointer(), generateByrefCopyHelper(), generateByrefDisposeHelper(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::generateDestroyHelper(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateThunk(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), clang::CodeGen::CodeGenModule::getAddrOfCXXStructor(), GetFunctionType(), GetFunctionTypeForVTable(), clang::CodeGen::CGObjCRuntime::getMessageSendInfo(), and clang::CodeGen::CodeGenModule::TryEmitDefinitionAsAlias().
llvm::FunctionType * CodeGenTypes::GetFunctionType | ( | GlobalDecl | GD | ) |
Definition at line 1197 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 1321 of file CGCall.cpp.
References arrangeCXXMethodDeclaration(), arrangeCXXStructorDeclaration(), clang::Type::getAs(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::CodeGen::getFromDtorType(), GetFunctionType(), getLLVMContext(), clang::ValueDecl::getType(), and isFuncTypeConvertible().
Referenced by clang::CodeGen::CodeGenVTables::CreateVTableInitializer(), and clang::CodeGen::CodeGenModule::GetAddrOfThunk().
llvm::LLVMContext& clang::CodeGen::CodeGenTypes::getLLVMContext | ( | ) | [inline] |
Definition at line 175 of file CodeGenTypes.h.
Referenced by ComputeRecordLayout(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), ConvertRecordDeclType(), ConvertType(), ConvertTypeForMem(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), GetFunctionType(), and GetFunctionTypeForVTable().
const TargetInfo& clang::CodeGen::CodeGenTypes::getTarget | ( | ) | const [inline] |
Definition at line 173 of file CodeGenTypes.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallArgs(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::CodeGen::CodeGenModule::ReturnTypeUsesFP2Ret(), and clang::CodeGen::CodeGenModule::ReturnTypeUsesFPRet().
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 189 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. doesn't depend on an incomplete tag type).
Code to verify a given function type is complete, i.e. 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 223 of file CodeGenTypes.cpp.
References clang::FunctionType::getReturnType(), and isFuncParamTypeConvertible().
Referenced by ConvertType(), and GetFunctionTypeForVTable().
bool clang::CodeGen::CodeGenTypes::isRecordBeingLaidOut | ( | const Type * | Ty | ) | const [inline] |
Definition at line 312 of file CodeGenTypes.h.
Referenced by isSafeToConvert().
bool CodeGenTypes::isRecordLayoutComplete | ( | const Type * | Ty | ) | const |
isRecordLayoutComplete - Return true if the specified type is already completely laid out.
Definition at line 99 of file CodeGenTypes.cpp.
Referenced by isSafeToConvert().
IsZeroInitializable - Return whether a type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
Definition at line 712 of file CodeGenTypes.cpp.
References clang::Type::getAs(), clang::ASTContext::getBaseElementType(), getCXXABI(), clang::ASTContext::getLangOpts(), and clang::CodeGen::CGCXXABI::isZeroInitializable().
Referenced by clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), EmitNullBaseClassInitialization(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), GetNumNonZeroBytesInInit(), and isSimpleZero().
bool CodeGenTypes::isZeroInitializable | ( | const CXXRecordDecl * | RD | ) |
IsZeroInitializable - Return whether a record type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
Definition at line 734 of file CodeGenTypes.cpp.
References getCGRecordLayout(), and clang::CodeGen::CGRecordLayout::isZeroInitializable().
bool clang::CodeGen::CodeGenTypes::noRecordsBeingLaidOut | ( | ) | const [inline] |
Definition at line 309 of file CodeGenTypes.h.
Referenced by isSafeToConvert().
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 237 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().