LLVM  3.7.0
XCoreMachineFunctionInfo.h
Go to the documentation of this file.
1 //===-- XCoreMachineFuctionInfo.h - XCore machine function info -*- C++ -*-===//
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 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares XCore-specific per-machine-function information.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
15 #define LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
16 
19 #include <vector>
20 
21 namespace llvm {
22 
23 // Forward declarations
24 class Function;
25 
26 /// XCoreFunctionInfo - This class is derived from MachineFunction private
27 /// XCore target-specific information for each MachineFunction.
29  virtual void anchor();
30  bool LRSpillSlotSet;
31  int LRSpillSlot;
32  bool FPSpillSlotSet;
33  int FPSpillSlot;
34  bool EHSpillSlotSet;
35  int EHSpillSlot[2];
36  unsigned ReturnStackOffset;
37  bool ReturnStackOffsetSet;
38  int VarArgsFrameIndex;
39  mutable int CachedEStackSize;
40  std::vector<std::pair<MachineBasicBlock::iterator, CalleeSavedInfo>>
41  SpillLabels;
42 
43 public:
45  LRSpillSlotSet(false),
46  FPSpillSlotSet(false),
47  EHSpillSlotSet(false),
48  ReturnStackOffsetSet(false),
49  VarArgsFrameIndex(0),
50  CachedEStackSize(-1) {}
51 
53  LRSpillSlotSet(false),
54  FPSpillSlotSet(false),
55  EHSpillSlotSet(false),
56  ReturnStackOffsetSet(false),
57  VarArgsFrameIndex(0),
58  CachedEStackSize(-1) {}
59 
61 
62  void setVarArgsFrameIndex(int off) { VarArgsFrameIndex = off; }
63  int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
64 
66  bool hasLRSpillSlot() { return LRSpillSlotSet; }
67  int getLRSpillSlot() const {
68  assert(LRSpillSlotSet && "LR Spill slot not set");
69  return LRSpillSlot;
70  }
71 
73  bool hasFPSpillSlot() { return FPSpillSlotSet; }
74  int getFPSpillSlot() const {
75  assert(FPSpillSlotSet && "FP Spill slot not set");
76  return FPSpillSlot;
77  }
78 
79  const int* createEHSpillSlot(MachineFunction &MF);
80  bool hasEHSpillSlot() { return EHSpillSlotSet; }
81  const int* getEHSpillSlot() const {
82  assert(EHSpillSlotSet && "EH Spill slot not set");
83  return EHSpillSlot;
84  }
85 
86  void setReturnStackOffset(unsigned value) {
87  assert(!ReturnStackOffsetSet && "Return stack offset set twice");
88  ReturnStackOffset = value;
89  ReturnStackOffsetSet = true;
90  }
91 
92  unsigned getReturnStackOffset() const {
93  assert(ReturnStackOffsetSet && "Return stack offset not set");
94  return ReturnStackOffset;
95  }
96 
97  bool isLargeFrame(const MachineFunction &MF) const;
98 
99  std::vector<std::pair<MachineBasicBlock::iterator, CalleeSavedInfo>> &
101  return SpillLabels;
102  }
103 };
104 } // End llvm namespace
105 
106 #endif
int createLRSpillSlot(MachineFunction &MF)
std::vector< std::pair< MachineBasicBlock::iterator, CalleeSavedInfo > > & getSpillLabels()
unsigned getReturnStackOffset() const
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
#define false
Definition: ConvertUTF.c:65
void setReturnStackOffset(unsigned value)
const int * getEHSpillSlot() const
int createFPSpillSlot(MachineFunction &MF)
const int * createEHSpillSlot(MachineFunction &MF)
XCoreFunctionInfo - This class is derived from MachineFunction private XCore target-specific informat...
bool isLargeFrame(const MachineFunction &MF) const
XCoreFunctionInfo(MachineFunction &MF)