@@ -74,7 +74,6 @@ class X86RetpolineThunks : public MachineFunctionPass {
74
74
75
75
void createThunkFunction (Module &M, StringRef Name);
76
76
void insertRegReturnAddrClobber (MachineBasicBlock &MBB, unsigned Reg);
77
- void insert32BitPushReturnAddrClobber (MachineBasicBlock &MBB);
78
77
void populateThunk (MachineFunction &MF, Optional<unsigned > Reg = None);
79
78
};
80
79
@@ -225,31 +224,6 @@ void X86RetpolineThunks::insertRegReturnAddrClobber(MachineBasicBlock &MBB,
225
224
.addReg (Reg);
226
225
}
227
226
228
- void X86RetpolineThunks::insert32BitPushReturnAddrClobber (
229
- MachineBasicBlock &MBB) {
230
- // The instruction sequence we use to replace the return address without
231
- // a scratch register is somewhat complicated:
232
- // # Clear capture_spec from return address.
233
- // addl $4, %esp
234
- // # Top of stack words are: Callee, RA. Exchange Callee and RA.
235
- // pushl 4(%esp) # Push callee
236
- // pushl 4(%esp) # Push RA
237
- // popl 8(%esp) # Pop RA to final RA
238
- // popl (%esp) # Pop callee to next top of stack
239
- // retl # Ret to callee
240
- BuildMI (&MBB, DebugLoc (), TII->get (X86::ADD32ri), X86::ESP)
241
- .addReg (X86::ESP)
242
- .addImm (4 );
243
- addRegOffset (BuildMI (&MBB, DebugLoc (), TII->get (X86::PUSH32rmm)), X86::ESP,
244
- false , 4 );
245
- addRegOffset (BuildMI (&MBB, DebugLoc (), TII->get (X86::PUSH32rmm)), X86::ESP,
246
- false , 4 );
247
- addRegOffset (BuildMI (&MBB, DebugLoc (), TII->get (X86::POP32rmm)), X86::ESP,
248
- false , 8 );
249
- addRegOffset (BuildMI (&MBB, DebugLoc (), TII->get (X86::POP32rmm)), X86::ESP,
250
- false , 0 );
251
- }
252
-
253
227
void X86RetpolineThunks::populateThunk (MachineFunction &MF,
254
228
Optional<unsigned > Reg) {
255
229
// Set MF properties. We never use vregs...
0 commit comments