LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NVPTXRegisterInfo.h
Go to the documentation of this file.
1 //===- NVPTXRegisterInfo.h - NVPTX 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 NVPTX implementation of the TargetRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef NVPTXREGISTERINFO_H
15 #define NVPTXREGISTERINFO_H
16 
17 #include "ManagedStringPool.h"
19 
20 #define GET_REGINFO_HEADER
21 #include "NVPTXGenRegisterInfo.inc"
23 #include <sstream>
24 
25 namespace llvm {
26 
27 // Forward Declarations.
28 class TargetInstrInfo;
29 class NVPTXSubtarget;
30 
32 private:
33  bool Is64Bit;
34  // Hold Strings that can be free'd all together with NVPTXRegisterInfo
35  ManagedStringPool ManagedStrPool;
36 
37 public:
39 
40  //------------------------------------------------------
41  // Pure virtual functions from TargetRegisterInfo
42  //------------------------------------------------------
43 
44  // NVPTX callee saved registers
45  virtual const uint16_t *
46  getCalleeSavedRegs(const MachineFunction *MF = 0) const;
47 
48  // NVPTX callee saved register classes
49  virtual const TargetRegisterClass *const *
51 
52  virtual BitVector getReservedRegs(const MachineFunction &MF) const;
53 
54  virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
55  unsigned FIOperandNum,
56  RegScavenger *RS = NULL) const;
57 
58  virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const;
59  virtual unsigned getFrameRegister(const MachineFunction &MF) const;
60  virtual unsigned getRARegister() const;
61 
63  return const_cast<ManagedStringPool *>(&ManagedStrPool);
64  }
65 
66  const char *getName(unsigned RegNo) const {
67  std::stringstream O;
68  O << "reg" << RegNo;
69  return getStrPool()->getManagedString(O.str().c_str())->c_str();
70  }
71 
72 };
73 
74 std::string getNVPTXRegClassName(const TargetRegisterClass *RC);
75 std::string getNVPTXRegClassStr(const TargetRegisterClass *RC);
76 
77 } // end namespace llvm
78 
79 #endif
ManagedStringPool * getStrPool() const
virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const
virtual const uint16_t * getCalleeSavedRegs(const MachineFunction *MF=0) const
NVPTX Callee Saved Registers.
virtual BitVector getReservedRegs(const MachineFunction &MF) const
virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=NULL) const
bundle_iterator< MachineInstr, instr_iterator > iterator
virtual unsigned getRARegister() const
SmallVectorImpl< T >::const_pointer c_str(SmallVectorImpl< T > &str)
Definition: Windows.h:154
std::string * getManagedString(const char *S)
virtual const TargetRegisterClass *const * getCalleeSavedRegClasses(const MachineFunction *MF) const
std::string getNVPTXRegClassStr(TargetRegisterClass const *RC)
std::string getNVPTXRegClassName(TargetRegisterClass const *RC)
virtual unsigned getFrameRegister(const MachineFunction &MF) const
const char * getName(unsigned RegNo) const
NVPTXRegisterInfo(const NVPTXSubtarget &st)