Skip to content

Commit d423a4c

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix unreachable-break issue in executorch/runtime/executor/method_meta.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: D78275955
1 parent 00491fd commit d423a4c

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

runtime/executor/method_meta.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,18 @@ Result<Tag> get_tag(
2424
return_type serialization_value,
2525
size_t index) {
2626
switch (serialization_value->val_type()) {
27-
case executorch_flatbuffer::KernelTypes::Null: {
27+
case executorch_flatbuffer::KernelTypes::Null:
2828
return Tag::None;
29-
} break;
30-
case executorch_flatbuffer::KernelTypes::Int: {
29+
case executorch_flatbuffer::KernelTypes::Int:
3130
return Tag::Int;
32-
} break;
33-
case executorch_flatbuffer::KernelTypes::Double: {
31+
case executorch_flatbuffer::KernelTypes::Double:
3432
return Tag::Double;
35-
} break;
36-
case executorch_flatbuffer::KernelTypes::Bool: {
33+
case executorch_flatbuffer::KernelTypes::Bool:
3734
return Tag::Bool;
38-
} break;
39-
case executorch_flatbuffer::KernelTypes::String: {
35+
case executorch_flatbuffer::KernelTypes::String:
4036
return Tag::String;
41-
} break;
42-
case executorch_flatbuffer::KernelTypes::Tensor: {
37+
case executorch_flatbuffer::KernelTypes::Tensor:
4338
return Tag::Tensor;
44-
} break;
4539
default:
4640
ET_LOG(
4741
Error,

0 commit comments

Comments
 (0)