[clang] [CIR] Implement Statement Expressions (PR #153677)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 14 16:26:37 PDT 2025
================
@@ -23,16 +25,57 @@ using namespace clang;
using namespace clang::CIRGen;
using namespace cir;
-void CIRGenFunction::emitCompoundStmtWithoutScope(const CompoundStmt &s) {
- for (auto *curStmt : s.body()) {
- if (emitStmt(curStmt, /*useCurrentScope=*/false).failed())
- getCIRGenModule().errorNYI(curStmt->getSourceRange(),
- std::string("emitCompoundStmtWithoutScope: ") +
- curStmt->getStmtClassName());
+mlir::LogicalResult CIRGenFunction::emitCompoundStmtWithoutScope(
+ const CompoundStmt &s, Address *lastValue, AggValueSlot slot) {
+ const Stmt *exprResult = s.getStmtExprResult();
+ assert((!lastValue || (lastValue && exprResult)) &&
+ "If lastValue is not null then the CompoundStmt must have a "
+ "StmtExprResult");
+
+ for (Stmt *curStmt : s.body()) {
----------------
andykaylor wrote:
```suggestion
for (const Stmt *curStmt : s.body()) {
```
https://github.com/llvm/llvm-project/pull/153677
More information about the cfe-commits
mailing list