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 | |
parent | ea5ed00ea34fd3c687dd0fac9fd483d0174438e3 (diff) | |
download | external_llvm-e717faa467538a6e86c3f651382af3ec2759d43a.zip external_llvm-e717faa467538a6e86c3f651382af3ec2759d43a.tar.gz external_llvm-e717faa467538a6e86c3f651382af3ec2759d43a.tar.bz2 |
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')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 14 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.h | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 149da04..89995af 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) { diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 2947d76..1bb6906 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/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); }; |