Skip to content

Commit 79c9b9f

Browse files
committed
Address code review comments
1 parent 324b521 commit 79c9b9f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID,
7575
mlir::Value complex = builder.createComplexCreate(loc, real, imag);
7676
return RValue::get(complex);
7777
}
78+
default:
79+
break;
7880
}
7981

8082
cgm.errorNYI(loc, "non constant foldable builtin calls");

clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ mlir::Value ComplexExprEmitter::VisitCallExpr(const CallExpr *e) {
7474
if (e->getCallReturnType(cgf.getContext())->isReferenceType())
7575
return emitLoadOfLValue(e);
7676

77-
mlir::Location loc = cgf.getLoc(e->getExprLoc());
78-
auto complex = cgf.emitCallExpr(e).getComplexVal();
79-
return builder.createComplexCreate(loc, complex.first, complex.second);
77+
return cgf.emitCallExpr(e).getValue();
8078
}
8179

8280
mlir::Value ComplexExprEmitter::VisitInitListExpr(InitListExpr *e) {

0 commit comments

Comments
 (0)