Fix a bunch of custom-inserter functions to handle the case where
[oota-llvm.git] / lib / Target / PIC16 / PIC16MachineFunctionInfo.h
1 //====- PIC16MachineFuctionInfo.h - PIC16 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 PIC16-specific per-machine-function information.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef PIC16MACHINEFUNCTIONINFO_H
15 #define PIC16MACHINEFUNCTIONINFO_H
16
17 #include "llvm/CodeGen/MachineFunction.h"
18
19 namespace llvm {
20
21 /// PIC16MachineFunctionInfo - This class is derived from MachineFunction
22 /// private PIC16 target-specific information for each MachineFunction.
23 class PIC16MachineFunctionInfo : public MachineFunctionInfo {
24   // The frameindexes generated for spill/reload are stack based.
25   // This maps maintain zero based indexes for these FIs.
26   std::map<unsigned, unsigned> FiTmpOffsetMap;
27   unsigned TmpSize;
28
29   // These are the frames for return value and argument passing 
30   // These FrameIndices will be expanded to foo.frame external symbol
31   // and all others will be expanded to foo.tmp external symbol.
32   unsigned ReservedFrameCount;
33
34 public:
35   PIC16MachineFunctionInfo()
36     : TmpSize(0), ReservedFrameCount(0) {}
37
38   explicit PIC16MachineFunctionInfo(MachineFunction &MF)
39     : TmpSize(0), ReservedFrameCount(0) {}
40
41   std::map<unsigned, unsigned> &getFiTmpOffsetMap() { return FiTmpOffsetMap; }
42
43   unsigned getTmpSize() const { return TmpSize; }
44   void setTmpSize(unsigned Size) { TmpSize = Size; }
45
46   unsigned getReservedFrameCount() const { return ReservedFrameCount; }
47   void setReservedFrameCount(unsigned Count) { ReservedFrameCount = Count; }
48 };
49
50 } // End llvm namespace
51
52 #endif