Move this code to lib/Target/SparcV9/MachineFunctionInfo.cpp
[oota-llvm.git] / lib / Target / PowerPC / PowerPCRegisterInfo.h
1 //===- PowerPCRegisterInfo.h - PowerPC 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 PowerPC implementation of the MRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef POWERPCREGISTERINFO_H
15 #define POWERPCREGISTERINFO_H
16
17 #include "llvm/Target/MRegisterInfo.h"
18 #include "PowerPCGenRegisterInfo.h.inc"
19 #include <map>
20
21 namespace llvm {
22
23 class Type;
24
25 class PowerPCRegisterInfo : public PowerPCGenRegisterInfo {
26   bool is64bit;
27   std::map<unsigned, unsigned> ImmToIdxMap;
28 public:
29   PowerPCRegisterInfo(bool is64b);
30   const TargetRegisterClass* getRegClassForType(const Type* Ty) const;
31
32   /// Code Generation virtual methods...
33   void storeRegToStackSlot(MachineBasicBlock &MBB,
34                            MachineBasicBlock::iterator MBBI,
35                            unsigned SrcReg, int FrameIndex) const;
36
37   void loadRegFromStackSlot(MachineBasicBlock &MBB,
38                             MachineBasicBlock::iterator MBBI,
39                             unsigned DestReg, int FrameIndex) const;
40   
41   void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
42                     unsigned DestReg, unsigned SrcReg,
43                     const TargetRegisterClass *RC) const;
44
45   void eliminateCallFramePseudoInstr(MachineFunction &MF,
46                                      MachineBasicBlock &MBB,
47                                      MachineBasicBlock::iterator I) const;
48
49   void eliminateFrameIndex(MachineBasicBlock::iterator II) const;
50
51   void emitPrologue(MachineFunction &MF) const;
52   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
53 };
54
55 } // end namespace llvm
56
57 #endif