Akira Hatanaka | 4552c9a | 2011-04-15 21:51:11 +0000 | [diff] [blame] | 1 | //==--- MipsFrameLowering.h - Define frame lowering for Mips --*- C++ -*---===// |
Anton Korobeynikov | 3346491 | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 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 | // |
Akira Hatanaka | 4552c9a | 2011-04-15 21:51:11 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Anton Korobeynikov | 3346491 | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 9 | // |
| 10 | // |
| 11 | // |
Akira Hatanaka | 4552c9a | 2011-04-15 21:51:11 +0000 | [diff] [blame] | 12 | //===----------------------------------------------------------------------===// |
Anton Korobeynikov | 3346491 | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 13 | |
Bruno Cardoso Lopes | 49eaf76 | 2011-03-04 19:20:24 +0000 | [diff] [blame] | 14 | #ifndef MIPS_FRAMEINFO_H |
| 15 | #define MIPS_FRAMEINFO_H |
Anton Korobeynikov | 3346491 | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 16 | |
| 17 | #include "Mips.h" |
| 18 | #include "MipsSubtarget.h" |
Anton Korobeynikov | 16c29b5 | 2011-01-10 12:39:04 +0000 | [diff] [blame] | 19 | #include "llvm/Target/TargetFrameLowering.h" |
Anton Korobeynikov | 3346491 | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 20 | |
| 21 | namespace llvm { |
| 22 | class MipsSubtarget; |
| 23 | |
Anton Korobeynikov | 16c29b5 | 2011-01-10 12:39:04 +0000 | [diff] [blame] | 24 | class MipsFrameLowering : public TargetFrameLowering { |
Anton Korobeynikov | 3346491 | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 25 | protected: |
| 26 | const MipsSubtarget &STI; |
| 27 | |
| 28 | public: |
Anton Korobeynikov | 16c29b5 | 2011-01-10 12:39:04 +0000 | [diff] [blame] | 29 | explicit MipsFrameLowering(const MipsSubtarget &sti) |
Akira Hatanaka | 69c19f7 | 2011-05-23 20:16:59 +0000 | [diff] [blame] | 30 | : TargetFrameLowering(StackGrowsDown, 8, 0), STI(sti) { |
Anton Korobeynikov | 3346491 | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 31 | } |
| 32 | |
Akira Hatanaka | 69c19f7 | 2011-05-23 20:16:59 +0000 | [diff] [blame] | 33 | bool targetHandlesStackFrameRounding() const; |
Anton Korobeynikov | 3346491 | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 34 | |
| 35 | /// emitProlog/emitEpilog - These methods insert prolog and epilog code into |
| 36 | /// the function. |
| 37 | void emitPrologue(MachineFunction &MF) const; |
| 38 | void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; |
Anton Korobeynikov | d0c3817 | 2010-11-18 21:19:35 +0000 | [diff] [blame] | 39 | |
| 40 | bool hasFP(const MachineFunction &MF) const; |
Bruno Cardoso Lopes | fb67faa | 2011-01-18 19:50:18 +0000 | [diff] [blame] | 41 | |
Akira Hatanaka | 17a1e87 | 2011-05-20 18:39:33 +0000 | [diff] [blame] | 42 | void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, |
| 43 | RegScavenger *RS) const; |
Anton Korobeynikov | 3346491 | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | } // End llvm namespace |
| 47 | |
| 48 | #endif |