llvm.dbg.region.end() intrinsic is not required to be in _last_ basic block in a...
authorDevang Patel <dpatel@apple.com>
Sat, 13 Jun 2009 02:16:18 +0000 (02:16 +0000)
committerDevang Patel <dpatel@apple.com>
Sat, 13 Jun 2009 02:16:18 +0000 (02:16 +0000)
commitdaf9e02893e7e17ca2267ffd5e994f824adbb624
tree0428be7d3e8fdcac204f822bcc81c019f7ee13cd
parent7e0b551e2aeefd9b32810e14b8b27b6da3ec441e
llvm.dbg.region.end() intrinsic is not required to be in _last_ basic block in a function.  If that happens then any basic block that follows (lexically) the block with regin.end will not have scope info available.  LexicalScopeStack relies on processing basic block in CFG order, but this processing order is not guaranteed. Things get complicated when the optimizer gets a chance to optimizer IR with dbg intrinsics.
Apply defensive patch to preserve at least one lexical scope till the end of function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73282 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
test/DebugInfo/2009-06-12-InlineFuncStart.ll [new file with mode: 0644]