[llvm-commits] [llvm] r83355 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfDebug.cpp DwarfDebug.h
Devang Patel
dpatel at apple.com
Mon Oct 5 18:26:37 PDT 2009
Author: dpatel
Date: Mon Oct 5 20:26:37 2009
New Revision: 83355
URL: http://llvm.org/viewvc/llvm-project?rev=83355&view=rev
Log:
Add utility routine to collect variable debug info. This is not yet used.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=83355&r1=83354&r2=83355&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Oct 5 20:26:37 2009
@@ -1782,6 +1782,20 @@
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) {
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=83355&r1=83354&r2=83355&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Mon Oct 5 20:26:37 2009
@@ -560,6 +560,9 @@
/// 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);
};
More information about the llvm-commits
mailing list