clang
9.0.0
|
#include "TargetInfo.h"
#include "ABIInfo.h"
#include "CGBlocks.h"
#include "CGCXXABI.h"
#include "CGValue.h"
#include "CodeGenFunction.h"
#include "clang/AST/RecordLayout.h"
#include "clang/Basic/CodeGenOptions.h"
#include "clang/CodeGen/CGFunctionInfo.h"
#include "clang/CodeGen/SwiftCallingConv.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/Twine.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
Go to the source code of this file.
Namespaces | |
clang | |
Dataflow Directional Tag Classes. | |
clang::CodeGen | |
Enumerations | |
enum | |
enum | X86AVXABILevel |
The AVX ABI level for X86 targets. More... | |
Functions | |
static ABIArgInfo | coerceToIntArray (QualType Ty, ASTContext &Context, llvm::LLVMContext &LLVMContext) |
static void | AssignToArrayRange (CodeGen::CGBuilderTy &Builder, llvm::Value *Array, llvm::Value *Value, unsigned FirstIndex, unsigned LastIndex) |
static bool | isAggregateTypeForABI (QualType T) |
static bool | occupiesMoreThan (CodeGenTypes &cgt, ArrayRef< llvm::Type *> scalarTypes, unsigned maxAllRegisters) |
Does the given lowering require more than the given number of registers when expanded? More... | |
static CGCXXABI::RecordArgABI | getRecordArgABI (const RecordType *RT, CGCXXABI &CXXABI) |
static CGCXXABI::RecordArgABI | getRecordArgABI (QualType T, CGCXXABI &CXXABI) |
static bool | classifyReturnType (const CGCXXABI &CXXABI, CGFunctionInfo &FI, const ABIInfo &Info) |
static QualType | useFirstFieldIfTransparentUnion (QualType Ty) |
Pass transparent unions as if they were the type of the first element. More... | |
static llvm::Value * | emitRoundPointerUpToAlignment (CodeGenFunction &CGF, llvm::Value *Ptr, CharUnits Align) |
static Address | emitVoidPtrDirectVAArg (CodeGenFunction &CGF, Address VAListAddr, llvm::Type *DirectTy, CharUnits DirectSize, CharUnits DirectAlign, CharUnits SlotSize, bool AllowHigherAlign) |
Emit va_arg for a platform using the common void* representation, where arguments are simply emitted in an array of slots on the stack. More... | |
static Address | emitVoidPtrVAArg (CodeGenFunction &CGF, Address VAListAddr, QualType ValueTy, bool IsIndirect, std::pair< CharUnits, CharUnits > ValueInfo, CharUnits SlotSizeAndAlign, bool AllowHigherAlign) |
Emit va_arg for a platform using the common void* representation, where arguments are simply emitted in an array of slots on the stack. More... | |
static Address | emitMergePHI (CodeGenFunction &CGF, Address Addr1, llvm::BasicBlock *Block1, Address Addr2, llvm::BasicBlock *Block2, const llvm::Twine &Name="") |
static bool | isEmptyRecord (ASTContext &Context, QualType T, bool AllowArrays) |
isEmptyRecord - Return true iff a structure contains only empty fields. More... | |
static bool | isEmptyField (ASTContext &Context, const FieldDecl *FD, bool AllowArrays) |
isEmptyField - Return true iff a the field is "empty", that is it is an unnamed bit-field or an (array of) empty record(s). More... | |
static const Type * | isSingleElementStruct (QualType T, ASTContext &Context) |
isSingleElementStruct - Determine if a structure is a "single
element struct", i.e. More... | |
static void | rewriteInputConstraintReferences (unsigned FirstIn, unsigned NumNewOuts, std::string &AsmString) |
Rewrite input constraint references after adding some output constraints. More... | |
static bool | is32Or64BitBasicType (QualType Ty, ASTContext &Context) |
static bool | addFieldSizes (ASTContext &Context, const RecordDecl *RD, uint64_t &Size) |
static bool | addBaseAndFieldSizes (ASTContext &Context, const CXXRecordDecl *RD, uint64_t &Size) |
static bool | isSSEVectorType (ASTContext &Context, QualType Ty) |
static bool | isRecordWithSSEVectorType (ASTContext &Context, QualType Ty) |
static bool | isArgInAlloca (const ABIArgInfo &Info) |
static bool | BitsContainNoUserData (QualType Ty, unsigned StartBit, unsigned EndBit, ASTContext &Context) |
BitsContainNoUserData - Return true if the specified [start,end) bit range is known to either be off the end of the specified type or being in alignment padding. More... | |
static bool | ContainsFloatAtOffset (llvm::Type *IRType, unsigned IROffset, const llvm::DataLayout &TD) |
ContainsFloatAtOffset - Return true if the specified LLVM IR type has a float member at the specified offset. More... | |
static llvm::Type * | GetX86_64ByValArgumentPair (llvm::Type *Lo, llvm::Type *Hi, const llvm::DataLayout &TD) |
GetX86_64ByValArgumentPair - Given a high and low type that can ideally be used as elements of a two register pair to pass or return, return a first class aggregate to represent them. More... | |
static Address | EmitX86_64VAArgFromMemory (CodeGenFunction &CGF, Address VAListAddr, QualType Ty) |
static bool | PPC64_initDwarfEHRegSizeTable (CodeGen::CodeGenFunction &CGF, llvm::Value *Address) |
static bool | isIntegerLikeType (QualType Ty, ASTContext &Context, llvm::LLVMContext &VMContext) |
static bool | requiresAMDGPUProtectedVisibility (const Decl *D, llvm::GlobalValue *GV) |
static bool | requiresAMDGPUDefaultVisibility (const Decl *D, llvm::GlobalValue *GV) |
static bool | getTypeString (SmallStringEnc &Enc, const Decl *D, CodeGen::CodeGenModule &CGM, TypeStringCache &TSC) |
The XCore ABI includes a type information section that communicates symbol type information to the linker. More... | |
void | clang::CodeGen::computeSPIRKernelABIInfo (CodeGenModule &CGM, CGFunctionInfo &FI) |
static bool | appendType (SmallStringEnc &Enc, QualType QType, const CodeGen::CodeGenModule &CGM, TypeStringCache &TSC) |
Handles the type's qualifier before dispatching a call to handle specific type encodings. More... | |
static bool | extractFieldType (SmallVectorImpl< FieldEncoding > &FE, const RecordDecl *RD, const CodeGen::CodeGenModule &CGM, TypeStringCache &TSC) |
Helper function for appendRecordType(). More... | |
static bool | appendRecordType (SmallStringEnc &Enc, const RecordType *RT, const CodeGen::CodeGenModule &CGM, TypeStringCache &TSC, const IdentifierInfo *ID) |
Appends structure and union types to Enc and adds encoding to cache. More... | |
static bool | appendEnumType (SmallStringEnc &Enc, const EnumType *ET, TypeStringCache &TSC, const IdentifierInfo *ID) |
Appends enum types to Enc and adds the encoding to the cache. More... | |
static void | appendQualifier (SmallStringEnc &Enc, QualType QT) |
Appends type's qualifier to Enc. More... | |
static bool | appendBuiltinType (SmallStringEnc &Enc, const BuiltinType *BT) |
Appends built-in types to Enc. More... | |
static bool | appendPointerType (SmallStringEnc &Enc, const PointerType *PT, const CodeGen::CodeGenModule &CGM, TypeStringCache &TSC) |
Appends a pointer encoding to Enc before calling appendType for the pointee. More... | |
static bool | appendArrayType (SmallStringEnc &Enc, QualType QT, const ArrayType *AT, const CodeGen::CodeGenModule &CGM, TypeStringCache &TSC, StringRef NoSizeEnc) |
Appends array encoding to Enc before calling appendType for the element. More... | |
static bool | appendFunctionType (SmallStringEnc &Enc, const FunctionType *FT, const CodeGen::CodeGenModule &CGM, TypeStringCache &TSC) |
Appends a function encoding to Enc, calling appendType for the return type and the arguments. More... | |
anonymous enum |
Definition at line 996 of file TargetInfo.cpp.
|
strong |
The AVX ABI level for X86 targets.
Definition at line 2036 of file TargetInfo.cpp.
|
static |
Definition at line 1319 of file TargetInfo.cpp.
References addFieldSizes(), clang::CXXRecordDecl::bases(), clang::CodeGen::ABIInfo::CGT, classifyReturnType(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::Type::getAs(), clang::CodeGen::ABIInfo::getContext(), clang::RecordType::getDecl(), clang::CodeGen::ABIArgInfo::getDirect(), clang::CodeGen::ABIArgInfo::getExtend(), clang::CodeGen::ABIArgInfo::getIgnore(), clang::CodeGen::ABIInfo::getNaturalAlignIndirect(), clang::CodeGen::ABIInfo::getNaturalAlignIndirectInReg(), clang::ASTContext::getTypeSize(), clang::CodeGen::ABIInfo::getVMContext(), isAggregateTypeForABI(), clang::Type::isAnyComplexType(), isEmptyRecord(), clang::CodeGen::ABIInfo::isHomogeneousAggregate(), clang::Type::isPromotableIntegerType(), isSingleElementStruct(), clang::Type::isVoidType(), and State.
|
static |
Definition at line 1299 of file TargetInfo.cpp.
References clang::RecordDecl::fields(), and is32Or64BitBasicType().
Referenced by addBaseAndFieldSizes().
|
static |
Appends array encoding to Enc before calling appendType for the element.
Definition at line 9068 of file TargetInfo.cpp.
References appendQualifier(), appendType(), clang::ArrayType::getElementType(), clang::ArrayType::getSizeModifier(), and clang::ArrayType::Normal.
Referenced by appendType(), and getTypeString().
|
static |
Appends built-in types to Enc.
Definition at line 8998 of file TargetInfo.cpp.
References clang::BuiltinType::getKind().
Referenced by appendType().
|
static |
Appends enum types to Enc and adds the encoding to the cache.
Definition at line 8940 of file TargetInfo.cpp.
References clang::EnumType::getDecl(), clang::EnumDecl::getDefinition(), and clang::IdentifierInfo::getName().
Referenced by appendType().
|
static |
Appends a function encoding to Enc, calling appendType for the return type and the arguments.
Definition at line 9090 of file TargetInfo.cpp.
References appendType(), clang::Type::getAs(), and clang::FunctionType::getReturnType().
Referenced by appendType().
|
static |
Appends a pointer encoding to Enc before calling appendType for the pointee.
Definition at line 9057 of file TargetInfo.cpp.
References appendType(), and clang::PointerType::getPointeeType().
Referenced by appendType().
|
static |
Appends type's qualifier to Enc.
This is done prior to appending the type's encoding.
Definition at line 8984 of file TargetInfo.cpp.
References clang::QualType::isConstQualified(), clang::QualType::isRestrictQualified(), and clang::QualType::isVolatileQualified().
Referenced by appendArrayType(), and appendType().
|
static |
Appends structure and union types to Enc and adds encoding to cache.
Recursively calls appendType (via extractFieldType) for each field. Union types have their fields ordered according to the ABI.
Definition at line 8888 of file TargetInfo.cpp.
References extractFieldType(), clang::RecordDecl::field_empty(), clang::RecordType::getDecl(), clang::RecordDecl::getDefinition(), clang::IdentifierInfo::getName(), and clang::Type::isUnionType().
Referenced by appendType().
|
static |
Handles the type's qualifier before dispatching a call to handle specific type encodings.
Definition at line 9124 of file TargetInfo.cpp.
References appendArrayType(), appendBuiltinType(), appendEnumType(), appendFunctionType(), appendPointerType(), appendQualifier(), appendRecordType(), clang::Type::getAs(), clang::Type::getAsArrayTypeUnsafe(), clang::Type::getAsStructureType(), clang::Type::getAsUnionType(), clang::QualType::getBaseTypeIdentifier(), and clang::QualType::getCanonicalType().
Referenced by appendArrayType(), appendFunctionType(), appendPointerType(), clang::CodeGen::computeSPIRKernelABIInfo(), extractFieldType(), and getTypeString().
|
static |
Definition at line 61 of file TargetInfo.cpp.
|
static |
BitsContainNoUserData - Return true if the specified [start,end) bit range is known to either be off the end of the specified type or being in alignment padding.
The user type specified is known to be at most 128 bits in size, and have passed through X86_64ABIInfo::classify with a successful classification that put one of the two halves in the INTEGER class.
It is conservatively correct to return false.
Definition at line 2996 of file TargetInfo.cpp.
References clang::ASTContext::getAsConstantArrayType(), clang::ASTContext::getTypeSize(), and i.
Referenced by ContainsFloatAtOffset().
|
static |
Definition at line 158 of file TargetInfo.cpp.
References clang::CodeGen::CGCXXABI::classifyReturnType(), clang::Type::getAs(), clang::CodeGen::ABIInfo::getNaturalAlignIndirect(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), and clang::CodeGen::CGFunctionInfo::getReturnType().
Referenced by addBaseAndFieldSizes(), clang::CodeGen::CGCXXABI::canCallMismatchedFunctionType(), EmitX86_64VAArgFromMemory(), getTypeString(), GetX86_64ByValArgumentPair(), hasMicrosoftABIRestrictions(), and isRecordWithSSEVectorType().
|
static |
Definition at line 50 of file TargetInfo.cpp.
|
static |
ContainsFloatAtOffset - Return true if the specified LLVM IR type has a float member at the specified offset.
For example, {int,{float}} has a float at offset 4. It is conservatively correct for this routine to return false.
Definition at line 3077 of file TargetInfo.cpp.
References BitsContainNoUserData(), clang::CodeGen::ABIInfo::getContext(), clang::CodeGen::ABIInfo::getDataLayout(), clang::CharUnits::getQuantity(), clang::ASTContext::getTypeSizeInChars(), clang::CodeGen::ABIInfo::getVMContext(), min(), and clang::CodeGen::Type.
|
static |
Definition at line 373 of file TargetInfo.cpp.
Referenced by EmitX86_64VAArgFromMemory().
|
static |
Definition at line 257 of file TargetInfo.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CharUnits::getQuantity(), and clang::CodeGen::CodeGenTypeCache::IntPtrTy.
Referenced by emitVoidPtrDirectVAArg(), and EmitX86_64VAArgFromMemory().
|
static |
Emit va_arg for a platform using the common void* representation, where arguments are simply emitted in an array of slots on the stack.
This version implements the core direct-value passing rules.
SlotSize | - The size and alignment of a stack slot. Each argument will be allocated to a multiple of this number of slots, and all the slots will be aligned to this value. |
AllowHigherAlign | - The slot alignment is not a cap; an argument type with an alignment greater than the slot size will be emitted on a higher-alignment address, potentially leaving one or more empty slots behind as padding. If this is false, the returned address might be less-aligned than DirectAlign. |
Definition at line 287 of file TargetInfo.cpp.
References clang::CharUnits::alignTo(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateConstInBoundsByteGEP(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CGBuilderTy::CreateStore(), emitRoundPointerUpToAlignment(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::Address::getElementType(), clang::CodeGen::Address::getPointer(), clang::CodeGen::CodeGenTypeCache::Int8PtrTy, and clang::CodeGen::Address::invalid().
Referenced by emitVoidPtrVAArg().
|
static |
Emit va_arg for a platform using the common void* representation, where arguments are simply emitted in an array of slots on the stack.
IsIndirect | - Values of this type are passed indirectly. |
ValueInfo | - The size and alignment of this type, generally computed with getContext().getTypeInfoInChars(ValueTy). |
SlotSizeAndAlign | - The size and alignment of a stack slot. Each argument will be allocated to a multiple of this number of slots, and all the slots will be aligned to this value. |
AllowHigherAlign | - The slot alignment is not a cap; an argument type with an alignment greater than the slot size will be emitted on a higher-alignment address, potentially leaving one or more empty slots behind as padding. |
Definition at line 340 of file TargetInfo.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateLoad(), emitVoidPtrDirectVAArg(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), clang::CodeGen::CodeGenTypeCache::getPointerSize(), and clang::CodeGen::Type.
Referenced by EmitX86_64VAArgFromMemory(), getTypeString(), and isArgInAlloca().
|
static |
Definition at line 3639 of file TargetInfo.cpp.
References clang::TypeInfo::Align, clang::CodeGen::CGFunctionInfo::arguments(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::ABIArgInfo::canHaveCoerceToType(), clang::CodeGen::ABIInfo::CGT, clang::CodeGen::swiftcall::classifyArgumentType(), classifyReturnType(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateAlignedLoad(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateBitCast(), clang::CodeGen::CGBuilderTy::CreateConstInBoundsByteGEP(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CGBuilderTy::CreateMemCpy(), clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CGBuilderTy::CreateStore(), clang::CodeGen::CGBuilderTy::CreateStructGEP(), clang::CodeGen::CodeGenTypeCache::DoubleTy, clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitBranch(), emitMergePHI(), emitRoundPointerUpToAlignment(), clang::CodeGen::ABIInfo::EmitVAArg(), emitVoidPtrVAArg(), clang::CharUnits::fromQuantity(), clang::Type::getAs(), clang::CodeGen::CGFunctionInfo::getCallingConvention(), clang::ASTContext::getCanonicalType(), clang::CodeGen::ABIArgInfo::getCoerceToType(), clang::CodeGen::ABIInfo::getContext(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::ABIInfo::getCXXABI(), clang::CodeGen::ABIInfo::getDataLayout(), clang::RecordType::getDecl(), clang::CodeGen::ABIArgInfo::getDirect(), clang::CodeGen::ABIArgInfo::getExpand(), clang::CodeGen::ABIArgInfo::getExtend(), clang::CodeGen::ABIArgInfo::getIgnore(), clang::CodeGen::ABIArgInfo::getIndirect(), clang::TargetInfo::getLongDoubleFormat(), clang::CodeGen::ABIInfo::getNaturalAlignIndirect(), clang::CharUnits::getQuantity(), getRecordArgABI(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::CodeGen::ABIInfo::getTarget(), clang::ASTContext::getTypeAlignInChars(), clang::ASTContext::getTypeInfo(), clang::ASTContext::getTypeInfoInChars(), clang::ASTContext::getTypeSize(), clang::CodeGen::ABIInfo::getVMContext(), clang::RecordDecl::hasFlexibleArrayMember(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::Address::invalid(), clang::Type::isAggregateType(), isAggregateTypeForABI(), clang::Type::isAnyComplexType(), clang::Type::isBuiltinType(), clang::CodeGen::ABIArgInfo::isDirect(), clang::BuiltinType::isFloatingPoint(), clang::Type::isFloatingType(), clang::CodeGen::ABIInfo::isHomogeneousAggregate(), clang::Type::isIntegerType(), clang::Type::isMemberPointerType(), clang::Type::isPointerType(), isSingleElementStruct(), clang::Type::isVectorType(), clang::Type::isVoidType(), Offset, clang::CodeGen::CGCXXABI::RAA_DirectInMemory, clang::ASTContext::toCharUnitsFromBits(), clang::CodeGen::Type, V, and clang::TypeInfo::Width.
|
static |
Helper function for appendRecordType().
Builds a SmallVector containing the encoded field types in declaration order.
Definition at line 8860 of file TargetInfo.cpp.
References appendType(), clang::RecordDecl::fields(), and clang::CodeGen::CodeGenModule::getContext().
Referenced by appendRecordType().
|
static |
Definition at line 139 of file TargetInfo.cpp.
References clang::RecordDecl::canPassInRegisters(), clang::RecordType::getDecl(), clang::CodeGen::CGCXXABI::getRecordArgABI(), clang::CodeGen::CGCXXABI::RAA_Default, and clang::CodeGen::CGCXXABI::RAA_Indirect.
Referenced by EmitX86_64VAArgFromMemory(), getRecordArgABI(), getTypeString(), GetX86_64ByValArgumentPair(), and isRecordWithSSEVectorType().
|
static |
Definition at line 150 of file TargetInfo.cpp.
References clang::Type::getAs(), getRecordArgABI(), and clang::CodeGen::CGCXXABI::RAA_Default.
|
static |
The XCore ABI includes a type information section that communicates symbol type information to the linker.
The linker uses this information to verify safety/correctness of things such as array bound and pointers et al. The ABI only requires C (and XC) language modules to emit TypeStrings. This type information (TypeString) is emitted into meta data for all global symbols: definitions, declarations, functions & variables.
The TypeString carries type, qualifier, name, size & value details. Please see 'Tools Development Guide' section 2.16.2 for format details: https://www.xmos.com/download/public/Tools-Development-Guide%28X9114A%29.pdf The output is tested by test/CodeGen/xcore-stringtype.c.
Definition at line 9158 of file TargetInfo.cpp.
References clang::CharUnits::alignTo(), appendArrayType(), appendType(), clang::CodeGen::CGFunctionInfo::arguments(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::ABIInfo::CGT, clang::CLanguageLinkage, clang::CodeGen::swiftcall::classifyArgumentType(), classifyReturnType(), clang::CodeGen::ABIInfo::computeInfo(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::ABIInfo::EmitVAArg(), emitVoidPtrVAArg(), clang::RecordDecl::fields(), clang::CharUnits::fromQuantity(), clang::Type::getAs(), clang::Type::getAsArrayTypeUnsafe(), clang::ASTContext::getASTRecordLayout(), clang::CodeGen::ABIArgInfo::getCoerceAndExpand(), clang::CodeGen::ABIInfo::getContext(), clang::CodeGen::ABIInfo::getCXXABI(), clang::CodeGen::CodeGenTypes::getCXXABI(), clang::CodeGen::ABIInfo::getDataLayout(), clang::CodeGen::ABIArgInfo::getDirect(), clang::CodeGen::ABIArgInfo::getExtend(), clang::ASTRecordLayout::getFieldOffset(), clang::CodeGen::ABIArgInfo::getIgnore(), clang::ASTContext::getIntTypeForBitwidth(), clang::CodeGen::ABIArgInfo::getKind(), clang::CodeGen::ABIInfo::getNaturalAlignIndirect(), clang::CodeGen::CGFunctionInfo::getNumRequiredArgs(), clang::CharUnits::getQuantity(), getRecordArgABI(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::CodeGen::ABIArgInfo::getSignExtend(), clang::ASTContext::getTypeAlign(), clang::ASTContext::getTypeInfoInChars(), clang::ASTContext::getTypeSize(), clang::ASTContext::getTypeSizeInChars(), getTypeStoreSize(), clang::CodeGen::ABIInfo::getVMContext(), i, clang::CodeGen::ABIArgInfo::Indirect, isAggregateTypeForABI(), clang::Type::isComplexType(), isEmptyRecord(), clang::Type::isFloatingType(), clang::Type::isIntegralOrEnumerationType(), clang::CharUnits::isMultipleOf(), clang::Type::isRealFloatingType(), clang::Type::isStructureOrClassType(), clang::TagDecl::isUnion(), clang::Type::isUnsignedIntegerOrEnumerationType(), clang::Type::isVectorType(), clang::Type::isVoidType(), clang::CharUnits::isZero(), clang::CodeGen::CGCXXABI::RAA_DirectInMemory, clang::CodeGen::Type, useFirstFieldIfTransparentUnion(), and clang::CharUnits::Zero().
|
static |
GetX86_64ByValArgumentPair - Given a high and low type that can ideally be used as elements of a two register pair to pass or return, return a first class aggregate to represent them.
For example, if the low part of a by-value argument should be passed as i32* and the high part as float, return {i32*, float}.
Definition at line 3209 of file TargetInfo.cpp.
References clang::CodeGen::CGFunctionInfo::arg_begin(), clang::CodeGen::CGFunctionInfo::arg_end(), clang::CodeGen::ABIInfo::CGT, clang::CodeGen::swiftcall::classifyArgumentType(), classifyReturnType(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::CanQual< T >::getAs(), clang::Type::getAs(), clang::CodeGen::CGFunctionInfo::getCallingConvention(), clang::ASTContext::getCanonicalType(), clang::CodeGen::ABIInfo::getContext(), clang::CodeGen::ABIInfo::getCXXABI(), clang::CodeGen::ABIInfo::getDataLayout(), clang::CodeGen::ABIArgInfo::getDirect(), clang::ComplexType::getElementType(), clang::CodeGen::ABIArgInfo::getExtend(), clang::CodeGen::ABIArgInfo::getIgnore(), clang::CodeGen::CGFunctionInfo::getNumRequiredArgs(), getRecordArgABI(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::CanQual< T >::getTypePtr(), clang::CodeGen::ABIInfo::getVMContext(), Integer, clang::CodeGen::CGFunctionInfo::isChainCall(), clang::CodeGen::ABIArgInfo::isIndirect(), clang::Type::isIntegralOrEnumerationType(), clang::Type::isPromotableIntegerType(), clang::Type::isRecordType(), clang::Type::isUnionType(), clang::ASTContext::LongDoubleTy, clang::CodeGen::CGCXXABI::RAA_Indirect, clang::CodeGen::Type, UINT_MAX, and useFirstFieldIfTransparentUnion().
|
static |
Definition at line 1283 of file TargetInfo.cpp.
References clang::Type::getAs(), clang::ASTContext::getTypeSize(), clang::Type::hasPointerRepresentation(), clang::Type::isBlockPointerType(), and clang::Type::isEnumeralType().
Referenced by addFieldSizes().
Definition at line 74 of file TargetInfo.cpp.
References clang::CodeGen::CodeGenFunction::hasScalarEvaluationKind(), and clang::Type::isMemberFunctionPointerType().
Referenced by addBaseAndFieldSizes(), EmitX86_64VAArgFromMemory(), getTypeString(), and isRecordWithSSEVectorType().
|
static |
Definition at line 1864 of file TargetInfo.cpp.
References clang::CodeGen::CGFunctionInfo::arg_begin(), clang::CodeGen::CGFunctionInfo::arg_end(), clang::CodeGen::ABIArgInfo::CoerceAndExpand, clang::CodeGen::ABIArgInfo::Direct, emitVoidPtrVAArg(), clang::CodeGen::ABIArgInfo::Expand, clang::CodeGen::ABIArgInfo::Extend, clang::CharUnits::fromQuantity(), clang::CodeGen::CGFunctionInfo::getCallingConvention(), clang::CodeGen::ABIInfo::getContext(), clang::CodeGen::ABIArgInfo::getIndirectByVal(), clang::CodeGen::ABIArgInfo::getInReg(), clang::CodeGen::ABIArgInfo::getKind(), clang::ASTContext::getPointerType(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::ASTContext::getTypeInfoInChars(), clang::CodeGen::ABIInfo::getVMContext(), clang::CodeGen::ABIArgInfo::Ignore, clang::CodeGen::ABIArgInfo::InAlloca, clang::CodeGen::ABIArgInfo::Indirect, clang::CodeGen::CGFunctionInfoArgInfo::info, clang::CodeGen::ABIArgInfo::isIndirect(), clang::CodeGen::ABIArgInfo::isSRetAfterThis(), clang::CodeGen::CGFunctionInfo::setArgStruct(), clang::CodeGen::ABIArgInfo::setInAllocaSRet(), clang::CodeGenOptions::SRCK_Default, clang::CodeGenOptions::SRCK_InRegs, clang::CodeGenOptions::SRCK_OnStack, and clang::CodeGen::CGFunctionInfoArgInfo::type.
|
static |
isEmptyField - Return true iff a the field is "empty", that is it is an unnamed bit-field or an (array of) empty record(s).
Definition at line 478 of file TargetInfo.cpp.
References clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::RecordType::getDecl(), clang::ValueDecl::getType(), isEmptyRecord(), and clang::FieldDecl::isUnnamedBitfield().
Referenced by isEmptyRecord().
|
static |
isEmptyRecord - Return true iff a structure contains only empty fields.
Note that a structure with a flexible array member is not considered empty.
Definition at line 511 of file TargetInfo.cpp.
References clang::RecordDecl::fields(), clang::Type::getAs(), clang::RecordType::getDecl(), clang::RecordDecl::hasFlexibleArrayMember(), and isEmptyField().
Referenced by addBaseAndFieldSizes(), clang::CodeGen::TargetCodeGenInfo::getLLVMSyncScopeID(), getTypeString(), isEmptyField(), isRecordWithSSEVectorType(), and isSingleElementStruct().
|
static |
Definition at line 5938 of file TargetInfo.cpp.
References clang::Type::getAs(), clang::ASTContext::getTypeSize(), clang::Type::isPointerType(), clang::Type::isRealFloatingType(), and clang::Type::isVectorType().
|
static |
Definition at line 1465 of file TargetInfo.cpp.
References clang::CharUnits::alignTo(), clang::CodeGen::CGFunctionInfo::arguments(), clang::CodeGen::ABIInfo::CGT, clang::CodeGen::swiftcall::classifyArgumentType(), classifyReturnType(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::RecordDecl::fields(), clang::CharUnits::fromQuantity(), clang::Type::getAs(), clang::CodeGen::CGFunctionInfo::getCallingConvention(), clang::CodeGen::ABIInfo::getContext(), clang::CodeGen::ABIInfo::getCXXABI(), clang::RecordType::getDecl(), clang::CodeGen::ABIArgInfo::getDirect(), clang::CodeGen::ABIArgInfo::getDirectInReg(), clang::CodeGen::ABIArgInfo::getExpand(), clang::CodeGen::ABIArgInfo::getExpandWithPadding(), clang::CodeGen::ABIArgInfo::getExtend(), clang::CodeGen::ABIArgInfo::getExtendInReg(), clang::CodeGen::CGFunctionInfo::getHasRegParm(), clang::CodeGen::ABIArgInfo::getIgnore(), clang::CodeGen::ABIArgInfo::getInAlloca(), clang::CodeGen::ABIArgInfo::getIndirect(), clang::CodeGen::ABIInfo::getNaturalAlignIndirect(), clang::CodeGen::ABIInfo::getNaturalAlignIndirectInReg(), clang::CharUnits::getQuantity(), getRecordArgABI(), clang::CodeGen::CGFunctionInfo::getRegParm(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::ASTContext::getTypeAlign(), clang::QualType::getTypePtr(), clang::ASTContext::getTypeSize(), clang::ASTContext::getTypeSizeInChars(), clang::CodeGen::ABIInfo::getVMContext(), clang::RecordDecl::hasFlexibleArrayMember(), i, clang::if(), clang::CodeGen::ABIArgInfo::InAlloca, Integer, isAggregateTypeForABI(), clang::Type::isBuiltinType(), clang::CodeGen::CGFunctionInfo::isChainCall(), isEmptyRecord(), clang::CodeGen::ABIInfo::isHomogeneousAggregate(), clang::CodeGen::ABIArgInfo::isIndirect(), clang::Type::isIntegralOrEnumerationType(), clang::CharUnits::isMultipleOf(), clang::Type::isPointerType(), clang::Type::isPromotableIntegerType(), clang::Type::isReferenceType(), isSingleElementStruct(), isSSEVectorType(), clang::Type::isVectorType(), clang::CodeGen::CGCXXABI::RAA_DirectInMemory, clang::CodeGen::CGCXXABI::RAA_Indirect, clang::CodeGen::ABIArgInfo::setInReg(), State, clang::CodeGen::Type, and useFirstFieldIfTransparentUnion().
|
static |
isSingleElementStruct - Determine if a structure is a "single element struct", i.e.
it has exactly one non-empty field or exactly one field which is itself a single element struct. Structures with flexible array members are never considered single element structs.
Definition at line 539 of file TargetInfo.cpp.
References clang::Type::getAs(), clang::RecordType::getDecl(), clang::RecordDecl::hasFlexibleArrayMember(), and isEmptyRecord().
Referenced by addBaseAndFieldSizes(), EmitX86_64VAArgFromMemory(), and isRecordWithSSEVectorType().
|
static |
Definition at line 1461 of file TargetInfo.cpp.
References clang::Type::getAs(), and clang::ASTContext::getTypeSize().
Referenced by isRecordWithSSEVectorType().
|
static |
Does the given lowering require more than the given number of registers when expanded?
This is intended to be the basis of a reasonable basic implementation of should{Pass,Return}IndirectlyForSwift.
For most targets, a limit of four total registers is reasonable; this limits the amount of code required in order to move around the value in case it wasn't produced immediately prior to the call by the caller (or wasn't produced in exactly the right registers) or isn't used immediately within the callee. But some targets may need to further limit the register count due to an inability to support that many return registers.
Definition at line 112 of file TargetInfo.cpp.
References clang::TargetInfo::getPointerWidth(), clang::CodeGen::CodeGenTypes::getTarget(), and clang::CodeGen::Type.
|
static |
Definition at line 4867 of file TargetInfo.cpp.
Definition at line 7883 of file TargetInfo.cpp.
References clang::Default, clang::DefaultVisibility, clang::QualType::getAddressSpace(), clang::Decl::getAttr(), clang::TargetInfo::getConstantAddressSpace(), clang::CodeGen::CodeGenModule::getContext(), clang::getLangASFromTargetAS(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getTarget(), clang::ASTContext::getTargetAddressSpace(), clang::ASTContext::getTargetNullPointerValue(), clang::CodeGen::CodeGenModule::getTriple(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::HiddenVisibility, clang::isTargetAddressSpace(), clang::CodeGen::CodeGenModule::isTypeConstant(), clang::opencl_generic, clang::opencl_global, clang::ProtectedVisibility, and requiresAMDGPUProtectedVisibility().
Definition at line 7871 of file TargetInfo.cpp.
References clang::Decl::hasAttr(), and clang::HiddenVisibility.
Referenced by requiresAMDGPUDefaultVisibility().
|
static |
Rewrite input constraint references after adding some output constraints.
In the case where there is one output and one input and we add one output, we need to replace all operand references greater than or equal to 1: mov $0, $1 mov eax, $1 The result will be: mov $0, $2 mov eax, $2
Definition at line 1161 of file TargetInfo.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGBuilderTy::CreateBitCast(), clang::CodeGen::LValue::getAddress(), clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenFunction::getLLVMContext(), clang::CodeGen::LValue::getType(), clang::ASTContext::getTypeSize(), clang::Type::hasPointerRepresentation(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::Type::isAnyComplexType(), clang::Type::isBlockPointerType(), clang::Type::isEnumeralType(), clang::Type::isMemberPointerType(), clang::Type::isVectorType(), clang::CodeGen::LValue::setAddress(), and clang::CodeGen::Type.
Pass transparent unions as if they were the type of the first element.
Sema should ensure that all elements of the union have the same "machine type".
Definition at line 174 of file TargetInfo.cpp.
References clang::RecordDecl::field_begin(), clang::RecordDecl::field_empty(), clang::Type::getAsUnionType(), and clang::Decl::hasAttr().
Referenced by getTypeString(), GetX86_64ByValArgumentPair(), and isRecordWithSSEVectorType().