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::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 59 of file MachineBasicBlock.h.


Member Typedef Documentation

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

Definition at line 89 of file MachineBasicBlock.h.

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

Definition at line 110 of file MachineBasicBlock.h.

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

Definition at line 90 of file MachineBasicBlock.h.

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

Definition at line 112 of file MachineBasicBlock.h.

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

Definition at line 61 of file MachineBasicBlock.h.

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

Definition at line 88 of file MachineBasicBlock.h.

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

Definition at line 109 of file MachineBasicBlock.h.

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

Definition at line 91 of file MachineBasicBlock.h.

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

Definition at line 111 of file MachineBasicBlock.h.


Constructor & Destructor Documentation

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

Definition at line 71 of file MachineBasicBlock.h.

References Insts.

MachineBasicBlock::~MachineBasicBlock  ) 
 

Definition at line 25 of file MachineBasicBlock.cpp.

References llvm::LeakDetector::removeGarbageObject().


Member Function Documentation

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 105 of file MachineBasicBlock.cpp.

References addPredecessor(), and Successors.

Referenced by ReplaceUsesOfBlockWith().

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

Definition at line 97 of file MachineBasicBlock.h.

References Insts.

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

Definition at line 100 of file MachineBasicBlock.h.

References Insts.

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

Definition at line 99 of file MachineBasicBlock.h.

References Insts.

Referenced by llvm::ChooseInstructionsForDelaySlots(), llvm::LiveRangeInfo::coalesceLRs(), llvm::LiveRangeInfo::constructLiveRanges(), llvm::DeleteInstruction(), llvm::X86RegisterInfo::emitPrologue(), llvm::PPC64RegisterInfo::emitPrologue(), llvm::PPC32RegisterInfo::emitPrologue(), getFirstTerminator(), print(), llvm::RecordSchedule(), llvm::ReplaceNopsWithUsefulInstr(), ReplaceUsesOfBlockWith(), llvm::PeepholeOpts::runOnBasicBlock(), llvm::LiveVariables::runOnMachineFunction(), and llvm::LiveIntervals::runOnMachineFunction().

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

Definition at line 163 of file MachineBasicBlock.h.

References Insts.

void MachineBasicBlock::dump  )  const
 

Definition at line 84 of file MachineBasicBlock.cpp.

References print().

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

Definition at line 94 of file MachineBasicBlock.h.

References Insts.

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

Definition at line 102 of file MachineBasicBlock.h.

References Insts.

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

Definition at line 101 of file MachineBasicBlock.h.

References Insts.

Referenced by llvm::BuildMI(), llvm::ChooseInstructionsForDelaySlots(), llvm::LiveRangeInfo::coalesceLRs(), llvm::LiveRangeInfo::constructLiveRanges(), llvm::DeleteInstruction(), llvm::X86RegisterInfo::emitEpilogue(), llvm::PPC64RegisterInfo::emitEpilogue(), llvm::PPC32RegisterInfo::emitEpilogue(), getFirstTerminator(), llvm::X86InstrInfo::insertGoto(), print(), llvm::RecordSchedule(), ReplaceUsesOfBlockWith(), llvm::PeepholeOpts::runOnBasicBlock(), llvm::LiveVariables::runOnMachineFunction(), and llvm::LiveIntervals::runOnMachineFunction().

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

Definition at line 161 of file MachineBasicBlock.h.

References Insts.

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

Definition at line 160 of file MachineBasicBlock.h.

References Insts.

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), llvm::DeleteInstruction(), llvm::X86RegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPC64RegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPC32RegisterInfo::eliminateCallFramePseudoInstr(), and llvm::X86InstrInfo::reverseBranchCondition().

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

Definition at line 96 of file MachineBasicBlock.h.

References Insts.

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

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

Definition at line 81 of file MachineBasicBlock.h.

References BB.

Referenced by llvm::ChooseInstructionsForDelaySlots(), llvm::SchedGraph::dump(), llvm::DOTGraphTraits< const MachineFunction * >::getNodeLabel(), llvm::operator<<(), print(), print(), llvm::ReplaceNopsWithUsefulInstr(), RequiresFPRegKill(), and llvm::LiveIntervals::runOnMachineFunction().

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 76 of file MachineBasicBlock.cpp.

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

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 180 of file MachineBasicBlock.h.

References Number.

Referenced by llvm::DOTGraphTraits< const MachineFunction * >::getNodeLabel(), llvm::LiveVariables::MarkVirtRegAliveInBlock(), and llvm::LiveVariables::runOnMachineFunction().

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

