[llvm-commits] CVS: llvm/utils/TableGen/InstrSelectorEmitter.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Aug 11 17:32:01 PDT 2003


Changes in directory llvm/utils/TableGen:

InstrSelectorEmitter.cpp updated: 1.26 -> 1.27

---
Log message:

It is not an error if a rule does not match, it's just a failed match!


---
Diffs of the changes:

Index: llvm/utils/TableGen/InstrSelectorEmitter.cpp
diff -u llvm/utils/TableGen/InstrSelectorEmitter.cpp:1.26 llvm/utils/TableGen/InstrSelectorEmitter.cpp:1.27
--- llvm/utils/TableGen/InstrSelectorEmitter.cpp:1.26	Mon Aug 11 16:28:59 2003
+++ llvm/utils/TableGen/InstrSelectorEmitter.cpp	Mon Aug 11 17:30:51 2003
@@ -1064,8 +1064,9 @@
        << "    return N->getCostFor(" << SlotName << "_Slot);\n\n"
        << "  unsigned Cost;\n"
        << "  switch (N->getNodeType()) {\n"
-       << "  default: assert(0 && \"Unhandled node type for " << SlotName
-       << "!\");\n";
+       << "  default: Cost = ~0U >> 1;   // Match failed\n"
+       << "           N->setPatternCostFor(" << SlotName << "_Slot, NoMatchPattern, Cost, NumSlots);\n"
+       << "           break;\n";
 
     for (PatternOrganizer::NodesForSlot::iterator J = I->second.begin(),
            E = I->second.end(); J != E; ++J)





More information about the llvm-commits mailing list