[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-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] [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] [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] Add support for builtin_verbose_trap (PR #79230)

2024-04-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/13] Add support for builtin_verbose_trap The builtin causes

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

2024-04-24 Thread Akira Hatanaka via cfe-commits
@@ -3424,6 +3445,26 @@ llvm::DIMacroFile *CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent, return DBuilder.createTempMacroFile(Parent, Line, FName); } +llvm::DILocation *CGDebugInfo::CreateTrapFailureMessageFor( ahatanaka wrote: I've updated the

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

2024-04-25 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/14] Add support for builtin_verbose_trap The builtin causes

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

2024-04-25 Thread Akira Hatanaka via cfe-commits
@@ -3424,6 +3445,26 @@ llvm::DIMacroFile *CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent, return DBuilder.createTempMacroFile(Parent, Line, FName); } +llvm::DILocation *CGDebugInfo::CreateTrapFailureMessageFor( ahatanak wrote: @dwblaikie any ot

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

2024-04-26 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: I'll merge this in a day or two if there are no objections. 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] [Clang] Add diagnostic about "%P" specifier with Objective-C pointers (#89968) (PR #89977)

2024-04-26 Thread Akira Hatanaka via cfe-commits
@@ -44,15 +44,18 @@ void test_os_log_format(const char *pc, int i, void *p, void *buf) { } // Test os_log_format primitive with ObjC string literal format argument. -void test_objc(const char *pc, int i, void *p, void *buf, NSString *nss) { +void test_objc(const char *pc, int

[clang] [Clang] Add diagnostic about "%P" specifier with Objective-C pointers (#89968) (PR #89977)

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

[clang] [Clang] Add diagnostic about "%P" specifier with Objective-C pointers (#89968) (PR #89977)

2024-04-26 Thread Akira Hatanaka via cfe-commits
@@ -44,15 +44,18 @@ void test_os_log_format(const char *pc, int i, void *p, void *buf) { } // Test os_log_format primitive with ObjC string literal format argument. -void test_objc(const char *pc, int i, void *p, void *buf, NSString *nss) { +void test_objc(const char *pc, int

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

2024-04-30 Thread Akira Hatanaka via cfe-commits
@@ -27,6 +27,9 @@ namespace llvm { } } +// Prefix for __builtin_verbose_trap. +#define CLANG_VERBOSE_TRAP_PREFIX "__llvm_verbose_trap" ahatanak wrote: If we used a C++ constant, wouldn't it be harder to make a compile time constant string (e.g., `^__llvm_v

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

2024-04-30 Thread Akira Hatanaka via cfe-commits
@@ -27,6 +27,9 @@ namespace llvm { } } +// Prefix for __builtin_verbose_trap. +#define CLANG_VERBOSE_TRAP_PREFIX "__llvm_verbose_trap" ahatanak wrote: @delcypher I don't think it has to mention `llvm`. Can we make it even shorter, e.g., `__trap_msg`? http

[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] [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] [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] [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-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] [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] [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] 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 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] [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] Add support for builtin_verbose_trap (PR #79230)

2024-04-30 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/15] Add support for builtin_verbose_trap The builtin causes

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

2024-04-30 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: We could use the function name without the prefix as the key when searching for the subprogram in `CGDebugInfo::createInlinedTrapSubprogram`. https://github.com/llvm/llvm-project/pull/79230 ___ cfe-commits mailing list cfe-commits@list

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

2024-05-08 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/2] [Sema] Don't drop weak_import from a declaration that foll

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

2024-05-08 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: > With that said, I think you need to check if a definition exists at all and > not just whether the last declaration is that definition. Note that `checkNewAttributesAfterDef`, which is called right before the check, removes attributes on `New` if there was a full definition.

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

2024-05-09 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/3] [Sema] Don't drop weak_import from a declaration that foll

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

2024-05-09 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: The updated patch checks that the decl isn't `DeclarationOnly` to make it clear that we are looking for all definitions although we know we won't find any full definitions. https://github.com/llvm/llvm-project/pull/85886 ___ cfe-commi

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

2024-05-09 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/4] [Sema] Don't drop weak_import from a declaration that foll

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

2024-05-09 Thread Akira Hatanaka via cfe-commits
@@ -27,6 +27,9 @@ namespace llvm { } } +// Prefix for __builtin_verbose_trap. +#define CLANG_VERBOSE_TRAP_PREFIX "__llvm_verbose_trap" ahatanak wrote: I can make it a C++ constant if that's preferable. https://github.com/llvm/llvm-project/pull/79230 __

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