Definition at line 86 of file MachineBasicBlock.h.

References Parent.

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

getParent - Return the MachineFunction containing this basic block.

Definition at line 85 of file MachineBasicBlock.h.

References Parent.

Referenced by llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::PPC64RegisterInfo::eliminateFrameIndex(), llvm::PPC32RegisterInfo::eliminateFrameIndex(), getFirstTerminator(), print(), and ReplaceUsesOfBlockWith().

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

Definition at line 155 of file MachineBasicBlock.h.

References Insts.

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

Definition at line 154 of file MachineBasicBlock.h.

References Insts.

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), llvm::BuildMI(), llvm::X86RegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPC64RegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPC32RegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPC64RegisterInfo::eliminateFrameIndex(), llvm::PPC32RegisterInfo::eliminateFrameIndex(), llvm::X86RegisterInfo::emitEpilogue(), llvm::PPC64RegisterInfo::emitEpilogue(), llvm::PPC32RegisterInfo::emitEpilogue(), llvm::X86RegisterInfo::emitPrologue(), llvm::PPC64RegisterInfo::emitPrologue(), llvm::PPC32RegisterInfo::emitPrologue(), llvm::InsertAfter(), and llvm::InsertBefore().

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

Definition at line 151 of file MachineBasicBlock.h.

References Insts.

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

Definition at line 150 of file MachineBasicBlock.h.

References Insts.

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

Definition at line 115 of file MachineBasicBlock.h.

References Predecessors.

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

Definition at line 114 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().

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

Definition at line 119 of file MachineBasicBlock.h.

References Predecessors.

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

Definition at line 117 of file MachineBasicBlock.h.

References Predecessors.

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

Definition at line 116 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().

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

Definition at line 118 of file MachineBasicBlock.h.

References Predecessors.

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

Definition at line 88 of file MachineBasicBlock.cpp.

References begin(), end(), getBasicBlock(), llvm::Value::getName(), getParent(), and I.

Referenced by dump(), and llvm::DOTGraphTraits< const MachineFunction * >::getNodeLabel().

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

Definition at line 152 of file MachineBasicBlock.h.

References Insts.

Referenced by llvm::MachineInstr::MachineInstr(), and llvm::RecordSchedule().

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

Definition at line 104 of file MachineBasicBlock.h.

References Insts.

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

Definition at line 103 of file MachineBasicBlock.h.

References Insts.

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

Definition at line 162 of file MachineBasicBlock.h.

References Insts.

Referenced by llvm::RecordSchedule().

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 117 of file MachineBasicBlock.cpp.

References Successors.

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 110 of file MachineBasicBlock.cpp.

References I, removePredecessor(), and Successors.

Referenced by ReplaceUsesOfBlockWith().

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

Definition at line 106 of file MachineBasicBlock.h.

References Insts.

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

Definition at line 105 of file MachineBasicBlock.h.

References Insts.

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

Definition at line 93 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 167 of file MachineBasicBlock.h.

References Insts.

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

Definition at line 121 of file MachineBasicBlock.h.

References Successors.

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

Definition at line 120 of file MachineBasicBlock.h.

References Successors.

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

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

Definition at line 125 of file MachineBasicBlock.h.

References Successors.

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

Definition at line 123 of file MachineBasicBlock.h.

References Successors.

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

Definition at line 122 of file MachineBasicBlock.h.

References Successors.

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

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

Definition at line 124 of file MachineBasicBlock.h.

References Successors.


Friends And Related Function Documentation

friend struct ilist_traits< MachineBasicBlock > [friend]
 

Definition at line 183 of file MachineBasicBlock.h.


Member Data Documentation

const BasicBlock* llvm::MachineBasicBlock::BB
 

Definition at line 64 of file MachineBasicBlock.h.

Referenced by getBasicBlock().

Instructions llvm::MachineBasicBlock::Insts
 

Definition at line 62 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::Next
 

Definition at line 63 of file MachineBasicBlock.h.

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

int llvm::MachineBasicBlock::Number
 

Definition at line 67 of file MachineBasicBlock.h.

Referenced by getNumber().

MachineFunction* llvm::MachineBasicBlock::Parent
 

Definition at line 68 of file MachineBasicBlock.h.

Referenced by getParent().

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

Definition at line 65 of file MachineBasicBlock.h.

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

MachineBasicBlock* llvm::MachineBasicBlock::Prev
 

Definition at line 63 of file MachineBasicBlock.h.

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

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

Definition at line 66 of file MachineBasicBlock.h.

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


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