llvm-project
9099ddf1 - [CIR] Support ConstantExpr in CIRGenFunction::emitLValue (#237421)

Commit
7 hours ago
[CIR] Support ConstantExpr in CIRGenFunction::emitLValue (#237421) ### Description This patch adds `ConstantExpr` handling to `CIRGenFunction::emitLValue`, establishing parity with classic Clang CodeGen (`clang/lib/CodeGen/CGExpr.cpp:1825-1830`) and completing AST visitor coverage across CIR. In ClangIR, `ConstantExpr` was already supported in `ScalarExprEmitter` (`CIRGenExprScalar.cpp:147`) and `AggExprEmitter` (`CIRGenExprAggregate.cpp:344`), but was stubbed with `errorNYI` in `CIRGenFunction::emitLValue`: ```cpp case Expr::ConstantExprClass: getCIRGenModule().errorNYI(e->getSourceRange(), "emitLValue: ConstantExpr"); return LValue(); ``` Classic Clang unwraps and evaluates the subexpression when evaluating an lvalue. This patch brings `CIRGenFunction::emitLValue` in line with classic Clang by delegating to `emitLValue(cast<ConstantExpr>(e)->getSubExpr())`. Fixes #237403.
Author
Parents
Loading