forked from Hoernchen/Epiphany
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathEpiphanyFrameLowering.h
66 lines (48 loc) · 2.49 KB
/
EpiphanyFrameLowering.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//==- EpiphanyFrameLowering.h - Define frame lowering for Epiphany -*- C++ -*--=//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This class implements the Epiphany-specific parts of the TargetFrameLowering
// class.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_EPIPHANY_FRAMEINFO_H
#define LLVM_EPIPHANY_FRAMEINFO_H
#include "EpiphanyConfig.h"
#include "Epiphany.h"
#include "llvm/Target/TargetFrameLowering.h"
namespace llvm {
class EpiphanySubtarget;
class EpiphanyFrameLowering : public TargetFrameLowering {
protected:
const EpiphanySubtarget &STI;
public:
explicit EpiphanyFrameLowering(const EpiphanySubtarget &sti)
: TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 8, 0, 8), STI(sti) {}
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into
/// the function.
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS) const override;
int getFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg) const override;
void processFunctionBeforeFrameFinalized(MachineFunction &MF, RegScavenger *RS) const override;
// Callee-saved regs spill-restore
bool assignCalleeSavedSpillSlots(MachineFunction &MF,
const TargetRegisterInfo *TRI, std::vector<CalleeSavedInfo> &CSI) const override;
/// Returns true if the specified function should have a dedicated frame
/// pointer register. This is true if the function has variable sized allocas,
/// if it needs dynamic stack realignment, if frame pointer elimination is
/// disabled, or if the frame address is taken.
bool hasFP(const MachineFunction &MF) const override;
bool hasReservedCallFrame(const MachineFunction &MF) const override;
MachineBasicBlock::iterator eliminateCallFramePseudoInstr(MachineFunction &MF,
MachineBasicBlock &MBB,
MachineBasicBlock::iterator I) const override;
};
} // End llvm namespace
#endif