diff options
author | Devang Patel <dpatel@apple.com> | 2009-10-06 01:26:37 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-10-06 01:26:37 +0000 |
commit | e717faa467538a6e86c3f651382af3ec2759d43a (patch) | |
tree | e9696ae051212c861d1e9ddcf95cc419feed9229 /lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | ea5ed00ea34fd3c687dd0fac9fd483d0174438e3 (diff) |
Add utility routine to collect variable debug info. This is not yet used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83355 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 149da04810..89995afcd6 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/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) { |