LLVM API Documentation
00001 //===-- XCoreFrameLowering.h - Frame info for XCore Target ------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file contains XCore frame information that doesn't fit anywhere else 00011 // cleanly... 00012 // 00013 //===----------------------------------------------------------------------===// 00014 00015 #ifndef LLVM_LIB_TARGET_XCORE_XCOREFRAMELOWERING_H 00016 #define LLVM_LIB_TARGET_XCORE_XCOREFRAMELOWERING_H 00017 00018 #include "llvm/Target/TargetFrameLowering.h" 00019 #include "llvm/Target/TargetMachine.h" 00020 00021 namespace llvm { 00022 class XCoreSubtarget; 00023 00024 class XCoreFrameLowering: public TargetFrameLowering { 00025 public: 00026 XCoreFrameLowering(const XCoreSubtarget &STI); 00027 00028 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into 00029 /// the function. 00030 void emitPrologue(MachineFunction &MF) const override; 00031 void emitEpilogue(MachineFunction &MF, 00032 MachineBasicBlock &MBB) const override; 00033 00034 bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, 00035 MachineBasicBlock::iterator MI, 00036 const std::vector<CalleeSavedInfo> &CSI, 00037 const TargetRegisterInfo *TRI) const override; 00038 bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, 00039 MachineBasicBlock::iterator MI, 00040 const std::vector<CalleeSavedInfo> &CSI, 00041 const TargetRegisterInfo *TRI) const override; 00042 00043 void eliminateCallFramePseudoInstr(MachineFunction &MF, 00044 MachineBasicBlock &MBB, 00045 MachineBasicBlock::iterator I) const override; 00046 00047 bool hasFP(const MachineFunction &MF) const override; 00048 00049 void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, 00050 RegScavenger *RS = nullptr) const override; 00051 00052 void processFunctionBeforeFrameFinalized(MachineFunction &MF, 00053 RegScavenger *RS = nullptr) const override; 00054 00055 //! Stack slot size (4 bytes) 00056 static int stackSlotSize() { 00057 return 4; 00058 } 00059 }; 00060 } 00061 00062 #endif