[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-15 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Actually I've given this a lot of thought, I think we should not consider explicitly __ptrauth qualified types to be relocatable, how does that sound? https://github.com/llvm/llvm-project/pull/143969 ___ cfe-commits mailing list cfe-comm

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-15 Thread Oliver Hunt via cfe-commits
ojhunt wrote: found how to unmark the approval as the next update will change this fairly substantially https://github.com/llvm/llvm-project/pull/143969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-03 Thread Oliver Hunt via cfe-commits
@@ -1,5 +1,5 @@ // RUN: cp %s %t -// RUN: %clang_cc1 -x c++ -Wunused-lambda-capture -Wno-unused-value -std=c++1z -fixit %t +// RUN: %clang_cc1 -x c++ -Wno-vla-cxx-extension -Wunused-lambda-capture -Wno-unused-value -std=c++1z -fixit %t ojhunt wrote: ah no, th

[clang] [clang][CGObjC] Sign the v-table pointer in ObjC exception RTTI. (PR #135562)

2025-06-03 Thread Oliver Hunt via cfe-commits
@@ -7676,10 +7676,26 @@ CGObjCNonFragileABIMac::GetInterfaceEHType(const ObjCInterfaceDecl *ID, } llvm::Value *VTableIdx = llvm::ConstantInt::get(CGM.Int32Ty, 2); + llvm::Constant *VTablePtr = llvm::ConstantExpr::getInBoundsGetElementPtr( + VTableGV->getValueType(),

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-03 Thread Oliver Hunt via cfe-commits
ojhunt wrote: I don't understand the windows failure (ninja says there was a failure, but I cannot find any failure in the log?) I'm also confused by the documentation failure: it's not telling me what/where the error is coming from. https://github.com/llvm/llvm-project/pull/141148 __

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-03 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/141148 >From 0db205bb8f6925dd725885395f58a688000c7b8b Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 22 May 2025 02:38:26 -0700 Subject: [PATCH 1/5] [clang] Correct FixIt ranges for unused capture warnings Fixes

[clang] [clang][CGObjC] Sign the v-table pointer in ObjC exception RTTI. (PR #135562)

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

[clang] [clang][PAC] Add __builtin_get_vtable_pointer (PR #139790)

2025-06-03 Thread Oliver Hunt via cfe-commits
@@ -3074,6 +3074,39 @@ following way: Query for this feature with ``__has_builtin(__builtin_offsetof)``. +``__builtin_get_vtable_pointer`` + + +``__builtin_get_vtable_pointer`` loads and authenticates the primary vtable +pointer from an instanc

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-03 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > Documentation failure says: > > Warning, treated as error: > /home/runner/work/llvm-project/llvm-project/clang-build/tools/clang/docs/DiagnosticsReference.rst:18009:Unexpected > indentation. Right, but I don't know how/what is causing the failure as I haven't changed any dia

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-03 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/141148 >From 0db205bb8f6925dd725885395f58a688000c7b8b Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 22 May 2025 02:38:26 -0700 Subject: [PATCH 1/5] [clang] Correct FixIt ranges for unused capture warnings Fixes

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-03 Thread Oliver Hunt via cfe-commits
ojhunt wrote: I can't reproduce this locally so I've ensured my tree is up to date and pushing again to see if it fails again https://github.com/llvm/llvm-project/pull/141148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [clang][docs] Fix docs-clang-html. (PR #142387)

2025-06-03 Thread Oliver Hunt via cfe-commits
ojhunt wrote: this is tripping on CI and my machine. To repro I need to delete `$BUILD_DIR/tools/clang/docs` and build with `TZ=UTC ninja docs-clang-man` I find it necessary to delete the doc directory to trigger this. https://github.com/llvm/llvm-project/pull/142387 ___

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-03 Thread Oliver Hunt via cfe-commits
ojhunt wrote: The docs failure is #142387 https://github.com/llvm/llvm-project/pull/141148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PAC] Add __builtin_get_vtable_pointer (PR #139790)

2025-06-03 Thread Oliver Hunt via cfe-commits
@@ -1825,6 +1825,37 @@ static ExprResult PointerAuthStringDiscriminator(Sema &S, CallExpr *Call) { return Call; } +static ExprResult GetVTablePointer(Sema &S, CallExpr *Call) { + if (S.checkArgCount(Call, 1)) +return ExprError(); + ExprResult ThisArg = S.DefaultFuncti

[clang] [clang][PAC] Add __builtin_get_vtable_pointer (PR #139790)

2025-06-03 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/139790 >From a933679801bde89b53584c4c65118658477db4da Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Tue, 13 May 2025 13:35:55 -0700 Subject: [PATCH 1/5] [clang][PAC] Add __builtin_get_vtable_pointer With pointer aut

[clang] [clang][PAC] Add __builtin_get_vtable_pointer (PR #139790)

2025-06-03 Thread Oliver Hunt via cfe-commits
@@ -3074,6 +3074,39 @@ following way: Query for this feature with ``__has_builtin(__builtin_offsetof)``. +``__builtin_get_vtable_pointer`` + + +``__builtin_get_vtable_pointer`` loads and authenticates the primary vtable +pointer from an instanc

[clang] [PAuth] Use different discriminators for __int128_t / __uint128_t / _BitInt(n) (PR #140276)

2025-06-04 Thread Oliver Hunt via cfe-commits
@@ -4451,6 +4451,8 @@ defm ptrauth_init_fini_address_discrimination : OptInCC1FFlag<"ptrauth-init-fini "Enable address discrimination of function pointers in init/fini arrays">; defm ptrauth_elf_got : OptInCC1FFlag<"ptrauth-elf-got", "Enable authentication of pointers from G

[clang] [PAuth] Use different discriminators for __int128_t / __uint128_t / _BitInt(n) (PR #140276)

2025-06-04 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt commented: This basically looks good to me, sans the "can this just be on by default for elf/linux/etc" question https://github.com/llvm/llvm-project/pull/140276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [PAuth] Use different discriminators for __int128_t / __uint128_t / _BitInt(n) (PR #140276)

2025-06-04 Thread Oliver Hunt via cfe-commits
@@ -1883,6 +1883,9 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args, Args.addOptInFlag( CmdArgs, options::OPT_fptrauth_function_pointer_type_discrimination, options::OPT_fno_ptrauth_function_pointer_type_discrimination); + Args.addOptInFlag( --

[clang] [clang][PAC] Add __builtin_get_vtable_pointer (PR #139790)

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

[clang] [PAuth] Use different discriminators for __int128_t / __uint128_t / _BitInt(n) (PR #140276)

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

[clang] [clang][CGObjC] Sign the v-table pointer in ObjC exception RTTI. (PR #135562)

2025-06-04 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/135562 >From 5dc1e5fbb57f88e412e044605d8fe30a66255a35 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Sun, 13 Apr 2025 13:21:49 -0700 Subject: [PATCH 1/4] [clang][CGObjC] Sign the v-table pointer in ObjC exception RTT

[libunwind] [libunwind][AArch64] Protect PC within libunwind's context. (PR #113368)

2025-06-04 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Sorry, I missed this Now that the ptrauth qualifier is available I'm going to be preparing and pushing the darwin libunwind+personality function changes, which are very aggressive in there protection of data and pointers https://github.com/llvm/llvm-project/pull/113368 _

[clang] [clang][PAC] Add __builtin_get_vtable_pointer (PR #139790)

2025-06-03 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/139790 >From a933679801bde89b53584c4c65118658477db4da Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Tue, 13 May 2025 13:35:55 -0700 Subject: [PATCH 1/3] [clang][PAC] Add __builtin_get_vtable_pointer With pointer aut

[clang] [clang][PAC] Add __builtin_get_vtable_pointer (PR #139790)

2025-06-03 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/139790 >From a933679801bde89b53584c4c65118658477db4da Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Tue, 13 May 2025 13:35:55 -0700 Subject: [PATCH 1/2] [clang][PAC] Add __builtin_get_vtable_pointer With pointer aut

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-05-30 Thread Oliver Hunt via cfe-commits
@@ -0,0 +1,250 @@ +// RUN: cp %s %t +// RUN: %clang_cc1 -x c++ -Wunused-lambda-capture -Wno-unused-value -std=c++1z -fixit %t +// RUN: grep -v CHECK %t | FileCheck %s + + +#define MACRO_CAPTURE(...) __VA_ARGS__ +int main() { +int a = 0, b = 0, c = 0; +auto F0 = [a, &b]()

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-05-30 Thread Oliver Hunt via cfe-commits
@@ -972,6 +972,12 @@ class Sema final : public SemaBase { /// Calls \c Lexer::getLocForEndOfToken() SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset = 0); + /// Calls \c Lexer::findNextToken() to find the next token, and if the + /// locations of bo

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-05-30 Thread Oliver Hunt via cfe-commits
@@ -2164,15 +2164,29 @@ ExprResult Sema::BuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc, bool IsLast = (I + 1) == LSI->NumExplicitCaptures; SourceRange FixItRange; if (CaptureRange.isValid()) { +auto GetTrailingEndLocat

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-05-30 Thread Oliver Hunt via cfe-commits
@@ -84,6 +84,21 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc, unsigned Offset) { return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts); } +SourceRange Sema::getRangeForNextToken(SourceLocation Loc, + bool

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-05-30 Thread Oliver Hunt via cfe-commits
@@ -84,6 +84,21 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc, unsigned Offset) { return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts); } +SourceRange Sema::getRangeForNextToken(SourceLocation Loc, + bool

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-05-30 Thread Oliver Hunt via cfe-commits
@@ -972,6 +972,12 @@ class Sema final : public SemaBase { /// Calls \c Lexer::getLocForEndOfToken() SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset = 0); + /// Calls \c Lexer::findNextToken() to find the next token, and if the + /// locations of bo

[clang] [clang][ptrauth] Add support for querying the ptrauth schema of a type (PR #138482)

2025-06-06 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/138482 >From ecea44f2965cda3a4e6e1ccec096066830ddfa41 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Sun, 4 May 2025 21:07:33 -0700 Subject: [PATCH 1/2] [clang][ptrauth] Add support for querying the ptrauth schema of

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

2025-06-06 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/143230 This hardens the unwinding logic and datastructures on systems that support pointer authentication. The approach taken to hardening is to harden the schemas of as many high value fields in the myriad structs as

[libunwind] [libunwind][AArch64] Protect PC within libunwind's context. (PR #113368)

2025-06-06 Thread Oliver Hunt via cfe-commits
ojhunt wrote: I've finally got our downstream hardening to the point where it should be sane: https://github.com/llvm/llvm-project/pull/143230 https://github.com/llvm/llvm-project/pull/113368 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

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

2025-06-06 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/143230 >From 68103962b254565fdfad069c350af90ede7109b4 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Fri, 6 Jun 2025 18:50:28 -0700 Subject: [PATCH] [runtimes][PAC] Harden unwinding when possible (#138571) This harde

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

2025-06-06 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/143230 >From 637245f9be6ed0163c9129d27a572f153b6f8523 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Fri, 6 Jun 2025 18:50:28 -0700 Subject: [PATCH] [runtimes][PAC] Harden unwinding when possible (#138571) This harde

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

2025-06-06 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Updating formatting before review - had discussed with Louis and he expressed a preference for some of it, but this llvm.org style bot complains many other cases (likely a local config issue when I was trying to cleanup the downstream code. So I've updated with a direct clang-fo

[clang] [AArch64][FMV] Enable PAuth and BTI hardening of resolver functions (PR #141573)

2025-06-05 Thread Oliver Hunt via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -triple aarch64-linux-gnu -mbranch-target-enforce -msign-return-address=all -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,BTI-SIGNRA %s ojhunt wrote: none of the other ptrauth tests are in a subdirectory, are yo

[clang] [clang][PAC] add support for options parameter to __ptrauth (PR #136828)

2025-06-11 Thread Oliver Hunt via cfe-commits
@@ -65,6 +65,17 @@ enum class PointerAuthenticationMode : unsigned { SignAndAuth }; +static constexpr llvm::StringLiteral PointerAuthenticationOptionStrip = "strip"; ojhunt wrote: ah so what @erichkeane was suggesting is that places needing the string woul

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143796)

2025-06-11 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/143796 This reworks the way we compute relocatability and replaceability of types. We do this by having a single interface the provides a full `TypeRelocationInfo` for a QualType. This simplifies the reasoning for all

[clang] [Clang] Fix a crash when diagnosing a non relocatable with no copy ctr (PR #143350)

2025-06-09 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt approved this pull request. Looks good https://github.com/llvm/llvm-project/pull/143350 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix a crash when diagnosing a non relocatable with no copy ctr (PR #143350)

2025-06-09 Thread Oliver Hunt via cfe-commits
@@ -2052,7 +2052,7 @@ static void DiagnoseNonTriviallyRelocatableReason(Sema &SemaRef, } if (!D->hasSimpleMoveConstructor() && !D->hasSimpleCopyConstructor()) { -const auto *Decl = cast( +const auto *Decl = cast_or_null( ojhunt wrote: I didn't re

[clang] [Clang] Fix a crash when diagnosing a non relocatable with no copy ctr (PR #143350)

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

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

2025-06-08 Thread Oliver Hunt via cfe-commits
ojhunt wrote: unused variable errors are likely fallout from refactoring and workaround removals I did as part of the prep, will do some cleanup/diagnostics work later this week. I mostly wanted to get this available to others to see whether they were ok adopting this rather than rolling thei

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

2025-06-12 Thread Oliver Hunt via cfe-commits
@@ -32,22 +32,23 @@ #endif #if defined(_WIN32) - #if defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS) || (defined(__MINGW32__) && !defined(_LIBCXXABI_BUILDING_LIBRARY)) - #define _LIBCXXABI_HIDDEN - #define _LIBCXXABI_DATA_VIS - #define _LIBCXXABI_FUNC_VIS - #define _LI

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

2025-06-12 Thread Oliver Hunt via cfe-commits
@@ -32,22 +32,23 @@ #endif #if defined(_WIN32) - #if defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS) || (defined(__MINGW32__) && !defined(_LIBCXXABI_BUILDING_LIBRARY)) - #define _LIBCXXABI_HIDDEN - #define _LIBCXXABI_DATA_VIS - #define _LIBCXXABI_FUNC_VIS - #define _LI

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

2025-06-12 Thread Oliver Hunt via cfe-commits
@@ -126,6 +130,36 @@ _LIBUNWIND_HIDDEN int __unw_set_reg(unw_cursor_t *cursor, unw_regnum_t regNum, // First, get the FDE for the old location and then update it. co->getInfo(&info); co->setInfoBasedOnIPRegister(false); + +#if __has_feature(ptrauth_calls) +

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

2025-06-12 Thread Oliver Hunt via cfe-commits
@@ -807,7 +812,12 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext) strd31, [x0, #0x208] #endif movx0, #0 // return UNW_ESUCCESS + +#if __has_feature(ptrauth_calls) + retab +#else ojhunt wrote: This is what we have downstream, i

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

2025-06-12 Thread Oliver Hunt via cfe-commits
@@ -557,7 +596,19 @@ 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 defined(__A

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143796)

2025-06-12 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Closing this PR because there's a lot of noise in it that is just completely reverted/gone at this point. https://github.com/llvm/llvm-project/pull/143796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143796)

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

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-12 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/143969 This adds a function to ASTContext to query whether a type contains values with address discriminated pointer auth, and performs the required semantic checks to ensure correct reporting of relocatablity in those

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-12 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/143969 >From f47680310ed68a9f8e8cb15bc1cd474740072463 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 12 Jun 2025 13:17:11 -0700 Subject: [PATCH 1/2] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-12 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/143969 >From f47680310ed68a9f8e8cb15bc1cd474740072463 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 12 Jun 2025 13:17:11 -0700 Subject: [PATCH 1/2] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-12 Thread Oliver Hunt via cfe-commits
@@ -628,10 +628,13 @@ class ASTContext : public RefCountedBase { getRelocationInfoForCXXRecord(const CXXRecordDecl *) const; void setRelocationInfoForCXXRecord(const CXXRecordDecl *, CXXRecordDeclRelocationInfo); + bool containsAddressD

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

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

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-12 Thread Oliver Hunt via cfe-commits
@@ -1705,6 +1705,40 @@ void ASTContext::setRelocationInfoForCXXRecord( RelocatableClasses.insert({D, Info}); } +bool ASTContext::containsAddressDiscriminatedPointerAuth(QualType T) { + if (!LangOpts.PointerAuthCalls && !LangOpts.PointerAuthIntrinsics) +return false; + +

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-12 Thread Oliver Hunt via cfe-commits
@@ -15121,6 +15155,21 @@ ASTContext::baseForVTableAuthentication(const CXXRecordDecl *ThisClass) { return PrimaryBase; } +bool ASTContext::hasAddressDiscriminatedVTableAuthentication( ojhunt wrote: Which function? https://github.com/llvm/llvm-project/pull

[clang] [Clang] _default-movable_ should be based on the first declaration (PR #143661)

2025-06-11 Thread Oliver Hunt via cfe-commits
@@ -121,8 +121,10 @@ static bool hasSuitableConstructorForRelocation(Sema &SemaRef, CXXMethodDecl *Decl = LookupSpecialMemberFromXValue(SemaRef, D, /*Assign=*/false); ojhunt wrote: Is it reasonable to have LookupSpecialMemberFromXValue simply return

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143796)

2025-06-12 Thread Oliver Hunt via cfe-commits
@@ -292,77 +294,129 @@ Sema::CheckCXX2CRelocatableAndReplaceable(const CXXRecordDecl *D) { return HasSuitableSMP(); // is a union with no user-declared special member functions, or -if (IsUnion()) +if (IsTrivialUnion()) return HasSuitableSMP();

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143796)

2025-06-12 Thread Oliver Hunt via cfe-commits
@@ -621,17 +621,24 @@ class ASTContext : public RefCountedBase { public: struct CXXRecordDeclRelocationInfo { +static CXXRecordDeclRelocationInfo NonRelocatable() { + return {false, false}; +} + unsigned IsRelocatable; unsigned IsReplaceable; -

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143796)

2025-06-12 Thread Oliver Hunt via cfe-commits
@@ -10615,7 +10615,7 @@ void Sema::checkIllFormedTrivialABIStruct(CXXRecordDecl &RD) { } } - if (IsCXXTriviallyRelocatableType(RD)) + if (CheckCXX2CRelocatableAndReplaceable(&RD).IsRelocatable) ojhunt wrote: I think I did restore it for QualType an

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143796)

2025-06-12 Thread Oliver Hunt via cfe-commits
@@ -292,77 +294,129 @@ Sema::CheckCXX2CRelocatableAndReplaceable(const CXXRecordDecl *D) { return HasSuitableSMP(); // is a union with no user-declared special member functions, or -if (IsUnion()) +if (IsTrivialUnion()) return HasSuitableSMP();

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

2025-06-27 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Re: the oracle concerns - there are some protections we have, but in general I think the current pointer auth semantics/diagnostics make it too easy to silently introduce oracles. Additionally a lot of the current unwind pointerauth work is focused on protecting the ABI boundarie

[clang] [clang] Update diagnostics for type aware allocators (PR #148576)

2025-07-14 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/148576 Alas reflection pushed p2719 out of C++26, so this PR changes the diagnostics to reflect that for now type aware allocation is functionally a clang extension. >From d86fea4e16dc9962f87a8969e74b62767476ec30 Mon S

[clang] [clang][ObjC][PAC] Add ptrauth protections to objective-c (PR #147899)

2025-07-10 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/147899 >From 3b0a91c3d4a4ae8ec7980d2201d94f59746fb769 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 9 Jul 2025 17:30:48 -0700 Subject: [PATCH] [clang][ObjC][PAC] Add ptrauth protections to objective-c This PR i

[clang] [clang] Fixes #138823 (PR #147938)

2025-07-10 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/147938 Make sure to mark a concept decl as being invalid if the constraint is invalid. >From 8beb2eeab5270df51408d233d90d89be735b1828 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 10 Jul 2025 03:57:32 -0700 Sub

[clang] [clang][ObjC][PAC] Add ptrauth protections to objective-c (PR #147899)

2025-07-10 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/147899 >From 0d38b0d9b153bfb55c199d3bb4b6cdca2f708af9 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 9 Jul 2025 17:30:48 -0700 Subject: [PATCH 1/4] [clang][ObjC][PAC] Add ptrauth protections to objective-c This

[clang] [clang][ObjC][PAC] Add ptrauth protections to objective-c (PR #147899)

2025-07-10 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/147899 >From 0d38b0d9b153bfb55c199d3bb4b6cdca2f708af9 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 9 Jul 2025 17:30:48 -0700 Subject: [PATCH] [clang][ObjC][PAC] Add ptrauth protections to objective-c This PR i

[clang] [clang][ObjC][PAC] Add ptrauth protections to objective-c (PR #147899)

2025-07-10 Thread Oliver Hunt via cfe-commits
ojhunt wrote: dammit habitually force pushed a squash and rebase. #skilled. https://github.com/llvm/llvm-project/pull/147899 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ObjC][PAC] Add ptrauth protections to objective-c (PR #147899)

2025-07-10 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/147899 >From 0d38b0d9b153bfb55c199d3bb4b6cdca2f708af9 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 9 Jul 2025 17:30:48 -0700 Subject: [PATCH 1/2] [clang][ObjC][PAC] Add ptrauth protections to objective-c This

[clang] [clang][ObjC][PAC] Add ptrauth protections to objective-c (PR #147899)

2025-07-10 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/147899 >From 0d38b0d9b153bfb55c199d3bb4b6cdca2f708af9 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 9 Jul 2025 17:30:48 -0700 Subject: [PATCH 1/3] [clang][ObjC][PAC] Add ptrauth protections to objective-c This

[clang] [clang] Fix a crash when dynamic_cast-ing to a `final` class (PR #148088)

2025-07-13 Thread Oliver Hunt via cfe-commits
@@ -2341,8 +2341,15 @@ llvm::Value *CodeGenFunction::EmitDynamicCast(Address ThisAddr, } else if (IsExact) { // If the destination type is effectively final, this pointer points to the // right type if and only if its vptr has the right value. -Value = CGM.getCXX

[clang] [clang] Update diagnostics for type aware allocators (PR #148576)

2025-07-14 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/148576 >From d86fea4e16dc9962f87a8969e74b62767476ec30 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Mon, 14 Jul 2025 00:26:08 -0700 Subject: [PATCH 1/2] [clang] Update diagnostics for type aware allocators Alas refl

[clang] [clang] Update diagnostics for type aware allocators (PR #148576)

2025-07-14 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/148576 >From d86fea4e16dc9962f87a8969e74b62767476ec30 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Mon, 14 Jul 2025 00:26:08 -0700 Subject: [PATCH 1/3] [clang] Update diagnostics for type aware allocators Alas refl

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

2025-06-25 Thread Oliver Hunt via cfe-commits
ojhunt wrote: I'll be back to working on this later today - there's a pile of feedback, and a bunch of nonsense that I managed to accidentally accrue and/or re-format when pushing the PR so it will take a little time to unbreak that. It may be easiest to force push a repaired PR first and then

[clang] [clang] Update diagnostics for type aware allocators (PR #148576)

2025-07-14 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > Please update `clang/docs/LanguageExtensions.rst`. Good point, also as it got dropped from C++26 I'm restoring and updating the in tree docs as well. https://github.com/llvm/llvm-project/pull/148576 ___ cfe-commits mailing list cfe-co

[clang] [clang] Fix a crash when dynamic_cast-ing to a `final` class (PR #148088)

2025-07-15 Thread Oliver Hunt via cfe-commits
@@ -2341,8 +2341,15 @@ llvm::Value *CodeGenFunction::EmitDynamicCast(Address ThisAddr, } else if (IsExact) { // If the destination type is effectively final, this pointer points to the // right type if and only if its vptr has the right value. -Value = CGM.getCXX

[clang] [clang] Update diagnostics and documentation for type aware allocators (PR #148576)

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

<    1   2   3   4   5   6