SDIsel processes llvm.dbg.declare by recording the variable debug information descrip...
[oota-llvm.git] / lib / Target / ARM / ARMRegisterInfo.h
1 //===- ARMRegisterInfo.h - ARM 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 ARM implementation of the MRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef ARMREGISTERINFO_H
15 #define ARMREGISTERINFO_H
16
17 #include "llvm/Target/MRegisterInfo.h"
18 #include "ARMGenRegisterInfo.h.inc"
19
20 namespace llvm {
21   class ARMSubtarget;
22   class TargetInstrInfo;
23   class Type;
24
25 struct ARMRegisterInfo : public ARMGenRegisterInfo {
26   const TargetInstrInfo &TII;
27   const ARMSubtarget &STI;
28 private:
29   /// FramePtr - ARM physical register used as frame ptr.
30   unsigned FramePtr;
31
32 public:
33   ARMRegisterInfo(const TargetInstrInfo &tii, const ARMSubtarget &STI);
34
35   /// getRegisterNumbering - Given the enum value for some register, e.g.
36   /// ARM::LR, return the number that it corresponds to (e.g. 14).
37   static unsigned getRegisterNumbering(unsigned RegEnum);
38
39   /// Code Generation virtual methods...
40   void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
41                      unsigned DestReg, const MachineInstr *Orig) const;
42
43   const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
44
45   const TargetRegisterClass* const*
46   getCalleeSavedRegClasses(const MachineFunction *MF = 0) const;
47
48   BitVector getReservedRegs(const MachineFunction &MF) const;
49
50   bool isReservedReg(const MachineFunction &MF, unsigned Reg) const;
51
52   bool requiresRegisterScavenging(const MachineFunction &MF) const;
53
54   bool hasFP(const MachineFunction &MF) const;
55
56   bool hasReservedCallFrame(MachineFunction &MF) const;
57
58   void eliminateCallFramePseudoInstr(MachineFunction &MF,
59                                      MachineBasicBlock &MBB,
60                                      MachineBasicBlock::iterator I) const;
61
62   void eliminateFrameIndex(MachineBasicBlock::iterator II,
63                            int SPAdj, RegScavenger *RS = NULL) const;
64
65   void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
66                                             RegScavenger *RS = NULL) const;
67
68   void emitPrologue(MachineFunction &MF) const;
69   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
70
71   // Debug information queries.
72   unsigned getRARegister() const;
73   unsigned getFrameRegister(MachineFunction &MF) const;
74
75   // Exception handling queries.
76   unsigned getEHExceptionRegister() const;
77   unsigned getEHHandlerRegister() const;
78
79   int getDwarfRegNum(unsigned RegNum, bool isEH) const;
80   
81   bool isLowRegister(unsigned Reg) const;
82 };
83
84 } // end namespace llvm
85
86 #endif