[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2025-01-28 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Merged in [71ab44a8](https://github.com/llvm/llvm-project/commit/71ab44a8193c56e4ef9aede4d9bac8e14760c6c6), via command line so as to provide proper commit author attribution to @wolfy1961 (as this doesn't seem to be possible via the web interface). https://github.com/llvm/llvm

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2025-01-28 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/11 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2025-01-24 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/11 >From 6a873f5c487a936344f6cd226b7d525b406f34b2 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 15:08:39 +0100 Subject: [PATCH 1/9] [Clang] Add "extend lifetime" flags and release note Follow

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2025-01-10 Thread Stephen Tozer via cfe-commits
@@ -412,6 +412,20 @@ New Compiler Flags only for thread-local variables, and none (which corresponds to the existing ``-fno-c++-static-destructors`` flag) skips all static destructors registration. +- The ``-fextend-variable-liveness`` flag has been added to allow for imp

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2025-01-08 Thread Richard Smith via cfe-commits
https://github.com/zygoloid commented: New flag name LGTM. https://github.com/llvm/llvm-project/pull/11 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2025-01-08 Thread Richard Smith via cfe-commits
@@ -412,6 +412,20 @@ New Compiler Flags only for thread-local variables, and none (which corresponds to the existing ``-fno-c++-static-destructors`` flag) skips all static destructors registration. +- The ``-fextend-variable-liveness`` flag has been added to allow for imp

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2025-01-08 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/11 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2025-01-08 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. https://github.com/llvm/llvm-project/pull/11 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2025-01-08 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Post-holiday ping - I believe all the comments have been addressed now, does the new form look acceptable? https://github.com/llvm/llvm-project/pull/11 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-12-12 Thread Stephen Tozer via cfe-commits
SLTozer wrote: I've added a test for this patch that tests the driver - since we will now be relying on the driver to decide whether to pass these flags to the frontend, rather than trivially always doing so (so that [later on](https://github.com/llvm/llvm-project/pull/118026) we can use the d

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-12-12 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/11 >From 6a873f5c487a936344f6cd226b7d525b406f34b2 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 15:08:39 +0100 Subject: [PATCH 1/7] [Clang] Add "extend lifetime" flags and release note Follow

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-12-12 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/11 >From 6a873f5c487a936344f6cd226b7d525b406f34b2 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 15:08:39 +0100 Subject: [PATCH 1/6] [Clang] Add "extend lifetime" flags and release note Follow

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-12-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/11 >From 6a873f5c487a936344f6cd226b7d525b406f34b2 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 15:08:39 +0100 Subject: [PATCH 1/4] [Clang] Add "extend lifetime" flags and release note Follow

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-12-04 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/11 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-12-04 Thread Richard Smith via cfe-commits
zygoloid wrote: Looks like the tests in #110102 are named `extend-liveness-*.cpp`. Perhaps `-fextend-liveness` would be a good name for this flag? https://github.com/llvm/llvm-project/pull/11 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-12-04 Thread Richard Smith via cfe-commits
https://github.com/zygoloid commented: I think this flag name is going to be extremely confusing. "lifetime" is a notion defined formally by the C++ language standard, and "lifetime extension" is again a process defined in C++ with a specific meaning. Those meanings have nothing to do with wha

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-11-29 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > As far as I understand it, these are driver options that will be passed > through to cc1? In that case we can at least test the passthrough, i.e. that > `-fextend-lifetimes` appears in the output of `-###`. I think my preferred approach would be to merge both patches simultane

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-11-29 Thread Jeremy Morse via cfe-commits
jmorse wrote: The additions here look fine; however I think there's generally precedent that anything we add needs to have /some/ kind of test, or be covered by something already existing, otherwise we're vulnerable to: * Patch lands, * Someone refactors clang switch handling, * Other patche

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-11-27 Thread Stephen Tozer via cfe-commits
@@ -2217,6 +2217,11 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Args.getAllArgValues(OPT_fsanitize_trap_EQ), Diags, Opts.SanitizeTrap); + Opts.ExtendThisPtr = + Opts.OptimizationLevel > 0

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-11-27 Thread Stephen Tozer via cfe-commits
SLTozer wrote: This patch has been changed as a result of some other patches that have removed the need for the attribute that this patch once added. Since this patch does not emit fake uses (the actual emission of fake uses is added in the [next patch](https://github.com/llvm/llvm-project/pul

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-11-27 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/11 >From a33566974fbf260181d20d3f1b67081d21493506 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 15:08:39 +0100 Subject: [PATCH 1/2] [Clang] Add "extend lifetime" flags and release note Follow

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-10-04 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > The release note doesn't say: Does `-fextend-lifetimes` imply > `-fextend-this-pointer`? They're implemented as independent toggles but the > effect isn't really independent IIRC. I wonder (years after it was originally > implemented downstream, I know) whether we'd be better

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-10-03 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/11 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-10-03 Thread Stephen Tozer via cfe-commits
@@ -211,6 +211,16 @@ New Compiler Flags only for thread-local variables, and none (which corresponds to the existing ``-fno-c++-static-destructors`` flag) skips all static destructors registration. +- The ``-fextend-lifetimes`` and ``-fextend-this-ptr`` flags have been ad

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-10-03 Thread Stephen Tozer via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 %s -emit-llvm -O2 -fextend-lifetimes -o - | FileCheck --check-prefixes=CHECK-ALL,CHECK-O2 %s +// RUN: %clang_cc1 %s -emit-llvm -O0 -fextend-lifetimes -o - | FileCheck --check-prefixes=CHECK-ALL,CHECK-O0 %s + +// Checks that we emit the functi

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-10-03 Thread David Blaikie via cfe-commits
@@ -211,6 +211,16 @@ New Compiler Flags only for thread-local variables, and none (which corresponds to the existing ``-fno-c++-static-destructors`` flag) skips all static destructors registration. +- The ``-fextend-lifetimes`` and ``-fextend-this-ptr`` flags have been ad

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-10-03 Thread David Blaikie via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 %s -emit-llvm -O2 -fextend-lifetimes -o - | FileCheck --check-prefixes=CHECK-ALL,CHECK-O2 %s +// RUN: %clang_cc1 %s -emit-llvm -O0 -fextend-lifetimes -o - | FileCheck --check-prefixes=CHECK-ALL,CHECK-O0 %s + +// Checks that we emit the functi

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-10-03 Thread David Blaikie via cfe-commits
@@ -2217,6 +2217,11 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Args.getAllArgValues(OPT_fsanitize_trap_EQ), Diags, Opts.SanitizeTrap); + Opts.ExtendThisPtr = + Opts.OptimizationLevel > 0

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-10-03 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 commented: It seems a little odd to have only positive forms of these flags; usually toggles would have both positive and negative forms. Maybe @MaskRay has an opinion? The release note doesn't say: Does `-fextend-lifetimes` imply `-fextend-this-pointer`? They're imp

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-10-03 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Ping - if anyone isn't able to review themselves but has an idea of someone who might, adding/pinging them would also be appreciated. https://github.com/llvm/llvm-project/pull/11 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-09-25 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/11 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-09-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Stephen Tozer (SLTozer) Changes Following the commit that added the fake use intrinsic to LLVM, this patch adds a pair of flags for the clang frontend that emit fake use intrinsics, for the purpose of extending the lifetime of variables (

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-09-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Stephen Tozer (SLTozer) Changes Following the commit that added the fake use intrinsic to LLVM, this patch adds a pair of flags for the clang frontend that emit fake use intrinsics, for the purpose of extending the lifetime of vari

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-09-25 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/11 Following the commit that added the fake use intrinsic to LLVM, this patch adds a pair of flags for the clang frontend that emit fake use intrinsics, for the purpose of extending the lifetime of variables (eith