diff options
author | Chris Lattner <sabre@nondot.org> | 2006-01-04 05:40:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-01-04 05:40:30 +0000 |
commit | dacceef2666d37eb984c6f5e0a84cdabab8dfffc (patch) | |
tree | 360abc17a34c0c671a2e24c710c8ef4ddeda4cb0 /lib/CodeGen/LiveVariables.cpp | |
parent | 0df687b1be4a29e0358e6e8710f0c71d5966c43a (diff) |
Add a LiveVariables::VarInfo::dump method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25080 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index a1bda195ff..c85d40b04f 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -35,10 +35,30 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/Config/alloca.h" #include <algorithm> +#include <iostream> using namespace llvm; static RegisterAnalysis<LiveVariables> X("livevars", "Live Variable Analysis"); +void LiveVariables::VarInfo::dump() const { + std::cerr << "Register Defined by: "; + if (DefInst) + std::cerr << *DefInst; + else + std::cerr << "<null>\n"; + std::cerr << " Alive in blocks: "; + for (unsigned i = 0, e = AliveBlocks.size(); i != e; ++i) + if (AliveBlocks[i]) std::cerr << i << ", "; + std::cerr << "\n Killed by:"; + if (Kills.empty()) + std::cerr << " No instructions.\n"; + else { + for (unsigned i = 0, e = Kills.size(); i != e; ++i) + std::cerr << "\n #" << i << ": " << *Kills[i]; + std::cerr << "\n"; + } +} + LiveVariables::VarInfo &LiveVariables::getVarInfo(unsigned RegIdx) { assert(MRegisterInfo::isVirtualRegister(RegIdx) && "getVarInfo: not a virtual register!"); |