More MC layering violations.
[oota-llvm.git] / lib / Target / MBlaze / MBlazeRegisterInfo.h
1 //===- MBlazeRegisterInfo.h - MBlaze Register Information Impl --*- 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 contains the MBlaze implementation of the TargetRegisterInfo
11 // class.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef MBLAZEREGISTERINFO_H
16 #define MBLAZEREGISTERINFO_H
17
18 #include "MBlaze.h"
19 #include "llvm/Target/TargetRegisterInfo.h"
20
21 #define GET_REGINFO_HEADER
22 #include "MBlazeGenRegisterInfo.inc"
23
24 namespace llvm {
25 class MBlazeSubtarget;
26 class TargetInstrInfo;
27 class Type;
28
29 namespace MBlaze {
30   /// SubregIndex - The index of various sized subregister classes. Note that
31   /// these indices must be kept in sync with the class indices in the
32   /// MBlazeRegisterInfo.td file.
33   enum SubregIndex {
34     SUBREG_FPEVEN = 1, SUBREG_FPODD = 2
35   };
36 }
37
38 struct MBlazeRegisterInfo : public MBlazeGenRegisterInfo {
39   const MBlazeSubtarget &Subtarget;
40   const TargetInstrInfo &TII;
41
42   MBlazeRegisterInfo(const MBlazeSubtarget &Subtarget,
43                      const TargetInstrInfo &tii);
44
45   static unsigned getRegisterFromNumbering(unsigned RegEnum);
46
47   /// Get PIC indirect call register
48   static unsigned getPICCallReg();
49
50   /// Code Generation virtual methods...
51   const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
52
53   BitVector getReservedRegs(const MachineFunction &MF) const;
54
55   void eliminateCallFramePseudoInstr(MachineFunction &MF,
56                                      MachineBasicBlock &MBB,
57                                      MachineBasicBlock::iterator I) const;
58
59   /// Stack Frame Processing Methods
60   void eliminateFrameIndex(MachineBasicBlock::iterator II,
61                            int SPAdj, RegScavenger *RS = NULL) const;
62
63   void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
64
65   /// Debug information queries.
66   unsigned getFrameRegister(const MachineFunction &MF) const;
67
68   /// Exception handling queries.
69   unsigned getEHExceptionRegister() const;
70   unsigned getEHHandlerRegister() const;
71 };
72
73 } // end namespace llvm
74
75 #endif