Skip to content

Commit b6f1833

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix unreachable-break issue in cinderx/Jit/lir/generator.cpp +5
Summary: LLVM has a warning `-Wunreachable-code-break` which identifies `break` statements that cannot be reached. These compromise readability, are misleading, and may identify bugs. This diff removes such statements. Such statements once existed to prevent accidental fallthroughs in switch statements. However, this is no longer necessary in C++17 because `[[fallthrough]]` is used to indicate intentional fallthroughs and we raise compilation errors for fallthroughs that are not annotated with `[[fallthrough]]` using `-Wimplicit-fallthrough`. For questions/comments, contact r-barnes. - If you approve of this diff, please use the "Accept & Ship" button :-) Reviewed By: dtolnay Differential Revision: D78276025 fbshipit-source-id: bf2543b9c6e61b7a934e8eaf6510d8a3092c5161
1 parent 9884521 commit b6f1833

2 files changed

Lines changed: 0 additions & 6 deletions

File tree

Jit/lir/generator.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,6 @@ LIRGenerator::TranslatedBlock LIRGenerator::TranslateOneBasicBlock(
821821
break;
822822
default:
823823
JIT_ABORT("not implemented");
824-
break;
825824
}
826825

827826
if (helper != 0) {
@@ -883,7 +882,6 @@ LIRGenerator::TranslatedBlock LIRGenerator::TranslateOneBasicBlock(
883882
}
884883
default: {
885884
JIT_ABORT("Invalid operation for DoubleBinaryOp");
886-
break;
887885
}
888886
}
889887

@@ -926,7 +924,6 @@ LIRGenerator::TranslatedBlock LIRGenerator::TranslateOneBasicBlock(
926924
break;
927925
default:
928926
JIT_ABORT("Not implemented {}", static_cast<int>(instr->op()));
929-
break;
930927
}
931928
bbb.appendInstr(instr->output(), op, instr->left(), instr->right());
932929
break;
@@ -1120,7 +1117,6 @@ LIRGenerator::TranslatedBlock LIRGenerator::TranslateOneBasicBlock(
11201117
default:
11211118
JIT_ABORT(
11221119
"Not implemented unary op {}", static_cast<int>(instr->op()));
1123-
break;
11241120
}
11251121
break;
11261122
}
@@ -1169,7 +1165,6 @@ LIRGenerator::TranslatedBlock LIRGenerator::TranslateOneBasicBlock(
11691165
}
11701166
case Opcode::kAssign: {
11711167
JIT_CHECK(false, "assign shouldn't be present");
1172-
break;
11731168
}
11741169
case Opcode::kBitCast: {
11751170
// BitCasts are purely informative

Jit/lir/postalloc.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ RewriteResult rewriteBitExtensionInstrs(instr_iter_t instr_iter) {
371371
case OperandBase::k64bit:
372372
case OperandBase::kObject:
373373
JIT_ABORT("can't be smaller than the maximum size");
374-
break;
375374
case OperandBase::kDouble:
376375
JIT_ABORT("A float point number cannot be the input of the instruction.");
377376
}

0 commit comments

Comments
 (0)