OSDN Git Service

Check in LLVM r95781.
[android-x86/external-llvm.git] / lib / Target / SystemZ / SystemZRegisterInfo.h
1 //===- SystemZRegisterInfo.h - SystemZ 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 SystemZ implementation of the TargetRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef SystemZREGISTERINFO_H
15 #define SystemZREGISTERINFO_H
16
17 #include "llvm/Target/TargetRegisterInfo.h"
18 #include "SystemZGenRegisterInfo.h.inc"
19
20 namespace llvm {
21
22 namespace SystemZ {
23   /// SubregIndex - The index of various sized subregister classes. Note that
24   /// these indices must be kept in sync with the class indices in the
25   /// SystemZRegisterInfo.td file.
26   enum SubregIndex {
27     SUBREG_32BIT = 1, SUBREG_EVEN = 1, SUBREG_ODD = 2
28   };
29 }
30
31 class SystemZSubtarget;
32 class SystemZInstrInfo;
33 class Type;
34
35 struct SystemZRegisterInfo : public SystemZGenRegisterInfo {
36   SystemZTargetMachine &TM;
37   const SystemZInstrInfo &TII;
38
39   SystemZRegisterInfo(SystemZTargetMachine &tm, const SystemZInstrInfo &tii);
40
41   /// Code Generation virtual methods...
42   const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
43
44   const TargetRegisterClass* const* getCalleeSavedRegClasses(
45                                      const MachineFunction *MF = 0) const;
46
47   BitVector getReservedRegs(const MachineFunction &MF) const;
48
49   bool hasReservedCallFrame(MachineFunction &MF) const { return true; }
50   bool hasFP(const MachineFunction &MF) const;
51
52   int getFrameIndexOffset(const MachineFunction &MF, int FI) const;
53
54   void eliminateCallFramePseudoInstr(MachineFunction &MF,
55                                      MachineBasicBlock &MBB,
56                                      MachineBasicBlock::iterator I) const;
57
58   unsigned eliminateFrameIndex(MachineBasicBlock::iterator II,
59                                int SPAdj, int *Value = NULL,
60                                RegScavenger *RS = NULL) const;
61
62
63   void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
64                                             RegScavenger *RS) const;
65
66   void emitPrologue(MachineFunction &MF) const;
67   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
68
69   // Debug information queries.
70   unsigned getRARegister() const;
71   unsigned getFrameRegister(const MachineFunction &MF) const;
72
73   // Exception handling queries.
74   unsigned getEHExceptionRegister() const;
75   unsigned getEHHandlerRegister() const;
76
77   int getDwarfRegNum(unsigned RegNum, bool isEH) const;
78 };
79
80 } // end namespace llvm
81
82 #endif