LLVM API Documentation
#include <TargetData.h>
Inheritance diagram for llvm::TargetData:
Public Member Functions | |
TargetData (const std::string &TargetName="", bool LittleEndian=false, unsigned char PtrSize=8, unsigned char PtrAl=8, unsigned char DoubleAl=8, unsigned char FloatAl=4, unsigned char LongAl=8, unsigned char IntAl=4, unsigned char ShortAl=2, unsigned char ByteAl=1, unsigned char BoolAl=1) | |
TargetData (const TargetData &TD) | |
TargetData (const std::string &ToolName, const Module *M) | |
~TargetData () | |
bool | isLittleEndian () const |
Target endianness... | |
bool | isBigEndian () const |
unsigned char | getBoolAlignment () const |
Target alignment constraints. | |
unsigned char | getByteAlignment () const |
unsigned char | getShortAlignment () const |
unsigned char | getIntAlignment () const |
unsigned char | getLongAlignment () const |
unsigned char | getFloatAlignment () const |
unsigned char | getDoubleAlignment () const |
unsigned char | getPointerAlignment () const |
unsigned char | getPointerSize () const |
unsigned char | getPointerSizeInBits () const |
uint64_t | getTypeSize (const Type *Ty) const |
unsigned char | getTypeAlignment (const Type *Ty) const |
unsigned char | getTypeAlignmentShift (const Type *Ty) const |
const Type * | getIntPtrType () const |
uint64_t | getIndexedOffset (const Type *Ty, const std::vector< Value * > &Indices) const |
const StructLayout * | getStructLayout (const StructType *Ty) const |
void | InvalidateStructLayoutInfo (const StructType *Ty) const |
Definition at line 35 of file TargetData.h.
TargetData::TargetData | ( | const std::string & | TargetName = "" , |
|
bool | LittleEndian = false , |
|||
unsigned char | PtrSize = 8 , |
|||
unsigned char | PtrAl = 8 , |
|||
unsigned char | DoubleAl = 8 , |
|||
unsigned char | FloatAl = 4 , |
|||
unsigned char | LongAl = 8 , |
|||
unsigned char | IntAl = 4 , |
|||
unsigned char | ShortAl = 2 , |
|||
unsigned char | ByteAl = 1 , |
|||
unsigned char | BoolAl = 1 | |||
) |
Definition at line 95 of file TargetData.cpp.
llvm::TargetData::TargetData | ( | const TargetData & | TD | ) | [inline] |
Definition at line 57 of file TargetData.h.
TargetData::TargetData | ( | const std::string & | ToolName, | |
const Module * | M | |||
) |
Definition at line 121 of file TargetData.cpp.
References llvm::Module::BigEndian, llvm::Module::getEndianness(), llvm::Module::getPointerSize(), M, and llvm::Module::Pointer64.
TargetData::~TargetData | ( | ) |
unsigned char llvm::TargetData::getBoolAlignment | ( | ) | const [inline] |
Target alignment constraints.
Definition at line 79 of file TargetData.h.
Referenced by getTypeInfo().
unsigned char llvm::TargetData::getByteAlignment | ( | ) | const [inline] |
unsigned char llvm::TargetData::getDoubleAlignment | ( | ) | const [inline] |
unsigned char llvm::TargetData::getFloatAlignment | ( | ) | const [inline] |
uint64_t TargetData::getIndexedOffset | ( | const Type * | Ty, | |
const std::vector< Value * > & | Indices | |||
) | const |
getIndexOffset - return the offset from the beginning of the type for the specified indices. This is used to implement getelementptr.
Definition at line 268 of file TargetData.cpp.
References llvm::gep_type_begin(), getStructLayout(), getTypeSize(), llvm::StructLayout::MemberOffsets, Ty, and llvm::Type::UIntTy.
Referenced by llvm::AsmPrinter::EmitConstantValueOnly(), and llvm::ExecutionEngine::getConstantValue().
unsigned char llvm::TargetData::getIntAlignment | ( | ) | const [inline] |
const Type * TargetData::getIntPtrType | ( | ) | const |
getIntPtrType - Return an unsigned integer type that is the same size or greater to the host pointer size.
Definition at line 258 of file TargetData.cpp.
References getPointerSize(), llvm::Type::UIntTy, llvm::Type::ULongTy, and llvm::Type::UShortTy.
Referenced by EmitGEPOffset(), isEliminableCastOfCast(), llvm::X86TargetLowering::LowerOperation(), OptimizeGEPExpression(), llvm::TargetLowering::TargetLowering(), llvm::SelectionDAGLowering::visitFree(), llvm::SelectionDAGLowering::visitGetElementPtr(), and llvm::SelectionDAGLowering::visitMalloc().
unsigned char llvm::TargetData::getLongAlignment | ( | ) | const [inline] |
unsigned char llvm::TargetData::getPointerAlignment | ( | ) | const [inline] |
unsigned char llvm::TargetData::getPointerSize | ( | ) | const [inline] |
Definition at line 87 of file TargetData.h.
Referenced by CreateArgv(), EmitGEPOffset(), llvm::AsmPrinter::EmitGlobalConstant(), getIntPtrType(), getTypeInfo(), and llvm::ExecutionEngine::LoadValueFromMemory().
unsigned char llvm::TargetData::getPointerSizeInBits | ( | ) | const [inline] |
unsigned char llvm::TargetData::getShortAlignment | ( | ) | const [inline] |
const StructLayout * TargetData::getStructLayout | ( | const StructType * | Ty | ) | const |
getStructLayout - Return a StructLayout object, indicating the alignment of the struct, its size, and the offsets of its fields. Note that this information is lazily cached.
Definition at line 156 of file TargetData.cpp.
References I, Layouts, and Ty.
Referenced by llvm::AsmPrinter::EmitGlobalConstant(), llvm::Interpreter::executeGEPOperation(), getIndexedOffset(), getStructOffsetStep(), getTypeInfo(), llvm::ExecutionEngine::InitializeMemory(), llvm::DSNode::mergeTypeInfo(), OptimizeGEPExpression(), and llvm::SelectionDAGLowering::visitGetElementPtr().
unsigned char TargetData::getTypeAlignment | ( | const Type * | Ty | ) | const |
getTypeAlignment - Return the minimum required alignment for the specified type.
Definition at line 243 of file TargetData.cpp.
References Align, getTypeInfo(), and Ty.
Referenced by llvm::SparcV9FunctionInfo::allocateSpilledValue(), llvm::FunctionLoweringInfo::FunctionLoweringInfo(), GetKnownAlignment(), llvm::JIT::getOrEmitGlobalVariable(), getTypeAlignmentShift(), and llvm::SelectionDAGLowering::visitAlloca().
unsigned char TargetData::getTypeAlignmentShift | ( | const Type * | Ty | ) | const |
getTypeAlignmentShift - Return the minimum required alignment for the specified type, returned as log2 of the value (a shift amount).
Definition at line 250 of file TargetData.cpp.
References Align, getTypeAlignment(), llvm::Log2_32(), and Ty.
Referenced by llvm::AsmPrinter::getPreferredAlignmentLog().
uint64_t TargetData::getTypeSize | ( | const Type * | Ty | ) | const |
getTypeSize - Return the number of bytes necessary to hold the specified type.
Definition at line 236 of file TargetData.cpp.
References Align, getTypeInfo(), and Ty.
Referenced by llvm::AliasSetTracker::add(), llvm::SparcV9FunctionInfo::allocateSpilledValue(), llvm::SparcV9RegInfo::colorMethodArgs(), llvm::SparcV9FunctionInfo::computeOffsetforLocalVar(), llvm::ConvertConstantToIntType(), llvm::X86SharedAsmPrinter::doFinalization(), llvm::AsmPrinter::EmitConstantPool(), llvm::AsmPrinter::EmitConstantValueOnly(), EmitGEPOffset(), llvm::AsmPrinter::EmitGlobalConstant(), llvm::ExecutionEngine::emitGlobals(), llvm::ExecutionEngine::EmitGlobalVariable(), llvm::Interpreter::executeGEPOperation(), llvm::ExpressionConvertibleToType(), findOptimalStorageSize(), llvm::FunctionLoweringInfo::FunctionLoweringInfo(), llvm::MachineConstantPool::getConstantPoolIndex(), getIndexedOffset(), llvm::AliasAnalysis::getModRefInfo(), llvm::JIT::getOrEmitGlobalVariable(), llvm::AsmPrinter::getPreferredAlignmentLog(), getStructOffsetStep(), llvm::getStructOffsetType(), llvm::ExecutionEngine::InitializeMemory(), llvm::DSNode::mergeTypeInfo(), OperandConvertibleToType(), OptimizeGEPExpression(), OptimizeOnceStoredGlobal(), ProcessGlobalsWithSameName(), llvm::AliasSetTracker::remove(), llvm::SelectionDAGLowering::visitAlloca(), llvm::Interpreter::visitAllocationInst(), llvm::SelectionDAGLowering::visitGetElementPtr(), and llvm::SelectionDAGLowering::visitMalloc().
void TargetData::InvalidateStructLayoutInfo | ( | const StructType * | Ty | ) | const |
InvalidateStructLayoutInfo - TargetData speculatively caches StructLayout objects. If a TargetData object is alive when types are being refined and removed, this method must be called whenever a StructType is removed to avoid a dangling pointer in this cache.
Definition at line 175 of file TargetData.cpp.
bool llvm::TargetData::isBigEndian | ( | ) | const [inline] |
Definition at line 76 of file TargetData.h.
Referenced by llvm::AsmPrinter::EmitGlobalConstant(), and llvm::DwarfWriter::EmitInt64().
bool llvm::TargetData::isLittleEndian | ( | ) | const [inline] |
Target endianness...
Definition at line 75 of file TargetData.h.
Referenced by llvm::ELFWriter::ELFWriter(), and llvm::TargetLowering::TargetLowering().