LLVM API Documentation

llvm::MachineBasicBlock Class Reference

#include <MachineBasicBlock.h>

Collaboration diagram for llvm::MachineBasicBlock:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ilist< MachineInstrInstructions
typedef ilist< MachineInstr
>::iterator 
iterator
typedef ilist< MachineInstr
>::const_iterator 
const_iterator
typedef std::reverse_iterator<
const_iterator
const_reverse_iterator
typedef std::reverse_iterator<
iterator
reverse_iterator
typedef std::vector< MachineBasicBlock
* >::iterator 
pred_iterator
typedef std::vector< MachineBasicBlock
* >::const_iterator 
const_pred_iterator
typedef std::vector< MachineBasicBlock
* >::iterator 
succ_iterator
typedef std::vector< MachineBasicBlock
* >::const_iterator 
const_succ_iterator

Public Member Functions

 MachineBasicBlock (const BasicBlock *bb=0)
 ~MachineBasicBlock ()
const BasicBlockgetBasicBlock () const
const MachineFunctiongetParent () const
MachineFunctiongetParent ()
unsigned size () const
bool empty () const
MachineInstrfront ()
MachineInstrback ()
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
pred_iterator pred_begin ()
const_pred_iterator pred_begin () const
pred_iterator pred_end ()
const_pred_iterator pred_end () const
unsigned pred_size () const
bool pred_empty () const
succ_iterator succ_begin ()
const_succ_iterator succ_begin () const
succ_iterator succ_end ()
const_succ_iterator succ_end () const
unsigned succ_size () const
bool succ_empty () const
void addSuccessor (MachineBasicBlock *succ)
void removeSuccessor (MachineBasicBlock *succ)
void removeSuccessor (succ_iterator I)
iterator getFirstTerminator ()
void pop_front ()
void pop_back ()
void push_back (MachineInstr *MI)
template<typename IT>
void insert (iterator I, IT S, IT E)
iterator insert (iterator I, MachineInstr *M)
iterator erase (iterator I)
iterator erase (iterator I, iterator E)
MachineInstrremove (MachineInstr *I)
void clear ()
void splice (iterator where, MachineBasicBlock *Other, iterator From, iterator To)
void dump () const
void print (std::ostream &OS) const
int getNumber () const

Public Attributes

Instructions Insts
MachineBasicBlockPrev
MachineBasicBlockNext
const BasicBlockBB
std::vector< MachineBasicBlock * > Predecessors
std::vector< MachineBasicBlock * > Successors
int Number
MachineFunctionParent

Friends

struct ilist_traits< MachineBasicBlock >

Detailed Description

Definition at line 60 of file MachineBasicBlock.h.


Member Typedef Documentation

typedef ilist<MachineInstr> llvm::MachineBasicBlock::Instructions

Definition at line 62 of file MachineBasicBlock.h.

typedef ilist<MachineInstr>::iterator llvm::MachineBasicBlock::iterator

Definition at line 89 of file MachineBasicBlock.h.

typedef ilist<MachineInstr>::const_iterator llvm::MachineBasicBlock::const_iterator

Definition at line 90 of file MachineBasicBlock.h.

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

Definition at line 91 of file MachineBasicBlock.h.

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

Definition at line 92 of file MachineBasicBlock.h.

typedef std::vector<MachineBasicBlock *>::iterator llvm::MachineBasicBlock::pred_iterator

Definition at line 110 of file MachineBasicBlock.h.

typedef std::vector<MachineBasicBlock *>::const_iterator llvm::MachineBasicBlock::const_pred_iterator

Definition at line 111 of file MachineBasicBlock.h.

typedef std::vector<MachineBasicBlock *>::iterator llvm::MachineBasicBlock::succ_iterator

Definition at line 112 of file MachineBasicBlock.h.

typedef std::vector<MachineBasicBlock *>::const_iterator llvm::MachineBasicBlock::const_succ_iterator

Definition at line 113 of file MachineBasicBlock.h.


Constructor & Destructor Documentation

