[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-10-03 Thread Jonas Hahnfeld via cfe-commits
hahnjo wrote: Note that this currently doesn't seem to work on Windows: https://github.com/llvm/llvm-project/issues/68092 https://github.com/llvm/llvm-project/pull/65257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-10-03 Thread Jonas Hahnfeld via cfe-commits
https://github.com/hahnjo closed https://github.com/llvm/llvm-project/pull/65257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-10-03 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev edited https://github.com/llvm/llvm-project/pull/65257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-10-03 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. LGTM. Let's move forward here and rely on a further post-commit review if necessary. https://github.com/llvm/llvm-project/pull/65257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-10-03 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,29 @@ +// UNSUPPORTED: system-aix +// RUN: cat %s | clang-repl | FileCheck %s +// RUN: cat %s | clang-repl -Xcc -O2 | FileCheck %s + +extern "C" int printf(const char*, ...); + vgvassilev wrote: > const A a(1); is a file-scope constant, no? Yes, misse

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-10-03 Thread Jonas Hahnfeld via cfe-commits
@@ -0,0 +1,29 @@ +// UNSUPPORTED: system-aix +// RUN: cat %s | clang-repl | FileCheck %s +// RUN: cat %s | clang-repl -Xcc -O2 | FileCheck %s + +extern "C" int printf(const char*, ...); + hahnjo wrote: `const A a(1);` is a file-scope constant, no? We don't need i

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-28 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,29 @@ +// UNSUPPORTED: system-aix +// RUN: cat %s | clang-repl | FileCheck %s +// RUN: cat %s | clang-repl -Xcc -O2 | FileCheck %s + +extern "C" int printf(const char*, ...); + vgvassilev wrote: Can you add a case for a file scope constant? We also sho

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-28 Thread Jonas Hahnfeld via cfe-commits
hahnjo wrote: ping @vgvassilev https://github.com/llvm/llvm-project/pull/65257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-28 Thread Iain Sandoe via cfe-commits
https://github.com/iains commented: (still getting used to the revised system) I have no comments on this patch. https://github.com/llvm/llvm-project/pull/65257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-18 Thread Jonas Hahnfeld via cfe-commits
hahnjo wrote: Ping on the updated patch, which is now also passing downstream testing after I realized that we were missing a backport of commit e451d552348bc714614d294e32dfbe7ec2cd4005, which explains why some constructors were wrongly ordered... https://github.com/llvm/llvm-project/pull/652

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-06 Thread Jonas Hahnfeld via cfe-commits
https://github.com/hahnjo review_requested https://github.com/llvm/llvm-project/pull/65257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-06 Thread Jonas Hahnfeld via cfe-commits
hahnjo wrote: The original patch worked for `clang-repl` but results in strong linkage which I found to cause problems with modules downstream in ROOT. Instead the latest push moves the special case one level higher to `basicGVALinkageForVariable` and returns `GVA_DiscardableODR` which fixes t

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-06 Thread Jonas Hahnfeld via cfe-commits
https://github.com/hahnjo updated https://github.com/llvm/llvm-project/pull/65257: >From 7b52d2ad531286ca3e14c3f05da51c91fd71bd0d Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Wed, 6 Sep 2023 13:11:57 +0200 Subject: [PATCH] [clang-repl] Emit const variables only once Disable internal lin

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-05 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > That looks good to me. Can we backport that to the llvm17 release branch? I > know at least one downstream project that jumps through hoops to support this. I'd say we should not backport to 17.0.0; we need to get the final rc out the door and this isn't fixing a critical

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-04 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. That looks good to me. Can we backport that to the llvm17 release branch? I know at least one downstream project that jumps through hoops to support this. https://github.com/llvm/llvm-project/pull/65257 __

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-04 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev review_requested https://github.com/llvm/llvm-project/pull/65257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-04 Thread Jonas Hahnfeld via cfe-commits
https://github.com/hahnjo review_requested https://github.com/llvm/llvm-project/pull/65257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-04 Thread Jonas Hahnfeld via cfe-commits
https://github.com/hahnjo review_requested https://github.com/llvm/llvm-project/pull/65257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-04 Thread Jonas Hahnfeld via cfe-commits
https://github.com/hahnjo review_requested https://github.com/llvm/llvm-project/pull/65257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-04 Thread Jonas Hahnfeld via cfe-commits
https://github.com/hahnjo created https://github.com/llvm/llvm-project/pull/65257: Disable internal linkage for const variables if IncrementalExtensions are enabled. Otherwise the variables are emitted multiple times, with multiple constructions at unique memory locations, during every PTU. >

[clang] [clang-repl] Emit const variables only once (PR #65257)

2023-09-04 Thread Jonas Hahnfeld via cfe-commits
https://github.com/hahnjo labeled https://github.com/llvm/llvm-project/pull/65257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits