[TableGen] Fix a bug introduced in r256627. If the switch was not emitted we still emitted a closing curly brace.
llvm-svn: 256697
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index 4ec08b2..2ec6544 100644
--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
@@ -2170,11 +2170,12 @@
OS << " return false;\n";
}
}
- OS << " }\n";
// If there were case statements emitted into the string stream write the
// default.
- if (!EmittedSwitch)
+ if (EmittedSwitch)
+ OS << " }\n";
+ else
OS << " return false;\n";
OS << "}\n\n";