diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2004-02-13 04:39:55 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-02-13 04:39:55 +0000 |
commit | 52440fd481f27d1feb8f77dfca8b1fa8aecfb2e2 (patch) | |
tree | b3e017c524d77ceea8919996c67fe88277f324c6 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | e8f7c2f8634d3899cdca8e4b1afcbf15344290a0 (diff) | |
download | llvm-52440fd481f27d1feb8f77dfca8b1fa8aecfb2e2.zip llvm-52440fd481f27d1feb8f77dfca8b1fa8aecfb2e2.tar.gz llvm-52440fd481f27d1feb8f77dfca8b1fa8aecfb2e2.tar.bz2 |
Refactor MachineFunction::print() into MachineBasicBlock::print().
Add MachineBasicBlock::dump().
llvm-svn: 11364
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 4de55f4..645e7cf 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -94,17 +94,21 @@ void MachineFunction::print(std::ostream &OS) const { // Print Constant Pool getConstantPool()->print(OS); - for (const_iterator BB = begin(); BB != end(); ++BB) { - const BasicBlock *LBB = BB->getBasicBlock(); - OS << "\n" << LBB->getName() << " (" << (const void*)LBB << "):\n"; - for (MachineBasicBlock::const_iterator I = BB->begin(); I != BB->end();++I){ - OS << "\t"; - I->print(OS, Target); - } - } + for (const_iterator BB = begin(); BB != end(); ++BB) + BB->print(OS); OS << "\nEnd function \"" << Fn->getName() << "\"\n\n"; } +void MachineBasicBlock::dump() const { print(std::cerr); } + +void MachineBasicBlock::print(std::ostream &OS) const { + const BasicBlock *LBB = getBasicBlock(); + OS << "\n" << LBB->getName() << " (" << (const void*)LBB << "):\n"; + for (const_iterator I = begin(); I != end(); ++I) { + OS << "\t"; + I->print(OS, MachineFunction::get(LBB->getParent()).getTarget()); + } +} // The next two methods are used to construct and to retrieve // the MachineCodeForFunction object for the given function. |