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::TargetMachine Class Reference

#include <TargetMachine.h>

Inheritance diagram for llvm::TargetMachine:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~TargetMachine ()
const std::string & getName () const
IntrinsicLoweringgetIntrinsicLowering () const
virtual const TargetInstrInfogetInstrInfo () const
virtual const TargetFrameInfogetFrameInfo () const
const TargetDatagetTargetData () const
virtual const MRegisterInfogetRegisterInfo () const
virtual TargetJITInfogetJITInfo ()
virtual const TargetSchedInfogetSchedInfo () const
virtual const SparcV9RegInfogetRegInfo () const
virtual bool addPassesToEmitAssembly (PassManager &PM, std::ostream &Out)
virtual bool addPassesToEmitMachineCode (FunctionPassManager &PM, MachineCodeEmitter &MCE)

Static Public Member Functions

static unsigned getModuleMatchQuality (const Module &M)
static unsigned getJITMatchQuality ()

Protected Member Functions

 TargetMachine (const std::string &name, IntrinsicLowering *IL, 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)
 TargetMachine (const std::string &name, IntrinsicLowering *IL, const TargetData &TD)
 TargetMachine (const std::string &name, IntrinsicLowering *IL, const Module &M)

Detailed Description

TargetMachine - Primary interface to the complete machine description for the target machine. All target-specific information should be accessible through this interface.

Definition at line 41 of file TargetMachine.h.


Constructor & Destructor Documentation

TargetMachine::TargetMachine const std::string &  name,
IntrinsicLowering IL,
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
[protected]
 

Definition at line 43 of file TargetMachine.cpp.

TargetMachine::TargetMachine const std::string &  name,
IntrinsicLowering IL,
const TargetData TD
[protected]
 

Definition at line 56 of file TargetMachine.cpp.

TargetMachine::TargetMachine const std::string &  name,
IntrinsicLowering IL,
const Module M
[protected]
 

This constructor is used for targets that support arbitrary TargetData layouts, like the C backend. It initializes the TargetData to match that of the specified module.

Definition at line 62 of file TargetMachine.cpp.

TargetMachine::~TargetMachine  )  [virtual]
 

Definition at line 68 of file TargetMachine.cpp.


Member Function Documentation

virtual bool llvm::TargetMachine::addPassesToEmitAssembly PassManager PM,
std::ostream &  Out
[inline, virtual]
 

addPassesToEmitAssembly - Add passes to the specified pass manager to get assembly langage code emitted. Typically this will involve several steps of code generation. This method should return true if assembly emission is not supported.

Reimplemented in llvm::CTargetMachine, llvm::PowerPCTargetMachine, llvm::SkeletonTargetMachine, llvm::SparcV9TargetMachine, and llvm::X86TargetMachine.

Definition at line 120 of file TargetMachine.h.

virtual bool llvm::TargetMachine::addPassesToEmitMachineCode FunctionPassManager PM,
MachineCodeEmitter MCE
[inline, virtual]
 

addPassesToEmitMachineCode - Add passes to the specified pass manager to get machine code emitted. This uses a MachineCodeEmitter object to handle actually outputting the machine code and resolving things like the address of functions. This method should returns true if machine code emission is not supported.

Reimplemented in llvm::PPC32TargetMachine, llvm::PPC64TargetMachine, llvm::SkeletonTargetMachine, llvm::SparcV9TargetMachine, and llvm::X86TargetMachine.

Definition at line 130 of file TargetMachine.h.

virtual const TargetFrameInfo* llvm::TargetMachine::getFrameInfo  )  const [inline, virtual]
 

Reimplemented in llvm::PowerPCTargetMachine, llvm::SkeletonTargetMachine, llvm::SparcV9TargetMachine, and llvm::X86TargetMachine.

Definition at line 97 of file TargetMachine.h.

Referenced by llvm::SparcV9FunctionInfo::allocateSpilledValue(), llvm::SparcV9RegInfo::colorMethodArgs(), llvm::SparcV9FunctionInfo::computeOffsetforLocalVar(), llvm::X86RegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPC64RegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPC32RegisterInfo::eliminateCallFramePseudoInstr(), llvm::X86RegisterInfo::emitPrologue(), llvm::PPC64RegisterInfo::emitPrologue(), llvm::PPC32RegisterInfo::emitPrologue(), llvm::getStaticStackSize(), llvm::MachineFrameInfo::print(), and llvm::SparcV9FunctionInfo::pushTempValue().

virtual const TargetInstrInfo* llvm::TargetMachine::getInstrInfo  )  const [inline, virtual]
 

Reimplemented in llvm::PPC32TargetMachine, llvm::PPC64TargetMachine, llvm::SkeletonTargetMachine, llvm::SparcV9TargetMachine, and llvm::X86TargetMachine.

