aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2009-07-21 18:27:05 +0000
committerDavid Greene <greened@obbligato.org>2009-07-21 18:27:05 +0000
commitb528d7627c5aa90478e8ae756fabc1d2a61f79d9 (patch)
treef37f654f34a94e403bfd52903afdce872ea759dd /lib/CodeGen
parent8523046f097df6e65d188ca942bdb2ad66071453 (diff)
downloadexternal_llvm-b528d7627c5aa90478e8ae756fabc1d2a61f79d9.zip
external_llvm-b528d7627c5aa90478e8ae756fabc1d2a61f79d9.tar.gz
external_llvm-b528d7627c5aa90478e8ae756fabc1d2a61f79d9.tar.bz2
Add PrefixPrinter arguments to the dump routines for MachineFunction and
MachineBasicBlock. We'll use these shortly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76603 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/MachineBasicBlock.cpp4
-rw-r--r--lib/CodeGen/MachineFunction.cpp9
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp
index 71e6b3e..82ff769 100644
--- a/lib/CodeGen/MachineBasicBlock.cpp
+++ b/lib/CodeGen/MachineBasicBlock.cpp
@@ -148,7 +148,8 @@ static inline void OutputReg(std::ostream &os, unsigned RegNo,
os << " %reg" << RegNo;
}
-void MachineBasicBlock::print(std::ostream &OS) const {
+void MachineBasicBlock::print(std::ostream &OS,
+ const PrefixPrinter &prefix) const {
const MachineFunction *MF = getParent();
if(!MF) {
OS << "Can't print out MachineBasicBlock because parent MachineFunction"
@@ -181,6 +182,7 @@ void MachineBasicBlock::print(std::ostream &OS) const {
}
for (const_iterator I = begin(); I != end(); ++I) {
+ OS << prefix(*I);
OS << "\t";
I->print(OS, &getParent()->getTarget());
}
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp
index 599efb8..324e3a5 100644
--- a/lib/CodeGen/MachineFunction.cpp
+++ b/lib/CodeGen/MachineFunction.cpp
@@ -252,7 +252,8 @@ void MachineFunction::dump() const {
print(*cerr.stream());
}
-void MachineFunction::print(std::ostream &OS) const {
+void MachineFunction::print(std::ostream &OS,
+ const PrefixPrinter &prefix) const {
OS << "# Machine code for " << Fn->getName () << "():\n";
// Print Frame Information
@@ -294,8 +295,10 @@ void MachineFunction::print(std::ostream &OS) const {
OS << "\n";
}
- for (const_iterator BB = begin(); BB != end(); ++BB)
- BB->print(OS);
+ for (const_iterator BB = begin(); BB != end(); ++BB) {
+ OS << prefix(*BB);
+ BB->print(OS, prefix);
+ }
OS << "\n# End machine code for " << Fn->getName () << "().\n\n";
}