LLVM API Documentation

MSP430FrameLowering.h
Go to the documentation of this file.
00001 //==- MSP430FrameLowering.h - Define frame lowering for MSP430 --*- 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 //
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_LIB_TARGET_MSP430_MSP430FRAMELOWERING_H
00015 #define LLVM_LIB_TARGET_MSP430_MSP430FRAMELOWERING_H
00016 
00017 #include "MSP430.h"
00018 #include "llvm/Target/TargetFrameLowering.h"
00019 
00020 namespace llvm {
00021 class MSP430FrameLowering : public TargetFrameLowering {
00022 protected:
00023 
00024 public:
00025   explicit MSP430FrameLowering()
00026       : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 2, -2, 2) {}
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, MachineBasicBlock &MBB) const override;
00032 
00033   void eliminateCallFramePseudoInstr(MachineFunction &MF,
00034                                   MachineBasicBlock &MBB,
00035                                   MachineBasicBlock::iterator I) const override;
00036 
00037   bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
00038                                  MachineBasicBlock::iterator MI,
00039                                  const std::vector<CalleeSavedInfo> &CSI,
00040                                  const TargetRegisterInfo *TRI) const override;
00041   bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
00042                                   MachineBasicBlock::iterator MI,
00043                                   const std::vector<CalleeSavedInfo> &CSI,
00044                                   const TargetRegisterInfo *TRI) const override;
00045 
00046   bool hasFP(const MachineFunction &MF) const override;
00047   bool hasReservedCallFrame(const MachineFunction &MF) const override;
00048   void processFunctionBeforeFrameFinalized(MachineFunction &MF,
00049                                      RegScavenger *RS = nullptr) const override;
00050 };
00051 
00052 } // End llvm namespace
00053 
00054 #endif