From a2886c21d9a08d63c324cc61aa91ae0893507a31 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 7 Feb 2012 05:05:23 +0000 Subject: Convert assert(0) to llvm_unreachable llvm-svn: 149967 --- llvm/lib/TableGen/Record.cpp | 2 +- llvm/lib/TableGen/TGParser.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'llvm/lib/TableGen') diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp index e8f23e48887..fece0df412c 100644 --- a/llvm/lib/TableGen/Record.cpp +++ b/llvm/lib/TableGen/Record.cpp @@ -942,7 +942,7 @@ Init *BinOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const { int64_t LHSv = LHSi->getValue(), RHSv = RHSi->getValue(); int64_t Result; switch (getOpcode()) { - default: assert(0 && "Bad opcode!"); + default: llvm_unreachable("Bad opcode!"); case SHL: Result = LHSv << RHSv; break; case SRA: Result = LHSv >> RHSv; break; case SRL: Result = (uint64_t)LHSv >> (uint64_t)RHSv; break; diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index 0f64f4bcdac..c7cf097aee1 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -729,7 +729,7 @@ Init *TGParser::ParseOperation(Record *CurRec) { RecTy *Type = 0; switch (Lex.getCode()) { - default: assert(0 && "Unhandled code!"); + default: llvm_unreachable("Unhandled code!"); case tgtok::XCast: Lex.Lex(); // eat the operation Code = UnOpInit::CAST; @@ -845,7 +845,7 @@ Init *TGParser::ParseOperation(Record *CurRec) { RecTy *Type = 0; switch (OpTok) { - default: assert(0 && "Unhandled code!"); + default: llvm_unreachable("Unhandled code!"); case tgtok::XConcat: Code = BinOpInit::CONCAT;Type = DagRecTy::get(); break; case tgtok::XSRA: Code = BinOpInit::SRA; Type = IntRecTy::get(); break; case tgtok::XSRL: Code = BinOpInit::SRL; Type = IntRecTy::get(); break; @@ -909,7 +909,7 @@ Init *TGParser::ParseOperation(Record *CurRec) { tgtok::TokKind LexCode = Lex.getCode(); Lex.Lex(); // eat the operation switch (LexCode) { - default: assert(0 && "Unhandled code!"); + default: llvm_unreachable("Unhandled code!"); case tgtok::XIf: Code = TernOpInit::IF; break; @@ -954,7 +954,7 @@ Init *TGParser::ParseOperation(Record *CurRec) { Lex.Lex(); // eat the ')' switch (LexCode) { - default: assert(0 && "Unhandled code!"); + default: llvm_unreachable("Unhandled code!"); case tgtok::XIf: { // FIXME: The `!if' operator doesn't handle non-TypedInit well at // all. This can be made much more robust. -- cgit v1.2.3