1 //===-- MipsReturnProtectorLowering.h - --------------------- -*- C++ -*-==// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file contains the Mips implementation of ReturnProtectorLowering 11 // class. 12 // 13 //===----------------------------------------------------------------------===// 14 15 #ifndef LLVM_LIB_TARGET_MIPS_MIPSRETURNPROTECTORLOWERING_H 16 #define LLVM_LIB_TARGET_MIPS_MIPSRETURNPROTECTORLOWERING_H 17 18 #include "llvm/CodeGen/ReturnProtectorLowering.h" 19 20 namespace llvm { 21 22 class MipsReturnProtectorLowering : public ReturnProtectorLowering { 23 public: 24 /// insertReturnProtectorPrologue/Epilogue - insert return protector 25 /// instrumentation in prologue or epilogue. 26 virtual void 27 insertReturnProtectorPrologue(MachineFunction &MF, MachineBasicBlock &MBB, 28 GlobalVariable *cookie) const override; 29 virtual void 30 insertReturnProtectorEpilogue(MachineFunction &MF, MachineInstr &MI, 31 GlobalVariable *cookie) const override; 32 33 /// opcodeIsReturn - Reuturn true is the given opcode is a return 34 /// instruction needing return protection, false otherwise. 35 virtual bool opcodeIsReturn(unsigned opcode) const override; 36 37 /// fillTempRegisters - Fill the list of available temp registers we can 38 /// use as a return protector register. 39 virtual void 40 fillTempRegisters(MachineFunction &MF, 41 std::vector<unsigned> &TempRegs) const override; 42 }; 43 44 } // namespace llvm 45 46 #endif 47