diff options
| author | Devang Patel <dpatel@apple.com> | 2009-10-06 01:50:42 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2009-10-06 01:50:42 +0000 |
| commit | 393a46deb66be6885fd064a38e650bed859af5a1 (patch) | |
| tree | 0c549b7feac8de70db0e1d87a799c3141f19d414 /lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
| parent | 77354f12a0fd1882f4ec787e0a4309c2aaeae819 (diff) | |
| download | external_llvm-393a46deb66be6885fd064a38e650bed859af5a1.zip external_llvm-393a46deb66be6885fd064a38e650bed859af5a1.tar.gz external_llvm-393a46deb66be6885fd064a38e650bed859af5a1.tar.bz2 | |
Add utility routine to set begin and end labels for DbgScopes.
This will be used by processDebugLoc().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83361 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
| -rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 89995af..c727465 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1796,6 +1796,30 @@ void DwarfDebug::CollectVariableInfo() { } } +/// SetDbgScopeBeginLabels - Update DbgScope begin labels for the scopes that +/// start with this machine instruction. +void DwarfDebug::SetDbgScopeBeginLabels(const MachineInstr *MI, unsigned Label) { + InsnToDbgScopeMapTy::iterator I = DbgScopeBeginMap.find(MI); + if (I == DbgScopeBeginMap.end()) + return; + SmallVector<DbgScope *, 2> &SD = I->second; + for (SmallVector<DbgScope *, 2>::iterator SDI = SD.begin(), SDE = SD.end(); + SDI != SDE; ++SDI) + (*SDI)->setStartLabelID(Label); +} + +/// SetDbgScopeEndLabels - Update DbgScope end labels for the scopes that +/// end with this machine instruction. +void DwarfDebug::SetDbgScopeEndLabels(const MachineInstr *MI, unsigned Label) { + InsnToDbgScopeMapTy::iterator I = DbgScopeEndMap.find(MI); + if (I == DbgScopeBeginMap.end()) + return; + SmallVector<DbgScope *, 2> &SD = I->second; + for (SmallVector<DbgScope *, 2>::iterator SDI = SD.begin(), SDE = SD.end(); + SDI != SDE; ++SDI) + (*SDI)->setEndLabelID(Label); +} + /// ExtractScopeInformation - Scan machine instructions in this function /// and collect DbgScopes. Return true, if atleast one scope was found. bool DwarfDebug::ExtractScopeInformation(MachineFunction *MF) { |
