Expose base register for DwarfWriter. Refactor code accordingly.
[oota-llvm.git] / lib / Target / Sparc / SparcRegisterInfo.h
1 //===- SparcRegisterInfo.h - Sparc Register Information Impl ----*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the Sparc implementation of the MRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef SPARCREGISTERINFO_H
15 #define SPARCREGISTERINFO_H
16
17 #include "llvm/Target/MRegisterInfo.h"
18 #include "SparcGenRegisterInfo.h.inc"
19
20 namespace llvm {
21
22 class SparcSubtarget;
23 class Type;
24
25 struct SparcRegisterInfo : public SparcGenRegisterInfo {
26   SparcSubtarget &Subtarget;
27   
28   SparcRegisterInfo(SparcSubtarget &st);
29
30   /// Code Generation virtual methods...
31   void storeRegToStackSlot(MachineBasicBlock &MBB,
32                            MachineBasicBlock::iterator MBBI,
33                            unsigned SrcReg, int FrameIndex,
34                            const TargetRegisterClass *RC) const;
35
36   void loadRegFromStackSlot(MachineBasicBlock &MBB,
37                             MachineBasicBlock::iterator MBBI,
38                             unsigned DestReg, int FrameIndex,
39                             const TargetRegisterClass *RC) const;
40
41   void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
42                     unsigned DestReg, unsigned SrcReg,
43                     const TargetRegisterClass *RC) const;
44   
45   virtual MachineInstr* foldMemoryOperand(MachineInstr* MI,
46                                           unsigned OpNum,
47                                           int FrameIndex) const;
48
49   void eliminateCallFramePseudoInstr(MachineFunction &MF,
50                                      MachineBasicBlock &MBB,
51                                      MachineBasicBlock::iterator I) const;
52
53   void eliminateFrameIndex(MachineBasicBlock::iterator II) const;
54
55   void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
56
57   void emitPrologue(MachineFunction &MF) const;
58   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
59   
60   // Debug information queries.
61   unsigned getFrameRegister(MachineFunction &MF) const;
62 };
63
64 } // end namespace llvm
65
66 #endif