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

#include <MachineFunction.h>

Inheritance diagram for llvm::MachineFunction:

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef ilist< MachineBasicBlockBasicBlockListType
typedef BasicBlockListType::iterator iterator
typedef BasicBlockListType::const_iterator const_iterator
typedef std::reverse_iterator<
const_iterator
const_reverse_iterator
typedef std::reverse_iterator<
iterator
reverse_iterator

Public Member Functions

 MachineFunction (const Function *Fn, const TargetMachine &TM)
 ~MachineFunction ()
const FunctiongetFunction () const
const TargetMachinegetTarget () const
SSARegMapgetSSARegMap () const
void clearSSARegMap ()
MachineFrameInfogetFrameInfo () const
MachineConstantPoolgetConstantPool () const
template<typename Ty>
Ty * getInfo ()
MachineBasicBlockgetBlockNumbered (unsigned N)
MachineBasicBlockgetLastBlock ()
 getLastBlock - Returns the MachineBasicBlock with the greatest number
const MachineBasicBlockgetLastBlock () const
void print (std::ostream &OS) const
void viewCFG () const
void viewCFGOnly () const
void dump () const
const BasicBlockListTypegetBasicBlockList () const
BasicBlockListTypegetBasicBlockList ()
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const
unsigned size () const
bool empty () const
const MachineBasicBlockfront () const
MachineBasicBlockfront ()
const MachineBasicBlockback () const
MachineBasicBlockback ()
unsigned addToMBBNumbering (MachineBasicBlock *MBB)
void removeFromMBBNumbering (unsigned N)

Static Public Member Functions

static MachineFunctionconstruct (const Function *F, const TargetMachine &TM)
static void destruct (const Function *F)
static MachineFunctionget (const Function *F)

Detailed Description

Definition at line 75 of file MachineFunction.h.


Member Typedef Documentation

typedef ilist<MachineBasicBlock> llvm::MachineFunction::BasicBlockListType
 

Definition at line 200 of file MachineFunction.h.

typedef BasicBlockListType::const_iterator llvm::MachineFunction::const_iterator
 

Definition at line 202 of file MachineFunction.h.

typedef std::reverse_iterator<const_iterator> llvm::MachineFunction::const_reverse_iterator
 

Definition at line 203 of file MachineFunction.h.

typedef BasicBlockListType::iterator llvm::MachineFunction::iterator
 

Definition at line 201 of file MachineFunction.h.

typedef std::reverse_iterator<iterator> llvm::MachineFunction::reverse_iterator
 

Definition at line 204 of file MachineFunction.h.


Constructor & Destructor Documentation

MachineFunction::MachineFunction const Function Fn,
const TargetMachine TM
 

Definition at line 109 of file MachineFunction.cpp.

Referenced by construct().

MachineFunction::~MachineFunction  ) 
 

Definition at line 119 of file MachineFunction.cpp.


Member Function Documentation

unsigned llvm::MachineFunction::addToMBBNumbering MachineBasicBlock MBB  )  [inline]
 

getNextMBBNumber - Returns the next unique number to be assigned to a MachineBasicBlock in this MachineFunction.

Definition at line 237 of file MachineFunction.h.

MachineBasicBlock& llvm::MachineFunction::back  )  [inline]
 

Definition at line 228 of file MachineFunction.h.

const MachineBasicBlock& llvm::MachineFunction::back  )  const [inline]
 

Definition at line 227 of file MachineFunction.h.

const_iterator llvm::MachineFunction::begin  )  const [inline]
 

Definition at line 214 of file MachineFunction.h.

iterator llvm::MachineFunction::begin  )  [inline]
 

Definition at line 213 of file MachineFunction.h.

Referenced by llvm::LiveRangeInfo::coalesceLRs(), llvm::LiveRangeInfo::constructLiveRanges(), llvm::GraphTraits< const MachineFunction * >::nodes_begin(), llvm::GraphTraits< MachineFunction * >::nodes_begin(), print(), llvm::LiveIntervals::print(), llvm::PeepholeOpts::runOnBasicBlock(), llvm::ModuloSchedulingPass::runOnFunction(), llvm::SparcV9CodeEmitter::runOnMachineFunction(), llvm::LiveVariables::runOnMachineFunction(), and llvm::LiveIntervals::runOnMachineFunction().

void MachineFunction::clearSSARegMap  ) 
 

Definition at line 247 of file MachineFunction.cpp.

MachineFunction & MachineFunction::construct const Function F,
const TargetMachine TM
[static]
 

construct - Allocate and initialize a MachineFunction for a given Function and Target

Definition at line 226 of file MachineFunction.cpp.

References llvm::Annotable::addAnnotation(), llvm::Annotable::getAnnotation(), MachineFunction(), and MF_AID().

void MachineFunction::destruct const Function F  )  [static]
 

destruct - Destroy the MachineFunction corresponding to a given Function

Definition at line 235 of file MachineFunction.cpp.

References llvm::Annotable::deleteAnnotation(), and MF_AID().

void MachineFunction::dump  )  const
 

