Made a single common InvalidRegNum = -1.
authorVikram S. Adve <vadve@cs.uiuc.edu>
Sat, 31 May 2003 07:44:07 +0000 (07:44 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Sat, 31 May 2003 07:44:07 +0000 (07:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6473 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetRegInfo.h

index 69dcadbb7634a32a5df550b46e5d48981744d858..29e10d395e59dbdb1c20c863262463e900e4135c 100644 (file)
@@ -65,6 +65,11 @@ protected:
 public:
   const TargetMachine &target;
 
+  // A register can be initialized to an invalid number. That number can
+  // be obtained using this method.
+  //
+  static int getInvalidRegNum() { return -1; }
+
   TargetRegInfo(const TargetMachine& tgt) : target(tgt) { }
   ~TargetRegInfo() {
     for (unsigned i = 0, e = MachineRegClassArr.size(); i != e; ++i)
@@ -209,12 +214,15 @@ public:
   }
   
   // Returns the assembly-language name of the specified machine register.
+  // 
   const char * const getUnifiedRegName(int UnifiedRegNum) const {
     unsigned regClassID = getNumOfRegClasses(); // initialize to invalid value
     int regNumInClass = getClassRegNum(UnifiedRegNum, regClassID);
     return MachineRegClassArr[regClassID]->getRegName(regNumInClass);
   }
 
+  // Get the register type for a register identified different ways.
+  // 
   virtual int getRegType(const Type* type) const = 0;
   virtual int getRegType(const LiveRange *LR) const = 0;
   virtual int getRegType(int unifiedRegNum) const = 0;
@@ -224,11 +232,6 @@ public:
   virtual unsigned getFramePointer() const = 0;
   virtual unsigned getStackPointer() const = 0;
 
-  // A register can be initialized to an invalid number. That number can
-  // be obtained using this method.
-  //
-  virtual int getInvalidRegNum() const = 0;
-
   // Method for inserting caller saving code. The caller must save all the
   // volatile registers across a call based on the calling conventions of
   // an architecture. This must insert code for saving and restoring