[clang] [PAC] Ignore noexcept on function type when computing discriminator of member function pointers (PR #109056)

2025-01-16 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/109056 >From eede4b2c2916a3016643fb56f87f7601dfaff69b Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Mon, 16 Sep 2024 17:12:13 -0700 Subject: [PATCH 1/5] [PAC] Re-sign a pointer to a noexcept member function whe

[clang] [PAC] Ignore noexcept on function type when computing discriminator of member function pointers (PR #109056)

2025-01-16 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/109056 >From eede4b2c2916a3016643fb56f87f7601dfaff69b Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Mon, 16 Sep 2024 17:12:13 -0700 Subject: [PATCH 1/4] [PAC] Re-sign a pointer to a noexcept member function whe

[clang] [PAC] Ignore noexcept on function type when computing discriminator of member function pointers (PR #109056)

2025-01-16 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/109056 >From eede4b2c2916a3016643fb56f87f7601dfaff69b Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Mon, 16 Sep 2024 17:12:13 -0700 Subject: [PATCH 1/3] [PAC] Re-sign a pointer to a noexcept member function whe

[clang] [PAC] Ignore noexcept on function type when computing discriminator of member function pointers (PR #109056)

2025-01-15 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak edited 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] [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)

2025-01-15 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/109056 >From eede4b2c2916a3016643fb56f87f7601dfaff69b Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Mon, 16 Sep 2024 17:12:13 -0700 Subject: [PATCH 1/2] [PAC] Re-sign a pointer to a noexcept member function whe

[clang] [clang-tools-extra] [NFC] Add implicit cast kinds for function pointer conversions (PR #110048)

2025-01-13 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/110048 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[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)

2025-01-13 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed 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] [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)

2025-01-13 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak reopened 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] [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)

2025-01-13 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: I meant to close https://github.com/llvm/llvm-project/pull/110048. 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-tools-extra] [NFC] Add implicit cast kinds for function pointer conversions (PR #110048)

2025-01-13 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: This change isn't needed anymore as it was decided that noexcept shouldn't be used to compute discriminators of function and member function pointers (see https://github.com/llvm/llvm-project/issues/106487#issuecomment-2440364300). https://github.com/llvm/llvm-project/pull/1100

[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)

2025-01-13 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: This change isn't needed anymore as it was decided that `noexcept` shouldn't be used to compute discriminators of function and member function pointers (see https://github.com/llvm/llvm-project/issues/106487#issuecomment-2440364300). https://github.com/llvm/llvm-project/pull/10

[clang] [APINotes] Add SWIFT_RETURNS_(UN)RETAINED support (PR #118938)

2024-12-09 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/118938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Define a diagnostic group for missing variadic macro arguments (PR #116855)

2024-12-03 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/116855 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Define a diagnostic group for missing variadic macro arguments (PR #116855)

2024-12-02 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: ping Removing `-Wgnu-zero-variadic-macro-argumentsis` broke multiple projects that had been building fine for years. https://github.com/llvm/llvm-project/pull/116855 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [ObjC] Enable diagnose_if on Objective-C methods (PR #115056)

2024-11-21 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: > There is almost certainly value in introducing a base class beneath > ObjCMethodDecl and FunctionDecl that is both a NamedDecl and a DeclContext, > because I'm not the first person to run into this problem. If I do the work, > whose review/approval do we need? Is it deep enou

[clang] [ObjC] Enable diagnose_if on Objective-C methods (PR #115056)

2024-11-20 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: > I wish I didn't need to change the ExprConstant call stack machinery like > this, happy to take suggestions. This is all because the closest ancestors of > FunctionDecl and ObjCMethodDecl are NamedDecl and DeclGroup. Should we enable `diagnose_if` for block methods too? ```

[clang] Define a diagnostic group for missing variadic macro arguments (PR #116855)

2024-11-19 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/116855 Make the new diagnostic group a subgroup of the following diagnostic groups: -Wpre-c23-compat -Wgnu-zero-variadic-macro-arguments -Wc++20-extensions -Wc23-extensions This change is needed as 5231005193afb8db01

[clang] [ObjC] Name lookup in methods shouldn't allow shadowing types (PR #116683)

2024-11-19 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/116683 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ObjC] Name lookup in methods shouldn't allow shadowing types (PR #116683)

2024-11-19 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak approved this pull request. https://github.com/llvm/llvm-project/pull/116683 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ObjC] Insert method parameters in scope as they are parsed (PR #113745)

2024-10-30 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/113745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Call base class method in DarwinAArch64TargetInfo::getOSDefines (PR #114241)

2024-10-30 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/114241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ObjC] Insert method parameters in scope as they are parsed (PR #113745)

2024-10-30 Thread Akira Hatanaka via cfe-commits
@@ -4768,60 +4822,9 @@ Decl *SemaObjC::ActOnMethodDeclaration( HasRelatedResultType); SmallVector Params; - - for (unsigned i = 0, e = Sel.getNumArgs(); i != e; ++i) { -QualType ArgType; -TypeSourceInfo *DI; - -if (!ArgInfo[i].Type) { - ArgType = Cont

[clang] [NFC] Call base class method in DarwinAArch64TargetInfo::getOSDefines (PR #114241)

2024-10-30 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: This is needed for a private patch we'll be upstreaming in the future. Even without that, I think it's an improvement over what we are doing now. https://github.com/llvm/llvm-project/pull/114241 ___ cfe-commits mailing list cfe-commits

[clang] [NFC} Call base class method in DarwinAArch64TargetInfo::getOSDefines (PR #114241)

2024-10-30 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/114241 None >From 606344e958371d8978b2b64d870db5bfc0bd7b28 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 30 Oct 2024 07:36:31 -0700 Subject: [PATCH] [NFC} Call base class method in DarwinAArch64TargetInfo

[clang] [NFC} Call base class method in DarwinAArch64TargetInfo::getOSDefines (PR #114241)

2024-10-30 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/114241 >From 98fe1611486549221a1475188d6d19a2d2cc9d12 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 30 Oct 2024 07:36:31 -0700 Subject: [PATCH] [NFC] Call base class method in DarwinAArch64TargetInfo::getO

[clang] [NFC] Call base class method in DarwinAArch64TargetInfo::getOSDefines (PR #114241)

2024-10-30 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak edited https://github.com/llvm/llvm-project/pull/114241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [NFC] Add implicit cast kinds for function pointer conversions (PR #110048)

2024-09-25 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak ready_for_review https://github.com/llvm/llvm-project/pull/110048 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [NFC] Add implicit cast kinds for function pointer conversions (PR #110048)

2024-09-25 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/110048 >From b9a8339220635b9a0b2d77a11d80b496a18a917a Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 25 Sep 2024 14:47:05 -0700 Subject: [PATCH] [NFC] Add implicit cast kinds for function pointer conversion

[clang] [clang-tools-extra] [NFC] Add implicit cast kinds for function pointer conversions (PR #110048)

2024-09-25 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/110048 The new cast kinds are needed to distinguish between no-op conversions and conversions from pointers to noexcept functions to pointers to functions without noexcept as the latter can cause function pointers to

[clang] [clang-tools-extra] [llvm] [NFC] Add implicit cast kinds for function pointer conversions (PR #110047)

2024-09-25 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/110047 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [NFC] Add implicit cast kinds for function pointer conversions (PR #110047)

2024-09-25 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/110047 The new cast kinds are needed to distinguish between no-op conversions and conversions from pointers to noexcept functions to pointers to functions without noexcept as the latter can cause function pointers to

[clang] Fix compatibility version in test (PR #97128)

2024-09-24 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak approved this pull request. https://github.com/llvm/llvm-project/pull/97128 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[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-19 Thread Akira Hatanaka via cfe-commits
@@ -2419,8 +2419,13 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { return Visit(const_cast(E)); case CK_NoOp: { -return CE->changesVolatileQualification() ? EmitLoadOfLValue(CE) - : Visit(const_cast(E)); +i

[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 Akira Hatanaka via cfe-commits
@@ -2419,8 +2419,13 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { return Visit(const_cast(E)); case CK_NoOp: { -return CE->changesVolatileQualification() ? EmitLoadOfLValue(CE) - : Visit(const_cast(E)); +i

[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 Akira Hatanaka via cfe-commits
@@ -2419,8 +2419,13 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { return Visit(const_cast(E)); case CK_NoOp: { -return CE->changesVolatileQualification() ? EmitLoadOfLValue(CE) - : Visit(const_cast(E)); +i

[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-17 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/109056 Fixes https://github.com/llvm/llvm-project/issues/106487. >From eede4b2c2916a3016643fb56f87f7601dfaff69b Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Mon, 16 Sep 2024 17:12:13 -0700 Subject: [PATCH] [PA

[clang] [Clang][Sema] Fix crash when type used in return statement contains errors (PR #79788)

2024-08-20 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: I think this change can confuse users in some cases. ``` class Error { public: Error() = default; Error(Error &&); Error &operator=(Error &&); explicit operator bool() const; }; Error getError(); Error foo() { if (Error e = getError(1)) { return e; } return Er

[clang] [PAC] Add support for __ptrauth type qualifier (PR #100830)

2024-08-14 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: RFC for `__ptrauth`: https://discourse.llvm.org/t/rfc-ptrauth-qualifier/80710 https://github.com/llvm/llvm-project/pull/100830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [PAC] Add support for __ptrauth type qualifier (PR #100830)

2024-08-09 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: I'll try to come up with an RFC for the qualifier today. https://github.com/llvm/llvm-project/pull/100830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Add support for __ptrauth type qualifier (PR #100830)

2024-08-09 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: @rjmccall sent an RFC for upstreaming pointer authentication work to llvm-dev in 2019, which mentions the `__ptrauth` qualifier. https://discourse.llvm.org/t/rfc-pointer-authentication-for-arm64e/53433 I don't think we sent an RFC for adding support for the `__ptrauth` qualifie

[clang] Run test with triple arm64-apple-ios (PR #102343)

2024-08-07 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/102343 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Add support for __ptrauth type qualifier (PR #100830)

2024-08-07 Thread Akira Hatanaka via cfe-commits
@@ -104,6 +104,7 @@ FEATURE(thread_sanitizer, LangOpts.Sanitize.has(SanitizerKind::Thread)) FEATURE(dataflow_sanitizer, LangOpts.Sanitize.has(SanitizerKind::DataFlow)) FEATURE(scudo, LangOpts.Sanitize.hasOneOf(SanitizerKind::Scudo)) FEATURE(ptrauth_intrinsics, LangOpts.Pointer

[clang] Run test with triple arm64-apple-ios (PR #102343)

2024-08-07 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/102343 None >From 2cc9159dd6592579d8cf91d37cd6f1826d402f53 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 7 Aug 2024 09:05:11 -0700 Subject: [PATCH] Run test with triple arm64-apple-ios --- clang/test/Cod

[clang] [PAC] Add support for __ptrauth type qualifier (PR #100830)

2024-08-06 Thread Akira Hatanaka via cfe-commits
@@ -104,6 +104,7 @@ FEATURE(thread_sanitizer, LangOpts.Sanitize.has(SanitizerKind::Thread)) FEATURE(dataflow_sanitizer, LangOpts.Sanitize.has(SanitizerKind::DataFlow)) FEATURE(scudo, LangOpts.Sanitize.hasOneOf(SanitizerKind::Scudo)) FEATURE(ptrauth_intrinsics, LangOpts.Pointer

[clang] [PAC] Add support for __ptrauth type qualifier (PR #100830)

2024-08-01 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak ready_for_review https://github.com/llvm/llvm-project/pull/100830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] [LTO] enable `ObjCARCContractPass` only on optimized build (PR #101114)

2024-07-30 Thread Akira Hatanaka via cfe-commits
@@ -588,12 +588,6 @@ bool EmitAssemblyHelper::AddEmitPasses(legacy::PassManager &CodeGenPasses, // this also adds codegenerator level optimization passes. CodeGenFileType CGFT = getCodeGenFileType(Action); - // Add ObjC ARC final-cleanup optimizations. This is done as pa

[clang] [PAC] Define __builtin_ptrauth_type_discriminator (PR #100204)

2024-07-23 Thread Akira Hatanaka via cfe-commits
@@ -1,5 +1,6 @@ // RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple %itanium_abi_triple -verify %s -DN=1 // RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple %itanium_abi_triple -verify %s -DN=2 +// RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple %i

[clang] [PAC] Define __builtin_ptrauth_type_discriminator (PR #100204)

2024-07-23 Thread Akira Hatanaka via cfe-commits
@@ -1,5 +1,6 @@ // RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple %itanium_abi_triple -verify %s -DN=1 // RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple %itanium_abi_triple -verify %s -DN=2 +// RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple %i

[clang] [PAC] Define __builtin_ptrauth_type_discriminator (PR #100204)

2024-07-23 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/100204 >From 4cbbf9ee2c5afaa3818c10ab6f2645353da94a8c Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Tue, 23 Jul 2024 11:55:57 -0700 Subject: [PATCH 1/2] [PAC] Define __builtin_ptrauth_type_discriminator The bui

[clang] [PAC] Define __builtin_ptrauth_type_discriminator (PR #100204)

2024-07-23 Thread Akira Hatanaka via cfe-commits
@@ -0,0 +1,64 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++17 -Wno-vla -fsyntax-only -verify -fptrauth-intrinsics %s +// RUN: %clang_cc1 -triple aarch64-linux-gnu -std=c++17 -Wno-vla -fsyntax-only -verify -fptrauth-intrinsics %s + +// RUN: not %clang_cc1 -triple arm64-

[clang] [PAC] Define __builtin_ptrauth_type_discriminator (PR #100204)

2024-07-23 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/100204 The builtin computes the discriminator for a type, which can be used to sign/authenticate function pointers and member function pointers. If the type passed to the builtin is a C++ member function pointer type

[clang] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-07-22 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: Do we have to fix this just to appease gcc 9.2? It looks like newer versions of gcc (after 9.3) don't emit the warning. https://github.com/llvm/llvm-project/pull/93906 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [ASTContext] Add a break to nested switch in `encodeTypeForFunctionPointerAuth` (PR #99763)

2024-07-22 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: Should we use unreachable If it's not possible to suppress the warning from gcc? https://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations https://github.com/llvm/llvm-project/pull/99763 __

[clang] [PAC] Fix a crash when signing a pointer to a function with an incomplete enum parameter (PR #99595)

2024-07-19 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/99595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Authenticate function pointers in UBSan type checks (PR #99590)

2024-07-19 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/99590 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Fix a crash when signing a pointer to a function with an incomplete enum parameter (PR #99595)

2024-07-18 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/99595 Use type int as the underlying type when the enum type is incomplete. >From 14612f84704edbcc3b3bcb20d6e114890e1c3998 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Thu, 18 Jul 2024 17:59:46 -0700 Subject:

[clang] [PAC] Authenticate function pointers in UBSan type checks (PR #99590)

2024-07-18 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/99590 The function pointer needs to be authenticated before doing the type checks. >From c44fbc480f8632a178633637010ab6953ed3e50d Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Thu, 18 Jul 2024 16:54:09 -0700 Su

[clang] [PAC] Implement function pointer re-signing (PR #98847)

2024-07-18 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/98847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Don't drop weak_import from a declaration that follows a declaration directly contained in a linkage-specification (PR #85886)

2024-07-17 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/85886 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Don't drop weak_import from a declaration that follows a declaration directly contained in a linkage-specification (PR #85886)

2024-07-17 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/85886 >From d39667c7e65c10babb478d8f8d54fecb66d90568 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Tue, 19 Mar 2024 15:50:00 -0700 Subject: [PATCH 1/5] [Sema] Don't drop weak_import from a declaration that foll

[clang] [PAC] Implement function pointer re-signing (PR #98847)

2024-07-16 Thread Akira Hatanaka via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 %s -triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics -emit-llvm -o- -fptrauth-function-pointer-type-discrimination | FileCheck %s ahatanak wrote: Thanks! Please add a line to test linux after this PR is merged

[clang] [PAC] Implement function pointer re-signing (PR #98847)

2024-07-16 Thread Akira Hatanaka via cfe-commits
@@ -351,3 +434,125 @@ CodeGenModule::getVTablePointerAuthInfo(CodeGenFunction *CGF, /* IsIsaPointer */ false, /* AuthenticatesNullValues */ false, Discriminator); } + +llvm::Value *CodeGenFunction::AuthPointerToPointerCast(

[clang] [PAC] Implement function pointer re-signing (PR #98847)

2024-07-16 Thread Akira Hatanaka via cfe-commits
@@ -0,0 +1,77 @@ +// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck -check-prefix=CHECK -check-prefix=NOPCH %s ahatanak wrote: Sorry, I just realized th

[clang] [PAC] Implement function pointer re-signing (PR #98847)

2024-07-16 Thread Akira Hatanaka via cfe-commits
@@ -165,6 +166,88 @@ CGPointerAuthInfo CodeGenModule::getPointerAuthInfoForType(QualType T) { return ::getPointerAuthInfoForType(*this, T); } +static bool isZeroConstant(llvm::Value *value) { + if (auto ci = dyn_cast(value)) +return ci->isZero(); + return false; +} +

[clang] [PAC] Implement function pointer re-signing (PR #98847)

2024-07-16 Thread Akira Hatanaka via cfe-commits
@@ -165,6 +166,88 @@ CGPointerAuthInfo CodeGenModule::getPointerAuthInfoForType(QualType T) { return ::getPointerAuthInfoForType(*this, T); } +static bool isZeroConstant(llvm::Value *value) { + if (auto ci = dyn_cast(value)) +return ci->isZero(); + return false; +} +

[clang] [PAC] Implement function pointer re-signing (PR #98847)

2024-07-16 Thread Akira Hatanaka via cfe-commits
@@ -165,6 +166,88 @@ CGPointerAuthInfo CodeGenModule::getPointerAuthInfoForType(QualType T) { return ::getPointerAuthInfoForType(*this, T); } +static bool isZeroConstant(llvm::Value *value) { ahatanak wrote: I fixed the names of variables and functions add

[clang] [PAC] Implement function pointer re-signing (PR #98847)

2024-07-16 Thread Akira Hatanaka via cfe-commits
@@ -3126,3 +3137,57 @@ CodeGenFunction::EmitPointerAuthAuth(const CGPointerAuthInfo &PointerAuth, return EmitPointerAuthCommon(*this, PointerAuth, Pointer, llvm::Intrinsic::ptrauth_auth); } + +llvm::Value *CodeGenFunction::EmitPointerAuthSign(Q

[clang] [PAC] Implement function pointer re-signing (PR #98847)

2024-07-16 Thread Akira Hatanaka via cfe-commits
@@ -2373,7 +2373,9 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { DestLV.setTBAAInfo(TBAAAccessInfo::getMayAliasInfo()); return EmitLoadOfLValue(DestLV, CE->getExprLoc()); } -return Builder.CreateBitCast(Src, DstTy); + +llvm::Value *Result =

[clang] [PAC] Implement function pointer re-signing (PR #98847)

2024-07-14 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak ready_for_review https://github.com/llvm/llvm-project/pull/98847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Implement function pointer re-signing (PR #98847)

2024-07-14 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak edited https://github.com/llvm/llvm-project/pull/98847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Resign function pointer (PR #98847)

2024-07-14 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak edited https://github.com/llvm/llvm-project/pull/98847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Implement function pointer type discrimination (PR #96992)

2024-07-11 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/96992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Implement function pointer type discrimination (PR #96992)

2024-07-11 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak edited https://github.com/llvm/llvm-project/pull/96992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [arm64e] Implement function pointer type discrimination (PR #96992)

2024-07-11 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak edited https://github.com/llvm/llvm-project/pull/96992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-07-11 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak edited https://github.com/llvm/llvm-project/pull/96992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-07-09 Thread Akira Hatanaka via cfe-commits
@@ -3140,6 +3140,269 @@ ASTContext::getPointerAuthVTablePointerDiscriminator(const CXXRecordDecl *RD) { return llvm::getPointerAuthStableSipHash(Str); } +/// Encode a function type for use in the discriminator of a function pointer +/// type. We can't use the itanium scheme

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-07-09 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/96992 >From cf22a4be007f7e6fdc6e4c17c1f32fa70440b123 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 26 Jun 2024 13:02:31 -0700 Subject: [PATCH 1/5] [clang] Implement function pointer type discrimination Giv

[clang] [CodeGen] Add a flag to disable emitting block signature strings (PR #96944)

2024-07-09 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/96944 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen] Add a flag to disable emitting block signature strings (PR #96944)

2024-07-08 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/96944 >From d21bdaec94a169b27e7f7bace399e77bf99fd572 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Tue, 25 Jun 2024 19:37:46 -0700 Subject: [PATCH 1/2] [CodeGen] Add a flag to disable emitting block signature s

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-07-08 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/96992 >From cf22a4be007f7e6fdc6e4c17c1f32fa70440b123 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 26 Jun 2024 13:02:31 -0700 Subject: [PATCH 1/4] [clang] Implement function pointer type discrimination Giv

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-07-08 Thread Akira Hatanaka via cfe-commits
@@ -5,55 +5,65 @@ // RUN: -fptrauth-vtable-pointer-address-discrimination \ // RUN: -fptrauth-vtable-pointer-type-discrimination \ // RUN: -fptrauth-init-fini | \ -// RUN: FileCheck %s --check-prefixes=INTRIN,CALLS,RETS,VPTR_ADDR_DISCR,VPTR_TYPE_DISCR,INITFINI +// RUN:

[clang] [CodeGen] Add a flag to disable emitting block signature strings (PR #96944)

2024-07-03 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/96944 >From d21bdaec94a169b27e7f7bace399e77bf99fd572 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Tue, 25 Jun 2024 19:37:46 -0700 Subject: [PATCH 1/2] [CodeGen] Add a flag to disable emitting block signature s

[clang] [CodeGen] Add a flag to disable emitting block signature strings (PR #96944)

2024-07-03 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: Sorry, I didn't remember that I had to set `BLOCK_HAS_SIGNATURE` to 0. https://github.com/llvm/llvm-project/pull/96944 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-07-02 Thread Akira Hatanaka via cfe-commits
@@ -2220,6 +2220,11 @@ llvm::Constant *ConstantLValueEmitter::emitPointerAuthPointer(const Expr *E) { // The assertions here are all checked by Sema. assert(Result.Val.isLValue()); + auto *Base = Result.Val.getLValueBase().get(); + if (auto *Decl = dyn_cast_or_null(Base

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-07-02 Thread Akira Hatanaka via cfe-commits
@@ -3140,6 +3140,269 @@ ASTContext::getPointerAuthVTablePointerDiscriminator(const CXXRecordDecl *RD) { return llvm::getPointerAuthStableSipHash(Str); } +/// Encode a function type for use in the discriminator of a function pointer +/// type. We can't use the itanium scheme

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-07-02 Thread Akira Hatanaka via cfe-commits
@@ -2220,6 +2220,11 @@ llvm::Constant *ConstantLValueEmitter::emitPointerAuthPointer(const Expr *E) { // The assertions here are all checked by Sema. assert(Result.Val.isLValue()); + auto *Base = Result.Val.getLValueBase().get(); + if (auto *Decl = dyn_cast_or_null(Base

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-06-28 Thread Akira Hatanaka via cfe-commits
@@ -2220,6 +2220,11 @@ llvm::Constant *ConstantLValueEmitter::emitPointerAuthPointer(const Expr *E) { // The assertions here are all checked by Sema. assert(Result.Val.isLValue()); + auto *Base = Result.Val.getLValueBase().get(); + if (auto *Decl = dyn_cast_or_null(Base

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-06-28 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/96992 >From cf22a4be007f7e6fdc6e4c17c1f32fa70440b123 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 26 Jun 2024 13:02:31 -0700 Subject: [PATCH 1/3] [clang] Implement function pointer type discrimination Giv

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-06-28 Thread Akira Hatanaka via cfe-commits
@@ -470,6 +470,9 @@ ENUM_LANGOPT(StrictFlexArraysLevel, StrictFlexArraysLevelKind, 2, COMPATIBLE_VALUE_LANGOPT(MaxTokens, 32, 0, "Max number of tokens per TU or 0") +BENIGN_LANGOPT(FunctionPointerTypeDiscrimination, 1, 0, ahatanak wrote: I moved the langopt

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-06-28 Thread Akira Hatanaka via cfe-commits
@@ -3140,6 +3140,269 @@ ASTContext::getPointerAuthVTablePointerDiscriminator(const CXXRecordDecl *RD) { return llvm::getPointerAuthStableSipHash(Str); } +/// Encode a function type for use in the discriminator of a function pointer +/// type. We can't use the itanium scheme

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-06-28 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak ready_for_review https://github.com/llvm/llvm-project/pull/96992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-06-28 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/96992 >From cf22a4be007f7e6fdc6e4c17c1f32fa70440b123 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 26 Jun 2024 13:02:31 -0700 Subject: [PATCH 1/2] [clang] Implement function pointer type discrimination Giv

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-06-27 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/96992 Give users an option to sign a function pointer using a non-zero discrimiantor based on the type of the destination. >From cf22a4be007f7e6fdc6e4c17c1f32fa70440b123 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka

[clang] [CodeGen] Add a flag to disable emitting block signature strings (PR #96944)

2024-06-27 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak ready_for_review https://github.com/llvm/llvm-project/pull/96944 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen] Add a flag to disable emitting block signature strings (PR #96944)

2024-06-27 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/96944 >From d21bdaec94a169b27e7f7bace399e77bf99fd572 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Tue, 25 Jun 2024 19:37:46 -0700 Subject: [PATCH] [CodeGen] Add a flag to disable emitting block signature strin

[clang] [CodeGen] Add a flag to disable emitting block signature strings (PR #96944)

2024-06-27 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/96944 Users who don't need the signature string to be emitted can use the flag to reduce code size. rdar://121933818 >From 5f71f113b27482114904eae8234c6ebc17eef5a4 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-06-25 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/79230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-06-25 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak edited https://github.com/llvm/llvm-project/pull/79230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-06-24 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/79230 >From 95200f3bb3859738981240a9d8c503a13ede9601 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Tue, 16 Jan 2024 13:18:09 -0800 Subject: [PATCH 01/19] Add support for builtin_verbose_trap The builtin causes

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-06-24 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/79230 >From 95200f3bb3859738981240a9d8c503a13ede9601 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Tue, 16 Jan 2024 13:18:09 -0800 Subject: [PATCH 01/18] Add support for builtin_verbose_trap The builtin causes

  1   2   3   4   5   6   7   8   9   10   >