llvm::MachineBasicBlock::MachineBasicBlock ( const BasicBlock bb = 0  )  [inline]

Definition at line 72 of file MachineBasicBlock.h.

References Insts.

MachineBasicBlock::~MachineBasicBlock (  ) 

Definition at line 26 of file MachineBasicBlock.cpp.

References llvm::LeakDetector::removeGarbageObject().


Member Function Documentation

const BasicBlock* llvm::MachineBasicBlock::getBasicBlock (  )  const [inline]

getBasicBlock - Return the LLVM basic block that this instance corresponded to originally.

Definition at line 82 of file MachineBasicBlock.h.

References BB.

Referenced by llvm::operator<<(), print(), print(), llvm::AsmPrinter::printBasicBlockLabel(), and llvm::SelectionDAGLowering::visitSwitch().

const MachineFunction* llvm::MachineBasicBlock::getParent (  )  const [inline]

getParent - Return the MachineFunction containing this basic block.

Definition at line 86 of file MachineBasicBlock.h.

References Parent.

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::SparcRegisterInfo::eliminateFrameIndex(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::IA64RegisterInfo::eliminateFrameIndex(), llvm::ARMRegisterInfo::eliminateFrameIndex(), llvm::AlphaRegisterInfo::eliminateFrameIndex(), getFirstTerminator(), llvm::SelectionDAGLowering::GetRegistersForValue(), HandleVRSaveUpdate(), llvm::operator<<(), print(), RemoveVRSaveCode(), llvm::X86InstrInfo::reverseBranchCondition(), llvm::ScheduleDAG::Run(), llvm::SelectionDAGLowering::visitAlloca(), llvm::SelectionDAGLowering::visitBr(), llvm::SelectionDAGLowering::visitSwitch(), and llvm::SelectionDAGLowering::visitSwitchCase().

MachineFunction* llvm::MachineBasicBlock::getParent (  )  [inline]

Definition at line 87 of file MachineBasicBlock.h.

References Parent.

unsigned llvm::MachineBasicBlock::size (  )  const [inline]

Definition at line 94 of file MachineBasicBlock.h.

References Insts.

bool llvm::MachineBasicBlock::empty (  )  const [inline]

Definition at line 95 of file MachineBasicBlock.h.

References Insts.

Referenced by llvm::LiveVariables::runOnMachineFunction().

MachineInstr& llvm::MachineBasicBlock::front (  )  [inline]

Definition at line 97 of file MachineBasicBlock.h.

References Insts.

MachineInstr& llvm::MachineBasicBlock::back (  )  [inline]

Definition at line 98 of file MachineBasicBlock.h.

References Insts.

Referenced by llvm::LiveVariables::runOnMachineFunction().

iterator llvm::MachineBasicBlock::begin (  )  [inline]

Definition at line 100 of file MachineBasicBlock.h.

References Insts.

Referenced by llvm::X86RegisterInfo::emitEpilogue(), llvm::X86RegisterInfo::emitPrologue(), llvm::SparcRegisterInfo::emitPrologue(), llvm::PPCRegisterInfo::emitPrologue(), llvm::IA64RegisterInfo::emitPrologue(), llvm::ARMRegisterInfo::emitPrologue(), llvm::AlphaRegisterInfo::emitPrologue(), getFirstTerminator(), print(), RemoveVRSaveCode(), llvm::SelectionDAGISel::runOnFunction(), and llvm::LiveVariables::runOnMachineFunction().

const_iterator llvm::MachineBasicBlock::begin (  )  const [inline]

Definition at line 101 of file MachineBasicBlock.h.

References Insts.

iterator llvm::MachineBasicBlock::end (  )  [inline]

Definition at line 102 of file MachineBasicBlock.h.

References Insts.

Referenced by llvm::X86RegisterInfo::emitEpilogue(), llvm::SparcRegisterInfo::emitEpilogue(), llvm::PPCRegisterInfo::emitEpilogue(), llvm::IA64RegisterInfo::emitEpilogue(), llvm::ARMRegisterInfo::emitEpilogue(), llvm::AlphaRegisterInfo::emitEpilogue(), llvm::ScheduleDAG::EmitNode(), llvm::ScheduleDAG::EmitNoop(), llvm::PPCRegisterInfo::emitPrologue(), llvm::IA64RegisterInfo::emitPrologue(), getFirstTerminator(), llvm::X86InstrInfo::insertGoto(), print(), RemoveVRSaveCode(), llvm::SelectionDAGISel::runOnFunction(), and llvm::LiveVariables::runOnMachineFunction().

const_iterator llvm::MachineBasicBlock::end (  )  const [inline]

Definition at line 103 of file MachineBasicBlock.h.

References Insts.

reverse_iterator llvm::MachineBasicBlock::rbegin (  )  [inline]

Definition at line 104 of file MachineBasicBlock.h.

References Insts.

const_reverse_iterator llvm::MachineBasicBlock::rbegin (  )  const [inline]

Definition at line 105 of file MachineBasicBlock.h.

References Insts.

reverse_iterator llvm::MachineBasicBlock::rend (  )  [inline]

Definition at line 106 of file MachineBasicBlock.h.

References Insts.

const_reverse_iterator llvm::MachineBasicBlock::rend (  )  const [inline]

Definition at line 107 of file MachineBasicBlock.h.

References Insts.

pred_iterator llvm::MachineBasicBlock::pred_begin (  )  [inline]

Definition at line 115 of file MachineBasicBlock.h.

References Predecessors.

Referenced by llvm::GraphTraits< Inverse< const MachineBasicBlock * > >::child_begin(), llvm::GraphTraits< Inverse< MachineBasicBlock * > >::child_begin(), llvm::LiveVariables::HandleVirtRegUse(), and llvm::LiveVariables::MarkVirtRegAliveInBlock().

const_pred_iterator llvm::MachineBasicBlock::pred_begin (  )  const [inline]

Definition at line 116 of file MachineBasicBlock.h.

References Predecessors.

pred_iterator llvm::MachineBasicBlock::pred_end (  )  [inline]

Definition at line 117 of file MachineBasicBlock.h.

References Predecessors.

Referenced by llvm::GraphTraits< Inverse< const MachineBasicBlock * > >::child_end(), llvm::GraphTraits< Inverse< MachineBasicBlock * > >::child_end(), llvm::LiveVariables::HandleVirtRegUse(), and llvm::LiveVariables::MarkVirtRegAliveInBlock().

const_pred_iterator llvm::MachineBasicBlock::pred_end (  )  const [inline]

Definition at line 118 of file MachineBasicBlock.h.

References Predecessors.

unsigned llvm::MachineBasicBlock::pred_size (  )  const [inline]

Definition at line 119 of file MachineBasicBlock.h.

References Predecessors.

bool llvm::MachineBasicBlock::pred_empty (  )  const [inline]

Definition at line 120 of file MachineBasicBlock.h.

References Predecessors.

succ_iterator llvm::MachineBasicBlock::succ_begin (  )  [inline]

Definition at line 121 of file MachineBasicBlock.h.

References Successors.

Referenced by llvm::GraphTraits< const MachineBasicBlock * >::child_begin(), llvm::GraphTraits< MachineBasicBlock * >::child_begin(), print(), and llvm::LiveVariables::runOnMachineFunction().

const_succ_iterator llvm::MachineBasicBlock::succ_begin (  )  const [inline]

Definition at line 122 of file MachineBasicBlock.h.

References Successors.

succ_iterator llvm::MachineBasicBlock::succ_end (  )  [inline]

Definition at line 123 of file MachineBasicBlock.h.

References Successors.

Referenced by llvm::GraphTraits< const MachineBasicBlock * >::child_end(), llvm::GraphTraits< MachineBasicBlock * >::child_end(), print(), and llvm::LiveVariables::runOnMachineFunction().

const_succ_iterator llvm::MachineBasicBlock::succ_end (  )  const [inline]

Definition at line 124 of file MachineBasicBlock.h.

References Successors.

unsigned llvm::MachineBasicBlock::succ_size (  )  const [inline]

Definition at line 125 of file MachineBasicBlock.h.

References Successors.

bool llvm::MachineBasicBlock::succ_empty (  )  const [inline]

Definition at line 126 of file MachineBasicBlock.h.

References Successors.

Referenced by print().

void MachineBasicBlock::addSuccessor ( MachineBasicBlock succ  ) 

addSuccessor - Add succ as a successor of this MachineBasicBlock. The Predecessors list of succ is automatically updated.

Definition at line 114 of file MachineBasicBlock.cpp.

References addPredecessor(), and Successors.

Referenced by llvm::X86TargetLowering::InsertAtEndOfBasicBlock(), llvm::PPCTargetLowering::InsertAtEndOfBasicBlock(), llvm::SelectionDAGLowering::visitBr(), llvm::SelectionDAGLowering::visitSwitch(), and llvm::SelectionDAGLowering::visitSwitchCase().

void MachineBasicBlock::removeSuccessor ( MachineBasicBlock succ  ) 

removeSuccessor - Remove successor from the successors list of this MachineBasicBlock. The Predecessors list of succ is automatically updated.

Definition at line 119 of file MachineBasicBlock.cpp.

References removePredecessor(), and Successors.

void MachineBasicBlock::removeSuccessor ( succ_iterator  I  ) 

removeSuccessor - Remove specified successor from the successors list of this MachineBasicBlock. The Predecessors list of succ is automatically updated.

Definition at line 126 of file MachineBasicBlock.cpp.

References Successors.

MachineBasicBlock::iterator MachineBasicBlock::getFirstTerminator (  ) 

getFirstTerminator - returns an iterator to the first terminator instruction of this basic block. If a terminator does not exist, it returns end()

Definition at line 77 of file MachineBasicBlock.cpp.

References begin(), end(), llvm::TargetMachine::getInstrInfo(), getParent(), llvm::MachineFunction::getTarget(), llvm::TargetInstrInfo::isTerminatorInstr(), and TII.

void llvm::MachineBasicBlock::pop_front (  )  [inline]

Definition at line 151 of file MachineBasicBlock.h.

References Insts.

void llvm::MachineBasicBlock::pop_back (  )  [inline]

Definition at line 152 of file MachineBasicBlock.h.

References Insts.

void llvm::MachineBasicBlock::push_back ( MachineInstr MI  )  [inline]

Definition at line 153 of file MachineBasicBlock.h.

References Insts, and MI.

Referenced by llvm::MachineInstr::MachineInstr().

template<typename IT>
void llvm::MachineBasicBlock::insert ( iterator  I,
IT  S,
IT  E 
) [inline]

Definition at line 155 of file MachineBasicBlock.h.

References Insts.

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), llvm::X86RegisterInfo::eliminateCallFramePseudoInstr(), llvm::IA64RegisterInfo::eliminateCallFramePseudoInstr(), llvm::AlphaRegisterInfo::eliminateCallFramePseudoInstr(), llvm::IA64RegisterInfo::eliminateFrameIndex(), llvm::AlphaRegisterInfo::eliminateFrameIndex(), llvm::IA64RegisterInfo::emitEpilogue(), llvm::ScheduleDAG::EmitNode(), llvm::X86RegisterInfo::emitPrologue(), and llvm::IA64RegisterInfo::emitPrologue().

