Merge from mainline.
[llvm-complete.git] / lib / Target / ARM / ARMRegisterInfo.h
blobcf18e86f33d6d0199a9f3cf32015366d0ec8a179
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.
12 //===----------------------------------------------------------------------===//
14 #ifndef ARMREGISTERINFO_H
15 #define ARMREGISTERINFO_H
17 #include "llvm/Target/MRegisterInfo.h"
18 #include "ARMGenRegisterInfo.h.inc"
20 namespace llvm {
21 class ARMSubtarget;
22 class TargetInstrInfo;
23 class Type;
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;
32 public:
33 ARMRegisterInfo(const TargetInstrInfo &tii, const ARMSubtarget &STI);
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);
39 /// Code Generation virtual methods...
40 void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
41 unsigned DestReg, const MachineInstr *Orig) const;
43 const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
45 const TargetRegisterClass* const*
46 getCalleeSavedRegClasses(const MachineFunction *MF = 0) const;
48 BitVector getReservedRegs(const MachineFunction &MF) const;
50 bool isReservedReg(const MachineFunction &MF, unsigned Reg) const;
52 bool requiresRegisterScavenging(const MachineFunction &MF) const;
54 bool hasFP(const MachineFunction &MF) const;
56 bool hasReservedCallFrame(MachineFunction &MF) const;
58 void eliminateCallFramePseudoInstr(MachineFunction &MF,
59 MachineBasicBlock &MBB,
60 MachineBasicBlock::iterator I) const;
62 void eliminateFrameIndex(MachineBasicBlock::iterator II,
63 int SPAdj, RegScavenger *RS = NULL) const;
65 void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
66 RegScavenger *RS = NULL) const;
68 void emitPrologue(MachineFunction &MF) const;
69 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
71 // Debug information queries.
72 unsigned getRARegister() const;
73 unsigned getFrameRegister(MachineFunction &MF) const;
75 // Exception handling queries.
76 unsigned getEHExceptionRegister() const;
77 unsigned getEHHandlerRegister() const;
79 int getDwarfRegNum(unsigned RegNum, bool isEH) const;
81 bool isLowRegister(unsigned Reg) const;
84 } // end namespace llvm
86 #endif