Add support for multiple-return values in inline asm. This should
[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 TargetRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef ARMREGISTERINFO_H
15 #define ARMREGISTERINFO_H
16
17 #include "llvm/Target/TargetRegisterInfo.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   /// emitLoadConstPool - Emits a load from constpool to materialize the
36   /// specified immediate.
37   void emitLoadConstPool(MachineBasicBlock &MBB,
38                          MachineBasicBlock::iterator &MBBI,
39                          unsigned DestReg, int Val,
40                          unsigned Pred, unsigned PredReg,
41                          const TargetInstrInfo *TII, bool isThumb) const;
42
43   /// getRegisterNumbering - Given the enum value for some register, e.g.
44   /// ARM::LR, return the number that it corresponds to (e.g. 14).
45   static unsigned getRegisterNumbering(unsigned RegEnum);
46
47   /// Code Generation virtual methods...
48   const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
49
50   const TargetRegisterClass* const*
51   getCalleeSavedRegClasses(const MachineFunction *MF = 0) const;
52
53   BitVector getReservedRegs(const MachineFunction &MF) const;
54
55   bool isReservedReg(const MachineFunction &MF, unsigned Reg) const;
56
57   bool requiresRegisterScavenging(const MachineFunction &MF) const;
58
59   bool hasFP(const MachineFunction &MF) const;
60
61   bool hasReservedCallFrame(MachineFunction &MF) const;
62
63   void eliminateCallFramePseudoInstr(MachineFunction &MF,
64                                      MachineBasicBlock &MBB,
65                                      MachineBasicBlock::iterator I) const;
66
67   void eliminateFrameIndex(MachineBasicBlock::iterator II,
68                            int SPAdj, RegScavenger *RS = NULL) const;
69
70   void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
71                                             RegScavenger *RS = NULL) const;
72
73   void emitPrologue(MachineFunction &MF) const;
74   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
75
76   // Debug information queries.
77   unsigned getRARegister() const;
78   unsigned getFrameRegister(MachineFunction &MF) const;
79
80   // Exception handling queries.
81   unsigned getEHExceptionRegister() const;
82   unsigned getEHHandlerRegister() const;
83
84   int getDwarfRegNum(unsigned RegNum, bool isEH) const;
85   
86   bool isLowRegister(unsigned Reg) const;
87 };
88
89 } // end namespace llvm
90
91 #endif