[clang] [CIR] Defer declarations and tentative definitions (PR #141700)

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

[clang] [CIR] Defer declarations and tentative definitions (PR #141700)

2025-05-28 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/141700 >From f0520c397b3739c09aeaf75c20e33ecf9053c2af Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 23 May 2025 17:53:48 -0700 Subject: [PATCH 1/2] [CIR] Defer declarations and tentative definitions This ch

[clang] [CIR] Defer declarations and tentative definitions (PR #141700)

2025-05-28 Thread Andy Kaylor via cfe-commits
@@ -135,6 +135,10 @@ class CIRGenConsumer : public clang::ASTConsumer { } } } + + void CompleteTentativeDefinition(VarDecl *D) override { +Gen->CompleteTentativeDefinition(D); + } andykaylor wrote: We're using clang naming style in this file ba

[clang] [CIR] Defer declarations and tentative definitions (PR #141700)

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

[clang] [CIR] Defer declarations and tentative definitions (PR #141700)

2025-05-28 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/141700 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Defer declarations and tentative definitions (PR #141700)

2025-05-28 Thread Henrich Lauko via cfe-commits
@@ -135,6 +135,10 @@ class CIRGenConsumer : public clang::ASTConsumer { } } } + + void CompleteTentativeDefinition(VarDecl *D) override { +Gen->CompleteTentativeDefinition(D); + } xlauko wrote: ```suggestion void CompleteTentativeDefinition(V

[clang] [CIR] Defer declarations and tentative definitions (PR #141700)

2025-05-28 Thread Henrich Lauko via cfe-commits
@@ -1044,6 +1057,24 @@ StringRef CIRGenModule::getMangledName(GlobalDecl gd) { return mangledDeclNames[canonicalGd] = result.first->first(); } +void CIRGenModule::emitTentativeDefinition(const VarDecl *d) { + assert(!d->getInit() && "Cannot emit definite definitions here!")

[clang] [CIR] Defer declarations and tentative definitions (PR #141700)

2025-05-28 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm, with minor nits https://github.com/llvm/llvm-project/pull/141700 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Defer declarations and tentative definitions (PR #141700)

2025-05-27 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) Changes This change adds code to defer emitting declarations and tentative definitions until they are referenced or trigger by a call to CompleteTentativeDefinition. This is needed to avoid premature handling of d

[clang] [CIR] Defer declarations and tentative definitions (PR #141700)

2025-05-27 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/141700 This change adds code to defer emitting declarations and tentative definitions until they are referenced or trigger by a call to CompleteTentativeDefinition. This is needed to avoid premature handling of dec