OSDN Git Service

[DebugInfo] Fix bug in LiveDebugVariables.
authorHsiangkai Wang <hsiangkai@gmail.com>
Wed, 5 Sep 2018 05:58:53 +0000 (05:58 +0000)
committerHsiangkai Wang <hsiangkai@gmail.com>
Wed, 5 Sep 2018 05:58:53 +0000 (05:58 +0000)
commit10377f6858aee4815540be4fa74a66c43eadf15b
tree936f3686c20232babc9556a737efa7f07d1fd2e7
parent8ca386371e31e98bede8e74a6e3406807157af97
[DebugInfo] Fix bug in LiveDebugVariables.

In lib/CodeGen/LiveDebugVariables.cpp, it uses std::prev(MBBI) to
get DebugValue's SlotIndex. However, the previous instruction may be
also a debug instruction. It could not use a debug instruction to query
SlotIndex in mi2iMap.

Scan all debug instructions and use the first debug instruction to query
SlotIndex for following debug instructions. Only handle DBG_VALUE in
handleDebugValue().

Differential Revision: https://reviews.llvm.org/D50621

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341446 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/SlotIndexes.h
lib/CodeGen/LiveDebugVariables.cpp
test/DebugInfo/X86/live-debug-vars-index.mir [new file with mode: 0644]