The default of the dispatch switch statement was to branch to a BB that executed
[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 #include "MBlazeGenRegisterInfo.h.inc"
21
22 namespace llvm {
23 class MBlazeSubtarget;
24 class TargetInstrInfo;
25 class Type;
26
27 namespace MBlaze {
28   /// SubregIndex - The index of various sized subregister classes. Note that
29   /// these indices must be kept in sync with the class indices in the
30   /// MBlazeRegisterInfo.td file.
31   enum SubregIndex {
32     SUBREG_FPEVEN = 1, SUBREG_FPODD = 2
33   };
34 }
35
36 struct MBlazeRegisterInfo : public MBlazeGenRegisterInfo {
37   const MBlazeSubtarget &Subtarget;
38   const TargetInstrInfo &TII;
39
40   MBlazeRegisterInfo(const MBlazeSubtarget &Subtarget,
41                      const TargetInstrInfo &tii);
42
43   /// getRegisterNumbering - Given the enum value for some register, e.g.
44   /// MBlaze::RA, return the number that it corresponds to (e.g. 31).
45   static unsigned getRegisterNumbering(unsigned RegEnum);
46   static unsigned getRegisterFromNumbering(unsigned RegEnum);
47   static unsigned getSpecialRegisterFromNumbering(unsigned RegEnum);
48
49   /// Get PIC indirect call register
50   static unsigned getPICCallReg();
51
52   /// Code Generation virtual methods...
53   const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
54
55   BitVector getReservedRegs(const MachineFunction &MF) const;
56
57   void eliminateCallFramePseudoInstr(MachineFunction &MF,
58                                      MachineBasicBlock &MBB,
59                                      MachineBasicBlock::iterator I) const;
60
61   /// Stack Frame Processing Methods
62   void eliminateFrameIndex(MachineBasicBlock::iterator II,
63                            int SPAdj, RegScavenger *RS = NULL) const;
64
65   void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
66
67   /// Debug information queries.
68   unsigned getRARegister() const;
69   unsigned getFrameRegister(const MachineFunction &MF) const;
70
71   /// Exception handling queries.
72   unsigned getEHExceptionRegister() const;
73   unsigned getEHHandlerRegister() const;
74
75   int getDwarfRegNum(unsigned RegNum, bool isEH) const;
76 };
77
78 } // end namespace llvm
79
80 #endif