iterator llvm::MachineBasicBlock::insert ( iterator  I,
MachineInstr M 
) [inline]

Definition at line 156 of file MachineBasicBlock.h.

References Insts, and M.

iterator llvm::MachineBasicBlock::erase ( iterator  I  )  [inline]

Definition at line 161 of file MachineBasicBlock.h.

References Insts.

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), llvm::X86RegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPCRegisterInfo::eliminateCallFramePseudoInstr(), llvm::IA64RegisterInfo::eliminateCallFramePseudoInstr(), llvm::ARMRegisterInfo::eliminateCallFramePseudoInstr(), llvm::AlphaRegisterInfo::eliminateCallFramePseudoInstr(), llvm::X86RegisterInfo::emitEpilogue(), and llvm::X86InstrInfo::reverseBranchCondition().

iterator llvm::MachineBasicBlock::erase ( iterator  I,
iterator  E 
) [inline]

Definition at line 162 of file MachineBasicBlock.h.

References Insts.

MachineInstr* llvm::MachineBasicBlock::remove ( MachineInstr I  )  [inline]

Definition at line 163 of file MachineBasicBlock.h.

References Insts.

Referenced by llvm::MachineInstr::removeFromParent().

void llvm::MachineBasicBlock::clear (  )  [inline]

Definition at line 164 of file MachineBasicBlock.h.

