For PR786:
[oota-llvm.git] / lib / Target / Sparc / SparcRegisterInfo.h
index 784a8e5c805ccd5ab7e631fa304ca3f6a801c5f6..bbb11f86dee029e29cf181984ac96ae144bc115c 100644 (file)
@@ -1,4 +1,4 @@
-//===- SparcV8RegisterInfo.h - SparcV8 Register Information Impl -*- C++ -*-==//
+//===- SparcRegisterInfo.h - Sparc Register Information Impl ----*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,22 +7,25 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file contains the SparcV8 implementation of the MRegisterInfo class.
+// This file contains the Sparc implementation of the MRegisterInfo class.
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef SPARCV8REGISTERINFO_H
-#define SPARCV8REGISTERINFO_H
+#ifndef SPARCREGISTERINFO_H
+#define SPARCREGISTERINFO_H
 
 #include "llvm/Target/MRegisterInfo.h"
-#include "SparcV8GenRegisterInfo.h.inc"
+#include "SparcGenRegisterInfo.h.inc"
 
 namespace llvm {
 
+class SparcSubtarget;
 class Type;
 
-struct SparcV8RegisterInfo : public SparcV8GenRegisterInfo {
-  SparcV8RegisterInfo();
+struct SparcRegisterInfo : public SparcGenRegisterInfo {
+  SparcSubtarget &Subtarget;
+  
+  SparcRegisterInfo(SparcSubtarget &st);
 
   /// Code Generation virtual methods...
   void storeRegToStackSlot(MachineBasicBlock &MBB,
@@ -43,6 +46,10 @@ struct SparcV8RegisterInfo : public SparcV8GenRegisterInfo {
                                           unsigned OpNum,
                                           int FrameIndex) const;
 
+  const unsigned *getCalleeSaveRegs() const;
+
+  const TargetRegisterClass* const* getCalleeSaveRegClasses() const;
+
   void eliminateCallFramePseudoInstr(MachineFunction &MF,
                                      MachineBasicBlock &MBB,
                                      MachineBasicBlock::iterator I) const;
@@ -53,6 +60,10 @@ struct SparcV8RegisterInfo : public SparcV8GenRegisterInfo {
 
   void emitPrologue(MachineFunction &MF) const;
   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
+  
+  // Debug information queries.
+  unsigned getRARegister() const;
+  unsigned getFrameRegister(MachineFunction &MF) const;
 };
 
 } // end namespace llvm