[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 11 08:13:04 PDT 2025


================
@@ -130,17 +389,136 @@ mlir::Value ScalarExprEmitter::VisitCastExpr(CastExpr *ce) {
   QualType destTy = ce->getType();
   CastKind kind = ce->getCastKind();
 
+  // These cases are generally not written to ignore the result of evaluating
+  // their sub-expressions, so we clear this now.
+  [[maybe_unused]] bool ignored = TestAndClearIgnoreResultAssign();
----------------
erichkeane wrote:

```suggestion
  TestAndClearIgnoreResultAssign();
```

More interestingly, why not just ignoreResultAssign = false; or something?

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


More information about the cfe-commits mailing list