2024-05-10 Thread Akira Hatanaka via cfe-commits
@@ -172,6 +172,27 @@ static bool checkArgCount(Sema &S, CallExpr *Call, unsigned DesiredArgCount) { << /*is non object*/ 0 << Call->getArg(1)->getSourceRange(); } +static bool checkBuiltinVerboseTrap(CallExpr *Call, Sema &S) { ahatanak wrote: clang

[clang] [clang][CodeGen] Remove unused LValue::getAddress CGF arg. (PR #92465)

2024-05-16 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak approved this pull request. https://github.com/llvm/llvm-project/pull/92465 ___ 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-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] [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] 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-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 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] d112cc2 - [NFC][Clang][OpaquePtr] Remove the call to Address::deprecated in

2022-03-02 Thread Akira Hatanaka via cfe-commits
Author: Akira Hatanaka Date: 2022-03-02T08:58:00-08:00 New Revision: d112cc27569b8329b4c9090265b809d459a4a5a8 URL: https://github.com/llvm/llvm-project/commit/d112cc27569b8329b4c9090265b809d459a4a5a8 DIFF: https://github.com/llvm/llvm-project/commit/d112cc27569b8329b4c9090265b809d459a4a5a8.diff

[clang] 3717b96 - [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in

2022-03-03 Thread Akira Hatanaka via cfe-commits
Author: Akira Hatanaka Date: 2022-03-03T08:54:46-08:00 New Revision: 3717b9661fd660933811c980a36a5e5deb8dcf40 URL: https://github.com/llvm/llvm-project/commit/3717b9661fd660933811c980a36a5e5deb8dcf40 DIFF: https://github.com/llvm/llvm-project/commit/3717b9661fd660933811c980a36a5e5deb8dcf40.diff

[clang] 9bb8c80 - [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in

2022-03-08 Thread Akira Hatanaka via cfe-commits
Author: Akira Hatanaka Date: 2022-03-08T09:45:15-08:00 New Revision: 9bb8c80beaa0da12ae29913faa45db2add152be7 URL: https://github.com/llvm/llvm-project/commit/9bb8c80beaa0da12ae29913faa45db2add152be7 DIFF: https://github.com/llvm/llvm-project/commit/9bb8c80beaa0da12ae29913faa45db2add152be7.diff

[clang] 2e1d9eb - [ObjC][ARC] Don't enter the cleanup scope if the initializer expression

2021-04-29 Thread Akira Hatanaka via cfe-commits
Author: Akira Hatanaka Date: 2021-04-29T16:04:30-07:00 New Revision: 2e1d9ebd46b826b06f0a5882e992e3d84335f268 URL: https://github.com/llvm/llvm-project/commit/2e1d9ebd46b826b06f0a5882e992e3d84335f268 DIFF: https://github.com/llvm/llvm-project/commit/2e1d9ebd46b826b06f0a5882e992e3d84335f268.diff

[clang] 809435e - [Sema] Don't set BlockDecl's DoesNotEscape bit if the parameter type of

2021-04-29 Thread Akira Hatanaka via cfe-commits
Author: Akira Hatanaka Date: 2021-04-29T16:19:48-07:00 New Revision: 809435e390e91355f64bee0142a65c4fe6e9f488 URL: https://github.com/llvm/llvm-project/commit/809435e390e91355f64bee0142a65c4fe6e9f488 DIFF: https://github.com/llvm/llvm-project/commit/809435e390e91355f64bee0142a65c4fe6e9f488.diff

[clang] e5df9cc - [CodeGen] Treat ObjC `__unsafe_unretained` and class types as trivial

2022-01-11 Thread Akira Hatanaka via cfe-commits
Author: Akira Hatanaka Date: 2022-01-11T11:18:24-08:00 New Revision: e5df9cc098b554ebb066792e40cbde6feddc57bc URL: https://github.com/llvm/llvm-project/commit/e5df9cc098b554ebb066792e40cbde6feddc57bc DIFF: https://github.com/llvm/llvm-project/commit/e5df9cc098b554ebb066792e40cbde6feddc57bc.diff

[clang] 34405b4 - [CodeGen][ObjC] Destroy callee-destroyed arguments in the caller

2020-12-28 Thread Akira Hatanaka via cfe-commits
Author: Akira Hatanaka Date: 2020-12-28T11:52:27-08:00 New Revision: 34405b41d61580ff893057784b1b19f81f66bad3 URL: https://github.com/llvm/llvm-project/commit/34405b41d61580ff893057784b1b19f81f66bad3 DIFF: https://github.com/llvm/llvm-project/commit/34405b41d61580ff893057784b1b19f81f66bad3.diff

[clang] dd95577 - Fix typo in diagnostic message

2021-01-12 Thread Akira Hatanaka via cfe-commits
Author: Akira Hatanaka Date: 2021-01-12T09:58:11-08:00 New Revision: dd955771240289fbcba5fa1312cb8c78f20cd78f URL: https://github.com/llvm/llvm-project/commit/dd955771240289fbcba5fa1312cb8c78f20cd78f DIFF: https://github.com/llvm/llvm-project/commit/dd955771240289fbcba5fa1312cb8c78f20cd78f.diff

[clang] 2caf757 - [Clang][AST] Resolve FIXME: Remove ObjCObjectPointer from

2021-10-20 Thread Akira Hatanaka via cfe-commits
Author: Alfonso Gregory Date: 2021-10-20T10:32:46-07:00 New Revision: 2caf7571e1020ae1024ab3f2d52ecc9aea85687d URL: https://github.com/llvm/llvm-project/commit/2caf7571e1020ae1024ab3f2d52ecc9aea85687d DIFF: https://github.com/llvm/llvm-project/commit/2caf7571e1020ae1024ab3f2d52ecc9aea85687d.dif

[clang] cc4bfd7 - [Sema][ObjC] Allow conversions between pointers to ObjC pointers and

2021-08-25 Thread Akira Hatanaka via cfe-commits
Author: Akira Hatanaka Date: 2021-08-25T10:22:29-07:00 New Revision: cc4bfd7f59d5a0024ada2a5c2a6f46d53290882b URL: https://github.com/llvm/llvm-project/commit/cc4bfd7f59d5a0024ada2a5c2a6f46d53290882b DIFF: https://github.com/llvm/llvm-project/commit/cc4bfd7f59d5a0024ada2a5c2a6f46d53290882b.diff

[clang] 59cc39a - [ObjC][ARC] Use the addresses of the ARC runtime functions instead of

2021-09-08 Thread Akira Hatanaka via cfe-commits
Author: Akira Hatanaka Date: 2021-09-08T11:56:22-07:00 New Revision: 59cc39ae141f92c01836064cd033c537f16dec5e URL: https://github.com/llvm/llvm-project/commit/59cc39ae141f92c01836064cd033c537f16dec5e DIFF: https://github.com/llvm/llvm-project/commit/59cc39ae141f92c01836064cd033c537f16dec5e.diff

[clang] 17c2948 - [clang-scan-deps] Add an API for clang dependency scanner to perform

2021-09-09 Thread Akira Hatanaka via cfe-commits
Author: Akira Hatanaka Date: 2021-09-09T08:52:50-07:00 New Revision: 17c2948d04431e94376e8d7883b5d89fbe705b5e URL: https://github.com/llvm/llvm-project/commit/17c2948d04431e94376e8d7883b5d89fbe705b5e DIFF: https://github.com/llvm/llvm-project/commit/17c2948d04431e94376e8d7883b5d89fbe705b5e.diff

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

[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-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-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] [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] [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 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] [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] [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-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
@@ -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
@@ -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
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
@@ -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] [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 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
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] [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
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] [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
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] [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] [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] [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] [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] [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] 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-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-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] [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] 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] 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] [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] 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] 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] [PAC] Add support for __ptrauth type qualifier (PR #100830)

2025-02-10 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: Any other feedback on this patch? For those who haven't followed the RFC, the RFC received positive reviews, and we have reached a consensus to move forward with the proposal. https://discourse.llvm.org/t/rfc-ptrauth-qualifier/80710/31 https://github.com/llvm/llvm-project/pull

[clang] [CodeGen][ObjC] Invalidate cached ObjC class layout information after parsing ObjC class implementations if new ivars are added to the interface (PR #126591)

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

[clang] [CodeGen][ObjC] Invalidate cached ObjC class layout information after parsing ObjC class implementations if new ivars are added to the interface (PR #126591)

2025-02-10 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: CC @AZero13 https://github.com/llvm/llvm-project/pull/126591 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen][ObjC] Invalidate cached ObjC class layout information after parsing ObjC class implementations if new ivars are added to the interface (PR #126591)

2025-02-10 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/126591 The layout and the size of an ObjC interface can change after its corresponding implementation is parsed when synthesized ivars or ivars declared in categories are added to the interface's list of ivars. This

[clang] [ObjC] Expand isClassLayoutKnownStatically to base classes as long as the implementation of it is known (PR #85465)

2025-02-12 Thread Akira Hatanaka via cfe-commits
@@ -1592,6 +1592,11 @@ class CGObjCNonFragileABIMac : public CGObjCCommonMac { bool isClassLayoutKnownStatically(const ObjCInterfaceDecl *ID) { // Test a class by checking its superclasses up to // its base class if it has one. + +// Cannot check a null class +

[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] [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] [PAC] Ignore noexcept on function type when computing discriminator of member function pointers (PR #109056)

2025-01-21 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] Ignore noexcept on function type when computing discriminator of member function pointers (PR #109056)

2025-01-21 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/109056 >From ca0c74faf969c6627f2522a0cd10cbf3553c3ab7 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Mon, 16 Sep 2024 17:12:13 -0700 Subject: [PATCH] [PAC] Ignore noexcept on function type when computing discrim

[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

<    5   6   7   8   9   10   11   >