[clang] [PAC] Re-sign a pointer to a noexcept member function when it is converted to a pointer to a member function without noexcept (PR #109056)

2024-09-18 Thread Oliver Hunt via cfe-commits
ojhunt wrote: LGTM https://github.com/llvm/llvm-project/pull/109056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add wraps attribute (for granular integer overflow handling) (PR #86618)

2024-08-21 Thread Oliver Hunt via cfe-commits
ojhunt wrote: I’m a little concerned about not allowing the attribute in C++ - the existence of other options in C++ does not mean they are an option (due to various and sundry restrictions of C++ version upgrades different projects have), but also you trivially end up in cases where header co

[clang] [llvm] [PAC] Fix address discrimination for type info vtable pointers (PR #102199)

2024-08-06 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Ok, it took me a moment to understand what was happening here - I had to talk to Ahmed because I didn't recognize the AddrDiscriminator_* enums and had assumed I'd forgotten them :D This needs to update `ItaniumRTTIBuilder::BuildVTablePointer` to take the storage address, and t

[clang] [llvm] [PAC] Fix address discrimination for type info vtable pointers (PR #102199)

2024-08-06 Thread Oliver Hunt via cfe-commits
@@ -3955,9 +3955,23 @@ void ItaniumRTTIBuilder::BuildVTablePointer(const Type *Ty) { VTable, Two); } - if (auto &Schema = CGM.getCodeGenOpts().PointerAuth.CXXTypeInfoVTablePointer) -VTable = CGM.getConstantSigne

[clang] [clang] Update argument checking tablegen code to use a 'full' name (PR #99993)

2024-07-30 Thread Oliver Hunt via cfe-commits
ojhunt wrote: @AaronBallman ah with more context, I see we didn't actually land "// Do something if not an identifier" (implying partial commit history at some point". I'm looking at exactly what happens, or if we're missing some test cases -- it's possible that when written there was the inte

[clang] [clang] Update argument checking tablegen code to use a 'full' name (PR #99993)

2024-07-30 Thread Oliver Hunt via cfe-commits
ojhunt wrote: @AaronBallman hmmm, looks like we may have lost some diff at some point, I'll investigate to work out what is going on https://github.com/llvm/llvm-project/pull/3 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [PAC][clang][test] Implement missing tests for some PAuth features (PR #100206)

2024-07-23 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Looks good to me (spent a bit of time verifying correct auth logic, but for the actual elf specific codegen I can't comment) https://github.com/llvm/llvm-project/pull/100206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [clang][test] Add function type discrimination tests to static destructor tests (PR #99604)

2024-07-22 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/99604 >From 640779f0327c3b3773ff055923c59a82ae6c7f30 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 18 Jul 2024 21:08:12 -0700 Subject: [PATCH 1/2] [clang][test] Add function type discrimination tests to ptrauth

[clang] [PAC] Implement authentication for C++ member function pointers (PR #99576)

2024-07-22 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/99576 >From 547ce3e9c7fe7e046b20f51f2f0d370a683659d1 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Fri, 10 May 2024 15:58:57 -0700 Subject: [PATCH 1/2] [PAC] Implement pointer authentication for C++ member functi

[clang] [PAC] Implement authentication for C++ member function pointers (PR #99576)

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

[clang] [PAC] Implement authentication for C++ member function pointers (PR #99576)

2024-07-22 Thread Oliver Hunt via cfe-commits
@@ -1036,9 +1155,32 @@ llvm::Constant *ItaniumCXXABI::BuildMemberPointer(const CXXMethodDecl *MD, // least significant bit of adj then makes exactly the same // discrimination as the least significant bit of ptr does for // Itanium. - MemPtr[0] = l

[clang] [PAC] Implement authentication for C++ member function pointers (PR #99576)

2024-07-22 Thread Oliver Hunt via cfe-commits
@@ -71,6 +71,15 @@ void has_ptrauth_vtable_pointer_type_discrimination() {} void no_ptrauth_vtable_pointer_type_discrimination() {} #endif +// This is always enabled when ptrauth_calls is enabled, on new enough clangs. ojhunt wrote: Weird mismerge I guess? -

[clang] [PAC] Incorrect codegen for constant global init with polymorphic MI (PR #99741)

2024-07-21 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/99741 >From 5822eb8f5b0d420a89d539f8fd2e23c69983967a Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Fri, 19 Jul 2024 22:48:26 -0700 Subject: [PATCH 1/2] [PAC] Incorrect codegen for constant global init with polymorph

[clang] [PAC] Incorrect codegen for constant global init with polymorphic MI (PR #99741)

2024-07-19 Thread Oliver Hunt via cfe-commits
ojhunt wrote: @ahmedbougacha @asl @kovdan01 pinging for review https://github.com/llvm/llvm-project/pull/99741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Incorrect codegen for constant global init with polymorphic MI (PR #99741)

2024-07-19 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/99741 Fixes an error where we use the wrong authentication schema for secondary vtable pointers in constant initialized globals of types with multiple polymorphic base classes. >From 5822eb8f5b0d420a89d539f8fd2e23c699

[clang] [PAC] Implement authentication for C++ member function pointers (PR #99576)

2024-07-19 Thread Oliver Hunt via cfe-commits
ojhunt wrote: @asl could you check this as well? (I apparently can't add/request reviewers?) https://github.com/llvm/llvm-project/pull/99576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [PAC] Implement authentication for C++ member function pointers (PR #99576)

2024-07-19 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt ready_for_review https://github.com/llvm/llvm-project/pull/99576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Implement authentication for C++ member function pointers (PR #99576)

2024-07-19 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/99576 >From 547ce3e9c7fe7e046b20f51f2f0d370a683659d1 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Fri, 10 May 2024 15:58:57 -0700 Subject: [PATCH] [PAC] Implement pointer authentication for C++ member function p

[clang] [clang][test] Add function type discrimination tests to static destructor tests (PR #99604)

2024-07-18 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt ready_for_review https://github.com/llvm/llvm-project/pull/99604 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][test] Add function type discrimination tests to static destructor tests (PR #99604)

2024-07-18 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/99604 I accidentally did not include tests for the setting up runtime calls when compiling with -fptrauth-function-pointer-type-discrimination >From 640779f0327c3b3773ff055923c59a82ae6c7f30 Mon Sep 17 00:00:00 2001 Fro

[clang] [PAC] Implement authentication for C++ member function pointers (PR #99576)

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

[clang] [clang] Implement authentication for C++ member function pointers (PR #99576)

2024-07-18 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/99576 >From 547ce3e9c7fe7e046b20f51f2f0d370a683659d1 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Fri, 10 May 2024 15:58:57 -0700 Subject: [PATCH] [PAC] Implement pointer authentication for C++ member function p

[clang] [clang] Implement authentication for C++ member function pointers (PR #99576)

2024-07-18 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/99576 >From c2bc964341fb4d0738e94d4afa6abc84eed0113c Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Fri, 10 May 2024 15:58:57 -0700 Subject: [PATCH] [clang] Implement pointer authentication for C++ member function

[clang] [clang] Implement authentication for C++ member function pointers (PR #99576)

2024-07-18 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/99576 Introduces type based signing of member function pointers. To support this discrimination schema we no longer emit member function pointer to virtual methods and indices into a vtable but migrate to using thunks.

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-16 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/98276 >From 4b92c4af87a1a381dad09b243db4d3ec71d64738 Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 18 Sep 2019 02:21:37 -0400 Subject: [PATCH 1/5] Sign function pointers passed to atexit and __cxa_atexit. Patch

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-16 Thread Oliver Hunt via cfe-commits
ojhunt wrote: I notice the r+, but I haven't fully addressed this feedback - are you suggesting corrections in a follow up patch, or just conceptually approving with this PR? :D https://github.com/llvm/llvm-project/pull/98276 ___ cfe-commits mailing

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-14 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/98276 >From 4b92c4af87a1a381dad09b243db4d3ec71d64738 Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 18 Sep 2019 02:21:37 -0400 Subject: [PATCH 1/4] Sign function pointers passed to atexit and __cxa_atexit. Patch

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-14 Thread Oliver Hunt via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s + +class Foo { + public: + ~Foo() { + } +}; + +// CHECK-LABEL: define void @_Z1fv() +// CHECK: call void @__cxa_throw(ptr %{{.*}}, ptr @_ZTI3Foo, ptr

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-14 Thread Oliver Hunt via cfe-commits
@@ -333,7 +338,8 @@ void CodeGenFunction::registerGlobalDtorWithLLVM(const VarDecl &VD, llvm::FunctionCallee Dtor, llvm::Constant *Addr) { // Create a function which calls the d

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-10 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt ready_for_review https://github.com/llvm/llvm-project/pull/98276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

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

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-09 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/98276 >From 4b92c4af87a1a381dad09b243db4d3ec71d64738 Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 18 Sep 2019 02:21:37 -0400 Subject: [PATCH 1/3] Sign function pointers passed to atexit and __cxa_atexit. Patch

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-09 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/98276 Updates codegen for global destructors and raising exceptions to ensure that the function pointers being passed are signed using the correct schema. Notably this requires that CodeGenFunction::createAtExitStub to