It is not an error if a rule does not match, it's just a failed match!
authorChris Lattner <sabre@nondot.org>
Mon, 11 Aug 2003 22:30:51 +0000 (22:30 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 11 Aug 2003 22:30:51 +0000 (22:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7761 91177308-0d34-0410-b5e6-96231b3b80d8

support/tools/TableGen/InstrSelectorEmitter.cpp
utils/TableGen/InstrSelectorEmitter.cpp

index 4f6a018413b1489414105ef0792dbdd0c941c22e..42d3c2207a90761f2f2687ffc1072f43430e2f45 100644 (file)
@@ -1064,8 +1064,9 @@ void InstrSelectorEmitter::run(std::ostream &OS) {
        << "    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)
index 4f6a018413b1489414105ef0792dbdd0c941c22e..42d3c2207a90761f2f2687ffc1072f43430e2f45 100644 (file)
@@ -1064,8 +1064,9 @@ void InstrSelectorEmitter::run(std::ostream &OS) {
        << "    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)