[Mlir-commits] [mlir] [mlir][EmitC] Make pre-increment and pre-decrement return left value (PR #212391)

Jianjian Guan llvmlistbot at llvm.org
Tue Jul 28 23:53:06 PDT 2026


jacquesguan wrote:

> Thanks for addressing that @jacquesguan ! Note that the pre-ops only return lvalues in C++: In C, they return rvalues. So these ops need to allow both. Their must-be-inlined behavior should also depend on that, I think.

I’m curious about the proper way to handle differences between C and C++ in EmitC. One approach would be to have pre-operations accept both lvalues and rvalues as result types. However, returning rvalues would still be considered incorrect in C++. Alternatively, we could add a flag or attribute to indicate whether the code is being executed in C++ mode.

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


More information about the Mlir-commits mailing list