XCore target: Make handling of large frames not dependent upon an FP.
[oota-llvm.git] / lib / Target / XCore / XCoreMachineFunctionInfo.h
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 XCOREMACHINEFUNCTIONINFO_H
15 #define XCOREMACHINEFUNCTIONINFO_H
16
17 #include "llvm/CodeGen/MachineFrameInfo.h"
18 #include "llvm/CodeGen/MachineFunction.h"
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.
28 class XCoreFunctionInfo : public MachineFunctionInfo {
29   virtual void anchor();
30   bool UsesLR;
31   int LRSpillSlot;
32   int FPSpillSlot;
33   int VarArgsFrameIndex;
34   mutable int CachedEStackSize;
35   std::vector<std::pair<MCSymbol*, CalleeSavedInfo> > SpillLabels;
36
37 public:
38   XCoreFunctionInfo() :
39     UsesLR(false),
40     LRSpillSlot(0),
41     FPSpillSlot(0),
42     VarArgsFrameIndex(0),
43     CachedEStackSize(-1) {}
44   
45   explicit XCoreFunctionInfo(MachineFunction &MF) :
46     UsesLR(false),
47     LRSpillSlot(0),
48     FPSpillSlot(0),
49     VarArgsFrameIndex(0),
50     CachedEStackSize(-1) {}
51   
52   ~XCoreFunctionInfo() {}
53   
54   void setVarArgsFrameIndex(int off) { VarArgsFrameIndex = off; }
55   int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
56   
57   void setUsesLR(bool val) { UsesLR = val; }
58   bool getUsesLR() const { return UsesLR; }
59   
60   void setLRSpillSlot(int off) { LRSpillSlot = off; }
61   int getLRSpillSlot() const { return LRSpillSlot; }
62   
63   void setFPSpillSlot(int off) { FPSpillSlot = off; }
64   int getFPSpillSlot() const { return FPSpillSlot; }
65   
66   bool isLargeFrame(const MachineFunction &MF) const;
67
68   std::vector<std::pair<MCSymbol*, CalleeSavedInfo> > &getSpillLabels() {
69     return SpillLabels;
70   }
71 };
72 } // End llvm namespace
73
74 #endif // XCOREMACHINEFUNCTIONINFO_H