[clang] [ItaniumMangle] Make sure class types are added to the dictionary of substitution candidates when compiling for older ABIs (PR #138947)

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

[clang] [ItaniumMangle] Make sure class types are added to the dictionary of substitution candidates when compiling for older ABIs (PR #138947)

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

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2025-05-19 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: > If that mode doesn't already permit using unknown pointers and references in > all language modes, then we should change it so that it does. > `__builtin_object_size` is best-effort, but we should produce a constant > value for it that's not the `-1` or `0` fallback value whe

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2025-05-19 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: > Looks like a bug to me. This warning presumably ought to be checking whether > it's valid to read / write to the given location using something like > [`isUserWritingOffTheEnd`](https://github.com/llvm/llvm-project/blob/b2e2ae8702e9fbbe0ef0eb5929aa2d5dc867b1c5/clang/lib/AST/Ex

[clang] [ItaniumMangle] Make sure class types are added to the dictionary of substitution candidates when compiling for older ABIs (PR #138947)

2025-05-19 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: Any other feedback? https://github.com/llvm/llvm-project/pull/138947 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2025-05-15 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: `evaluateVarDeclInit` is using the default argument expression (`default_val`) to evaluate the initializer of parameter `val`. ``` // Dig out the initializer, and use the declaration which it's attached to. // FIXME: We should eventually check whether the variable has a reachabl

[clang] [ItaniumMangle] Make sure class types are added to the dictionary of substitution candidates when compiling for older ABIs (PR #138947)

2025-05-12 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/138947 >From ece5ba2ee3adac03f058d5cc450ecf2ad70a5a70 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 7 May 2025 12:00:08 -0700 Subject: [PATCH 1/3] [ItaniumMangle] Make sure class types are added to the dic

[clang] [ObjC] Stop hard-coding the list of keywords that are allowed in selectors (PR #138952)

2025-05-08 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/138952 Rate limit ยท GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-

[clang] [ItaniumMangle] Make sure class types are added to the dictionary of substitution candidates when compiling for older ABIs (PR #138947)

2025-05-08 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: > Given that the mangleCXXRecordDecl function is used outside of the > `MangleVTable` , I think the ABI compatibility logic should be moved to > mangleCXXCtorVTable Could you elaborate on how to separate just the ABI compatibility logic from `mangleCXXRecordDecl`? Wouldn't yo

[clang] [ItaniumMangle] Make sure class types are added to the dictionary of substitution candidates when compiling for older ABIs (PR #138947)

2025-05-07 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/138947 >From ece5ba2ee3adac03f058d5cc450ecf2ad70a5a70 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 7 May 2025 12:00:08 -0700 Subject: [PATCH 1/2] [ItaniumMangle] Make sure class types are added to the dic

[clang] [ItaniumMangle] Make sure class types are added to the dictionary of substitution candidates when compiling for older ABIs (PR #138947)

2025-05-07 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: > > Can you confirm that the intent here is to restore mangler behavior to what > > it was prior to #132401, making the pair of PRs ABI-neutral? > > I a bit confused here as well. The description on the PR doesn't say this, > but the patch seems to claim that #132401 fixed a bu

[clang] [ItaniumMangle] Make sure class types are added to the dictionary of substitution candidates when compiling for older ABIs (PR #138947)

2025-05-07 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: > Can you confirm that the intent here is to restore mangler behavior to what > it was prior to #132401, making the pair of PRs ABI-neutral? Yes, exactly. This PR intends to restore the behavior prior to #132401 for older ABIs. https://github.com/llvm/llvm-project/pull/138947

[clang] [ObjC] Stop hard-coding the list of keywords that are allowed in selectors (PR #138952)

2025-05-07 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/138952 The design intent is that ObjC selector pieces can be arbitrary keywords, including basic C keywords like `if`, and the grammar permits this and makes it unambiguous. Use TokenKinds.def to autogenerate the li

[clang] [ItaniumMangle] Make sure class types are added to the dictionary of substitution candidates when compiling for older ABIs (PR #138947)

2025-05-07 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/138947 https://github.com/llvm/llvm-project/pull/132401 made changes to the function that mangles member pointer types, which caused substitutions to be mangled incorrectly. Make sure addSubstitution is called in ma

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2025-05-01 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: Is passing `-fstrict-flex-arrays=1` supposed to silence the warning? I still see the warning: https://godbolt.org/z/YEKhW19nK https://github.com/llvm/llvm-project/pull/95474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2025-05-01 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: clang started issuing a warning after this PR was merged when compiling the following code: ``` typedef long unsigned int size_t; extern "C" { void * memcpy(void * __dst, const void * __src, size_t __n); } struct MyClass { unsigned numberOfBuffers; unsigned long lo

[clang] Silence spurious -Wnontrivial-memcall warnings in C mode (PR #137429)

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

[clang] Fix crash with -ast-dump=json (PR #137324)

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

[clang] Silence spurious -Wnontrivial-memcall warnings in C mode (PR #137429)

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

[clang] Silence spurious -Wnontrivial-memcall warnings in C mode (PR #137429)

2025-04-25 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/137429 clang currently issues a warning when memset is used on a struct that contains an address-discriminated pointer field, even though this is entirely valid behavior. For example: ``` struct S { int * __ptrau

[clang] Fix crash with -ast-dump=json (PR #137324)

2025-04-25 Thread Akira Hatanaka via cfe-commits
@@ -211,6 +211,8 @@ Non-comprehensive list of changes in this release - Added `__builtin_elementwise_exp10`. - For AMDPGU targets, added `__builtin_v_cvt_off_f32_i4` that maps to the `v_cvt_off_f32_i4` instruction. - Added `__builtin_elementwise_minnum` and `__builtin_elementw

[clang] Fix crash with -ast-dump=json (PR #137324)

2025-04-25 Thread Akira Hatanaka via cfe-commits
@@ -367,9 +367,11 @@ void MangleContext::mangleObjCMethodName(const ObjCMethodDecl *MD, } OS << (MD->isInstanceMethod() ? '-' : '+') << '['; if (const auto *CID = MD->getCategory()) { -OS << CID->getClassInterface()->getName(); -if (includeCategoryNamespace) { -

[clang] Fix a crash in constant evaluation of ExtVectorElementExprs (PR #136771)

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

[clang] Fix a crash in constant evaluation of ExtVectorElementExprs (PR #136771)

2025-04-22 Thread Akira Hatanaka via cfe-commits
@@ -9197,7 +9197,10 @@ bool LValueExprEvaluator::VisitExtVectorElementExpr( if (Success) { Result.setFrom(Info.Ctx, Val); -const auto *VT = E->getBase()->getType()->castAs(); +QualType BaseType = E->getBase()->getType(); +if (E->isArrow()) ah

[clang] [clang][ExprConst] allow single element access of vector object to be constant expression (PR #101126)

2025-04-22 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: clang crashes compiling the following code. ``` typedef float float4 __attribute__((ext_vector_type(4))); constexpr float4 v{1,2,3,4}; constexpr const float4 *p = &v; constexpr float f = p->x; ``` I created a PR that fixes the crash: https://github.com/llvm/llvm-project/pull/13

[clang] Fix a crash in constant evaluation of ExtVectorElementExprs (PR #136771)

2025-04-22 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/136771 Handle the case where the base expression is a pointer to a vector type. rdar://149223362 >From c8df1a51efd6349c5905b337059d597d3c1d7146 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Tue, 22 Apr 2025 12

[clang] [clang][ptrauth] Make ptrauth feature detection tests more robust (PR #136204)

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

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

2025-04-15 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed 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] [CodeComplete] Don't drop ArrayToPointerDecay when doing member completion (PR #134951)

2025-04-15 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/134951 ___ 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-04-11 Thread Akira Hatanaka via cfe-commits
@@ -2850,6 +2850,26 @@ void CXXNameMangler::mangleQualifiers(Qualifiers Quals, const DependentAddressSp if (Quals.hasUnaligned()) mangleVendorQualifier("__unaligned"); + // __ptrauth. Note that this is parameterized. + if (PointerAuthQualifier PtrAuth = Quals.getPoin

[clang] [Clang] Force expressions with UO_Not to not be non-negative (PR #126846)

2025-04-10 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: > unsigned int foo(unsigned char x) > { > return ~(1< 'int' to 'unsigned int' > } > ``` Could you help me understand why clang is emitting the warning? Isn't it semantically equivalent to the following code? ``` unsigned int foo(unsigned char x) { int i = ~(1

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

2025-04-09 Thread Akira Hatanaka via cfe-commits
@@ -0,0 +1,142 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++11 -fptrauth-calls -fptrauth-intrinsics -verify -fsyntax-only %s +// RUN: %clang_cc1 -triple aarch64-linux-gnu -std=c++11 -fptrauth-calls -fptrauth-intrinsics -verify -fsyntax-only %s + +#define AQ __ptrauth

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

2025-04-09 Thread Akira Hatanaka via cfe-commits
@@ -0,0 +1,142 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++11 -fptrauth-calls -fptrauth-intrinsics -verify -fsyntax-only %s +// RUN: %clang_cc1 -triple aarch64-linux-gnu -std=c++11 -fptrauth-calls -fptrauth-intrinsics -verify -fsyntax-only %s + +#define AQ __ptrauth

[clang] [CodeComplete] Don't drop ArrayToPointerDecay when doing member completion (PR #134951)

2025-04-09 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak ready_for_review https://github.com/llvm/llvm-project/pull/134951 ___ 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-04-05 Thread Akira Hatanaka via cfe-commits
@@ -0,0 +1,142 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++11 -fptrauth-calls -fptrauth-intrinsics -verify -fsyntax-only %s +// RUN: %clang_cc1 -triple aarch64-linux-gnu -std=c++11 -fptrauth-calls -fptrauth-intrinsics -verify -fsyntax-only %s + +#define AQ __ptrauth

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

2025-03-31 Thread Akira Hatanaka via cfe-commits
@@ -0,0 +1,86 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify -fptrauth-intrinsics %s +// RUN: %clang_cc1 -triple aarch64-linux-gnu -fsyntax-only -verify -fptrauth-intrinsics %s + +#if __has_feature(ptrauth_qualifier) +#warning __ptrauth qualifier enabled! +

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

2025-03-21 Thread Akira Hatanaka via cfe-commits
@@ -0,0 +1,86 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify -fptrauth-intrinsics %s +// RUN: %clang_cc1 -triple aarch64-linux-gnu -fsyntax-only -verify -fptrauth-intrinsics %s + +#if __has_feature(ptrauth_qualifier) +#warning __ptrauth qualifier enabled! +

[clang] [Clang] Introduce a trait to determine the structure binding size (PR #131515)

2025-03-19 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: It looks like this PR introduced some undefined behavior. https://green.lab.llvm.org/job/llvm.org/job/clang-stage2-cmake-RgSan/767/testReport/ Could you take a look at the failing tests and fix them or revert the PR? https://github.com/llvm/llvm-project/pull/131515

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

2025-03-13 Thread Akira Hatanaka via cfe-commits
@@ -73,7 +73,7 @@ namespace { // value of the expression to the unqualified, non-atomic version of // the named type. if (!S.Context.getLangOpts().ObjC && !DestType->isRecordType() && - !DestType->isArrayType()) { + !DestType->isArrayType

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

2025-03-11 Thread Akira Hatanaka via cfe-commits
@@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify -fptrauth-intrinsics -std=c++11 %s +// RUN: %clang_cc1 -triple aarch64-linux-gnu -fsyntax-only -verify -fptrauth-intrinsics -std=c++11 %s + +template struct G { + T __ptrauth(0,0,1234) test; +

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

2025-03-10 Thread Akira Hatanaka via cfe-commits
@@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify -fptrauth-intrinsics -std=c++11 %s +// RUN: %clang_cc1 -triple aarch64-linux-gnu -fsyntax-only -verify -fptrauth-intrinsics -std=c++11 %s + +template struct G { + T __ptrauth(0,0,1234) test; +

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

2025-03-07 Thread Akira Hatanaka via cfe-commits
@@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify -fptrauth-intrinsics -std=c++11 %s +// RUN: %clang_cc1 -triple aarch64-linux-gnu -fsyntax-only -verify -fptrauth-intrinsics -std=c++11 %s + +template struct G { + T __ptrauth(0,0,1234) test; +

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

2025-03-07 Thread Akira Hatanaka via cfe-commits
@@ -73,7 +73,7 @@ namespace { // value of the expression to the unqualified, non-atomic version of // the named type. if (!S.Context.getLangOpts().ObjC && !DestType->isRecordType() && - !DestType->isArrayType()) { + !DestType->isArrayType

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

2025-02-27 Thread Akira Hatanaka via cfe-commits
@@ -2249,6 +2249,53 @@ Value *ScalarExprEmitter::VisitInitListExpr(InitListExpr *E) { return V; } +static bool isDeclRefKnownNonNull(CodeGenFunction &CGF, const ValueDecl *D) { + return !D->isWeak(); +} + +static bool isLValueKnownNonNull(CodeGenFunction &CGF, const Expr *

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

2025-02-24 Thread Akira Hatanaka via cfe-commits
@@ -5708,6 +5732,27 @@ CGCallee CodeGenFunction::EmitCallee(const Expr *E) { return EmitCallee(ICE->getSubExpr()); } +// Try to remember the original __ptrauth qualifier for loads of +// function pointers. +if (ICE->getCastKind() == CK_LValueToRValue) { +

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

2025-02-24 Thread Akira Hatanaka via cfe-commits
@@ -980,6 +980,25 @@ def err_ptrauth_indirect_goto_addrlabel_arithmetic : Error< "%select{subtraction|addition}0 of address-of-label expressions is not " "supported with ptrauth indirect gotos">; +// __ptrauth qualifier +def err_ptrauth_qualifier_invalid : Error< + "%sele

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

2025-02-24 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] [ObjC] Expand isClassLayoutKnownStatically to base classes as long as the implementation of it is known (PR #85465)

2025-02-17 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak approved this pull request. We can remove the null check when we prove `ID` is never null. https://github.com/llvm/llvm-project/pull/85465 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[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-17 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed 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-17 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/126591 >From 5101ebcb921fb621f9abcd7371337732f2d307b5 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 5 Feb 2025 14:47:45 -0800 Subject: [PATCH] [CodeGen][ObjC] Invalidate cached ObjC class layout informatio

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

  1   2   3   4   5   6   7   8   9   10   >