Definition at line 96 of file TargetMachine.h.

Referenced by llvm::LiveRangeInfo::constructLiveRanges(), llvm::SparcV9RegInfo::cpMem2RegMI(), llvm::SparcV9RegInfo::cpReg2MemMI(), llvm::DeleteInstruction(), llvm::MachineBasicBlock::getFirstTerminator(), llvm::MachineInstr::print(), llvm::LiveVariables::runOnMachineFunction(), llvm::LiveIntervals::runOnMachineFunction(), llvm::SparcV9RegInfo::suggestReg4RetValue(), and llvm::SparcV9RegInfo::suggestRegs4CallArgs().

IntrinsicLowering& llvm::TargetMachine::getIntrinsicLowering  )  const [inline]
 

getIntrinsicLowering - This method returns a reference to an IntrinsicLowering instance which should be used by the code generator to lower unknown intrinsic functions to the equivalent LLVM expansion.

Definition at line 89 of file TargetMachine.h.

Referenced by llvm::CTargetMachine::addPassesToEmitAssembly().

virtual TargetJITInfo* llvm::TargetMachine::getJITInfo  )  [inline, virtual]
 

getJITInfo - If this target supports a JIT, return information for it, otherwise return null.

Reimplemented in llvm::PPC32TargetMachine, llvm::SkeletonTargetMachine, llvm::SparcV9TargetMachine, and llvm::X86TargetMachine.

Definition at line 109 of file TargetMachine.h.

Referenced by llvm::JIT::create().

static unsigned llvm::TargetMachine::getJITMatchQuality  )  [inline, static]
 

getJITMatchQuality - This static method should be implemented by targets that provide JIT capabilities to indicate how suitable they are for execution on the current host. If a value of 0 is returned, the target will not be used unless an explicit -march option is used.

Reimplemented in llvm::PPC32TargetMachine, llvm::SparcV9TargetMachine, and llvm::X86TargetMachine.

Definition at line 80 of file TargetMachine.h.

Referenced by llvm::PPC64TargetMachine::getModuleMatchQuality().

static unsigned llvm::TargetMachine::getModuleMatchQuality const Module M  )  [inline, static]
 

getModuleMatchQuality - This static method should be implemented by targets to indicate how closely they match the specified module. This is used by the LLC tool to determine which target to use when an explicit -march option is not specified. If a target returns zero, it will never be chosen without an explicit -march option.

Reimplemented in llvm::CTargetMachine, llvm::PPC32TargetMachine, llvm::PPC64TargetMachine, llvm::SparcV9TargetMachine, and llvm::X86TargetMachine.

Definition at line 74 of file TargetMachine.h.

const std::string& llvm::TargetMachine::getName  )  const [inline]
 

Definition at line 83 of file TargetMachine.h.

virtual const SparcV9RegInfo* llvm::TargetMachine::getRegInfo  )  const [inline, virtual]
 

Reimplemented in llvm::SparcV9TargetMachine.

Definition at line 113 of file TargetMachine.h.

Referenced by llvm::IsUselessCopy(), and llvm::PhyRegAlloc::runOnFunction().

virtual const MRegisterInfo* llvm::TargetMachine::getRegisterInfo  )  const [inline, virtual]
 

getRegisterInfo - If register information is available, return it. If not, return null. This is kept separate from RegInfo until RegInfo has details of graph coloring register allocation removed from it.

Reimplemented in llvm::PPC32TargetMachine, llvm::PPC64TargetMachine, llvm::SkeletonTargetMachine, llvm::SparcV9TargetMachine, and llvm::X86TargetMachine.

Definition at line 104 of file TargetMachine.h.

Referenced by llvm::VirtRegMap::print(), print(), llvm::LiveVariables::runOnMachineFunction(), and llvm::LiveIntervals::runOnMachineFunction().

virtual const TargetSchedInfo* llvm::TargetMachine::getSchedInfo  )  const [inline, virtual]
 

Reimplemented in llvm::SparcV9TargetMachine.

Definition at line 112 of file TargetMachine.h.

const TargetData& llvm::TargetMachine::getTargetData  )  const [inline]
 

Definition at line 98 of file TargetMachine.h.

Referenced by llvm::SparcV9FunctionInfo::allocateSpilledValue(), llvm::SparcV9RegInfo::colorMethodArgs(), llvm::SparcV9FunctionInfo::computeOffsetforLocalVar(), llvm::ConvertConstantToIntType(), llvm::AsmPrinter::emitConstantValueOnly(), llvm::AsmPrinter::emitGlobalConstant(), findOptimalStorageSize(), llvm::SelectionDAG::SelectionDAG(), and SizeToAlignment().


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