[clang] [llvm] [docs] Add a section on AI-generated content to the developer policy (PR #91014)

2024-09-10 Thread Reid Kleckner via cfe-commits
https://github.com/rnk closed https://github.com/llvm/llvm-project/pull/91014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [docs] Add a section on AI-generated content to the developer policy (PR #91014)

2024-09-10 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/91014 >From 88e4991013a05e26cece87d3989ad957a4e18e3d Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 4 Sep 2024 16:52:49 + Subject: [PATCH 1/6] [clang] Fix FIXME in dynamic initializer emission, NFCI This poten

[clang] [llvm] [docs] Add a section on AI-generated content to the developer policy (PR #91014)

2024-09-10 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/91014 >From 88e4991013a05e26cece87d3989ad957a4e18e3d Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 4 Sep 2024 16:52:49 + Subject: [PATCH 1/5] [clang] Fix FIXME in dynamic initializer emission, NFCI This poten

[clang] [Clang] Fix Microsoft ABI inheritance model when member pointer is used in a base specifier (PR #91990)

2024-09-06 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/91990 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix Microsoft ABI inheritance model when member pointer is used in a base specifier (PR #91990)

2024-09-06 Thread Reid Kleckner via cfe-commits
@@ -13,3 +15,18 @@ template struct S3 { int T::*foo; }; + +template struct Base {}; +struct +S5 // #S5 +: +Base +// expected-error@-1 {{member pointer has incomplete base type 'S5'}} rnk wrote: I agree on the desired behavior, but doesn't this test show tha

[clang] [Clang] Fix Microsoft ABI inheritance model when member pointer is used in a base specifier (PR #91990)

2024-09-06 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: Sorry, looks like I wrote pending comments and didn't publish them https://github.com/llvm/llvm-project/pull/91990 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [Clang] Fix Microsoft ABI inheritance model when member pointer is used in a base specifier (PR #91990)

2024-09-06 Thread Reid Kleckner via cfe-commits
@@ -215,6 +215,14 @@ struct NewUnspecified; SingleTemplate tmpl_single; UnspecTemplate tmpl_unspec; +// Member pointers used in base specifiers force an unspecified inheritance model +struct MemPtrInBase : UnspecTemplate {}; rnk wrote: Yes, but it's not clea

[clang] [llvm] [docs] Add a section on AI-generated content to the developer policy (PR #91014)

2024-09-04 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/91014 >From 88e4991013a05e26cece87d3989ad957a4e18e3d Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 4 Sep 2024 16:52:49 + Subject: [PATCH 1/4] [clang] Fix FIXME in dynamic initializer emission, NFCI This poten

[clang] 601645c - [clang] Fix FIXME in dynamic initializer emission, NFCI

2024-09-04 Thread Reid Kleckner via cfe-commits
Author: Reid Kleckner Date: 2024-09-04T17:34:26Z New Revision: 601645c3b70e2a17d18779a3a51b8bc9ecdc9aa6 URL: https://github.com/llvm/llvm-project/commit/601645c3b70e2a17d18779a3a51b8bc9ecdc9aa6 DIFF: https://github.com/llvm/llvm-project/commit/601645c3b70e2a17d18779a3a51b8bc9ecdc9aa6.diff LOG:

[clang] [llvm] [docs] Add a section on AI-generated content to the developer policy (PR #91014)

2024-09-04 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/91014 >From 88e4991013a05e26cece87d3989ad957a4e18e3d Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 4 Sep 2024 16:52:49 + Subject: [PATCH 1/4] [clang] Fix FIXME in dynamic initializer emission, NFCI This poten

[clang] [MS] Put dllexported inline global initializers in a comdat (PR #107154)

2024-09-03 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/107154 >From cfb2cea5a4d4e0c1712e038692c4c5acee6b1f27 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 3 Sep 2024 21:16:40 + Subject: [PATCH 1/3] [MS] Put dllexported inline global initializers in a comdat Foll

[clang] [MS] Put dllexported inline global initializers in a comdat (PR #107154)

2024-09-03 Thread Reid Kleckner via cfe-commits
rnk wrote: Yeah, I should've explicitly said I was working on updating the comment block. It needed significant surgery. Actually, this code could probably use more significant refactoring, but let's set that aside for now. > Does this impact non-MS targets? At the moment, I can't think of a

[clang] [MS] Put dllexported inline global initializers in a comdat (PR #107154)

2024-09-03 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/107154 >From cfb2cea5a4d4e0c1712e038692c4c5acee6b1f27 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 3 Sep 2024 21:16:40 + Subject: [PATCH 1/2] [MS] Put dllexported inline global initializers in a comdat Foll

[clang] [MS] Put dllexported inline global initializers in a comdat (PR #107154)

2024-09-03 Thread Reid Kleckner via cfe-commits
rnk wrote: I think there is no change here in our conformance on inline variable initialization order, except that non-discardable inline variables (achieved in this instance with dllexport, but perhaps there are other ways to do this. The classic case is explicit instantiation, which is unord

[clang] [MS] Put dllexported inline global initializers in a comdat (PR #107154)

2024-09-03 Thread Reid Kleckner via cfe-commits
https://github.com/rnk created https://github.com/llvm/llvm-project/pull/107154 Follow-up to c19f4f8069722f6804086d4438a0254104242c46 to handle corner case of exported inline variables. Should fix #56485 >From cfb2cea5a4d4e0c1712e038692c4c5acee6b1f27 Mon Sep 17 00:00:00 2001 From: Reid Kleckne

[clang] Deprecate -fheinous-gnu-extensions; introduce a new warning flag (PR #105821)

2024-08-23 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. Thanks for doing this! https://github.com/llvm/llvm-project/pull/105821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] [Sema] Error on reference types inside a union with msvc 1900+ (PR #102851)

2024-08-13 Thread Reid Kleckner via cfe-commits
rnk wrote: Something to consider is that `-fms-extensions` has, at various points, been used as a tool for making Windows code portable to Apple platforms. So, there may be users out there who use references in unions on non-Windows platforms. However, they presumably also build with modern ve

[clang] [CUDA] Emit used function list in deterministic order. (PR #102661)

2024-08-09 Thread Reid Kleckner via cfe-commits
@@ -950,6 +950,9 @@ void CodeGenModule::Release() { UsedArray.push_back(llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast( GetAddrOfGlobal(GD), Int8PtrTy)); } +// Sort decls by name to always emit them in deterministic order. rnk wrot

[clang] [llvm] demangle function names in trace files (PR #87626)

2024-08-06 Thread Reid Kleckner via cfe-commits
rnk wrote: I think I'll leave this change in and file an issue about it. A 10% compile time regression with `-ftime-trace` isn't great, but it doesn't feel revert-worthy. https://github.com/llvm/llvm-project/pull/87626 ___ cfe-commits mailing list cf

[clang] [llvm] demangle function names in trace files (PR #87626)

2024-08-02 Thread Reid Kleckner via cfe-commits
rnk wrote: Are we sure we want this behavior? Demangling is really expensive. A user noticed a significant (10%) compile time regression from this change. We could skip the demangling and do it offline. It's also worth pointing out that we have to redo this work every time we optimize the same

[clang] Adds a pseudonym to clang"s windows mangler... (PR #97792)

2024-07-24 Thread Reid Kleckner via cfe-commits
https://github.com/rnk closed https://github.com/llvm/llvm-project/pull/97792 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adds a pseudonym to clang"s windows mangler... (PR #97792)

2024-07-23 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. Thanks, looks good, I'll wait for premerge checks to come back green before I merge it. https://github.com/llvm/llvm-project/pull/97792 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[clang] [llvm] [CloneFunction][DebugInfo] Avoid cloning DILocalVariables of inlined functions (PR #75385)

2024-07-23 Thread Reid Kleckner via cfe-commits
rnk wrote: I'm not seeing how your example constitutes an ODR violation, or how merging these lambda types by mangled name is incorrect. They are equivalent in your example. It seems like the issue has more to do with the details of how exactly we do the merge, and where the metadata reference

[clang] [clang-cl] [Sema] Support MSVC non-const lvalue to user-defined temporary reference (PR #99833)

2024-07-22 Thread Reid Kleckner via cfe-commits
@@ -5138,7 +5148,11 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType, // -- Otherwise, the reference shall be an lvalue reference to a //non-volatile const type (i.e., cv1 shall be const), or the reference //shall be an rvalue reference. -

[clang] [clang-cl] [Sema] Support MSVC non-const lvalue to user-defined temporary reference (PR #99833)

2024-07-22 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/99833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] [Sema] Support MSVC non-const lvalue to user-defined temporary reference (PR #99833)

2024-07-22 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. I think this looks good, but I would appreciate another reviewer looking at the patch. https://github.com/llvm/llvm-project/pull/99833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] Adds a pseudonym to clang"s windows mangler... (PR #97792)

2024-07-19 Thread Reid Kleckner via cfe-commits
@@ -1938,12 +1946,23 @@ void MicrosoftCXXNameMangler::mangleTemplateArgValue(QualType T, mangleNumber(V.getLValueOffset().getQuantity()); } else if (!V.hasLValuePath()) { // FIXME: This can only happen as an extension. Invent a mangling. -break; +

[clang] Adds a pseudonym to clang"s windows mangler... (PR #97792)

2024-07-19 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/97792 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adds a pseudonym to clang"s windows mangler... (PR #97792)

2024-07-19 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: Sorry, I made this comment some time ago, but it looks like I never published it https://github.com/llvm/llvm-project/pull/97792 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [Clang] [docs] [MSVC] Add sections on `__forceinline` and intrinsic behaviour differences between Clang and MSVC (PR #99426)

2024-07-18 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. https://github.com/llvm/llvm-project/pull/99426 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] [docs] [MSVC] Add sections on `__forceinline` and intrinsic behaviour differences between Clang and MSVC (PR #99426)

2024-07-18 Thread Reid Kleckner via cfe-commits
@@ -154,3 +154,133 @@ a hint suggesting how to fix the problem. As of this writing, Clang is able to compile a simple ATL hello world application. There are still issues parsing WRL headers for modern Windows 8 apps, but they should be addressed soon. + +__forceinline behavior

[clang] [Clang] [docs] [MSVC] Add sections on `__forceinline` and intrinsic behaviour differences between Clang and MSVC (PR #99426)

2024-07-18 Thread Reid Kleckner via cfe-commits
@@ -154,3 +154,133 @@ a hint suggesting how to fix the problem. As of this writing, Clang is able to compile a simple ATL hello world application. There are still issues parsing WRL headers for modern Windows 8 rnk wrote: "modern Windows 8" is obviously stale

[clang] [Clang] Fix Microsoft ABI inheritance model when member pointer is used in a base specifier (PR #91990)

2024-07-17 Thread Reid Kleckner via cfe-commits
@@ -9015,11 +9015,20 @@ bool Sema::RequireCompleteTypeImpl(SourceLocation Loc, QualType T, if (const MemberPointerType *MPTy = T->getAs()) { if (!MPTy->getClass()->isDependentType()) { - if (getLangOpts().CompleteMemberPointers && - !MPTy->getClass()->getA

[clang] [Clang] Fix Microsoft ABI inheritance model when member pointer is used in a base specifier (PR #91990)

2024-07-17 Thread Reid Kleckner via cfe-commits
@@ -215,6 +215,14 @@ struct NewUnspecified; SingleTemplate tmpl_single; UnspecTemplate tmpl_unspec; +// Member pointers used in base specifiers force an unspecified inheritance model +struct MemPtrInBase : UnspecTemplate {}; rnk wrote: I guess this memptr ty

[clang] [Clang] Fix Microsoft ABI inheritance model when member pointer is used in a base specifier (PR #91990)

2024-07-17 Thread Reid Kleckner via cfe-commits
@@ -13,3 +15,18 @@ template struct S3 { int T::*foo; }; + +template struct Base {}; +struct +S5 // #S5 +: +Base +// expected-error@-1 {{member pointer has incomplete base type 'S5'}} rnk wrote: Should this be an error in Microsoft mode? Shouldn't we silentl

[clang] [X86][vectorcall] Do not consume register for indirect return value (PR #97939)

2024-07-09 Thread Reid Kleckner via cfe-commits
rnk wrote: I lost the `__fastcall` or `__vectorcall` during editing, here's a fixed link: https://godbolt.org/z/46j33z8bc You can see the load from [edx] and store to [ecx]: ``` NonTrivial copy_nontrivial(NonTrivial *) PROC ; copy_nontrivial, COMDAT mov eax, DWORD PTR [edx]

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Reid Kleckner via cfe-commits
@@ -185,6 +203,18 @@ CALL_AO(PackedMembers) // CHECK: call void @llvm.memcpy.p0.p0.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret ptr +// WithEmptyField copy-assignment: +// CHECK-LABEL: define linkonce_odr nonnull align {{[0-9]+}} dereferenceable({

[clang] Adds an arbitrary pseudonym to clang"s windows mangler... (PR #97792)

2024-07-08 Thread Reid Kleckner via cfe-commits
rnk wrote: I think this NTTP mangling code needs some significant updates, refactoring, and an increase in test coverage. I see cd93532dfc455255cb2fa553090d14aaa52b106b landed last May, probably when I was offline for a while. https://github.com/llvm/llvm-project/pull/97792 __

[clang] [X86][vectorcall] Do not consume register for indirect return value (PR #97939)

2024-07-08 Thread Reid Kleckner via cfe-commits
rnk wrote: Thanks! I was going to say, surely this can't be right, I was pretty confident that sret pointers consume registers for these conventions, but it looks like I was mistaken. I think this bug and code dates to 661f35b0c54c79805e6b17944b155c111bc39ec3 from 2014, which I think made the

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-02 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. I think this looks good, then. Any other concerns? https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [MS ABI]: Support preserve_none in MS ABI (PR #96487)

2024-06-26 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/96487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-25 Thread Reid Kleckner via cfe-commits
rnk wrote: IIUC, this effectively removes all empty records from LLVM struct types. This makes the IR less "pretty", but these subobjects are notionally empty and consist of only padding bytes (i8 and i8 arrays) at the end of the day. I think that's acceptable. + @rjmccall , does that sound go

[clang] [MS ABI]: Support preserve_none in MS ABI (PR #96487)

2024-06-25 Thread Reid Kleckner via cfe-commits
@@ -2986,6 +2989,9 @@ void MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC) { case CC_Swift: Out << 'S'; break; rnk wrote: The default case here should be a proper compiler error, not an unreachable, since there's no good way to prevent arb

[clang] [MS ABI]: Support preserve_none in MS ABI (PR #96487)

2024-06-25 Thread Reid Kleckner via cfe-commits
@@ -2986,6 +2989,9 @@ void MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC) { case CC_Swift: Out << 'S'; break; case CC_SwiftAsync: Out << 'W'; break; case CC_PreserveMost: Out << 'U'; break; +case CC_PreserveNone: + Out << 'V'; ---

[clang] [MS ABI]: Support preserve_none in MS ABI (PR #96487)

2024-06-25 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/96487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MS ABI]: Support preserve_none in MS ABI (PR #96487)

2024-06-25 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: Thanks for looking at this, let's make this an error instead of a crash in the future. https://github.com/llvm/llvm-project/pull/96487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] Reland "[Win32][ELF] Make CodeView a DebugInfoFormat only for COFF format", second try (PR #88245)

2024-06-04 Thread Reid Kleckner via cfe-commits
@@ -298,15 +298,15 @@ // FioRACE2: "-E" // FioRACE2: "-o" "foo.x" -// RUN: %clang_cl /Z7 /Foa.obj -### -- %s 2>&1 | FileCheck -check-prefix=ABSOLUTE_OBJPATH %s +// RUN: %clang_cl -target x86_64-windows /Z7 /Foa.obj -### -- %s 2>&1 | FileCheck -check-prefix=ABSOLUTE_OBJPATH %

[clang] Reland "[Win32][ELF] Make CodeView a DebugInfoFormat only for COFF format", second try (PR #88245)

2024-06-04 Thread Reid Kleckner via cfe-commits
@@ -5,15 +5,15 @@ // NO_GHASH-NOT: "-gcodeview-ghash" // default -// RUN: %clang_cl /Z7 -### -- %s 2>&1 | FileCheck -check-prefix=NO_GHASH %s +// RUN: %clang_cl -target x86_64-windows /Z7 -### -- %s 2>&1 | FileCheck -check-prefix=NO_GHASH %s // enabled -// RUN: %clang_cl /Z7

[clang] Reland "[Win32][ELF] Make CodeView a DebugInfoFormat only for COFF format", second try (PR #88245)

2024-06-04 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/88245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland "[Win32][ELF] Make CodeView a DebugInfoFormat only for COFF format", second try (PR #88245)

2024-06-04 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. Sorry for the delay, looks good! https://github.com/llvm/llvm-project/pull/88245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Pipelines] Do not run CoroSplit and CoroCleanup in LTO pre-link pipeline (PR #90310)

2024-05-14 Thread Reid Kleckner via cfe-commits
rnk wrote: To be clear, you can repro the issue with the test case you have, just add `-fsanitize=address` to flags to repro. https://github.com/llvm/llvm-project/pull/90310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [llvm] [Pipelines] Do not run CoroSplit and CoroCleanup in LTO pre-link pipeline (PR #90310)

2024-05-10 Thread Reid Kleckner via cfe-commits
rnk wrote: Hey, I went ahead and reverted this patch in aa0776de464984e78ae1cc329bf541e9dd43631f because it is incompatible with ASan ThinLTO builds. I think you have uncovered a latent issue in the ASan + thinlto configuration that is not really the fault of this change, but I didn't see a

[clang] aa0776d - Revert "[Pipelines] Do not run CoroSplit and CoroCleanup in LTO pre-link pipeline (#90310)" and related patches

2024-05-10 Thread Reid Kleckner via cfe-commits
Author: Reid Kleckner Date: 2024-05-10T21:28:13Z New Revision: aa0776de464984e78ae1cc329bf541e9dd43631f URL: https://github.com/llvm/llvm-project/commit/aa0776de464984e78ae1cc329bf541e9dd43631f DIFF: https://github.com/llvm/llvm-project/commit/aa0776de464984e78ae1cc329bf541e9dd43631f.diff LOG:

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-05-07 Thread Reid Kleckner via cfe-commits
rnk wrote: I played with the idea of using LLVM packed structs (`<{ i129 }>`) to represent something like this, but they don't work the way I expected them to do: https://godbolt.org/z/M6hMYYhax LLVM DataLayout's idea of `sizeof(i129)` is still rounded up from 17 bytes to 32 bytes. Using byt

[clang] [clang] Note that optnone and target attributes do not apply to nested functions (PR #82815)

2024-05-03 Thread Reid Kleckner via cfe-commits
rnk wrote: Thanks for the reminder, I missed the update. https://github.com/llvm/llvm-project/pull/82815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Note that optnone and target attributes do not apply to nested functions (PR #82815)

2024-05-03 Thread Reid Kleckner via cfe-commits
https://github.com/rnk closed https://github.com/llvm/llvm-project/pull/82815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA] make kernel stub ICF-proof (PR #90155)

2024-04-29 Thread Reid Kleckner via cfe-commits
@@ -424,6 +424,34 @@ void CGNVCUDARuntime::emitDeviceStubBodyNew(CodeGenFunction &CGF, CGM.CreateRuntimeFunction(FTy, LaunchKernelName); CGF.EmitCall(FI, CGCallee::forDirect(cudaLaunchKernelFn), ReturnValueSlot(), LaunchKernelArgs); + + // To prevent CU

[clang] [CUDA] make kernel stub ICF-proof (PR #90155)

2024-04-29 Thread Reid Kleckner via cfe-commits
@@ -424,6 +424,34 @@ void CGNVCUDARuntime::emitDeviceStubBodyNew(CodeGenFunction &CGF, CGM.CreateRuntimeFunction(FTy, LaunchKernelName); CGF.EmitCall(FI, CGCallee::forDirect(cudaLaunchKernelFn), ReturnValueSlot(), LaunchKernelArgs); + + // To prevent CU

[clang] [CUDA] make kernel stub ICF-proof (PR #90155)

2024-04-29 Thread Reid Kleckner via cfe-commits
@@ -424,6 +424,34 @@ void CGNVCUDARuntime::emitDeviceStubBodyNew(CodeGenFunction &CGF, CGM.CreateRuntimeFunction(FTy, LaunchKernelName); CGF.EmitCall(FI, CGCallee::forDirect(cudaLaunchKernelFn), ReturnValueSlot(), LaunchKernelArgs); + + // To prevent CU

[clang] [clang] Handle trivial_abi attribute for Microsoft ABI. (PR #88857)

2024-04-29 Thread Reid Kleckner via cfe-commits
@@ -1105,6 +1105,11 @@ bool MicrosoftCXXABI::hasMostDerivedReturn(GlobalDecl GD) const { static bool isTrivialForMSVC(const CXXRecordDecl *RD, QualType Ty, CodeGenModule &CGM) { + // If the record is marked with the trivial_abi attribute, we don'

[clang] 1f44a0b - Make minor improvements to the creduce wrapper script

2024-04-29 Thread Reid Kleckner via cfe-commits
Author: Reid Kleckner Date: 2024-04-29T22:09:09Z New Revision: 1f44a0b1ff2daebe10b9916da228f7c0ba66827c URL: https://github.com/llvm/llvm-project/commit/1f44a0b1ff2daebe10b9916da228f7c0ba66827c DIFF: https://github.com/llvm/llvm-project/commit/1f44a0b1ff2daebe10b9916da228f7c0ba66827c.diff LOG:

[clang] [clang] Handle trivial_abi attribute for Microsoft ABI. (PR #88857)

2024-04-29 Thread Reid Kleckner via cfe-commits
rnk wrote: Sorry for the delay, work life does its best to intervene. https://github.com/llvm/llvm-project/pull/88857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Handle trivial_abi attribute for Microsoft ABI. (PR #88857)

2024-04-29 Thread Reid Kleckner via cfe-commits
@@ -1105,6 +1105,11 @@ bool MicrosoftCXXABI::hasMostDerivedReturn(GlobalDecl GD) const { static bool isTrivialForMSVC(const CXXRecordDecl *RD, QualType Ty, CodeGenModule &CGM) { + // If the record is marked with the trivial_abi attribute, we don'

[clang] [clang codegen] Fix MS ABI detection of user-provided constructors. (PR #90151)

2024-04-29 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/90151 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Handle trivial_abi attribute for Microsoft ABI. (PR #88857)

2024-04-18 Thread Reid Kleckner via cfe-commits
@@ -1105,6 +1105,11 @@ bool MicrosoftCXXABI::hasMostDerivedReturn(GlobalDecl GD) const { static bool isTrivialForMSVC(const CXXRecordDecl *RD, QualType Ty, CodeGenModule &CGM) { + // If the record is marked with the trivial_abi attribute, we don'

[clang] [clang] Handle trivial_abi attribute for Microsoft ABI. (PR #88857)

2024-04-18 Thread Reid Kleckner via cfe-commits
https://github.com/rnk requested changes to this pull request. https://github.com/llvm/llvm-project/pull/88857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Handle trivial_abi attribute for Microsoft ABI. (PR #88857)

2024-04-18 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/88857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Handle trivial_abi attribute for Microsoft ABI. (PR #88857)

2024-04-18 Thread Reid Kleckner via cfe-commits
@@ -1105,6 +1105,11 @@ bool MicrosoftCXXABI::hasMostDerivedReturn(GlobalDecl GD) const { static bool isTrivialForMSVC(const CXXRecordDecl *RD, QualType Ty, CodeGenModule &CGM) { + // If the record is marked with the trivial_abi attribute, we don'

[clang] [clang][Sema] Track trivial-relocatability as a type trait (PR #84621)

2024-04-16 Thread Reid Kleckner via cfe-commits
rnk wrote: So, I was completely unaware that trivial relocatability had been picked up at all by WG21. Since the beginning of `trivial_abi`, I we were solidly in the vendor-extension space trying to build non-standard but practical solutions to real world problems, like the fact that we couldn

[clang] [clang-cl] [Driver] Fix clang-cl driver supported colon options (PR #88216)

2024-04-16 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. Thank you for polishing this corner of the driver interface! It's interesting that they have an alternative separate spelling. I always felt like the `/Fopath.cpp` pattern was a bit unreadable. https://github.com/llvm/llvm-project/pull/88216 _

[clang] [clang] Handle trivial_abi attribute for Microsoft ABI. (PR #88857)

2024-04-16 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/88857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Handle trivial_abi attribute for Microsoft ABI. (PR #88857)

2024-04-16 Thread Reid Kleckner via cfe-commits
@@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -std=c++11 -fcxx-exceptions -fexceptions -emit-llvm -o - %s | FileCheck %s + +// CHECK: %[[STRUCT_TRIVIAL:.*]] = type { ptr } +struct __attribute__((trivial_abi)) Trivial { + int *p; + Trivial() : p(0) {} + Tr

[clang] [clang] Handle trivial_abi attribute for Microsoft ABI. (PR #88857)

2024-04-16 Thread Reid Kleckner via cfe-commits
@@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -std=c++11 -fcxx-exceptions -fexceptions -emit-llvm -o - %s | FileCheck %s + +// CHECK: %[[STRUCT_TRIVIAL:.*]] = type { ptr } +struct __attribute__((trivial_abi)) Trivial { + int *p; + Trivial() : p(0) {} + Tr

[clang] [clang] Handle trivial_abi attribute for Microsoft ABI. (PR #88857)

2024-04-16 Thread Reid Kleckner via cfe-commits
@@ -63,6 +63,10 @@ ABI Changes in This Version MSVC uses a different mangling for these objects, compatibility is not affected. (#GH85423). +- The attribute ``trivial_abi`` now works when targetting the Microsoft ABI. Marking rnk wrote: It's overly broa

[clang] Fix missing dtor in function calls accepting trivial ABI structs (PR #88751)

2024-04-15 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/88751 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SEH] Ignore async exception flag when the environment is not MSVC (PR #88101)

2024-04-15 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. https://github.com/llvm/llvm-project/pull/88101 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-04-01 Thread Reid Kleckner via cfe-commits
rnk wrote: To restate the finding, 29% of .debug_info is describing class methods, at least in Clang. I think this is a useful mode, and we should land it as is. There are many users up against the scaling limits of debug info size, and it's helpful to have this as an option for experimentati

[clang] [clang-cl] Allow a colon after /Fo option (PR #87209)

2024-04-01 Thread Reid Kleckner via cfe-commits
https://github.com/rnk closed https://github.com/llvm/llvm-project/pull/87209 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Allow a colon after /Fo option (PR #87209)

2024-04-01 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. https://github.com/llvm/llvm-project/pull/87209 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Allow a colon after /Fo option (PR #87209)

2024-04-01 Thread Reid Kleckner via cfe-commits
rnk wrote: That's interesting! I wonder how long the /F flags have accepted trailing colons. That form seems a lot more readable. I went looking for examples of how to do this with fewer aliases, but it looks like this is what is done currently: https://github.com/llvm/llvm-project/blob/main/c

[clang] [clang-tools-extra] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-03-22 Thread Reid Kleckner via cfe-commits
rnk wrote: > As a data point, I've been setting core.autocrlf=true on Windows for years. If that's the case, my information is stale, which I accept. > To be clear, this may do nothing on checkout if a user has set a config > option. That addresses my concerns. https://github.com/llvm/llv

[clang] [clang-tools-extra] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-03-22 Thread Reid Kleckner via cfe-commits
rnk wrote: I think it makes sense to remove carriage returns on checkin, but I'm not sure it makes sense to add them back on checkout on Windows. Historically, it's been really easy to write LLVM tests that fail when the source is checked out with CRLF. Many Windows developers have noted that

[clang] [clang][SPIRV] Don't warn on -mcmodel (PR #86039)

2024-03-21 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. https://github.com/llvm/llvm-project/pull/86039 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [asan][windows] Eliminate the static asan runtime on windows (PR #81677)

2024-02-23 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/81677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [asan][windows] Eliminate the static asan runtime on windows (PR #81677)

2024-02-23 Thread Reid Kleckner via cfe-commits
@@ -0,0 +1,81 @@ +//===-- sanitizer_win_thunk_interception.h - -===// +// +// 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] [compiler-rt] [asan][windows] Eliminate the static asan runtime on windows (PR #81677)

2024-02-23 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: Is it feasible to create a migration path from the static runtime to the dynamic runtime? As written, this requires users to update their ASan builds at the same time that they take this update. Is it possible to leave the static runtime behind, create a migra

[clang] [compiler-rt] [asan][windows] Eliminate the static asan runtime on windows (PR #81677)

2024-02-23 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/81677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Note that optnone and target attributes do not apply to nested functions (PR #82815)

2024-02-23 Thread Reid Kleckner via cfe-commits
https://github.com/rnk created https://github.com/llvm/llvm-project/pull/82815 This behavior is true for all attributes, but this behavior can be surprising for attributes which have function-wide effects, such as `optnone` and `target`. Most other function attributes affect the prototype or se

[clang] [compiler-rt] [asan][windows] Eliminate the static asan runtime on windows (PR #81677)

2024-02-23 Thread Reid Kleckner via cfe-commits
rnk wrote: I'm short on time, so I can't respond to all the discussion here, but at a high level, I agree with this direction and it's something I discussed with Microsoft folks working on ASan in the past, so I'm happy to see it come together. There is a great deal of build configuration com

[clang] [clang] Add `intrin0.h` header to mimic `intrin0.h` used by MSVC STL for clang-cl (PR #75711)

2024-02-23 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. I think there are risks to shadowing `yvals_core.h`, but @CaseyCarter is at least aware of it [here](https://github.com/microsoft/STL/issues/3634#issuecomment-1904956652). Once Clang ships its own intrin0.h header, the MSVC STL can adjust thei

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-08 Thread Reid Kleckner via cfe-commits
https://github.com/rnk closed https://github.com/llvm/llvm-project/pull/80519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-08 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/80519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-08 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: Thanks! I added notes. https://github.com/llvm/llvm-project/pull/80519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [InstrProf] Single byte counters in coverage (PR #75425)

2024-02-06 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: What are the next steps to work to land this? We're interested to try this out for Chrome! https://github.com/llvm/llvm-project/pull/75425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-06 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/80519 >From 6ab5ba3f970eaaea542fbed09cae17d3666df6b3 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Sat, 3 Feb 2024 00:18:42 + Subject: [PATCH 1/4] wip --- clang/lib/AST/Expr.cpp | 12

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-05 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/80519 >From 6ab5ba3f970eaaea542fbed09cae17d3666df6b3 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Sat, 3 Feb 2024 00:18:42 + Subject: [PATCH 1/3] wip --- clang/lib/AST/Expr.cpp | 12

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-05 Thread Reid Kleckner via cfe-commits
rnk wrote: > Also in the issue: #80510 you pointed out a crash bug. We should have the bug > covered in the test case as well. I think that is covered by the existing test case, instead of crashing, we now reject with an error. In the future if we want to align with GCC as you suggest, we'll

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-05 Thread Reid Kleckner via cfe-commits
@@ -108,3 +109,22 @@ int computed_with_lambda = [] { return result; }(); #endif + +#if __cplusplus >= 201703L +namespace DynamicFileScopeLiteral { +// This covers the case where we have a file-scope compound literal with a +// non-constant initializer in C++. Previously, we h

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-05 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/80519 >From 6ab5ba3f970eaaea542fbed09cae17d3666df6b3 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Sat, 3 Feb 2024 00:18:42 + Subject: [PATCH 1/2] wip --- clang/lib/AST/Expr.cpp | 12

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-05 Thread Reid Kleckner via cfe-commits
@@ -108,3 +109,22 @@ int computed_with_lambda = [] { return result; }(); #endif + +#if __cplusplus >= 201703L +namespace DynamicFileScopeLiteral { +// This covers the case where we have a file-scope compound literal with a +// non-constant initializer in C++. Previously, we h

  1   2   3   4   5   6   7   8   9   10   >