diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-31 22:34:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-31 22:34:59 +0000 |
commit | d4d10fff990e47327662a9065770e4ff848f1135 (patch) | |
tree | 9b9a3deb6adc14afa49a80588de7f090084f7f94 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | da2e04c69d4e38101e12f6d9f37e607e0edb21b3 (diff) | |
download | bcm5719-llvm-d4d10fff990e47327662a9065770e4ff848f1135.tar.gz bcm5719-llvm-d4d10fff990e47327662a9065770e4ff848f1135.zip |
If a function has live ins/outs, print them
llvm-svn: 23181
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index aa3226bbf22..2e3088c7e3b 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/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); |