[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

2025-09-22 Thread Oliver Hunt via cfe-commits
@@ -118,22 +119,51 @@ _LIBUNWIND_HIDDEN int __unw_set_reg(unw_cursor_t *cursor, unw_regnum_t regNum, typedef LocalAddressSpace::pint_t pint_t; AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor; if (co->validReg(regNum)) { -co->setReg(regNum, (pint_t)value);

[clang] [clang][PAC] Don't try to diagnose use of pointer auth on dependent types #159505 (PR #159859)

2025-09-19 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/159859 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PAC] Don't try to diagnose use of pointer auth on dependent types #159505 (PR #159859)

2025-09-19 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/159859 >From 1344c121f7e980364627ad9ffebd040ce90093b1 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Fri, 19 Sep 2025 15:37:41 -0600 Subject: [PATCH] [clang][PAC] Don't try to diagnose use of pointer auth on dependen

[clang] [clang][PAC] Don't try to diagnose use of pointer auth on dependent types #159505 (PR #159859)

2025-09-19 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/159859 We can't give a correct answer for dependent types, so for now just report no ptrauth involves if the type being queried is dependent. In future we may want to distinguigh the `None` vs `Dependent` cases but tha

[clang] [clang][ptrauth] Warn about the use of a weak signing schema (PR #157779)

2025-09-13 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > Side thought: Would this warning only trigger on variables where a developer > has explicitly added something to the source code to request a non-default > signing schema? (In that case, chances are higher that the developer may be > able to understand the warning well). T

[clang] [clang][ptrauth] Warn about the use of a weak signing schema (PR #157779)

2025-09-13 Thread Oliver Hunt via cfe-commits
@@ -8357,6 +8357,16 @@ NamedDecl *Sema::ActOnVariableDeclarator( D.isFunctionDefinition()); } + // Warn about the use of a weak pointer authentication schema on a variable ojhunt wrote: Yeah - I think that's an easier int

[clang] [clang][ptrauth] Warn about the use of a weak signing schema (PR #157779)

2025-09-12 Thread Oliver Hunt via cfe-commits
@@ -8357,6 +8357,16 @@ NamedDecl *Sema::ActOnVariableDeclarator( D.isFunctionDefinition()); } + // Warn about the use of a weak pointer authentication schema on a variable ojhunt wrote: This should be pulled into a separa

[clang] [clang][ptrauth] Warn about the use of a weak signing schema (PR #157779)

2025-09-12 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/157779 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ptrauth] Warn about the use of a weak signing schema (PR #157779)

2025-09-12 Thread Oliver Hunt via cfe-commits
@@ -0,0 +1,68 @@ +// RUN: %clang_cc1 -triple arm64e-apple-ios -fptrauth-calls -fptrauth-intrinsics -fsyntax-only -verify %s +// RUN: %clang_cc1 -triple arm64e-apple-ios -DNO_PTRAUTH -fsyntax-only -verify %s + +#if defined(NO_PTRAUTH) + +#define FN_PTR_AUTH(address_diversity, con

[clang] [clang][ptrauth] Warn about the use of a weak signing schema (PR #157779)

2025-09-12 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt requested changes to this pull request. Needs update to `clang/docs/ReleaseNotes.rst` https://github.com/llvm/llvm-project/pull/157779 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

2025-09-12 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > > I _think_ doing it as a follow up makes sense: it's not a matter of me not > > wanting to do this for linux, it's that I cannot test it at all. Doing it > > as a follow up would also give you the constants block to put the > > definition rather than having it just slotted in

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

2025-09-09 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > > > * Fix personality pointer authentication on non-Apple targets: > > > [[runtimes][PAC] Harden unwinding when possible #143230 > > > (comment)](https://github.com/llvm/llvm-project/pull/143230#discussion_r2318636296) > > > > > > I'm not sure what's going on in this diff as i

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

2025-09-09 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > * Fix personality pointer authentication on non-Apple targets: > [[runtimes][PAC] Harden unwinding when possible #143230 > (comment)](https://github.com/llvm/llvm-project/pull/143230#discussion_r2318636296) > * I'm not sure what's going on in this diff as it does not appear rel

[clang] [clang][PAC] Enable the PAC dynamic_cast to final class optimization (PR #152601)

2025-09-07 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/152601 >From e9a96bb893b9a751a108d3f80a877789facb64fb Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Mon, 4 Aug 2025 20:54:46 -0700 Subject: [PATCH] [clang][PAC] Enable the PAC dynamic_cast to final class optimizatio

[clang] [clang][PAC] Enable the PAC dynamic_cast to final class optimization (PR #152601)

2025-09-06 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/152601 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Polymorphic Cleanup type is moved despite not being POD types (PR #156607)

2025-09-06 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/156607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

2025-09-04 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Updating cxxabi and compiler-rt formatting as they seem to be set up such that clang-format matches the existing style https://github.com/llvm/llvm-project/pull/143230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

2025-09-04 Thread Oliver Hunt via cfe-commits
ojhunt wrote: (Updating to throw at build bots) https://github.com/llvm/llvm-project/pull/143230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Polymorphic Cleanup type is moved despite not being POD types (PR #156607)

2025-09-04 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > Not really sure I get the motivation/what is happening here, but I don't know > if there is a better person to review? Perhaps @efriedma-quic can give it a > quick double-check as well? If you build clang targeting arm64e, pointer authentication means vtable pointers are not m

[clang] [clang][docs] Add note about `-Wms-bitfield-padding` in MSVC compatibility docs (PR #155770)

2025-09-03 Thread Oliver Hunt via cfe-commits
ojhunt wrote: @cor3ntin prodding you in case you know who should review, or are ok signing off on it :D https://github.com/llvm/llvm-project/pull/155770 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

2025-09-03 Thread Oliver Hunt via cfe-commits
ojhunt wrote: hmmm, I thought `ptrauth_calls` was one of the checks guarded by a darwin target so I might revert the `|| defined(__PTRAUTH__)` changes https://github.com/llvm/llvm-project/pull/143230 ___ cfe-commits mailing list cfe-commits@lists.llvm

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

2025-09-03 Thread Oliver Hunt via cfe-commits
@@ -16,6 +16,12 @@ #include #endif +#if __has_feature(ptrauth_calls) || defined(__PTRAUTH__) ojhunt wrote: I found this while updating the __PTRAUTH__ guards -- I would be ok leaving this as a task for you folk as I think this is a linux specific file? htt

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

2025-09-03 Thread Oliver Hunt via cfe-commits
@@ -103,10 +104,68 @@ #define _LIBCXXABI_DTOR_FUNC #endif -#if __cplusplus < 201103L -# define _LIBCXXABI_NOEXCEPT throw() -#else -# define _LIBCXXABI_NOEXCEPT noexcept +#if __has_include() +# include #endif +#if __has_extension(ptrauth_qualifier) + +// The actual value

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

2025-09-03 Thread Oliver Hunt via cfe-commits
@@ -103,6 +103,52 @@ #define _LIBCXXABI_DTOR_FUNC #endif +#if __has_include() +# include +#endif ojhunt wrote: Once I get my local build setup again I will be doing a bunch of the ptrauth.h cleanup - there are many places that were obviously transitively i

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

2025-09-03 Thread Oliver Hunt via cfe-commits
@@ -1047,18 +1051,26 @@ class UnwindCursor : public AbstractUnwindCursor{ bool getInfoFromFdeCie(const typename CFI_Parser::FDE_Info &fdeInfo, const typename CFI_Parser::CIE_Info &cieInfo, pint_t pc, uintptr_t dso_base); - bo

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

2025-09-03 Thread Oliver Hunt via cfe-commits
@@ -541,7 +588,33 @@ struct scan_results }; } // unnamed namespace +} // extern "C" + +namespace { +// The logical model for casting authenticated function pointers makes +// it impossible to directly cast them without breaking the authentication, +// as a result we need this

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

2025-09-03 Thread Oliver Hunt via cfe-commits
@@ -30,6 +30,45 @@ EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *, PCONTEXT, _Unwind_Personality_Fn); #endif +#if __has_feature(ptrauth_qualifier) +#include +#if __has_feature(ptrauth_restricted_intptr_qualif

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

2025-09-03 Thread Oliver Hunt via cfe-commits
@@ -557,7 +630,21 @@ set_registers(_Unwind_Exception* unwind_exception, _Unwind_Context* context, reinterpret_cast(unwind_exception)); _Unwind_SetGR(context, __builtin_eh_return_data_regno(1), static_cast(results.ttypeIndex)); +#if __has_featu

[clang] [llvm] [clang] Polymorphic Cleanup type is moved despite not being POD types (PR #156607)

2025-09-03 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Not sure who should be looking at the Compiler.h change? https://github.com/llvm/llvm-project/pull/156607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Polymorphic Cleanup type is moved despite not being POD types (PR #156607)

2025-09-03 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/156607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Polymorphic Cleanup type is moved despite not being true POD … (PR #156607)

2025-09-03 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/156607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Polymorphic Cleanup type is moved despite not being true POD … (PR #156607)

2025-09-03 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/156607 …types Clang has a number of Cleanup types used in exception handling, these are presumed to be POD types that can be memmoved as needed, however this is not correct by default on platforms with pointer authent

[clang] [clang][docs] Add note about `-Wms-bitfield-padding` in MSVC compatibility docs (PR #155770)

2025-08-29 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/155770 >From cc25a94f6f2e28e386b00ca8feee4d2c53c1ee01 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 28 Aug 2025 00:01:13 -0700 Subject: [PATCH] [clang][docs] Add note about `-Wms-bitfield-padding` in MSVC compa

[clang] Add pointer auth documentation to contents (PR #155763)

2025-08-28 Thread Oliver Hunt via cfe-commits
ojhunt wrote: (oh yay, you don't have to create a separate issue \o/ ) https://github.com/llvm/llvm-project/pull/155763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add pointer auth documentation to contents (PR #155763)

2025-08-28 Thread Oliver Hunt via cfe-commits
ojhunt wrote: /cherry-pick 6394c58 https://github.com/llvm/llvm-project/pull/155763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add pointer auth documentation to contents (PR #155763)

2025-08-28 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt milestoned https://github.com/llvm/llvm-project/pull/155763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add pointer auth documentation to contents (PR #155763)

2025-08-28 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Checked with Aaron and he feels this is ok :D https://github.com/llvm/llvm-project/pull/155763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add pointer auth documentation to contents (PR #155763)

2025-08-28 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/155763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add pointer auth documentation to contents (PR #155763)

2025-08-28 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/155763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][docs] Add note about `-Wms-bitfield-padding` in MSVC compatibility docs (PR #155770)

2025-08-28 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/155770 None >From 8e0f9dc43fd6ae669659932cf8d6ced62db6532b Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 28 Aug 2025 00:01:13 -0700 Subject: [PATCH] [clang][docs] Add note about `-Wms-bitfield-padding` in MSVC

[clang] [clang][docs] Add note about `-Wms-bitfield-padding` in MSVC compatibility docs (PR #155770)

2025-08-28 Thread Oliver Hunt via cfe-commits
ojhunt wrote: I wasn't sure if this was warranted, but given little effort to add the note I figured that I could create it an ping the last person to touch it :D https://github.com/llvm/llvm-project/pull/155770 ___ cfe-commits mailing list cfe-commit

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-26 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/154490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-25 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/154490 >From 689d70c706546a5b0b2ee00ebe7e030041d6fb2b Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 20 Aug 2025 01:28:29 -0700 Subject: [PATCH 1/4] [clang][PAC] Fix builtins that claim Address discriminated typ

[clang] [clang][PAC] Enable the PAC dynamic_cast to final class optimization (PR #152601)

2025-08-25 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/152601 >From 0603664d1637ea7fc729486dec97c5f3292cddaa Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Mon, 4 Aug 2025 20:54:46 -0700 Subject: [PATCH] [clang][PAC] Enable the PAC dynamic_cast to final class optimizatio

[compiler-rt] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (#138571) (PR #143230)

2025-08-25 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/143230 >From 27fb74cf3545cedab4e1c7fa6f42b935b5f345c0 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Tue, 5 Aug 2025 18:16:32 -0700 Subject: [PATCH 1/8] [runtimes][PAC] Harden unwinding when possible (#138571) This h

[clang] [PAC] Fix codegen for polymorphic class variables with consteval constructors (PR #154858)

2025-08-25 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/154858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-24 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/154490 >From 689d70c706546a5b0b2ee00ebe7e030041d6fb2b Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 20 Aug 2025 01:28:29 -0700 Subject: [PATCH 1/3] [clang][PAC] Fix builtins that claim Address discriminated typ

[clang] [PAC] Fix codegen for polymorphic class variables with consteval constructors (PR #154858)

2025-08-23 Thread Oliver Hunt via cfe-commits
@@ -876,8 +876,9 @@ bool ConstStructBuilder::Build(const APValue &Val, const RecordDecl *RD, for (const BaseInfo &Base : Bases) { bool IsPrimaryBase = Layout.getPrimaryBase() == Base.Decl; - Build(Val.getStructBase(Base.Index), Base.Decl, IsPrimaryBase, -

[clang] [WebKit checkers] Treat asm brk as trivial (PR #155046)

2025-08-23 Thread Oliver Hunt via cfe-commits
@@ -666,6 +666,10 @@ class TrivialFunctionAnalysisVisitor return IsFunctionTrivial(Callee); } + bool VisitGCCAsmStmt(const GCCAsmStmt *AS) { +return AS->getAsmString() == "brk #0xc471"; ojhunt wrote: does this need to be restricted to a specific br

[clang] [Clang] Add detailed notes explaining why is_aggregate evaluates to false (PR #152488)

2025-08-23 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt requested changes to this pull request. https://github.com/llvm/llvm-project/pull/152488 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add detailed notes explaining why is_aggregate evaluates to false (PR #152488)

2025-08-23 Thread Oliver Hunt via cfe-commits
@@ -2639,6 +2642,87 @@ static void DiagnoseNonStandardLayoutReason(Sema &SemaRef, SourceLocation Loc, SemaRef.Diag(D->getLocation(), diag::note_defined_here) << D; } +static void DiagnoseNonAggregateReason(Sema &SemaRef, SourceLocation Loc, +

[clang] [Clang] Add detailed notes explaining why is_aggregate evaluates to false (PR #152488)

2025-08-23 Thread Oliver Hunt via cfe-commits
@@ -2639,6 +2642,87 @@ static void DiagnoseNonStandardLayoutReason(Sema &SemaRef, SourceLocation Loc, SemaRef.Diag(D->getLocation(), diag::note_defined_here) << D; } +static void DiagnoseNonAggregateReason(Sema &SemaRef, SourceLocation Loc, +

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-23 Thread Oliver Hunt via cfe-commits
@@ -1438,6 +1438,10 @@ void CXXRecordDecl::addedMember(Decl *D) { data().StructuralIfLiteral = false; } +if (!data().HasTrivialSpecialMembers && +T.hasAddressDiscriminatedPointerAuth()) + data().HasTrivialSpecialMembers = true; ojh

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-22 Thread Oliver Hunt via cfe-commits
@@ -74,7 +74,7 @@ static_assert(__is_trivially_destructible(S3)); static_assert(!__is_trivially_copyable(S3)); static_assert(!__is_trivially_relocatable(S3)); // expected-warning{{deprecated}} //FIXME -static_assert(__builtin_is_cpp_trivially_relocatable(S3)); +static_assert(!

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-21 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/154490 >From 689d70c706546a5b0b2ee00ebe7e030041d6fb2b Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 20 Aug 2025 01:28:29 -0700 Subject: [PATCH 1/2] [clang][PAC] Fix builtins that claim Address discriminated typ

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-21 Thread Oliver Hunt via cfe-commits
@@ -1438,6 +1438,10 @@ void CXXRecordDecl::addedMember(Decl *D) { data().StructuralIfLiteral = false; } +if (!data().HasTrivialSpecialMembers && +T.hasAddressDiscriminatedPointerAuth()) + data().HasTrivialSpecialMembers = true; ojh

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-21 Thread Oliver Hunt via cfe-commits
@@ -1438,6 +1438,10 @@ void CXXRecordDecl::addedMember(Decl *D) { data().StructuralIfLiteral = false; } +if (!data().HasTrivialSpecialMembers && +T.hasAddressDiscriminatedPointerAuth()) + data().HasTrivialSpecialMembers = true; ojh

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-21 Thread Oliver Hunt via cfe-commits
@@ -1438,6 +1438,10 @@ void CXXRecordDecl::addedMember(Decl *D) { data().StructuralIfLiteral = false; } +if (!data().HasTrivialSpecialMembers && +T.hasAddressDiscriminatedPointerAuth()) + data().HasTrivialSpecialMembers = true; ojh

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-21 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt ready_for_review https://github.com/llvm/llvm-project/pull/154490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-21 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/154490 >From 689d70c706546a5b0b2ee00ebe7e030041d6fb2b Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 20 Aug 2025 01:28:29 -0700 Subject: [PATCH] [clang][PAC] Fix builtins that claim Address discriminated types a

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-21 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/154490 >From b0ac8bf69e8075d9241707afaf45aba2bf20d392 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 20 Aug 2025 01:28:29 -0700 Subject: [PATCH] [clang][PAC] Fix builtins that claim Address discriminated types a

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt converted_to_draft https://github.com/llvm/llvm-project/pull/154490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/154490 A number of builtins report some variation of "this type is compatibile with some bitwise equivalent operation", but this is not true for address discriminated values. We had address a number of cases, but not a

[clang] [clang][PAC][darwin] Set correct default ptrauth features for arm64e-darwin (PR #153722)

2025-08-19 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/153722 >From 0cbb0846f270c6d6cb15492ba34ff9ae2ed33f67 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 14 Aug 2025 17:43:03 -0700 Subject: [PATCH 1/8] [clang][PAC][darwin] Set correct default ptrauth features for

[clang] [clang][PAC][darwin] Set correct default ptrauth features for arm64e-darwin (PR #153722)

2025-08-19 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/153722 >From 0cbb0846f270c6d6cb15492ba34ff9ae2ed33f67 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 14 Aug 2025 17:43:03 -0700 Subject: [PATCH 1/7] [clang][PAC][darwin] Set correct default ptrauth features for

[clang] [clang][PAC][darwin] Set correct default ptrauth features for arm64e-darwin (PR #153722)

2025-08-18 Thread Oliver Hunt via cfe-commits
@@ -3291,6 +3291,39 @@ void Darwin::addClangTargetOptions( if (!RequiresSubdirectorySearch) CC1Args.push_back("-fno-modulemap-allow-subdirectory-search"); } + + if (getTriple().isArm64e()) { +auto EnsureDefaultPtrauthFlag = [&](OptSpecifier Pos, OptSpecifier Ne

[clang] [clang][PAC] ptrauth_qualifier and ptrauth_intrinsic should only be available on Darwin (PR #153912)

2025-08-18 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt auto_merge_enabled https://github.com/llvm/llvm-project/pull/153912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PAC] ptrauth_qualifier and ptrauth_intrinsic should only be available on Darwin (PR #153912)

2025-08-18 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/153912 >From ea731927d6bdf85a3cdb333b756447658f2c2ea6 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Fri, 15 Aug 2025 18:40:12 -0700 Subject: [PATCH 1/6] [clang][PAC] Make ptrauth_qualifier and ptrauth_intrinsic Darw

[clang] [clang][PAC] ptrauth_qualifier and ptrauth_intrinsic should only be available on Darwin (PR #153912)

2025-08-18 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/153912 >From ea731927d6bdf85a3cdb333b756447658f2c2ea6 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Fri, 15 Aug 2025 18:40:12 -0700 Subject: [PATCH 1/5] [clang][PAC] Make ptrauth_qualifier and ptrauth_intrinsic Darw

[clang] [clang][PAC] ptrauth_qualifier and ptrauth_intrinsic should only be available on Darwin (PR #153912)

2025-08-18 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/153912 >From ea731927d6bdf85a3cdb333b756447658f2c2ea6 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Fri, 15 Aug 2025 18:40:12 -0700 Subject: [PATCH 1/4] [clang][PAC] Make ptrauth_qualifier and ptrauth_intrinsic Darw

[clang] [clang][PAC] ptrauth_qualifier and ptrauth_intrinsic should only be available on Darwin (PR #153912)

2025-08-18 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/153912 >From ea731927d6bdf85a3cdb333b756447658f2c2ea6 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Fri, 15 Aug 2025 18:40:12 -0700 Subject: [PATCH 1/3] [clang][PAC] Make ptrauth_qualifier and ptrauth_intrinsic Darw

[clang] [clang][PAC] ptrauth_qualifier and ptrauth_intrinsic should only be available on Darwin (PR #153912)

2025-08-18 Thread Oliver Hunt via cfe-commits
@@ -1528,6 +1528,9 @@ static void InitializePredefinedMacros(const TargetInfo &TI, #undef TARGET_OS } + if (LangOpts.PointerAuthIntrinsics) +Builder.defineMacro("__PTRAUTH__"); ojhunt wrote: I think the complexity of the ptrauth abi surface area means

[clang] [clang][PAC] ptrauth_qualifier and ptrauth_intrinsic should only be available on Darwin (PR #153912)

2025-08-18 Thread Oliver Hunt via cfe-commits
@@ -1089,6 +1089,7 @@ static void ComputeDATE_TIME(SourceLocation &DATELoc, SourceLocation &TIMELoc, /// specified by the identifier as a standard language feature. static bool HasFeature(const Preprocessor &PP, StringRef Feature) { const LangOptions &LangOpts = PP.getLangOp

[clang] [clang][ObjC] Fix incorrect return type inference for discarded blocks (PR #154109)

2025-08-18 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/154109 When parsing a block expression we were not entering a new eval context and as a result when parsing the block body we continue to treat any return statements as discarded so infer a `void` result. This fixes t

[clang] [clang] return type not correctly deduced for discarded lambdas (PR #153921)

2025-08-18 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/153921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add an ABI_EXTENSION concept that is testable under -pedantic… (PR #153506)

2025-08-17 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/153506 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add an ABI_EXTENSION concept that is testable under -pedantic… (PR #153506)

2025-08-17 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Closing, as for the current critical case (ptrauth) we're keeping the tests as a feature when the target is arm64e, and adding a ``__PTRAUTH__`` define that will be the correct test going forward. https://github.com/llvm/llvm-project/pull/153506 __

[clang] [clang][PAC] ptrauth_qualifier and ptrauth_intrinsic should only be available on Darwin (PR #153912)

2025-08-17 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/153912 >From ea731927d6bdf85a3cdb333b756447658f2c2ea6 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Fri, 15 Aug 2025 18:40:12 -0700 Subject: [PATCH 1/2] [clang][PAC] Make ptrauth_qualifier and ptrauth_intrinsic Darw

[clang] [clang][PAC] ptrauth_qualifier and ptrauth_intrinsic should only be available on Darwin (PR #153912)

2025-08-17 Thread Oliver Hunt via cfe-commits
ojhunt wrote: I realized that this can't be made to work nicely and automatically no matter how much I would like it to as of course the macro based version of `__has_ptrauth_feature` can't check for a macro being defined in expression contexts. Oh well, I guess that dream is over. I'll just s

[clang] [clang] return type not correctly deduced for discarded lambdas (PR #153921)

2025-08-17 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/153921 >From cee36b9d023f97b55bf01220ccd6f404311db339 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Fri, 15 Aug 2025 21:04:07 -0700 Subject: [PATCH 1/2] [clang] return type not correctly deduced for discarded lambda

[clang] [clang] return type not correctly deduced for discarded lambdas (PR #153921)

2025-08-17 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt ready_for_review https://github.com/llvm/llvm-project/pull/153921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] return type not correctly deduced for discarded lambdas (PR #153921)

2025-08-17 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/153921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] return type not correctly deduced for discarded lambdas (PR #153921)

2025-08-17 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/153921 >From cee36b9d023f97b55bf01220ccd6f404311db339 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Fri, 15 Aug 2025 21:04:07 -0700 Subject: [PATCH 1/2] [clang] return type not correctly deduced for discarded lambda

[clang] [clang] return type not correctly deduced for discarded lambdas (PR #153921)

2025-08-17 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/153921 >From cee36b9d023f97b55bf01220ccd6f404311db339 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Fri, 15 Aug 2025 21:04:07 -0700 Subject: [PATCH] [clang] return type not correctly deduced for discarded lambdas T

[clang] [clang][PAC][darwin] Set correct default ptrauth features for arm64e-darwin (PR #153722)

2025-08-17 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/153722 >From 0cbb0846f270c6d6cb15492ba34ff9ae2ed33f67 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 14 Aug 2025 17:43:03 -0700 Subject: [PATCH 1/5] [clang][PAC][darwin] Set correct default ptrauth features for

[clang] [clang][PAC][darwin] Set correct default ptrauth features for arm64e-darwin (PR #153722)

2025-08-17 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/153722 >From 0cbb0846f270c6d6cb15492ba34ff9ae2ed33f67 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 14 Aug 2025 17:43:03 -0700 Subject: [PATCH 1/4] [clang][PAC][darwin] Set correct default ptrauth features for

[clang] [clang][PAC][darwin] Set correct default ptrauth features for arm64e-darwin (PR #153722)

2025-08-17 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/153722 >From 0cbb0846f270c6d6cb15492ba34ff9ae2ed33f67 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 14 Aug 2025 17:43:03 -0700 Subject: [PATCH 1/3] [clang][PAC][darwin] Set correct default ptrauth features for

[clang] [clang][PAC] ptrauth_qualifier and ptrauth_intrinsic should only be available on Darwin (PR #153912)

2025-08-17 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Today, in the correct PR: @AaronBallman @cor3ntin I have an idea, and I'd like to see what you think. We currently have the misery of these has_feature checks, I'm wondering if we can make them _all_ darwin only, so for each one, say ptrauth_calls we add a predefined macro like

[clang] [clang] return type not correctly deduced for discarded lambdas (PR #153921)

2025-08-16 Thread Oliver Hunt via cfe-commits
ojhunt wrote: @AaronBallman @cor3ntin I have an idea, and I'd like to see what you think. We currently have the misery of these has_feature checks, I'm wondering if we can make them _all_ darwin only, so for each one, say ptrauth_calls we add a predefined macro like `__PTRAUTH_ABI_PTRAUTH_CALL

[clang] [clang] return type not correctly deduced for discarded lambdas (PR #153921)

2025-08-16 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > ```c++ > auto x = [](U, U = U::bar) {}; > ``` I think I technically knew you could have templated lambdas, but I certainly forgot about it entirely :D What I'm trying to construct is something that would not trigger an error if it was wrapped in an `if constexpr(0)` inside t

[clang] [clang] return type not correctly deduced for discarded lambdas (PR #153921)

2025-08-16 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > This should work > > ```diff > diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp > b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp > index f02a295220ef..6b423ce06523 100644 > --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp > +++ b/clang/lib/Sema/SemaTemplateInsta

[clang] [clang][PAC][darwin] Set correct default ptrauth features for arm64e-darwin (PR #153722)

2025-08-16 Thread Oliver Hunt via cfe-commits
@@ -0,0 +1,85 @@ +// RUN: %clang -target arm64 -DNO_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=no_default_ptrauth +// RUN: %clang -target arm64-apple-macosx -DNO_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=no_default_ptrauth +// RUN: %cl

[clang] [clang][PAC][darwin] Set correct default ptrauth features for arm64e-darwin (PR #153722)

2025-08-16 Thread Oliver Hunt via cfe-commits
@@ -0,0 +1,85 @@ +// RUN: %clang -target arm64 -DNO_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=no_default_ptrauth +// RUN: %clang -target arm64-apple-macosx -DNO_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=no_default_ptrauth +// RUN: %cl

[clang] [clang][PAC][darwin] Set correct default ptrauth features for arm64e-darwin (PR #153722)

2025-08-16 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/153722 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PAC][darwin] Set correct default ptrauth features for arm64e-darwin (PR #153722)

2025-08-16 Thread Oliver Hunt via cfe-commits
@@ -3291,6 +3291,39 @@ void Darwin::addClangTargetOptions( if (!RequiresSubdirectorySearch) CC1Args.push_back("-fno-modulemap-allow-subdirectory-search"); } + + if (getTriple().isArm64e()) { ojhunt wrote: I've done this - the out of date-ness was

[clang] [clang][PAC][darwin] Set correct default ptrauth features for arm64e-darwin (PR #153722)

2025-08-16 Thread Oliver Hunt via cfe-commits
@@ -3291,6 +3291,39 @@ void Darwin::addClangTargetOptions( if (!RequiresSubdirectorySearch) CC1Args.push_back("-fno-modulemap-allow-subdirectory-search"); } + + if (getTriple().isArm64e()) { +auto EnsureDefaultPtrauthFlag = [&](OptSpecifier Pos, OptSpecifier Ne

[clang] [clang][PAC] ptrauth_qualifier and ptrauth_intrinsic should only be available on Darwin (PR #153912)

2025-08-16 Thread Oliver Hunt via cfe-commits
@@ -1528,6 +1528,9 @@ static void InitializePredefinedMacros(const TargetInfo &TI, #undef TARGET_OS } + if (LangOpts.PointerAuthIntrinsics) +Builder.defineMacro("__PTRAUTH__"); ojhunt wrote: I think @AaronBallman had an opinion on the `__` suffix - I

[clang] [clang][PAC] ptrauth_qualifier and ptrauth_intrinsic should only be available on Darwin (PR #153912)

2025-08-16 Thread Oliver Hunt via cfe-commits
@@ -1528,6 +1528,9 @@ static void InitializePredefinedMacros(const TargetInfo &TI, #undef TARGET_OS } + if (LangOpts.PointerAuthIntrinsics) +Builder.defineMacro("__PTRAUTH__"); ojhunt wrote: (we have __ARM_FEATURE_PAUTH already) https://github.com/ll

[clang] [clang][PAC] ptrauth_qualifier and ptrauth_intrinsic should only be available on Darwin (PR #153912)

2025-08-16 Thread Oliver Hunt via cfe-commits
@@ -1528,6 +1528,9 @@ static void InitializePredefinedMacros(const TargetInfo &TI, #undef TARGET_OS } + if (LangOpts.PointerAuthIntrinsics) +Builder.defineMacro("__PTRAUTH__"); ojhunt wrote: Ok, so there's an existing `__ARM_FEATURE_PAUTH` but that do

[clang] [clang][PAC] ptrauth_qualifier and ptrauth_intrinsic should only be available on Darwin (PR #153912)

2025-08-16 Thread Oliver Hunt via cfe-commits
@@ -1528,6 +1528,9 @@ static void InitializePredefinedMacros(const TargetInfo &TI, #undef TARGET_OS } + if (LangOpts.PointerAuthIntrinsics) +Builder.defineMacro("__PTRAUTH__"); ojhunt wrote: I don't believe gcc has any support as yet? I recall talking

  1   2   3   4   5   6   7   8   9   >