Skip to content

Commit 31ef033

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix unreachable-break issue in cea/chips/cache_benchmarks/memtier_client/protocol.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 rbarnes. - If you approve of this diff, please use the "Accept & Ship" button :-) Reviewed By: dtolnay Differential Revision: D78275946 fbshipit-source-id: 10be8205e8567233eac63b10a772d10987d3480f
1 parent b6f1833 commit 31ef033

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

Jit/codegen/autogen.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ void AutoTranslator::translateInstr(Environ* env, const Instruction* instr)
122122
break;
123123
default:
124124
JIT_ABORT("Output operand has to be of type register or memory");
125-
break;
126125
}
127126
}
128127

@@ -144,7 +143,6 @@ void AutoTranslator::translateInstr(Environ* env, const Instruction* instr)
144143
break;
145144
default:
146145
JIT_ABORT("Illegal input type.");
147-
break;
148146
}
149147
});
150148

@@ -323,7 +321,6 @@ void TranslateCompare(Environ* env, const Instruction* instr) {
323321
break;
324322
default:
325323
JIT_ABORT("bad instruction for TranslateCompare");
326-
break;
327324
}
328325
if (instr->output()->dataType() != OperandBase::k8bit) {
329326
as->movzx(

0 commit comments

Comments
 (0)