[llvm] r225112 - Replace some 'unreachable' comments with llvm_unreachable.

Craig Topper craig.topper at gmail.com
Sat Jan 3 00:16:14 PST 2015


Author: ctopper
Date: Sat Jan  3 02:16:14 2015
New Revision: 225112

URL: http://llvm.org/viewvc/llvm-project?rev=225112&view=rev
Log:
Replace some 'unreachable' comments with llvm_unreachable.

Modified:
    llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp

Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=225112&r1=225111&r2=225112&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sat Jan  3 02:16:14 2015
@@ -2834,7 +2834,7 @@ void AsmMatcherEmitter::run(raw_ostream
   OS << "  // Find the appropriate table for this asm variant.\n";
   OS << "  const MatchEntry *Start, *End;\n";
   OS << "  switch (VariantID) {\n";
-  OS << "  default: // unreachable\n";
+  OS << "  default: llvm_unreachable(\"invalid variant!\");\n";
   for (unsigned VC = 0; VC != VariantCount; ++VC) {
     Record *AsmVariant = Target.getAsmParserVariant(VC);
     int AsmVariantNo = AsmVariant->getValueAsInt("Variant");
@@ -2888,7 +2888,7 @@ void AsmMatcherEmitter::run(raw_ostream
   OS << "  // Find the appropriate table for this asm variant.\n";
   OS << "  const MatchEntry *Start, *End;\n";
   OS << "  switch (VariantID) {\n";
-  OS << "  default: // unreachable\n";
+  OS << "  default: llvm_unreachable(\"invalid variant!\");\n";
   for (unsigned VC = 0; VC != VariantCount; ++VC) {
     Record *AsmVariant = Target.getAsmParserVariant(VC);
     int AsmVariantNo = AsmVariant->getValueAsInt("Variant");





More information about the llvm-commits mailing list