summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-10-06 01:26:37 +0000
committerDevang Patel <dpatel@apple.com>2009-10-06 01:26:37 +0000
commit475d32a987538df6f128a5c19372dcd8d9649c23 (patch)
tree2f58ab6cbb4f55cb1e42ebf3650e4fd11d97156c /llvm/lib/CodeGen/AsmPrinter
parente97fe329e9cf82a11754eeb91bd52527c9080f45 (diff)
downloadbcm5719-llvm-475d32a987538df6f128a5c19372dcd8d9649c23.tar.gz
bcm5719-llvm-475d32a987538df6f128a5c19372dcd8d9649c23.zip
Add utility routine to collect variable debug info. This is not yet used.
llvm-svn: 83355
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp14
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 149da048108..89995afcd6d 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1782,6 +1782,20 @@ void DwarfDebug::EndModule() {
DebugTimer->stopTimer();
}
+/// CollectVariableInfo - Populate DbgScope entries with variables' info.
+void DwarfDebug::CollectVariableInfo() {
+ if (!MMI) return;
+ MachineModuleInfo::VariableDbgInfoMapTy &VMap = MMI->getVariableDbgInfo();
+ for (MachineModuleInfo::VariableDbgInfoMapTy::iterator VI = VMap.begin(),
+ VE = VMap.end(); VI != VE; ++VI) {
+ MDNode *Var = VI->first;
+ DILocation VLoc(VI->second.first);
+ unsigned VSlot = VI->second.second;
+ DbgScope *Scope = getDbgScope(VLoc.getScope().getNode(), NULL);
+ Scope->AddVariable(new DbgVariable(DIVariable(Var), VSlot, false));
+ }
+}
+
/// ExtractScopeInformation - Scan machine instructions in this function
/// and collect DbgScopes. Return true, if atleast one scope was found.
bool DwarfDebug::ExtractScopeInformation(MachineFunction *MF) {
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 2947d76d703..1bb6906ed3a 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -560,6 +560,9 @@ public:
/// and collect DbgScopes. Return true, if atleast one scope was found.
bool ExtractScopeInformation(MachineFunction *MF);
+ /// CollectVariableInfo - Populate DbgScope entries with variables' info.
+ void CollectVariableInfo();
+
void SetDbgScopeLabels(const MachineInstr *MI, unsigned Label);
};
OpenPOWER on IntegriCloud