Expose the actual valuetype of each register class
authorChris Lattner <sabre@nondot.org>
Sun, 2 Oct 2005 06:23:19 +0000 (06:23 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 2 Oct 2005 06:23:19 +0000 (06:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23583 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/MRegisterInfo.h

index 09fdcbec101713fe0876582daf721e2048d3322c..2395670b0bf31ad88421553f57db10fdd7bcbd98 100644 (file)
@@ -17,6 +17,7 @@
 #define LLVM_TARGET_MREGISTERINFO_H
 
 #include "llvm/CodeGen/MachineBasicBlock.h"
+#include "llvm/Codegen/ValueTypes.h"
 #include <cassert>
 #include <functional>
 
@@ -44,13 +45,18 @@ public:
   typedef const unsigned* const_iterator;
 
 private:
+  MVT::ValueType VT;
   const unsigned RegSize, Alignment;    // Size & Alignment of register in bytes
   const iterator RegsBegin, RegsEnd;
 public:
-  TargetRegisterClass(unsigned RS, unsigned Al, iterator RB, iterator RE)
-    : RegSize(RS), Alignment(Al), RegsBegin(RB), RegsEnd(RE) {}
+  TargetRegisterClass(MVT::ValueType vt, unsigned RS, unsigned Al, iterator RB, iterator RE)
+    : VT(vt), RegSize(RS), Alignment(Al), RegsBegin(RB), RegsEnd(RE) {}
   virtual ~TargetRegisterClass() {}     // Allow subclasses
 
+  /// getType - Return the declared value type for this register class.
+  ///
+  MVT::ValueType getType() const { return VT; }
+  
   // begin/end - Return all of the registers in this class.
   iterator       begin() const { return RegsBegin; }
   iterator         end() const { return RegsEnd; }