summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-02-13 04:39:55 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-02-13 04:39:55 +0000
commit90421cd8f982b4fe38d8f5992423e4f63074869f (patch)
tree4ca710ebbb7312db9c46912809496e36caba25a4
parent21326fc2ad47ee7e73a8c0b03a4a0cc0b0a0c4e8 (diff)
downloadllvm-90421cd8f982b4fe38d8f5992423e4f63074869f.tar.gz
llvm-90421cd8f982b4fe38d8f5992423e4f63074869f.tar.bz2
llvm-90421cd8f982b4fe38d8f5992423e4f63074869f.tar.xz
Refactor MachineFunction::print() into MachineBasicBlock::print().
Add MachineBasicBlock::dump(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11364 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/MachineFunction.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp
index 4de55f4596..645e7cfedf 100644
--- a/lib/CodeGen/MachineFunction.cpp
+++ b/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.