[clang] [CIR] Upstream binary assignments and comma (PR #135115)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 10 13:11:02 PDT 2025


================
@@ -807,6 +808,65 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
   VISITCOMP(EQ)
   VISITCOMP(NE)
 #undef VISITCOMP
+
+  mlir::Value VisitBinAssign(const BinaryOperator *e) {
+    const bool ignore = std::exchange(ignoreResultAssign, false);
+
+    mlir::Value rhs;
+    LValue lhs;
+
+    switch (e->getLHS()->getType().getObjCLifetime()) {
----------------
andykaylor wrote:

It's strange that this makes Objective C seem like the normal case. I would have expected something like `if (objC) { switch()...`. I found a couple of other places do something like `if (auto ownership = FQT.getObjCLifetime())` and then a switch like this. I wonder if that would result in better performance for the non-ObjectiveC path.

https://github.com/llvm/llvm-project/pull/135115


More information about the cfe-commits mailing list