dump - Print the current MachineFunction to cerr, useful for debugger use.

Definition at line 127 of file MachineFunction.cpp.

References print().

Referenced by llvm::PhyRegAlloc::runOnFunction().

bool llvm::MachineFunction::empty  )  const [inline]
 

Definition at line 224 of file MachineFunction.h.

const_iterator llvm::MachineFunction::end  )  const [inline]
 

Definition at line 216 of file MachineFunction.h.

iterator llvm::MachineFunction::end  )  [inline]
 

Definition at line 215 of file MachineFunction.h.

Referenced by llvm::LiveRangeInfo::coalesceLRs(), llvm::LiveRangeInfo::constructLiveRanges(), llvm::GraphTraits< const MachineFunction * >::nodes_end(), llvm::GraphTraits< MachineFunction * >::nodes_end(), print(), llvm::LiveIntervals::print(), ReplaceUsesOfBlockWith(), llvm::PeepholeOpts::runOnBasicBlock(), llvm::ModuloSchedulingPass::runOnFunction(), llvm::SparcV9CodeEmitter::runOnMachineFunction(), llvm::LiveVariables::runOnMachineFunction(), and llvm::LiveIntervals::runOnMachineFunction().

MachineBasicBlock& llvm::MachineFunction::front  )  [inline]
 

Definition at line 226 of file MachineFunction.h.

const MachineBasicBlock& llvm::MachineFunction::front  )  const [inline]
 

Definition at line 225 of file MachineFunction.h.

Referenced by llvm::X86RegisterInfo::emitPrologue(), llvm::PPC64RegisterInfo::emitPrologue(), llvm::PPC32RegisterInfo::emitPrologue(), llvm::GraphTraits< Inverse< const MachineFunction * > >::getEntryNode(), llvm::GraphTraits< Inverse< MachineFunction * > >::getEntryNode(), llvm::GraphTraits< const MachineFunction * >::getEntryNode(), and llvm::GraphTraits< MachineFunction * >::getEntryNode().

MachineFunction & MachineFunction::get const Function F  )  [static]
 

get - Return a handle to a MachineFunction corresponding to the given Function. This should not be called before "construct()" for a given Function.

Definition at line 240 of file MachineFunction.cpp.

References llvm::Annotable::getAnnotation(), and MF_AID().

Referenced by llvm::LiveRangeInfo::coalesceLRs(), llvm::SparcV9RegInfo::colorMethodArgs(), llvm::LiveRangeInfo::constructLiveRanges(), llvm::MachineCodeForInstruction::destroy(), llvm::MachineCodeForInstruction::get(), llvm::PeepholeOpts::runOnBasicBlock(), llvm::PhyRegAlloc::runOnFunction(), llvm::ModuloSchedulingPass::runOnFunction(), and llvm::MachineFunctionPass::runOnFunction().

BasicBlockListType& llvm::MachineFunction::getBasicBlockList  )  [inline]
 

Definition at line 208 of file MachineFunction.h.

const BasicBlockListType& llvm::MachineFunction::getBasicBlockList  )  const [inline]
 

Definition at line 207 of file MachineFunction.h.

Referenced by llvm::SelectionDAG::SelectionDAG().

MachineBasicBlock* llvm::MachineFunction::getBlockNumbered unsigned  N  )  [inline]
 

getBlockNumbered - MachineBasicBlocks are automatically numbered when they are inserted into the machine function. The block number for a machine basic block can be found by using the MBB::getBlockNumber method, this method provides the inverse mapping.

Definition at line 146 of file MachineFunction.h.

MachineConstantPool* llvm::MachineFunction::getConstantPool  )  const [inline]
 

getConstantPool - Return the constant pool object for the current function.

Definition at line 127 of file MachineFunction.h.

Referenced by print(), and llvm::SparcV9CodeEmitter::runOnMachineFunction().

MachineFrameInfo* llvm::MachineFunction::getFrameInfo  )  const [inline]
 

getFrameInfo - Return the frame info object for the current function. This object contains information about objects allocated on the stack frame of the current function in an abstract way.

Definition at line 122 of file MachineFunction.h.

Referenced by llvm::VirtRegMap::assignVirt2StackSlot(), llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::PPC64RegisterInfo::eliminateFrameIndex(), llvm::PPC32RegisterInfo::eliminateFrameIndex(), llvm::X86RegisterInfo::emitEpilogue(), llvm::PPC64RegisterInfo::emitEpilogue(), llvm::PPC32RegisterInfo::emitEpilogue(), llvm::X86RegisterInfo::emitPrologue(), llvm::PPC64RegisterInfo::emitPrologue(), llvm::PPC32RegisterInfo::emitPrologue(), hasFP(), print(), and llvm::X86RegisterInfo::processFunctionBeforeFrameFinalized().

const Function* llvm::MachineFunction::getFunction  )  const [inline]
 

getFunction - Return the LLVM function that this machine code represents

Definition at line 106 of file MachineFunction.h.

