================
@@ -2147,11 +2148,23 @@ mlir::Value ScalarExprEmitter::VisitRealImag(const
UnaryOperator *e,
return {};
}
- // __real or __imag on a scalar returns zero. Emit the subexpr to ensure side
+ if (e->getOpcode() == UO_Real) {
+ return promotionTy.isNull() ? Visit(op)
+ : cgf.emitPromotedScalarExpr(op, promotionTy);
+ }
+
+ // __imag on a scalar returns zero. Emit the subexpr to ensure side
// effects are evaluated, but not the actual value.
- cgf.cgm.errorNYI(e->getSourceRange(),
- "VisitRealImag __real or __imag on a scalar");
- return {};
+ if (op->isGLValue())
----------------
AmrDeveloper wrote:
Sure, I will rename them and also add one case to cover the else branch
https://github.com/llvm/llvm-project/pull/159916
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits