LLVM API Documentation
#include <MachineFunction.h>
Inheritance diagram for llvm::MachineFunction:
Definition at line 78 of file MachineFunction.h.
typedef std::vector<std::pair<unsigned,unsigned> >::const_iterator llvm::MachineFunction::livein_iterator |
Definition at line 201 of file MachineFunction.h.
typedef std::vector<unsigned>::const_iterator llvm::MachineFunction::liveout_iterator |
Definition at line 202 of file MachineFunction.h.
typedef ilist<MachineBasicBlock> llvm::MachineFunction::BasicBlockListType |
Definition at line 269 of file MachineFunction.h.
typedef BasicBlockListType::iterator llvm::MachineFunction::iterator |
Definition at line 270 of file MachineFunction.h.
typedef BasicBlockListType::const_iterator llvm::MachineFunction::const_iterator |
Definition at line 271 of file MachineFunction.h.
typedef std::reverse_iterator<const_iterator> llvm::MachineFunction::const_reverse_iterator |
Definition at line 272 of file MachineFunction.h.
typedef std::reverse_iterator<iterator> llvm::MachineFunction::reverse_iterator |
Definition at line 273 of file MachineFunction.h.
MachineFunction::MachineFunction | ( | const Function * | Fn, | |
const TargetMachine & | TM | |||
) |
Definition at line 114 of file MachineFunction.cpp.
References llvm::TargetMachine::getTargetData(), and TM.
Referenced by construct().
MachineFunction::~MachineFunction | ( | ) |
Definition at line 125 of file MachineFunction.cpp.
const Function* llvm::MachineFunction::getFunction | ( | ) | const [inline] |
getFunction - Return the LLVM function that this machine code represents
Definition at line 127 of file MachineFunction.h.
Referenced by llvm::X86RegisterInfo::emitPrologue(), llvm::AlphaRegisterInfo::emitPrologue(), llvm::X86IntelAsmPrinter::runOnMachineFunction(), llvm::X86ATTAsmPrinter::runOnMachineFunction(), llvm::AsmPrinter::SetupMachineFunction(), and viewCFG().
const TargetMachine& llvm::MachineFunction::getTarget | ( | ) | const [inline] |
getTarget - Return the target machine this machine code is compiled with
Definition at line 131 of file MachineFunction.h.
Referenced by llvm::X86RegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPCRegisterInfo::eliminateCallFramePseudoInstr(), llvm::IA64RegisterInfo::eliminateCallFramePseudoInstr(), llvm::AlphaRegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPCRegisterInfo::emitEpilogue(), llvm::X86RegisterInfo::emitPrologue(), llvm::PPCRegisterInfo::emitPrologue(), llvm::IA64RegisterInfo::emitPrologue(), llvm::AlphaRegisterInfo::emitPrologue(), llvm::MachineBasicBlock::getFirstTerminator(), hasFP(), llvm::operator<<(), llvm::VirtRegMap::print(), llvm::MachineFrameInfo::print(), print(), RemoveVRSaveCode(), llvm::LiveVariables::runOnMachineFunction(), and llvm::LiveIntervals::runOnMachineFunction().
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 136 of file MachineFunction.h.
Referenced by llvm::LiveIntervals::addIntervalsForSpills(), AddLiveIn(), llvm::VirtRegMap::assignVirt2StackSlot(), llvm::VirtRegMap::grow(), llvm::IA64TargetLowering::LowerArguments(), LowerFORMAL_ARGUMENT(), LowerFORMAL_ARGUMENTS(), llvm::VirtRegMap::print(), llvm::ScheduleDAG::Run(), llvm::SelectionDAGISel::runOnFunction(), and llvm::LiveIntervals::runOnMachineFunction().
void MachineFunction::clearSSARegMap | ( | ) |
Definition at line 267 of file MachineFunction.cpp.
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 143 of file MachineFunction.h.
Referenced by llvm::VirtRegMap::assignVirt2StackSlot(), llvm::SparcRegisterInfo::eliminateFrameIndex(), llvm::IA64RegisterInfo::eliminateFrameIndex(), llvm::ARMRegisterInfo::eliminateFrameIndex(), llvm::AlphaRegisterInfo::eliminateFrameIndex(), llvm::X86RegisterInfo::emitEpilogue(), llvm::PPCRegisterInfo::emitEpilogue(), llvm::IA64RegisterInfo::emitEpilogue(), llvm::ARMRegisterInfo::emitEpilogue(), llvm::AlphaRegisterInfo::emitEpilogue(), llvm::X86RegisterInfo::emitPrologue(), llvm::SparcRegisterInfo::emitPrologue(), llvm::PPCRegisterInfo::emitPrologue(), llvm::IA64RegisterInfo::emitPrologue(), llvm::ARMRegisterInfo::emitPrologue(), llvm::AlphaRegisterInfo::emitPrologue(), llvm::FunctionLoweringInfo::FunctionLoweringInfo(), llvm::MRegisterInfo::getLocation(), llvm::X86TargetLowering::getReturnAddressFrameIndex(), hasFP(), llvm::IA64TargetLowering::LowerArguments(), LowerFORMAL_ARGUMENT(), LowerFORMAL_ARGUMENTS(), llvm::AlphaTargetLowering::LowerOperation(), LowerSCALAR_TO_VECTOR(), LowerSINT_TO_FP(), PerformShuffleCombine(), print(), llvm::X86RegisterInfo::processFunctionBeforeFrameFinalized(), and llvm::SelectionDAGLowering::visitAlloca().
MachineJumpTableInfo* llvm::MachineFunction::getJumpTableInfo | ( | ) | const [inline] |
getJumpTableInfo - Return the jump table info object for the current function. This object contains information about jump tables for switch instructions in the current function.
Definition at line 149 of file MachineFunction.h.
Referenced by print(), llvm::X86ATTAsmPrinter::runOnMachineFunction(), and llvm::SelectionDAGLowering::visitSwitch().
MachineConstantPool* llvm::MachineFunction::getConstantPool | ( | ) | const [inline] |
getConstantPool - Return the constant pool object for the current function.
Definition at line 154 of file MachineFunction.h.
Referenced by print(), llvm::ScheduleDAG::Run(), llvm::X86IntelAsmPrinter::runOnMachineFunction(), and llvm::X86ATTAsmPrinter::runOnMachineFunction().
Ty* llvm::MachineFunction::getInfo | ( | ) | [inline] |
MachineFunctionInfo - Keep track of various per-function pieces of information for backends that would like to do so.
Definition at line 160 of file MachineFunction.h.
References Ty.
Referenced by llvm::IA64RegisterInfo::emitPrologue(), hasFP(), and llvm::IA64TargetLowering::LowerCallTo().
void llvm::MachineFunction::setUsedPhysRegs | ( | bool * | UPR | ) | [inline] |
setUsedPhysRegs - The register allocator should call this to initialized the UsedPhysRegs set. This should be passed a new[]'d array with entries for all of the physical registers that the target supports. Each array entry should be set to true iff the physical register is used within the function.
Definition at line 173 of file MachineFunction.h.
bool* llvm::MachineFunction::getUsedPhysregs | ( | ) | [inline] |
getUsedPhysregs - This returns the UsedPhysRegs array. This returns null before register allocation.
Definition at line 177 of file MachineFunction.h.
Referenced by llvm::PPCRegisterInfo::emitPrologue().
const bool* llvm::MachineFunction::getUsedPhysregs | ( | ) | const [inline] |
Definition at line 178 of file MachineFunction.h.
bool llvm::MachineFunction::isPhysRegUsed | ( | unsigned | Reg | ) | [inline] |
isPhysRegUsed - Return true if the specified register is used in this function. This only works after register allocation.
Definition at line 182 of file MachineFunction.h.
Referenced by llvm::IA64RegisterInfo::emitPrologue().
void llvm::MachineFunction::changePhyRegUsed | ( | unsigned | Reg, | |
bool | State | |||
) | [inline] |
changePhyRegUsed - This method allows code that runs after register allocation to keep the PhysRegsUsed array up-to-date.
Definition at line 186 of file MachineFunction.h.
void llvm::MachineFunction::addLiveIn | ( | unsigned | Reg, | |
unsigned | vreg = 0 | |||
) | [inline] |
addLiveIn/Out - Add the specified register as a live in/out. Note that it is an error to add the same register to the same set more than once.
Definition at line 193 of file MachineFunction.h.
Referenced by AddLiveIn(), llvm::IA64TargetLowering::LowerArguments(), LowerFORMAL_ARGUMENT(), and LowerFORMAL_ARGUMENTS().
void llvm::MachineFunction::addLiveOut | ( | unsigned | Reg | ) | [inline] |
Definition at line 196 of file MachineFunction.h.
Referenced by llvm::IA64TargetLowering::LowerArguments(), and LowerRET().
livein_iterator llvm::MachineFunction::livein_begin | ( | ) | const [inline] |
Definition at line 203 of file MachineFunction.h.
Referenced by llvm::ScheduleDAG::EmitSchedule(), HandleVRSaveUpdate(), print(), llvm::LiveVariables::runOnMachineFunction(), and llvm::LiveIntervals::runOnMachineFunction().
livein_iterator llvm::MachineFunction::livein_end | ( | ) | const [inline] |
Definition at line 204 of file MachineFunction.h.
Referenced by llvm::ScheduleDAG::EmitSchedule(), HandleVRSaveUpdate(), print(), llvm::LiveVariables::runOnMachineFunction(), and llvm::LiveIntervals::runOnMachineFunction().
bool llvm::MachineFunction::livein_empty | ( | ) | const [inline] |
Definition at line 205 of file MachineFunction.h.
liveout_iterator llvm::MachineFunction::liveout_begin | ( | ) | const [inline] |
Definition at line 206 of file MachineFunction.h.
Referenced by HandleVRSaveUpdate(), print(), and llvm::LiveVariables::runOnMachineFunction().
liveout_iterator llvm::MachineFunction::liveout_end | ( | ) | const [inline] |
Definition at line 207 of file MachineFunction.h.
Referenced by HandleVRSaveUpdate(), print(), and llvm::LiveVariables::runOnMachineFunction().
bool llvm::MachineFunction::liveout_empty | ( | ) | const [inline] |
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 215 of file MachineFunction.h.
MachineBasicBlock* llvm::MachineFunction::getLastBlock | ( | ) | [inline] |
getLastBlock - Returns the MachineBasicBlock with the greatest number
Definition at line 222 of file MachineFunction.h.
const MachineBasicBlock* llvm::MachineFunction::getLastBlock | ( | ) | const [inline] |
Definition at line 225 of file MachineFunction.h.
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 137 of file MachineFunction.cpp.
References BB, begin(), E, end(), getConstantPool(), getFrameInfo(), getJumpTableInfo(), llvm::MRegisterInfo::getName(), llvm::Value::getName(), llvm::TargetMachine::getRegisterInfo(), getTarget(), livein_begin(), livein_end(), liveout_begin(), liveout_end(), MRI, llvm::BasicBlock::print(), llvm::MachineConstantPool::print(), llvm::MachineJumpTableInfo::print(), and llvm::MachineFrameInfo::print().
Referenced by dump().
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 221 of file MachineFunction.cpp.
References getFunction(), llvm::Intrinsic::getName(), and llvm::ViewGraph().
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 231 of file MachineFunction.cpp.
References viewCFG().
void MachineFunction::dump | ( | ) | const |
dump - Print the current MachineFunction to cerr, useful for debugger use.
Definition at line 135 of file MachineFunction.cpp.
References print().
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 246 of file MachineFunction.cpp.
References llvm::Annotable::addAnnotation(), llvm::Annotable::getAnnotation(), MachineFunction(), and MF_AID().
Referenced by llvm::SelectionDAGISel::runOnFunction().
void MachineFunction::destruct | ( | const Function * | F | ) | [static] |
destruct - Destroy the MachineFunction corresponding to a given Function
Definition at line 255 of file MachineFunction.cpp.
References llvm::Annotable::deleteAnnotation(), and MF_AID().
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 260 of file MachineFunction.cpp.
Referenced by llvm::MachineFunctionPass::runOnFunction().
const BasicBlockListType& llvm::MachineFunction::getBasicBlockList | ( | ) | const [inline] |
Definition at line 276 of file MachineFunction.h.
Referenced by llvm::FunctionLoweringInfo::FunctionLoweringInfo(), and llvm::SelectionDAGLowering::visitSwitch().
BasicBlockListType& llvm::MachineFunction::getBasicBlockList | ( | ) | [inline] |
Definition at line 277 of file MachineFunction.h.
iterator llvm::MachineFunction::begin | ( | ) | [inline] |
Definition at line 282 of file MachineFunction.h.
Referenced by llvm::ScheduleDAG::EmitSchedule(), print(), llvm::LiveIntervals::print(), RemoveVRSaveCode(), llvm::X86IntelAsmPrinter::runOnMachineFunction(), llvm::X86ATTAsmPrinter::runOnMachineFunction(), llvm::LiveVariables::runOnMachineFunction(), and llvm::LiveIntervals::runOnMachineFunction().
const_iterator llvm::MachineFunction::begin | ( | ) | const [inline] |
Definition at line 283 of file MachineFunction.h.
iterator llvm::MachineFunction::end | ( | ) | [inline] |
Definition at line 284 of file MachineFunction.h.
Referenced by print(), llvm::LiveIntervals::print(), RemoveVRSaveCode(), llvm::X86IntelAsmPrinter::runOnMachineFunction(), llvm::X86ATTAsmPrinter::runOnMachineFunction(), llvm::LiveVariables::runOnMachineFunction(), llvm::LiveIntervals::runOnMachineFunction(), llvm::SelectionDAGLowering::visitBr(), llvm::SelectionDAGLowering::visitSwitch(), and llvm::SelectionDAGLowering::visitSwitchCase().
const_iterator llvm::MachineFunction::end | ( | ) | const [inline] |
Definition at line 285 of file MachineFunction.h.
reverse_iterator llvm::MachineFunction::rbegin | ( | ) | [inline] |
Definition at line 287 of file MachineFunction.h.
const_reverse_iterator llvm::MachineFunction::rbegin | ( | ) | const [inline] |
Definition at line 288 of file MachineFunction.h.
reverse_iterator llvm::MachineFunction::rend | ( | ) | [inline] |
Definition at line 289 of file MachineFunction.h.
const_reverse_iterator llvm::MachineFunction::rend | ( | ) | const [inline] |
Definition at line 290 of file MachineFunction.h.
unsigned llvm::MachineFunction::size | ( | ) | const [inline] |
Definition at line 292 of file MachineFunction.h.
bool llvm::MachineFunction::empty | ( | ) | const [inline] |
Definition at line 293 of file MachineFunction.h.
const MachineBasicBlock& llvm::MachineFunction::front | ( | ) | const [inline] |
Definition at line 294 of file MachineFunction.h.
Referenced by llvm::X86RegisterInfo::emitPrologue(), llvm::SparcRegisterInfo::emitPrologue(), llvm::PPCRegisterInfo::emitPrologue(), llvm::IA64RegisterInfo::emitPrologue(), llvm::ARMRegisterInfo::emitPrologue(), llvm::AlphaRegisterInfo::emitPrologue(), llvm::ScheduleDAG::EmitSchedule(), and llvm::IA64TargetLowering::LowerArguments().
MachineBasicBlock& llvm::MachineFunction::front | ( | ) | [inline] |
Definition at line 295 of file MachineFunction.h.
const MachineBasicBlock& llvm::MachineFunction::back | ( | ) | const [inline] |
Definition at line 296 of file MachineFunction.h.
MachineBasicBlock& llvm::MachineFunction::back | ( | ) | [inline] |
Definition at line 297 of file MachineFunction.h.
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 306 of file MachineFunction.h.
References MBB.
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 314 of file MachineFunction.h.