Start breaking out common base functionality for register info.
[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 "ARM.h"
18 #include "llvm/Target/TargetRegisterInfo.h"
19 #include "ARMBaseRegisterInfo.h"
20
21 namespace llvm {
22   class ARMSubtarget;
23   class TargetInstrInfo;
24   class Type;
25
26 struct ARMRegisterInfo : public ARMBaseRegisterInfo {
27 public:
28   ARMRegisterInfo(const TargetInstrInfo &tii, const ARMSubtarget &STI);
29
30   /// emitLoadConstPool - Emits a load from constpool to materialize the
31   /// specified immediate.
32   void emitLoadConstPool(MachineBasicBlock &MBB,
33                          MachineBasicBlock::iterator &MBBI,
34                          const TargetInstrInfo *TII, DebugLoc dl,
35                          unsigned DestReg, int Val,
36                          ARMCC::CondCodes Pred = ARMCC::AL,
37                          unsigned PredReg = 0) const;
38
39   /// Code Generation virtual methods...
40   bool isReservedReg(const MachineFunction &MF, unsigned Reg) const;
41
42   bool requiresRegisterScavenging(const MachineFunction &MF) const;
43
44   bool hasReservedCallFrame(MachineFunction &MF) const;
45
46   void eliminateCallFramePseudoInstr(MachineFunction &MF,
47                                      MachineBasicBlock &MBB,
48                                      MachineBasicBlock::iterator I) const;
49
50   void eliminateFrameIndex(MachineBasicBlock::iterator II,
51                            int SPAdj, RegScavenger *RS = NULL) const;
52
53   void emitPrologue(MachineFunction &MF) const;
54   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
55 };
56
57 } // end namespace llvm
58
59 #endif