Skip to content

Commit 5a47507

Browse files
committed
[CIR][NFS] Fix missing return statement warning
1 parent 6fe62e9 commit 5a47507

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
102102
mlir::Type dstTy) const {
103103
if (mlir::isa<cir::IntType>(dstTy))
104104
return builder.createBoolToInt(value, dstTy);
105-
if (mlir::isa<cir::BoolType>(dstTy))
106-
return value;
105+
106+
assert(mlir::isa<cir::BoolType>(dstTy) && "Expect bool type");
107+
return value;
107108
}
108109

109110
//===--------------------------------------------------------------------===//
@@ -1857,9 +1858,6 @@ mlir::Value ScalarExprEmitter::VisitUnaryLNot(const UnaryOperator *e) {
18571858

18581859
// ZExt result to the expr type.
18591860
return maybePromoteBoolResult(boolVal, cgf.convertType(e->getType()));
1860-
1861-
cgf.cgm.errorNYI("destination type for logical-not unary operator is NYI");
1862-
return {};
18631861
}
18641862

18651863
/// Return the size or alignment of the type of argument of the sizeof

0 commit comments

Comments
 (0)