[clang] [CIR] Upstream BinAssign for ComplexType (PR #144868)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 20 14:38:41 PDT 2025
================
@@ -48,6 +55,48 @@ static const ComplexType *getComplexType(QualType type) {
return cast<ComplexType>(cast<AtomicType>(type)->getValueType());
}
+LValue ComplexExprEmitter::emitBinAssignLValue(const BinaryOperator *e,
+ mlir::Value &value) {
+ assert(cgf.getContext().hasSameUnqualifiedType(e->getLHS()->getType(),
+ e->getRHS()->getType()) &&
+ "Invalid assignment");
+
+ // Emit the RHS. __block variables need the RHS evaluated first.
+ value = Visit(e->getRHS());
+
+ // Compute the address to store into.
+ LValue lhs = cgf.emitLValue(e->getLHS());
+
+ // Store the result value into the LHS lvalue.
+ emitStoreOfComplex(cgf.getLoc(e->getExprLoc()), value, lhs, /*isInit*/ false);
+ return lhs;
+}
+
+mlir::Value ComplexExprEmitter::emitCast(CastKind ck, Expr *op,
+ QualType destTy) {
+ switch (ck) {
+ case CK_LValueToRValue: {
----------------
andykaylor wrote:
Braces aren't needed here.
https://github.com/llvm/llvm-project/pull/144868
More information about the cfe-commits
mailing list