[llvm-commits] CVS: llvm/utils/TableGen/InstrSelectorEmitter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Aug 7 14:43:01 PDT 2003
Changes in directory llvm/utils/TableGen:
InstrSelectorEmitter.cpp updated: 1.8 -> 1.9
---
Log message:
Use the new version of isSubClassOf
---
Diffs of the changes:
Index: llvm/utils/TableGen/InstrSelectorEmitter.cpp
diff -u llvm/utils/TableGen/InstrSelectorEmitter.cpp:1.8 llvm/utils/TableGen/InstrSelectorEmitter.cpp:1.9
--- llvm/utils/TableGen/InstrSelectorEmitter.cpp:1.8 Thu Aug 7 14:28:55 2003
+++ llvm/utils/TableGen/InstrSelectorEmitter.cpp Thu Aug 7 14:42:14 2003
@@ -110,18 +110,17 @@
static MVT::ValueType getIntrinsicType(Record *R) {
// Check to see if this is a register or a register class...
- const std::vector<Record*> &SuperClasses = R->getSuperClasses();
- for (unsigned i = 0, e = SuperClasses.size(); i != e; ++i)
- if (SuperClasses[i]->getName() == "RegisterClass") {
- return getValueType(R->getValueAsDef("RegType"));
- } else if (SuperClasses[i]->getName() == "Register") {
- std::cerr << "WARNING: Explicit registers not handled yet!\n";
- return MVT::Other;
- } else if (SuperClasses[i]->getName() == "Nonterminal") {
- //std::cerr << "Warning nonterminal type not handled yet:" << R->getName()
- // << "\n";
- return MVT::Other;
- }
+ if (R->isSubClassOf("RegisterClass")) {
+ return getValueType(R->getValueAsDef("RegType"));
+ } else if (R->isSubClassOf("Register")) {
+ std::cerr << "WARNING: Explicit registers not handled yet!\n";
+ return MVT::Other;
+ } else if (R->isSubClassOf("Nonterminal")) {
+ //std::cerr << "Warning nonterminal type not handled yet:" << R->getName()
+ // << "\n";
+ return MVT::Other;
+ }
+
throw "Error: Unknown value used: " + R->getName();
}
More information about the llvm-commits
mailing list