summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveDebugVariables.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-05-06 17:59:59 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-05-06 17:59:59 +0000
commitc86fe05923a31e8bc3ed7836e14199a84d775657 (patch)
treea991c0eb1dc59a1258283febb771c49547e8610b /llvm/lib/CodeGen/LiveDebugVariables.cpp
parent6cc4e4ddd0caac994e83c7353ccbfc2aadf8318b (diff)
downloadbcm5719-llvm-c86fe05923a31e8bc3ed7836e14199a84d775657.tar.gz
bcm5719-llvm-c86fe05923a31e8bc3ed7836e14199a84d775657.zip
Use TargetMachine hooks to properly print debug variable locations.
llvm-svn: 130997
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugVariables.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp
index 8b214831d2c..24b268a7f8e 100644
--- a/llvm/lib/CodeGen/LiveDebugVariables.cpp
+++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp
@@ -228,7 +228,7 @@ public:
/// Only first one needs DebugLoc to identify variable's lexical scope
/// in source file.
DebugLoc findDebugLoc();
- void print(raw_ostream&, const TargetRegisterInfo*);
+ void print(raw_ostream&, const TargetMachine*);
};
} // namespace
@@ -300,7 +300,7 @@ public:
};
} // namespace
-void UserValue::print(raw_ostream &OS, const TargetRegisterInfo *TRI) {
+void UserValue::print(raw_ostream &OS, const TargetMachine *TM) {
if (const MDString *MDS = dyn_cast<MDString>(variable->getOperand(2)))
OS << "!\"" << MDS->getString() << "\"\t";
if (offset)
@@ -312,15 +312,17 @@ void UserValue::print(raw_ostream &OS, const TargetRegisterInfo *TRI) {
else
OS << I.value();
}
- for (unsigned i = 0, e = locations.size(); i != e; ++i)
- OS << " Loc" << i << '=' << locations[i];
+ for (unsigned i = 0, e = locations.size(); i != e; ++i) {
+ OS << " Loc" << i << '=';
+ locations[i].print(OS, TM);
+ }
OS << '\n';
}
void LDVImpl::print(raw_ostream &OS) {
OS << "********** DEBUG VARIABLES **********\n";
for (unsigned i = 0, e = userValues.size(); i != e; ++i)
- userValues[i]->print(OS, TRI);
+ userValues[i]->print(OS, &MF->getTarget());
}
void UserValue::coalesceLocation(unsigned LocNo) {
@@ -701,7 +703,6 @@ UserValue::rewriteLocations(VirtRegMap &VRM, const TargetRegisterInfo &TRI) {
}
coalesceLocation(LocNo);
}
- DEBUG(print(dbgs(), &TRI));
}
/// findInsertLocation - Find an iterator for inserting a DBG_VALUE
OpenPOWER on IntegriCloud