summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveVariables.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-04 05:40:30 +0000
committerChris Lattner <sabre@nondot.org>2006-01-04 05:40:30 +0000
commitbe45b5e9484421c4620bd1e42f8cbf0b9bb76b1e (patch)
tree554d4d4f83d68103cecc7e535286b5f889135137 /llvm/lib/CodeGen/LiveVariables.cpp
parentd4f11f2209ea3c6a37b5346445dbbbb5eddc4dbb (diff)
downloadbcm5719-llvm-be45b5e9484421c4620bd1e42f8cbf0b9bb76b1e.tar.gz
bcm5719-llvm-be45b5e9484421c4620bd1e42f8cbf0b9bb76b1e.zip
Add a LiveVariables::VarInfo::dump method
llvm-svn: 25080
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index a1bda195ff6..c85d40b04f0 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/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!");
OpenPOWER on IntegriCloud