aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-31 22:34:59 +0000
committerChris Lattner <sabre@nondot.org>2005-08-31 22:34:59 +0000
commita1f68ca94e763945f9accc75768a55a84bae6cfb (patch)
treeb9528c607e699627e550e6f0af5508bd0617b3a7 /lib/CodeGen/MachineFunction.cpp
parentf76053269ecc6c7bd3d0b1e90ebdd0cef1bb2bdc (diff)
downloadexternal_llvm-a1f68ca94e763945f9accc75768a55a84bae6cfb.zip
external_llvm-a1f68ca94e763945f9accc75768a55a84bae6cfb.tar.gz
external_llvm-a1f68ca94e763945f9accc75768a55a84bae6cfb.tar.bz2
If a function has live ins/outs, print them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23181 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineFunction.cpp')
-rw-r--r--lib/CodeGen/MachineFunction.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp
index aa3226b..2e3088c 100644
--- a/lib/CodeGen/MachineFunction.cpp
+++ b/lib/CodeGen/MachineFunction.cpp
@@ -134,7 +134,29 @@ void MachineFunction::print(std::ostream &OS) const {
// Print Constant Pool
getConstantPool()->print(OS);
-
+
+ const MRegisterInfo *MRI = getTarget().getRegisterInfo();
+
+ if (livein_begin() != livein_end()) {
+ OS << "Live Ins:";
+ for (livein_iterator I = livein_begin(), E = livein_end(); I != E; ++I) {
+ if (MRI)
+ OS << " " << MRI->getName(I->first);
+ else
+ OS << " Reg #" << I->first;
+ }
+ OS << "\n";
+ }
+ if (liveout_begin() != liveout_end()) {
+ OS << "Live Outs:";
+ for (liveout_iterator I = liveout_begin(), E = liveout_end(); I != E; ++I)
+ if (MRI)
+ OS << " " << MRI->getName(*I);
+ else
+ OS << " Reg #" << *I;
+ OS << "\n";
+ }
+
for (const_iterator BB = begin(); BB != end(); ++BB)
BB->print(OS);