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)
commit494eb606cdeba7935bd0f6591b95aefa412ccff9
tree03933cca8cd626fc808d8f5f0e530a95b5d4ab47
parentebcc0dcad1c148f603f3746afa3f00a9caefbc56
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>

llvm-svn: 238035
llvm/lib/Target/X86/CMakeLists.txt
llvm/lib/Target/X86/X86.h
llvm/lib/Target/X86/X86ExpandPseudo.cpp [new file with mode: 0644]
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/lib/Target/X86/X86FrameLowering.h
llvm/lib/Target/X86/X86RegisterInfo.cpp
llvm/lib/Target/X86/X86TargetMachine.cpp
llvm/test/CodeGen/X86/x86-framelowering-trap.ll [new file with mode: 0644]