References Insts.

void llvm::MachineBasicBlock::splice ( iterator  where,
MachineBasicBlock Other,
iterator  From,
iterator  To 
) [inline]

splice - Take a block of instructions from MBB 'Other' in the range [From, To), and insert them into this MBB right before 'where'.

Definition at line 168 of file MachineBasicBlock.h.

References Insts, and llvm::MVT::Other.

void MachineBasicBlock::dump (  )  const

Definition at line 85 of file MachineBasicBlock.cpp.

References print().

void MachineBasicBlock::print ( std::ostream &  OS  )  const

Definition at line 89 of file MachineBasicBlock.cpp.

References begin(), E, end(), getBasicBlock(), llvm::Value::getName(), getParent(), llvm::BasicBlock::print(), succ_begin(), succ_empty(), and succ_end().

Referenced by dump().

int llvm::MachineBasicBlock::getNumber (  )  const [inline]

getNumber - MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFunction yet, in which case this will return -1.

Definition at line 181 of file MachineBasicBlock.h.

References Number.

Referenced by llvm::LiveVariables::MarkVirtRegAliveInBlock(), llvm::AsmPrinter::printBasicBlockLabel(), and llvm::LiveVariables::runOnMachineFunction().


Friends And Related Function Documentation

friend struct ilist_traits< MachineBasicBlock > [friend]

