Reorder includes to match coding standards. Fix an issue or two exposed by that.
[oota-llvm.git] / lib / Target / ARM / Thumb1RegisterInfo.h
1 //===- Thumb1RegisterInfo.h - Thumb-1 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 Thumb-1 implementation of the TargetRegisterInfo
11 // class.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef THUMB1REGISTERINFO_H
16 #define THUMB1REGISTERINFO_H
17
18 #include "ARM.h"
19 #include "ARMBaseRegisterInfo.h"
20 #include "llvm/Target/TargetRegisterInfo.h"
21
22 namespace llvm {
23   class ARMSubtarget;
24   class ARMBaseInstrInfo;
25
26 struct Thumb1RegisterInfo : public ARMBaseRegisterInfo {
27 public:
28   Thumb1RegisterInfo(const ARMBaseInstrInfo &tii, const ARMSubtarget &STI);
29
30   const TargetRegisterClass*
31   getLargestLegalSuperClass(const TargetRegisterClass *RC) const;
32
33   const TargetRegisterClass *getPointerRegClass(unsigned Kind = 0) const;
34
35   /// emitLoadConstPool - Emits a load from constpool to materialize the
36   /// specified immediate.
37  void emitLoadConstPool(MachineBasicBlock &MBB,
38                         MachineBasicBlock::iterator &MBBI,
39                         DebugLoc dl,
40                         unsigned DestReg, unsigned SubIdx, int Val,
41                         ARMCC::CondCodes Pred = ARMCC::AL,
42                         unsigned PredReg = 0,
43                         unsigned MIFlags = MachineInstr::NoFlags) const;
44
45   /// Code Generation virtual methods...
46   void eliminateCallFramePseudoInstr(MachineFunction &MF,
47                                      MachineBasicBlock &MBB,
48                                      MachineBasicBlock::iterator I) const;
49
50   // rewrite MI to access 'Offset' bytes from the FP. Update Offset to be
51   // however much remains to be handled. Return 'true' if no further
52   // work is required.
53   bool rewriteFrameIndex(MachineBasicBlock::iterator II, unsigned FrameRegIdx,
54                          unsigned FrameReg, int &Offset,
55                          const ARMBaseInstrInfo &TII) const;
56   void resolveFrameIndex(MachineBasicBlock::iterator I,
57                          unsigned BaseReg, int64_t Offset) const;
58   bool saveScavengerRegister(MachineBasicBlock &MBB,
59                              MachineBasicBlock::iterator I,
60                              MachineBasicBlock::iterator &UseMI,
61                              const TargetRegisterClass *RC,
62                              unsigned Reg) const;
63   void eliminateFrameIndex(MachineBasicBlock::iterator II,
64                            int SPAdj, RegScavenger *RS = NULL) const;
65 };
66 }
67
68 #endif // THUMB1REGISTERINFO_H