@@ -74,7 +74,6 @@ class X86RetpolineThunks : public MachineFunctionPass {
7474
7575 void createThunkFunction (Module &M, StringRef Name);
7676 void insertRegReturnAddrClobber (MachineBasicBlock &MBB, unsigned Reg);
77- void insert32BitPushReturnAddrClobber (MachineBasicBlock &MBB);
7877 void populateThunk (MachineFunction &MF, Optional<unsigned > Reg = None);
7978};
8079
@@ -225,31 +224,6 @@ void X86RetpolineThunks::insertRegReturnAddrClobber(MachineBasicBlock &MBB,
225224 .addReg (Reg);
226225}
227226
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-
253227void X86RetpolineThunks::populateThunk (MachineFunction &MF,
254228 Optional<unsigned > Reg) {
255229 // Set MF properties. We never use vregs...
0 commit comments