================ @@ -52,6 +54,19 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> { return {}; } + /// Emits the address of the l-value, then loads and returns the result. + mlir::Value emitLoadOfLValue(const Expr *e) { + LValue lv = cgf.emitLValue(e); + // FIXME: add some akin to EmitLValueAlignmentAssumption(E, V); + return cgf.emitLoadOfLValue(lv, e->getExprLoc()).getScalarVal(); + } + + // l-values + mlir::Value VisitDeclRefExpr(DeclRefExpr *e) { + // TODO: Handle constant emission ---------------- andykaylor wrote:
The missing code here is a call to `tryEmitAsConstant()` and there's no simple way to test whether it will do anything. I'll put in a MissingFeature assert. https://github.com/llvm/llvm-project/pull/128792 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits