Reapply r238011 with a fix for the trap instruction.
authorQuentin Colombet <qcolombet@apple.com>
Fri, 22 May 2015 18:10:47 +0000 (18:10 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Fri, 22 May 2015 18:10:47 +0000 (18:10 +0000)
commit57cc146595222b8db7ae73df9ccebd1d7c149132
treec2d90a24a11bac581283ba96c7189ece17ee2463
parent15fe7cf70fc92f9e7623fd2c7ffd38662cc29b1b
Reapply r238011 with a fix for the trap instruction.
The problem was that I slipped a change required for shrink-wrapping, namely I
used getFirstTerminator instead of the getLastNonDebugInstr that was here before
the refactoring, whereas the surrounding code is not yet patched for that.

Original message:
[X86] Refactor the prologue emission to prepare for shrink-wrapping.

- Add a late pass to expand pseudo instructions (tail call and EH returns).
 Instead of doing it in the prologue emission.
- Factor some static methods in X86FrameLowering to ease code sharing.

NFC.

Related to <rdar://problem/20821487>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238035 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/CMakeLists.txt
lib/Target/X86/X86.h
lib/Target/X86/X86ExpandPseudo.cpp [new file with mode: 0644]
lib/Target/X86/X86FrameLowering.cpp
lib/Target/X86/X86FrameLowering.h
lib/Target/X86/X86RegisterInfo.cpp
lib/Target/X86/X86TargetMachine.cpp
test/CodeGen/X86/x86-framelowering-trap.ll [new file with mode: 0644]