mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Add a LiveVariables::VarInfo::dump method
llvm-svn: 25080
This commit is contained in:
parent
16d652bfff
commit
f00c43e105
@ -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!");
|
||||
|
Loading…
Reference in New Issue
Block a user