Definition at line 184 of file MachineBasicBlock.h.


Member Data Documentation

Instructions llvm::MachineBasicBlock::Insts

Definition at line 63 of file MachineBasicBlock.h.

Referenced by back(), begin(), clear(), empty(), end(), erase(), front(), insert(), MachineBasicBlock(), pop_back(), pop_front(), push_back(), rbegin(), remove(), rend(), size(), and splice().

MachineBasicBlock* llvm::MachineBasicBlock::Prev

Definition at line 64 of file MachineBasicBlock.h.

Referenced by llvm::ilist_traits< MachineBasicBlock >::getPrev(), and llvm::ilist_traits< MachineBasicBlock >::setPrev().

MachineBasicBlock * llvm::MachineBasicBlock::Next

Definition at line 64 of file MachineBasicBlock.h.

Referenced by llvm::ilist_traits< MachineBasicBlock >::getNext(), and llvm::ilist_traits< MachineBasicBlock >::setNext().

const BasicBlock* llvm::MachineBasicBlock::BB

Definition at line 65 of file MachineBasicBlock.h.

Referenced by getBasicBlock().

std::vector<MachineBasicBlock *> llvm::MachineBasicBlock::Predecessors

Definition at line 66 of file MachineBasicBlock.h.

Referenced by pred_begin(), pred_empty(), pred_end(), and pred_size().

std::vector<MachineBasicBlock *> llvm::MachineBasicBlock::Successors

Definition at line 67 of file MachineBasicBlock.h.

Referenced by addSuccessor(), removeSuccessor(), succ_begin(), succ_empty(), succ_end(), and succ_size().

int llvm::MachineBasicBlock::Number

Definition at line 68 of file MachineBasicBlock.h.

Referenced by getNumber().

MachineFunction* llvm::MachineBasicBlock::Parent

Definition at line 69 of file MachineBasicBlock.h.

Referenced by getParent().


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