Referenced by llvm::SparcV9FunctionInfo::CalculateArgSize(), llvm::DOTGraphTraits< const MachineFunction * >::getGraphName(), llvm::SparcV9CodeEmitter::runOnMachineFunction(), llvm::SelectionDAG::SelectionDAG(), llvm::AsmPrinter::setupMachineFunction(), and viewCFG().

template<typename Ty>
Ty* llvm::MachineFunction::getInfo  )  [inline]
 

MachineFunctionInfo - Keep track of various per-function pieces of information for the sparc backend.

Definition at line 133 of file MachineFunction.h.

Referenced by llvm::SparcV9RegInfo::colorMethodArgs(), llvm::MachineCodeForInstruction::destroy(), llvm::MachineCodeForInstruction::get(), llvm::SparcV9FrameInfo::getDynamicAreaOffset(), llvm::SparcV9FrameInfo::getRegSpillAreaOffset(), llvm::getStaticStackSize(), llvm::SparcV9FrameInfo::getTmpAreaOffset(), and llvm::PhyRegAlloc::runOnFunction().

const MachineBasicBlock* llvm::MachineFunction::getLastBlock  )  const [inline]
 

Definition at line 156 of file MachineFunction.h.

MachineBasicBlock* llvm::MachineFunction::getLastBlock  )  [inline]
 

getLastBlock - Returns the MachineBasicBlock with the greatest number

Definition at line 153 of file MachineFunction.h.

SSARegMap* llvm::MachineFunction::getSSARegMap  )  const [inline]
 

SSARegMap Interface... Keep track of information about each SSA virtual register, such as which register class it belongs to.

Definition at line 115 of file MachineFunction.h.

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), llvm::VirtRegMap::assignVirt2StackSlot(), llvm::VirtRegMap::grow(), llvm::VirtRegMap::print(), and llvm::LiveIntervals::runOnMachineFunction().

const TargetMachine& llvm::MachineFunction::getTarget  )  const [inline]
 

getTarget - Return the target machine this machine code is compiled with

Definition at line 110 of file MachineFunction.h.

Referenced by llvm::SparcV9FunctionInfo::allocateSpilledValue(), llvm::SparcV9FunctionInfo::CalculateArgSize(), llvm::SparcV9FunctionInfo::computeOffsetforLocalVar(), llvm::X86RegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPC64RegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPC32RegisterInfo::eliminateCallFramePseudoInstr(), llvm::X86RegisterInfo::emitPrologue(), llvm::PPC64RegisterInfo::emitPrologue(), llvm::PPC32RegisterInfo::emitPrologue(), llvm::MachineBasicBlock::getFirstTerminator(), llvm::getStaticStackSize(), llvm::operator<<(), llvm::VirtRegMap::print(), llvm::MachineFrameInfo::print(), llvm::SparcV9FunctionInfo::pushTempValue(), llvm::LiveVariables::runOnMachineFunction(), and llvm::LiveIntervals::runOnMachineFunction().

void MachineFunction::print std::ostream &  OS  )  const
 

print - Print out the MachineFunction in a format suitable for debugging to the specified stream.

Definition at line 129 of file MachineFunction.cpp.

References begin(), end(), getConstantPool(), getFrameInfo(), llvm::Value::getName(), llvm::MachineConstantPool::print(), and llvm::MachineFrameInfo::print().

Referenced by dump().

const_reverse_iterator llvm::MachineFunction::rbegin  )  const [inline]
 

Definition at line 219 of file MachineFunction.h.

reverse_iterator llvm::MachineFunction::rbegin  )  [inline]
 

Definition at line 218 of file MachineFunction.h.

void llvm::MachineFunction::removeFromMBBNumbering unsigned  N  )  [inline]
 

removeFromMBBNumbering - Remove the specific machine basic block from our tracker, this is only really to be used by the MachineBasicBlock implementation.

Definition at line 245 of file MachineFunction.h.

const_reverse_iterator llvm::MachineFunction::rend  )  const [inline]
 

Definition at line 221 of file MachineFunction.h.

reverse_iterator llvm::MachineFunction::rend  )  [inline]
 

Definition at line 220 of file MachineFunction.h.

unsigned llvm::MachineFunction::size  )  const [inline]
 

Definition at line 223 of file MachineFunction.h.

void MachineFunction::viewCFG  )  const
 

viewCFG - This function is meant for use from the debugger. You can just say 'call F->viewCFG()' and a ghostview window should pop up from the program, displaying the CFG of the current function with the code for each basic block inside. This depends on there being a 'dot' and 'gv' program in your path.

Definition at line 185 of file MachineFunction.cpp.

References F, getFunction(), llvm::Value::getName(), and llvm::WriteGraph().

Referenced by viewCFGOnly().

void MachineFunction::viewCFGOnly  )  const
 

viewCFGOnly - This function is meant for use from the debugger. It works just like viewCFG, but it does not include the contents of basic blocks into the nodes, just the label. If you are only interested in the CFG this can make the graph smaller.

Definition at line 211 of file MachineFunction.cpp.

References viewCFG().


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