1 //===- PTXRegisterInfo.h - PTX Register Information Impl --------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the PTX implementation of the MRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef PTX_REGISTER_INFO_H
15 #define PTX_REGISTER_INFO_H
17 #include "llvm/Support/ErrorHandling.h"
18 #include "llvm/ADT/BitVector.h"
20 #include "PTXGenRegisterInfo.h.inc"
23 class PTXTargetMachine;
24 class MachineFunction;
26 struct PTXRegisterInfo : public PTXGenRegisterInfo {
27 PTXRegisterInfo(PTXTargetMachine &TM,
28 const TargetInstrInfo &TII) {}
30 virtual const unsigned
31 *getCalleeSavedRegs(const MachineFunction *MF = 0) const {
32 static const unsigned CalleeSavedRegs[] = { 0 };
33 return CalleeSavedRegs; // save nothing
36 virtual BitVector getReservedRegs(const MachineFunction &MF) const {
37 BitVector Reserved(getNumRegs());
38 return Reserved; // reserve no regs
41 virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI,
43 RegScavenger *RS = NULL) const {
44 llvm_unreachable("PTX does not support general function call");
47 virtual unsigned getFrameRegister(const MachineFunction &MF) const {
48 llvm_unreachable("PTX does not have a frame register");
52 virtual unsigned getRARegister() const {
53 llvm_unreachable("PTX does not have a return address register");
57 virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const {
58 return PTXGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
60 }; // struct PTXRegisterInfo
63 #endif // PTX_REGISTER_INFO_H