Compute the value types that are natively supported by a target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23282 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp
index bd02ccd..61e237f 100644
--- a/utils/TableGen/CodeGenTarget.cpp
+++ b/utils/TableGen/CodeGenTarget.cpp
@@ -152,6 +152,7 @@
   Namespace = R->getValueAsString("Namespace");
   SpillSize = R->getValueAsInt("Size");
   SpillAlignment = R->getValueAsInt("Alignment");
+  VT = getValueType(R->getValueAsDef("RegType"));
 
   if (CodeInit *CI = dynamic_cast<CodeInit*>(R->getValueInit("MethodBodies")))
     MethodBodies = CI->getValue();
@@ -182,6 +183,11 @@
   return TheDef->getName();
 }
 
+void CodeGenTarget::ReadLegalValueTypes() const {
+  const std::vector<CodeGenRegisterClass> &RCs = getRegisterClasses();
+  for (unsigned i = 0, e = RCs.size(); i != e; ++i)
+    LegalValueTypes.push_back(RCs[i].VT);
+}
 
 
 void CodeGenTarget::ReadInstructions() const {