forked from OSchip/llvm-project
Change to assert(0,x) to llvm_unreachable(x)
This avoids fall-through error in opt mode: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] PiperOrigin-RevId: 203616256
This commit is contained in:
parent
67c03193de
commit
f9da10ce45
|
@ -227,7 +227,7 @@ void MLFunctionState::print(const Statement *stmt) {
|
|||
os.indent(numSpaces);
|
||||
switch (stmt->getKind()) {
|
||||
case Statement::Kind::Operation: // TODO
|
||||
assert(0 && "Operation statement is not yet implemented");
|
||||
llvm_unreachable("Operation statement is not yet implemented");
|
||||
case Statement::Kind::For:
|
||||
return print(cast<ForStmt>(stmt));
|
||||
case Statement::Kind::If:
|
||||
|
|
|
@ -87,7 +87,7 @@ std::string Token::getStringValue() const {
|
|||
/// literal tokens since they have no fixed spelling.
|
||||
StringRef Token::getTokenSpelling(Kind kind) {
|
||||
switch (kind) {
|
||||
default: assert(0 && "This token kind has no fixed spelling");
|
||||
default: llvm_unreachable("This token kind has no fixed spelling");
|
||||
#define TOK_PUNCTUATION(NAME, SPELLING) case NAME: return SPELLING;
|
||||
#define TOK_OPERATOR(NAME, SPELLING) case NAME: return SPELLING;
|
||||
#define TOK_KEYWORD(SPELLING) case kw_##SPELLING: return #SPELLING;
|
||||
|
|
Loading…
Reference in New Issue