[clang] [clang][CodeGen] Emit file-scope compound literals in a constant context (PR #221390)
Akash Manna via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 21 21:54:12 PDT 2026
================
@@ -22210,6 +22210,52 @@ bool Expr::EvaluateAsInitializer(const ASTContext &Ctx, const VarDecl *VD,
CheckMemoryLeaks(Info);
}
+bool Expr::EvaluateAsConstantInitializer(EvalResult &Result,
----------------
akash-manna-sky wrote:
Done. The separate function is removed; a new `ConstantExprKind::Initializer` makes `EvaluateAsConstantExpr` fold through undefined behavior like `isConstantInitializer` did, and the bytecode `Context::evaluate` now uses its `Kind` to keep the initialized object alive.
https://github.com/llvm/llvm-project/pull/221390
More information about the cfe-commits
mailing list