67e130f153d5d078eb4d64a2e37b9ddc422605be
[oota-llvm.git] / lib / Target / PTX / PTXRegisterInfo.h
1 //===- PTXRegisterInfo.h - PTX 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 PTX implementation of the MRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef PTX_REGISTER_INFO_H
15 #define PTX_REGISTER_INFO_H
16
17 #include "llvm/Support/ErrorHandling.h"
18 #include "llvm/ADT/BitVector.h"
19
20 #include "PTXGenRegisterInfo.h.inc"
21
22 namespace llvm {
23 class PTXTargetMachine;
24 class MachineFunction;
25
26 struct PTXRegisterInfo : public PTXGenRegisterInfo {
27   PTXRegisterInfo(PTXTargetMachine &TM,
28                   const TargetInstrInfo &TII) {}
29
30   virtual const unsigned
31     *getCalleeSavedRegs(const MachineFunction *MF = 0) const {
32     static const unsigned CalleeSavedRegs[] = { 0 };
33     return CalleeSavedRegs; // save nothing
34   }
35
36   virtual BitVector getReservedRegs(const MachineFunction &MF) const {
37     BitVector Reserved(getNumRegs());
38     return Reserved; // reserve no regs
39   }
40
41   virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI,
42                                    int SPAdj,
43                                    RegScavenger *RS = NULL) const {
44     llvm_unreachable("PTX does not support general function call");
45   }
46
47   virtual unsigned getFrameRegister(const MachineFunction &MF) const {
48     llvm_unreachable("PTX does not have a frame register");
49     return 0;
50   }
51
52   virtual unsigned getRARegister() const {
53     llvm_unreachable("PTX does not have a return address register");
54     return 0;
55   }
56
57   virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const {
58     return PTXGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
59   }
60 }; // struct PTXRegisterInfo
61 } // namespace llvm
62
63 #endif // PTX_REGISTER_INFO_H