1 //===-- XCoreMachineFuctionInfo.h - XCore machine function info -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares XCore-specific per-machine-function information.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
15 #define LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
17 #include "llvm/CodeGen/MachineFrameInfo.h"
18 #include "llvm/CodeGen/MachineFunction.h"
23 // Forward declarations
26 /// XCoreFunctionInfo - This class is derived from MachineFunction private
27 /// XCore target-specific information for each MachineFunction.
28 class XCoreFunctionInfo : public MachineFunctionInfo {
29 virtual void anchor();
36 unsigned ReturnStackOffset;
37 bool ReturnStackOffsetSet;
38 int VarArgsFrameIndex;
39 mutable int CachedEStackSize;
40 std::vector<std::pair<MachineBasicBlock::iterator, CalleeSavedInfo>>
45 LRSpillSlotSet(false),
46 FPSpillSlotSet(false),
47 EHSpillSlotSet(false),
48 ReturnStackOffsetSet(false),
50 CachedEStackSize(-1) {}
52 explicit XCoreFunctionInfo(MachineFunction &MF) :
53 LRSpillSlotSet(false),
54 FPSpillSlotSet(false),
55 EHSpillSlotSet(false),
56 ReturnStackOffsetSet(false),
58 CachedEStackSize(-1) {}
60 ~XCoreFunctionInfo() {}
62 void setVarArgsFrameIndex(int off) { VarArgsFrameIndex = off; }
63 int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
65 int createLRSpillSlot(MachineFunction &MF);
66 bool hasLRSpillSlot() { return LRSpillSlotSet; }
67 int getLRSpillSlot() const {
68 assert(LRSpillSlotSet && "LR Spill slot not set");
72 int createFPSpillSlot(MachineFunction &MF);
73 bool hasFPSpillSlot() { return FPSpillSlotSet; }
74 int getFPSpillSlot() const {
75 assert(FPSpillSlotSet && "FP Spill slot not set");
79 const int* createEHSpillSlot(MachineFunction &MF);
80 bool hasEHSpillSlot() { return EHSpillSlotSet; }
81 const int* getEHSpillSlot() const {
82 assert(EHSpillSlotSet && "EH Spill slot not set");
86 void setReturnStackOffset(unsigned value) {
87 assert(!ReturnStackOffsetSet && "Return stack offset set twice");
88 ReturnStackOffset = value;
89 ReturnStackOffsetSet = true;
92 unsigned getReturnStackOffset() const {
93 assert(ReturnStackOffsetSet && "Return stack offset not set");
94 return ReturnStackOffset;
97 bool isLargeFrame(const MachineFunction &MF) const;
99 std::vector<std::pair<MachineBasicBlock::iterator, CalleeSavedInfo>> &
104 } // End llvm namespace