[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-15 Thread Henrich Lauko via cfe-commits
@@ -46,21 +52,124 @@ void CIRGenFunction::emitAutoVarAlloca(const VarDecl &d) { address = createTempAlloca(allocaTy, alignment, loc, d.getName()); declare(address.getPointer(), &d, ty, getLoc(d.getSourceRange()), alignment); + emission.Addr = address; setAddrOfLocalVar

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-11 Thread Andy Kaylor via cfe-commits
andykaylor wrote: Apparently the code formatting checker won't even let me mention "undef" in a comment. https://github.com/llvm/llvm-project/pull/130164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-07 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/130164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-07 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor closed https://github.com/llvm/llvm-project/pull/130164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-07 Thread Andy Kaylor via cfe-commits
@@ -46,21 +52,124 @@ void CIRGenFunction::emitAutoVarAlloca(const VarDecl &d) { address = createTempAlloca(allocaTy, alignment, loc, d.getName()); declare(address.getPointer(), &d, ty, getLoc(d.getSourceRange()), alignment); + emission.Addr = address; setAddrOfLocalVar

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-06 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,322 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-06 Thread Henrich Lauko via cfe-commits
@@ -94,10 +203,59 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) { assert(d.hasLocalStorage()); - assert(!cir::MissingFeatures::opAllocaVarDeclContext()); + CIRGenFunction::VarDeclContext varDeclCtx{*this, &d}; return emitAutoVarDecl(d); } +void CIRGenFunctio

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/130164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-06 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/130164 >From 69c7104391ff9b6ae1dbcb6275a3070da4f8dd02 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Tue, 4 Mar 2025 10:21:24 -0800 Subject: [PATCH 1/2] [CIR] Emit init of local variables Local variable initializ

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-06 Thread Andy Kaylor via cfe-commits
@@ -46,21 +52,124 @@ void CIRGenFunction::emitAutoVarAlloca(const VarDecl &d) { address = createTempAlloca(allocaTy, alignment, loc, d.getName()); declare(address.getPointer(), &d, ty, getLoc(d.getSourceRange()), alignment); + emission.Addr = address; setAddrOfLocalVar

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-06 Thread Andy Kaylor via cfe-commits
@@ -94,10 +203,59 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) { assert(d.hasLocalStorage()); - assert(!cir::MissingFeatures::opAllocaVarDeclContext()); + CIRGenFunction::VarDeclContext varDeclCtx{*this, &d}; return emitAutoVarDecl(d); } +void CIRGenFunctio

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-06 Thread Henrich Lauko via cfe-commits
@@ -46,21 +52,124 @@ void CIRGenFunction::emitAutoVarAlloca(const VarDecl &d) { address = createTempAlloca(allocaTy, alignment, loc, d.getName()); declare(address.getPointer(), &d, ty, getLoc(d.getSourceRange()), alignment); + emission.Addr = address; setAddrOfLocalVar

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-06 Thread Erich Keane via cfe-commits
@@ -0,0 +1,322 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: 1 comment, but I don't feel comfortable approving this with some of the work, so I'll count on the CIR reviewers (David, Henrick, Bruno, Nathan, etc) to do the approval. https://github.com/llvm/llvm-project/pull/130164 __

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) Changes Local variable initialization was previously being ignored. This change adds support for initialization of scalar variables with constant values and introduces the constant emitter framework. --- Patch i

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-06 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/130164 Local variable initialization was previously being ignored. This change adds support for initialization of scalar variables with constant values and introduces the constant emitter framework. >From 69c71043