[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-13 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: If Aaron weren't able to fix this in several commits, I'm not sure it's a `good first issue`. https://github.com/llvm/llvm-project/pull/67673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-13 Thread Erich Keane via cfe-commits
erichkeane wrote: I missed the compiler-rt bit there, thats a real shame, this is a really valueable patch that I'd hope someone would take up. While "GCC Doesnt Error" isn't particularly compelling and we SHOULD be better than that, I'd also prefer not throwing the baby out with the bath wat

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-13 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > (Was out of town...) > > > As mentioned at [#67360 > > > (comment)](https://github.com/llvm/llvm-project/pull/67360#issuecomment-1736187374) > > > , I think a default error is probably not appropriate. A priority value > > > <= 100 may compete with a runtime `__attrib

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-13 Thread Erich Keane via cfe-commits
erichkeane wrote: > > (Was out of town...) > > As mentioned at [#67360 > > (comment)](https://github.com/llvm/llvm-project/pull/67360#issuecomment-1736187374) > > , I think a default error is probably not appropriate. A priority value <= > > 100 may compete with a runtime `__attribute__((const

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-13 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > (Was out of town...) > > As mentioned at [#67360 > (comment)](https://github.com/llvm/llvm-project/pull/67360#issuecomment-1736187374) > , I think a default error is probably not appropriate. A priority value <= > 100 may compete with a runtime `__attribute__((constructo

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-12 Thread Fangrui Song via cfe-commits
MaskRay wrote: (Was out of town...) As mentioned at https://github.com/llvm/llvm-project/pull/67360#issuecomment-1736187374 , I think a default error is probably not appropriate. A priority value <= 100 may compete with a runtime `__attribute__((constructor(X)))` but more often it will work.

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-11 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/67673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-09 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/67673 >From 02565df450927fac88062f526a167c9beb518c2f Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 28 Sep 2023 09:20:12 -0400 Subject: [PATCH 1/7] Diagnose problematic uses of constructor/destructor att

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-09 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/67673 >From 02565df450927fac88062f526a167c9beb518c2f Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 28 Sep 2023 09:20:12 -0400 Subject: [PATCH 1/5] Diagnose problematic uses of constructor/destructor att

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-09 Thread Aaron Ballman via cfe-commits
@@ -2352,26 +2352,126 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::De

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-09 Thread Aaron Ballman via cfe-commits
@@ -2352,26 +2352,126 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::De

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-06 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers edited https://github.com/llvm/llvm-project/pull/67673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-06 Thread Nick Desaulniers via cfe-commits
@@ -2352,26 +2352,126 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::De

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-06 Thread Nick Desaulniers via cfe-commits
@@ -2352,26 +2352,126 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::De

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-06 Thread Joseph Huber via cfe-commits
jhuber6 wrote: I already changed the `init_fini_array_test` while I fixed an unrelated problem, so it should be fine now. https://github.com/llvm/llvm-project/pull/67673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Ping, especially @MaskRay https://github.com/llvm/llvm-project/pull/67673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-09-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/67673 >From 02565df450927fac88062f526a167c9beb518c2f Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 28 Sep 2023 09:20:12 -0400 Subject: [PATCH 1/4] Diagnose problematic uses of constructor/destructor att

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-09-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/67673 >From 02565df450927fac88062f526a167c9beb518c2f Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 28 Sep 2023 09:20:12 -0400 Subject: [PATCH 1/3] Diagnose problematic uses of constructor/destructor att

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-09-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/67673 >From 02565df450927fac88062f526a167c9beb518c2f Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 28 Sep 2023 09:20:12 -0400 Subject: [PATCH 1/2] Diagnose problematic uses of constructor/destructor att

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-09-28 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I _think_ I made the correct changes in compiler-rt's CMake so that all of > the compiler-rt projects can use reserved priorities, but I'd appreciate > confirmation from @MaskRay on those changes. Hmm, nope, it seems the test cases still fail (but the source files work).

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-09-28 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff c51857b4e53031753d6b998ce0ef5f59c073aeb3 02565df450927fac88062f526a167c9beb518c2f --

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-09-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Changes Functions with these attributes will be automatically called before main() or after main() exits gracefully. In glibc environments, the constructor function is passed the same arguments as main(), so that signature is allowed. In all othe

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-09-28 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: This is another pass at https://github.com/llvm/llvm-project/pull/67360 Note: llvm-libc will still have a test failure until I figure out the correct way to repair init_fini_array_test.cpp. I *think* I made the correct changes in compiler-rt's CMake so that all of the compi

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-09-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/67673 Functions with these attributes will be automatically called before main() or after main() exits gracefully. In glibc environments, the constructor function is passed the same arguments as main(), so that s