LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

llvm::TargetData Class Reference

#include <TargetData.h>

Inheritance diagram for llvm::TargetData:

Inheritance graph
[legend]
Collaboration diagram for llvm::TargetData:

Collaboration graph
[legend]
List of all members.

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
uint64_t getTypeSize (const Type *Ty) const
unsigned char getTypeAlignment (const Type *Ty) const
unsigned char getTypeAlignmentShift (const Type *Ty) const
const TypegetIntPtrType () const
uint64_t getIndexedOffset (const Type *Ty, const std::vector< Value * > &Indices) const
const StructLayoutgetStructLayout (const StructType *Ty) const

Detailed Description

Definition at line 35 of file TargetData.h.


Constructor & Destructor Documentation

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

References llvm::Module::BigEndian, llvm::Module::getEndianness(), llvm::Module::getPointerSize(), and llvm::Module::Pointer64.

TargetData::~TargetData  ) 
 

Definition at line 121 of file TargetData.cpp.

References I.


Member Function Documentation

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]
 

Definition at line 80 of file TargetData.h.

Referenced by getTypeInfo().

unsigned char llvm::TargetData::getDoubleAlignment  )  const [inline]
 

Definition at line 85 of file TargetData.h.

Referenced by getTypeInfo(), and SizeToAlignment().

unsigned char llvm::TargetData::getFloatAlignment  )  const [inline]
 

Definition at line 84 of file TargetData.h.

Referenced by getTypeInfo().

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 230 of file TargetData.cpp.

References llvm::gep_type_begin(), getStructLayout(), getTypeSize(), llvm::StructLayout::MemberOffsets, and llvm::Type::UIntTy.

Referenced by llvm::AsmPrinter::emitConstantValueOnly(), and llvm::ExecutionEngine::getConstantValue().

unsigned char llvm::TargetData::getIntAlignment  )  const [inline]
 

Definition at line 82 of file TargetData.h.

Referenced by getTypeInfo().

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 220 of file TargetData.cpp.

References getPointerSize(), llvm::Type::UIntTy, llvm::Type::ULongTy, and llvm::Type::UShortTy.

Referenced by isEliminableCastOfCast().

unsigned char llvm::TargetData::getLongAlignment  )  const [inline]
 

Definition at line 83 of file TargetData.h.

Referenced by getTypeInfo().

unsigned char llvm::TargetData::getPointerAlignment  )  const [inline]
 

Definition at line 86 of file TargetData.h.

Referenced by getTypeInfo().

unsigned char llvm::TargetData::getPointerSize  )  const [inline]
 

Definition at line 87 of file TargetData.h.

Referenced by CreateArgv(), getIntPtrType(), getTypeInfo(), and llvm::SelectionDAG::SelectionDAG().

unsigned char llvm::TargetData::getShortAlignment  )  const [inline]
 

Definition at line 81 of file TargetData.h.

Referenced by getTypeInfo().

const StructLayout * TargetData::getStructLayout const StructType Ty  )  const
 

Definition at line 136 of file TargetData.cpp.

References I.

Referenced by llvm::AsmPrinter::emitGlobalConstant(), llvm::Interpreter::executeGEPOperation(), getIndexedOffset(), getStructOffsetStep(), getTypeInfo(), llvm::ExecutionEngine::InitializeMemory(), and llvm::DSNode::mergeTypeInfo().

unsigned char TargetData::getTypeAlignment const Type Ty  )  const
 

getTypeAlignment - Return the minimum required alignment for the specified type.

Definition at line 205 of file TargetData.cpp.

References getTypeInfo().

Referenced by llvm::SparcV9FunctionInfo::allocateSpilledValue(), llvm::MachineFrameInfo::CreateStackObject(), and getTypeAlignmentShift().

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 212 of file TargetData.cpp.

References getTypeAlignment(), and llvm::log2().

uint64_t TargetData::getTypeSize const Type Ty  )  const
 

getTypeSize - Return the number of bytes necessary to hold the specified type.

Definition at line 198 of file TargetData.cpp.

References getTypeInfo().

Referenced by llvm::AliasSetTracker::add(), llvm::SparcV9FunctionInfo::allocateSpilledValue(), llvm::SparcV9RegInfo::colorMethodArgs(), llvm::SparcV9FunctionInfo::computeOffsetforLocalVar(), llvm::ConvertConstantToIntType(), ConvertMallocToType(), ConvertOperandToType(), llvm::MachineFrameInfo::CreateStackObject(), llvm::AsmPrinter::emitConstantValueOnly(), llvm::AsmPrinter::emitGlobalConstant(), llvm::ExecutionEngine::emitGlobals(), llvm::ExecutionEngine::EmitGlobalVariable(), llvm::Interpreter::executeGEPOperation(), llvm::ExpressionConvertibleToType(), findOptimalStorageSize(), getIndexedOffset(), llvm::AliasAnalysis::getModRefInfo(), llvm::JIT::getOrEmitGlobalVariable(), getStructOffsetStep(), llvm::getStructOffsetType(), llvm::ExecutionEngine::InitializeMemory(), MallocConvertibleToType(), llvm::DSNode::mergeTypeInfo(), OperandConvertibleToType(), OptimizeOnceStoredGlobal(), ProcessGlobalsWithSameName(), llvm::AliasSetTracker::remove(), and llvm::Interpreter::visitAllocationInst().

bool llvm::TargetData::isBigEndian  )  const [inline]
 

Definition at line 76 of file TargetData.h.

Referenced by llvm::AsmPrinter::emitGlobalConstant().

bool llvm::TargetData::isLittleEndian  )  const [inline]
 

Target endianness...

Definition at line 75 of file TargetData.h.


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