Skip to content

Commit 5700531

Browse files
committed
[mlir][emitc] Use LLVM_FALLTHROUGH
The switch case code was simplified using LLVM_FALLTHROUGH.
1 parent ed5bd23 commit 5700531

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mlir/lib/Dialect/EmitC/IR/EmitC.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "llvm/ADT/STLExtras.h"
1818
#include "llvm/ADT/TypeSwitch.h"
1919
#include "llvm/Support/Casting.h"
20+
#include "llvm/Support/Compiler.h"
2021

2122
using namespace mlir;
2223
using namespace mlir::emitc;
@@ -114,11 +115,10 @@ bool mlir::emitc::isIntegerIndexOrOpaqueType(Type type) {
114115
bool mlir::emitc::isSupportedFloatType(Type type) {
115116
if (auto floatType = llvm::dyn_cast<FloatType>(type)) {
116117
switch (floatType.getWidth()) {
117-
case 16: {
118-
if (llvm::isa<Float16Type, BFloat16Type>(type))
119-
return true;
120-
return false;
121-
}
118+
case 16:
119+
if (!llvm::isa<Float16Type, BFloat16Type>(type))
120+
return false;
121+
LLVM_FALLTHROUGH;
122122
case 32:
123123
case 64:
124124
return true;

0 commit comments

Comments
 (0)