[MC] Use the non-EH register mapping in the debug_frame section.
authorFrederic Riss <friss@apple.com>
Thu, 26 Feb 2015 19:48:07 +0000 (19:48 +0000)
committerFrederic Riss <friss@apple.com>
Thu, 26 Feb 2015 19:48:07 +0000 (19:48 +0000)
commit09e8018e149df6f27887e2d375db5f7bad7e123c
tree10749d572d0cea09a514547e08c3835993c356eb
parent298988eb79490ec7e3039fa6808d2d406992b103
[MC] Use the non-EH register mapping in the debug_frame section.

On 32bits x86 Darwin, the register mappings for the eh_frane and
debug_frame sections are different. Thus the same CFI instructions
should result in different registers in the object file. The
problem isn't target specific though, but it requires that the
mappings for EH register numbers be different from the standard
Dwarf one.

The patch looks a bit clumsy. LLVM uses the EH mapping as
canonical for everything frame related. Thus we need to do a
double conversion EH -> LLVM -> Non-EH, when emitting the
debug_frame section.

Fixes PR22363.

Differential Revision: http://reviews.llvm.org/D7593

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230670 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/MCDwarf.cpp
test/MC/X86/i386-darwin-frame-register.ll [new file with mode: 0644]