Skip to content

Commit

Permalink
[Flang] Use llvm_unreachable to replace assert, NFC
Browse files Browse the repository at this point in the history
IIUC, the `default` case should be unreachable inferred from the context.

Reviewed By: kkwli0

Differential Revision: https://reviews.llvm.org/D154344
  • Loading branch information
bzEq committed Jul 4, 2023
1 parent 8b8e62d commit fb09f9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flang/lib/Optimizer/Builder/PPCIntrinsicCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ PPCIntrinsicLibrary::genVecCmp(mlir::Type resultType,
break;
}
default:
assert(false && "Invalid vector operation for generator");
llvm_unreachable("Invalid vector operation for generator");
}
} else if (vecTyInfo.isFloat()) {
mlir::Value vargs[2];
Expand All @@ -631,12 +631,12 @@ PPCIntrinsicLibrary::genVecCmp(mlir::Type resultType,
vargs[1] = argBases[0];
break;
default:
assert(false && "Invalid vector operation for generator");
llvm_unreachable("Invalid vector operation for generator");
}
auto callOp{builder.create<fir::CallOp>(loc, funcOp, vargs)};
res = callOp.getResult(0);
} else
assert(false && "invalid vector type");
llvm_unreachable("invalid vector type");

return res;
}
Expand Down

0 comments on commit fb09f9f

Please sign in to comment.