[clang] [CIR] Upstream `AddressSpace` conversions support (PR #161212)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 7 16:11:21 PDT 2025
================
@@ -172,32 +190,28 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID,
builder.getUInt8Ty(), "bi_alloca", suitableAlignmentInBytes, size);
// Initialize the allocated buffer if required.
- if (builtinID != Builtin::BI__builtin_alloca_uninitialized) {
- // Initialize the alloca with the given size and alignment according to
- // the lang opts. Only the trivial non-initialization is supported for
- // now.
-
- switch (getLangOpts().getTrivialAutoVarInit()) {
- case LangOptions::TrivialAutoVarInitKind::Uninitialized:
- // Nothing to initialize.
- break;
- case LangOptions::TrivialAutoVarInitKind::Zero:
- case LangOptions::TrivialAutoVarInitKind::Pattern:
- cgm.errorNYI("trivial auto var init");
- break;
- }
- }
+ if (builtinID != Builtin::BI__builtin_alloca_uninitialized)
+ initializeAlloca(*this, allocaAddr, size, suitableAlignmentInBytes);
----------------
andykaylor wrote:
This change is unrelated to what you're doing in this PR. It should be done in a separate PR (probably when a second call to `initializeAlloca` is needed).
https://github.com/llvm/llvm-project/pull/161212
More information about the cfe-commits
mailing list