Subtarget feature can now set any variable to any value
llvm-svn: 25678
diff --git a/llvm/utils/TableGen/SubtargetEmitter.cpp b/llvm/utils/TableGen/SubtargetEmitter.cpp
index a6cee21..091cbc6 100644
--- a/llvm/utils/TableGen/SubtargetEmitter.cpp
+++ b/llvm/utils/TableGen/SubtargetEmitter.cpp
@@ -473,10 +473,11 @@
Record *R = Features[i];
std::string Instance = R->getName();
std::string Name = R->getValueAsString("Name");
- std::string Type = R->getValueAsString("Type");
+ std::string Value = R->getValueAsString("Value");
std::string Attribute = R->getValueAsString("Attribute");
-
- OS << " " << Attribute << " = (Bits & " << Instance << ") != 0;\n";
+
+ OS << " if ((Bits & " << Instance << ") != 0) "
+ << Attribute << " = " << Value << ";\n";
}
if (HasItineraries) {