Start parsing register classes into a more structured form


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15961 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/CodeGenTarget.h b/utils/TableGen/CodeGenTarget.h
index 2d65b7b..9b338d8 100644
--- a/utils/TableGen/CodeGenTarget.h
+++ b/utils/TableGen/CodeGenTarget.h
@@ -46,8 +46,10 @@
 
   mutable std::map<std::string, CodeGenInstruction> Instructions;
   mutable std::vector<CodeGenRegister> Registers;
-  void ReadInstructions() const;
+  mutable std::vector<CodeGenRegisterClass> RegisterClasses;
   void ReadRegisters() const;
+  void ReadRegisterClasses() const;
+  void ReadInstructions() const;
 public:
   CodeGenTarget();
 
@@ -73,6 +75,12 @@
     return Registers;
   }
 
+  const std::vector<CodeGenRegisterClass> getRegisterClasses() {
+    if (RegisterClasses.empty()) ReadRegisterClasses();
+    return RegisterClasses;
+  }
+
+
   /// getInstructions - Return all of the instructions defined for this target.
   ///
   const std::map<std::string, CodeGenInstruction> &getInstructions() const {