diff options
author | Devang Patel <dpatel@apple.com> | 2010-02-17 02:20:34 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-02-17 02:20:34 +0000 |
commit | 22fb4b2a5708c2987a04a823df98b6f9fda60d0c (patch) | |
tree | 66dc0d7ced7216b9b9d45213a3c5700835500739 /lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 785d16fe75a4ea0d465f2641f0a19033e0d9badc (diff) |
Before setting scope end marker, pay attention to scope begin marker and existing scope end marker, if any. Scope must begin before it ends and nested inlined scope do not truncate surrounding scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96445 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 5093dd9a9c..852c7ea640 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -238,7 +238,18 @@ public: LIndex = DSI; } } - setLastInsn(LastInsn); + + unsigned CurrentLastInsnIndex = 0; + if (const MachineInstr *CL = getLastInsn()) + CurrentLastInsnIndex = MIIndexMap[CL]; + unsigned FIndex = MIIndexMap[getFirstInsn()]; + + // Set LastInsn as the last instruction for this scope only if + // it follows + // 1) this scope's first instruction and + // 2) current last instruction for this scope, if any. + if (LIndex >= CurrentLastInsnIndex && LIndex >= FIndex) + setLastInsn(LastInsn); } #ifndef NDEBUG |