ojhunt wrote:
> > > * Fix personality pointer authentication on non-Apple targets:
> > > [[runtimes][PAC] Harden unwinding when possible #143230
> > > (comment)](https://github.com/llvm/llvm-project/pull/143230#discussion_r2318636296)
> >
> >
> > I'm not sure what's going on in this diff as i
ojhunt wrote:
> * Fix personality pointer authentication on non-Apple targets:
> [[runtimes][PAC] Harden unwinding when possible #143230
> (comment)](https://github.com/llvm/llvm-project/pull/143230#discussion_r2318636296)
> *
I'm not sure what's going on in this diff as it does not appear rel
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/152601
>From e9a96bb893b9a751a108d3f80a877789facb64fb Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Mon, 4 Aug 2025 20:54:46 -0700
Subject: [PATCH] [clang][PAC] Enable the PAC dynamic_cast to final class
optimizatio
https://github.com/ojhunt closed
https://github.com/llvm/llvm-project/pull/152601
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt closed
https://github.com/llvm/llvm-project/pull/156607
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ojhunt wrote:
Updating cxxabi and compiler-rt formatting as they seem to be set up such that
clang-format matches the existing style
https://github.com/llvm/llvm-project/pull/143230
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists
ojhunt wrote:
(Updating to throw at build bots)
https://github.com/llvm/llvm-project/pull/143230
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ojhunt wrote:
> Not really sure I get the motivation/what is happening here, but I don't know
> if there is a better person to review? Perhaps @efriedma-quic can give it a
> quick double-check as well?
If you build clang targeting arm64e, pointer authentication means vtable
pointers are not m
ojhunt wrote:
@cor3ntin prodding you in case you know who should review, or are ok signing
off on it :D
https://github.com/llvm/llvm-project/pull/155770
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/lis
ojhunt wrote:
hmmm, I thought `ptrauth_calls` was one of the checks guarded by a darwin
target so I might revert the `|| defined(__PTRAUTH__)` changes
https://github.com/llvm/llvm-project/pull/143230
___
cfe-commits mailing list
cfe-commits@lists.llvm
@@ -16,6 +16,12 @@
#include
#endif
+#if __has_feature(ptrauth_calls) || defined(__PTRAUTH__)
ojhunt wrote:
I found this while updating the __PTRAUTH__ guards -- I would be ok leaving
this as a task for you folk as I think this is a linux specific file?
htt
@@ -103,10 +104,68 @@
#define _LIBCXXABI_DTOR_FUNC
#endif
-#if __cplusplus < 201103L
-# define _LIBCXXABI_NOEXCEPT throw()
-#else
-# define _LIBCXXABI_NOEXCEPT noexcept
+#if __has_include()
+# include
#endif
+#if __has_extension(ptrauth_qualifier)
+
+// The actual value
@@ -103,6 +103,52 @@
#define _LIBCXXABI_DTOR_FUNC
#endif
+#if __has_include()
+# include
+#endif
ojhunt wrote:
Once I get my local build setup again I will be doing a bunch of the ptrauth.h
cleanup - there are many places that were obviously transitively i
@@ -1047,18 +1051,26 @@ class UnwindCursor : public AbstractUnwindCursor{
bool getInfoFromFdeCie(const typename CFI_Parser::FDE_Info &fdeInfo,
const typename CFI_Parser::CIE_Info &cieInfo,
pint_t pc, uintptr_t dso_base);
- bo
@@ -541,7 +588,33 @@ struct scan_results
};
} // unnamed namespace
+} // extern "C"
+
+namespace {
+// The logical model for casting authenticated function pointers makes
+// it impossible to directly cast them without breaking the authentication,
+// as a result we need this
@@ -30,6 +30,45 @@ EXCEPTION_DISPOSITION
_GCC_specific_handler(PEXCEPTION_RECORD, void *, PCONTEXT,
_Unwind_Personality_Fn);
#endif
+#if __has_feature(ptrauth_qualifier)
+#include
+#if __has_feature(ptrauth_restricted_intptr_qualif
@@ -557,7 +630,21 @@ set_registers(_Unwind_Exception* unwind_exception,
_Unwind_Context* context,
reinterpret_cast(unwind_exception));
_Unwind_SetGR(context, __builtin_eh_return_data_regno(1),
static_cast(results.ttypeIndex));
+#if __has_featu
ojhunt wrote:
Not sure who should be looking at the Compiler.h change?
https://github.com/llvm/llvm-project/pull/156607
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt edited
https://github.com/llvm/llvm-project/pull/156607
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt edited
https://github.com/llvm/llvm-project/pull/156607
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt created
https://github.com/llvm/llvm-project/pull/156607
…types
Clang has a number of Cleanup types used in exception handling, these are
presumed to be POD types that can be memmoved as needed, however this is not
correct by default on platforms with pointer authent
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/155770
>From cc25a94f6f2e28e386b00ca8feee4d2c53c1ee01 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 28 Aug 2025 00:01:13 -0700
Subject: [PATCH] [clang][docs] Add note about `-Wms-bitfield-padding` in MSVC
compa
ojhunt wrote:
(oh yay, you don't have to create a separate issue \o/ )
https://github.com/llvm/llvm-project/pull/155763
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ojhunt wrote:
/cherry-pick 6394c58
https://github.com/llvm/llvm-project/pull/155763
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt milestoned
https://github.com/llvm/llvm-project/pull/155763
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ojhunt wrote:
Checked with Aaron and he feels this is ok :D
https://github.com/llvm/llvm-project/pull/155763
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt closed
https://github.com/llvm/llvm-project/pull/155763
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt edited
https://github.com/llvm/llvm-project/pull/155763
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt created
https://github.com/llvm/llvm-project/pull/155770
None
>From 8e0f9dc43fd6ae669659932cf8d6ced62db6532b Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 28 Aug 2025 00:01:13 -0700
Subject: [PATCH] [clang][docs] Add note about `-Wms-bitfield-padding` in MSVC
ojhunt wrote:
I wasn't sure if this was warranted, but given little effort to add the note I
figured that I could create it an ping the last person to touch it :D
https://github.com/llvm/llvm-project/pull/155770
___
cfe-commits mailing list
cfe-commit
https://github.com/ojhunt closed
https://github.com/llvm/llvm-project/pull/154490
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/154490
>From 689d70c706546a5b0b2ee00ebe7e030041d6fb2b Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Wed, 20 Aug 2025 01:28:29 -0700
Subject: [PATCH 1/4] [clang][PAC] Fix builtins that claim Address
discriminated typ
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/152601
>From 0603664d1637ea7fc729486dec97c5f3292cddaa Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Mon, 4 Aug 2025 20:54:46 -0700
Subject: [PATCH] [clang][PAC] Enable the PAC dynamic_cast to final class
optimizatio
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/143230
>From 27fb74cf3545cedab4e1c7fa6f42b935b5f345c0 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Tue, 5 Aug 2025 18:16:32 -0700
Subject: [PATCH 1/8] [runtimes][PAC] Harden unwinding when possible (#138571)
This h
https://github.com/ojhunt closed
https://github.com/llvm/llvm-project/pull/154858
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/154490
>From 689d70c706546a5b0b2ee00ebe7e030041d6fb2b Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Wed, 20 Aug 2025 01:28:29 -0700
Subject: [PATCH 1/3] [clang][PAC] Fix builtins that claim Address
discriminated typ
@@ -876,8 +876,9 @@ bool ConstStructBuilder::Build(const APValue &Val, const
RecordDecl *RD,
for (const BaseInfo &Base : Bases) {
bool IsPrimaryBase = Layout.getPrimaryBase() == Base.Decl;
- Build(Val.getStructBase(Base.Index), Base.Decl, IsPrimaryBase,
-
@@ -666,6 +666,10 @@ class TrivialFunctionAnalysisVisitor
return IsFunctionTrivial(Callee);
}
+ bool VisitGCCAsmStmt(const GCCAsmStmt *AS) {
+return AS->getAsmString() == "brk #0xc471";
ojhunt wrote:
does this need to be restricted to a specific br
https://github.com/ojhunt requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/152488
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2639,6 +2642,87 @@ static void DiagnoseNonStandardLayoutReason(Sema
&SemaRef, SourceLocation Loc,
SemaRef.Diag(D->getLocation(), diag::note_defined_here) << D;
}
+static void DiagnoseNonAggregateReason(Sema &SemaRef, SourceLocation Loc,
+
@@ -2639,6 +2642,87 @@ static void DiagnoseNonStandardLayoutReason(Sema
&SemaRef, SourceLocation Loc,
SemaRef.Diag(D->getLocation(), diag::note_defined_here) << D;
}
+static void DiagnoseNonAggregateReason(Sema &SemaRef, SourceLocation Loc,
+
@@ -1438,6 +1438,10 @@ void CXXRecordDecl::addedMember(Decl *D) {
data().StructuralIfLiteral = false;
}
+if (!data().HasTrivialSpecialMembers &&
+T.hasAddressDiscriminatedPointerAuth())
+ data().HasTrivialSpecialMembers = true;
ojh
@@ -74,7 +74,7 @@ static_assert(__is_trivially_destructible(S3));
static_assert(!__is_trivially_copyable(S3));
static_assert(!__is_trivially_relocatable(S3)); //
expected-warning{{deprecated}}
//FIXME
-static_assert(__builtin_is_cpp_trivially_relocatable(S3));
+static_assert(!
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/154490
>From 689d70c706546a5b0b2ee00ebe7e030041d6fb2b Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Wed, 20 Aug 2025 01:28:29 -0700
Subject: [PATCH 1/2] [clang][PAC] Fix builtins that claim Address
discriminated typ
@@ -1438,6 +1438,10 @@ void CXXRecordDecl::addedMember(Decl *D) {
data().StructuralIfLiteral = false;
}
+if (!data().HasTrivialSpecialMembers &&
+T.hasAddressDiscriminatedPointerAuth())
+ data().HasTrivialSpecialMembers = true;
ojh
@@ -1438,6 +1438,10 @@ void CXXRecordDecl::addedMember(Decl *D) {
data().StructuralIfLiteral = false;
}
+if (!data().HasTrivialSpecialMembers &&
+T.hasAddressDiscriminatedPointerAuth())
+ data().HasTrivialSpecialMembers = true;
ojh
@@ -1438,6 +1438,10 @@ void CXXRecordDecl::addedMember(Decl *D) {
data().StructuralIfLiteral = false;
}
+if (!data().HasTrivialSpecialMembers &&
+T.hasAddressDiscriminatedPointerAuth())
+ data().HasTrivialSpecialMembers = true;
ojh
https://github.com/ojhunt ready_for_review
https://github.com/llvm/llvm-project/pull/154490
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/154490
>From 689d70c706546a5b0b2ee00ebe7e030041d6fb2b Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Wed, 20 Aug 2025 01:28:29 -0700
Subject: [PATCH] [clang][PAC] Fix builtins that claim Address discriminated
types a
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/154490
>From b0ac8bf69e8075d9241707afaf45aba2bf20d392 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Wed, 20 Aug 2025 01:28:29 -0700
Subject: [PATCH] [clang][PAC] Fix builtins that claim Address discriminated
types a
https://github.com/ojhunt converted_to_draft
https://github.com/llvm/llvm-project/pull/154490
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt created
https://github.com/llvm/llvm-project/pull/154490
A number of builtins report some variation of "this type is compatibile with
some bitwise equivalent operation", but this is not true for address
discriminated values. We had address a number of cases, but not a
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/153722
>From 0cbb0846f270c6d6cb15492ba34ff9ae2ed33f67 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 14 Aug 2025 17:43:03 -0700
Subject: [PATCH 1/8] [clang][PAC][darwin] Set correct default ptrauth features
for
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/153722
>From 0cbb0846f270c6d6cb15492ba34ff9ae2ed33f67 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 14 Aug 2025 17:43:03 -0700
Subject: [PATCH 1/7] [clang][PAC][darwin] Set correct default ptrauth features
for
@@ -3291,6 +3291,39 @@ void Darwin::addClangTargetOptions(
if (!RequiresSubdirectorySearch)
CC1Args.push_back("-fno-modulemap-allow-subdirectory-search");
}
+
+ if (getTriple().isArm64e()) {
+auto EnsureDefaultPtrauthFlag = [&](OptSpecifier Pos, OptSpecifier Ne
https://github.com/ojhunt auto_merge_enabled
https://github.com/llvm/llvm-project/pull/153912
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/153912
>From ea731927d6bdf85a3cdb333b756447658f2c2ea6 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Fri, 15 Aug 2025 18:40:12 -0700
Subject: [PATCH 1/6] [clang][PAC] Make ptrauth_qualifier and ptrauth_intrinsic
Darw
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/153912
>From ea731927d6bdf85a3cdb333b756447658f2c2ea6 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Fri, 15 Aug 2025 18:40:12 -0700
Subject: [PATCH 1/5] [clang][PAC] Make ptrauth_qualifier and ptrauth_intrinsic
Darw
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/153912
>From ea731927d6bdf85a3cdb333b756447658f2c2ea6 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Fri, 15 Aug 2025 18:40:12 -0700
Subject: [PATCH 1/4] [clang][PAC] Make ptrauth_qualifier and ptrauth_intrinsic
Darw
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/153912
>From ea731927d6bdf85a3cdb333b756447658f2c2ea6 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Fri, 15 Aug 2025 18:40:12 -0700
Subject: [PATCH 1/3] [clang][PAC] Make ptrauth_qualifier and ptrauth_intrinsic
Darw
@@ -1528,6 +1528,9 @@ static void InitializePredefinedMacros(const TargetInfo
&TI,
#undef TARGET_OS
}
+ if (LangOpts.PointerAuthIntrinsics)
+Builder.defineMacro("__PTRAUTH__");
ojhunt wrote:
I think the complexity of the ptrauth abi surface area means
@@ -1089,6 +1089,7 @@ static void ComputeDATE_TIME(SourceLocation &DATELoc,
SourceLocation &TIMELoc,
/// specified by the identifier as a standard language feature.
static bool HasFeature(const Preprocessor &PP, StringRef Feature) {
const LangOptions &LangOpts = PP.getLangOp
https://github.com/ojhunt created
https://github.com/llvm/llvm-project/pull/154109
When parsing a block expression we were not entering a new eval context and as
a result when parsing the block body we continue to treat any return statements
as discarded so infer a `void` result.
This fixes t
https://github.com/ojhunt closed
https://github.com/llvm/llvm-project/pull/153921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt closed
https://github.com/llvm/llvm-project/pull/153506
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ojhunt wrote:
Closing, as for the current critical case (ptrauth) we're keeping the tests as
a feature when the target is arm64e, and adding a ``__PTRAUTH__`` define that
will be the correct test going forward.
https://github.com/llvm/llvm-project/pull/153506
__
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/153912
>From ea731927d6bdf85a3cdb333b756447658f2c2ea6 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Fri, 15 Aug 2025 18:40:12 -0700
Subject: [PATCH 1/2] [clang][PAC] Make ptrauth_qualifier and ptrauth_intrinsic
Darw
ojhunt wrote:
I realized that this can't be made to work nicely and automatically no matter
how much I would like it to as of course the macro based version of
`__has_ptrauth_feature` can't check for a macro being defined in expression
contexts. Oh well, I guess that dream is over. I'll just s
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/153921
>From cee36b9d023f97b55bf01220ccd6f404311db339 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Fri, 15 Aug 2025 21:04:07 -0700
Subject: [PATCH 1/2] [clang] return type not correctly deduced for discarded
lambda
https://github.com/ojhunt ready_for_review
https://github.com/llvm/llvm-project/pull/153921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt edited
https://github.com/llvm/llvm-project/pull/153921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/153921
>From cee36b9d023f97b55bf01220ccd6f404311db339 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Fri, 15 Aug 2025 21:04:07 -0700
Subject: [PATCH 1/2] [clang] return type not correctly deduced for discarded
lambda
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/153921
>From cee36b9d023f97b55bf01220ccd6f404311db339 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Fri, 15 Aug 2025 21:04:07 -0700
Subject: [PATCH] [clang] return type not correctly deduced for discarded
lambdas
T
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/153722
>From 0cbb0846f270c6d6cb15492ba34ff9ae2ed33f67 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 14 Aug 2025 17:43:03 -0700
Subject: [PATCH 1/5] [clang][PAC][darwin] Set correct default ptrauth features
for
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/153722
>From 0cbb0846f270c6d6cb15492ba34ff9ae2ed33f67 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 14 Aug 2025 17:43:03 -0700
Subject: [PATCH 1/4] [clang][PAC][darwin] Set correct default ptrauth features
for
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/153722
>From 0cbb0846f270c6d6cb15492ba34ff9ae2ed33f67 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 14 Aug 2025 17:43:03 -0700
Subject: [PATCH 1/3] [clang][PAC][darwin] Set correct default ptrauth features
for
ojhunt wrote:
Today, in the correct PR:
@AaronBallman @cor3ntin I have an idea, and I'd like to see what you think. We
currently have the misery of these has_feature checks, I'm wondering if we can
make them _all_ darwin only, so for each one, say ptrauth_calls we add a
predefined macro like
ojhunt wrote:
@AaronBallman @cor3ntin I have an idea, and I'd like to see what you think. We
currently have the misery of these has_feature checks, I'm wondering if we can
make them _all_ darwin only, so for each one, say ptrauth_calls we add a
predefined macro like `__PTRAUTH_ABI_PTRAUTH_CALL
ojhunt wrote:
> ```c++
> auto x = [](U, U = U::bar) {};
> ```
I think I technically knew you could have templated lambdas, but I certainly
forgot about it entirely :D
What I'm trying to construct is something that would not trigger an error if it
was wrapped in an `if constexpr(0)` inside t
ojhunt wrote:
> This should work
>
> ```diff
> diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
> b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
> index f02a295220ef..6b423ce06523 100644
> --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
> +++ b/clang/lib/Sema/SemaTemplateInsta
@@ -0,0 +1,85 @@
+// RUN: %clang -target arm64 -DNO_DEFAULT_PTRAUTH %s
-fsyntax-only -Xclang -verify=no_default_ptrauth
+// RUN: %clang -target arm64-apple-macosx -DNO_DEFAULT_PTRAUTH %s
-fsyntax-only -Xclang -verify=no_default_ptrauth
+// RUN: %cl
@@ -0,0 +1,85 @@
+// RUN: %clang -target arm64 -DNO_DEFAULT_PTRAUTH %s
-fsyntax-only -Xclang -verify=no_default_ptrauth
+// RUN: %clang -target arm64-apple-macosx -DNO_DEFAULT_PTRAUTH %s
-fsyntax-only -Xclang -verify=no_default_ptrauth
+// RUN: %cl
https://github.com/ojhunt edited
https://github.com/llvm/llvm-project/pull/153722
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3291,6 +3291,39 @@ void Darwin::addClangTargetOptions(
if (!RequiresSubdirectorySearch)
CC1Args.push_back("-fno-modulemap-allow-subdirectory-search");
}
+
+ if (getTriple().isArm64e()) {
ojhunt wrote:
I've done this - the out of date-ness was
@@ -3291,6 +3291,39 @@ void Darwin::addClangTargetOptions(
if (!RequiresSubdirectorySearch)
CC1Args.push_back("-fno-modulemap-allow-subdirectory-search");
}
+
+ if (getTriple().isArm64e()) {
+auto EnsureDefaultPtrauthFlag = [&](OptSpecifier Pos, OptSpecifier Ne
@@ -1528,6 +1528,9 @@ static void InitializePredefinedMacros(const TargetInfo
&TI,
#undef TARGET_OS
}
+ if (LangOpts.PointerAuthIntrinsics)
+Builder.defineMacro("__PTRAUTH__");
ojhunt wrote:
I think @AaronBallman had an opinion on the `__` suffix - I
@@ -1528,6 +1528,9 @@ static void InitializePredefinedMacros(const TargetInfo
&TI,
#undef TARGET_OS
}
+ if (LangOpts.PointerAuthIntrinsics)
+Builder.defineMacro("__PTRAUTH__");
ojhunt wrote:
(we have __ARM_FEATURE_PAUTH already)
https://github.com/ll
@@ -1528,6 +1528,9 @@ static void InitializePredefinedMacros(const TargetInfo
&TI,
#undef TARGET_OS
}
+ if (LangOpts.PointerAuthIntrinsics)
+Builder.defineMacro("__PTRAUTH__");
ojhunt wrote:
Ok, so there's an existing `__ARM_FEATURE_PAUTH` but that do
@@ -1528,6 +1528,9 @@ static void InitializePredefinedMacros(const TargetInfo
&TI,
#undef TARGET_OS
}
+ if (LangOpts.PointerAuthIntrinsics)
+Builder.defineMacro("__PTRAUTH__");
ojhunt wrote:
I don't believe gcc has any support as yet? I recall talking
@@ -147,8 +147,8 @@ FEATURE(type_sanitizer,
LangOpts.Sanitize.has(SanitizerKind::Type))
FEATURE(thread_sanitizer, LangOpts.Sanitize.has(SanitizerKind::Thread))
FEATURE(dataflow_sanitizer, LangOpts.Sanitize.has(SanitizerKind::DataFlow))
FEATURE(scudo, LangOpts.Sanitize.hasOneOf
@@ -1089,6 +1089,7 @@ static void ComputeDATE_TIME(SourceLocation &DATELoc,
SourceLocation &TIMELoc,
/// specified by the identifier as a standard language feature.
static bool HasFeature(const Preprocessor &PP, StringRef Feature) {
const LangOptions &LangOpts = PP.getLangOp
ojhunt wrote:
@mizvekov @cor3ntin ok, I think the actual issue is in
`Sema::PushExpressionEvaluationContext`. When pushing a new evaluation context
down we all set the new context's `InDiscardedStatement` state to its parent's
state.
I think for lambda expressions that is incorrect as it mean
ojhunt wrote:
> Yes the correct behavior for return type deduction for a function with no
> non-discarded return statements is for it to be deduced as void:
> https://godbolt.org/z/qaYebb5q9
Right, once you pointed it out I remembered that not all of the
semantic/erroneous code in discarded s
ojhunt wrote:
Out of curiosity I looked at this, and here we do end up doing the right thing,
though I assume in the case of an inferred return we end up simply ignoring the
interior branch of the `if(0)` entirely:
```cpp
auto f() {
auto l = [](auto) { return true; };
if constexpr (0)
ojhunt wrote:
> Yeah this is not correct, simply removing that return statement will cause us
> to attempt to use a discarded return statement for return type deduction
> purposes, but that is not supposed to happen.
Ah yeah, I had misunderstood (again) the rules for when otherwise discarded
https://github.com/ojhunt converted_to_draft
https://github.com/llvm/llvm-project/pull/153921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ojhunt wrote:
@cor3ntin This is not actually correct as it fails to handle the not all paths
return case. The problem here is that I don't really know just how the full
deduction path handles that? (I'll continue to prod around but this area is not
familiar to me)
https://github.com/llvm/llvm
https://github.com/ojhunt created
https://github.com/llvm/llvm-project/pull/153921
The early return for lamda expressions with deduced return types in
Sema::ActOnCapScopeReturnStmt meant that we were not actually perform the
required return type deduction for such lambdas when in a discarded c
Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Zhaoxuan Jiang
,Bill Wendling ,Morris Hafner
,David Green ,
Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Alex Bradbury
,DeanSturtevant1
,Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Craig
Topper ,DeanSturtevant1 ,
Valentin Clement =?utf-8?b?KOODkOOD
Valentin Clement =?utf-8?b?KOODkOODrOODsw==?=,Zhaoxuan Jiang
,Bill Wendling ,Morris Hafner
,David Green ,
Valentin Clement =?utf-8?b?KOODkOODrOODsw==?=,Alex Bradbury
,DeanSturtevant1
,Valentin Clement =?utf-8?b?KOODkOODrOODsw==?=,Craig
Topper ,DeanSturtevant1 ,
Valentin Clement =?utf-8?b?KOODk
1 - 100 of 811 matches
Mail list logo