summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86RegisterInfo.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-07-08 21:02:53 +0000
committerBill Wendling <isanbard@gmail.com>2009-07-08 21:02:53 +0000
commitc3d505c3c2a8c0e1f1db572f47451cfe2a1a58a3 (patch)
tree4e124e75f73e4097e40ba049d317caa43312f29c /lib/Target/X86/X86RegisterInfo.h
parent058a024eb7265239d527680b0a448cdb48102a46 (diff)
downloadllvm-c3d505c3c2a8c0e1f1db572f47451cfe2a1a58a3.tar.gz
llvm-c3d505c3c2a8c0e1f1db572f47451cfe2a1a58a3.tar.bz2
llvm-c3d505c3c2a8c0e1f1db572f47451cfe2a1a58a3.tar.xz
Recommit r74952 with a bug fix:
DWARF requires frame moves be specified at specific times. If you have a prologue like this: __Z3fooi: Leh_func_begin1: LBB1_0: ## entry pushl %ebp Llabel1: movl %esp, %ebp Llabel2: pushl %esi Llabel3: subl $20, %esp call "L1$pb" "L1$pb": popl %esi The "pushl %ebp" needs a table entry specifying the offset. The "movl %esp, %ebp" makes %ebp the new stack frame register, so that needs to be specified in DWARF. And "pushl %esi" saves the callee-saved %esi register, which also needs to be specified in DWARF. Before, all of this logic was in one method. This didn't work too well, because as you can see there are multiple FDE line entries that need to be created. This fix creates the "MachineMove" objects directly when they're needed; instead of waiting until the end, and losing information. There is some ugliness where we generate code like this: LBB22_0: ## entry pushl %ebp Llabel280: movl %esp, %ebp Llabel281: Llabel284: pushl %ebp <---------- pushl %ebx pushl %edi pushl %esi Llabel282: subl $328, %esp Notice the extra "pushl %ebp". If we generate a "machine move" instruction in the FDE for that pushl, the linker may get very confused about what value %ebp should have when exitting the function. I.e., it'll give it the value %esp instead of the %ebp value from the first "pushl". Not to mention that, in this case, %ebp isn't modified in the function (that's a separate bug). I put a small hack in to get it to work. It might be the only solution, but should be revisited once the above case is fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75047 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86RegisterInfo.h')
-rw-r--r--lib/Target/X86/X86RegisterInfo.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Target/X86/X86RegisterInfo.h b/lib/Target/X86/X86RegisterInfo.h
index 33b9f5edc7..e1a23cb4ed 100644
--- a/lib/Target/X86/X86RegisterInfo.h
+++ b/lib/Target/X86/X86RegisterInfo.h
@@ -136,12 +136,11 @@ public:
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
RegScavenger *RS = NULL) const;
+ void emitCalleeSavedFrameMoves(MachineFunction &MF, unsigned LabelId,
+ unsigned FramePtr) const;
void emitPrologue(MachineFunction &MF) const;
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
- void emitFrameMoves(MachineFunction &MF,
- unsigned FrameLabelId, unsigned ReadyLabelId) const;
-
// Debug information queries.
unsigned getRARegister() const;
unsigned getFrameRegister(MachineFunction &MF) const;