@@ -30,6 +30,46 @@ EXCEPTION_DISPOSITION
_GCC_specific_handler(PEXCEPTION_RECORD, void *, PCONTEXT,
_Unwind_Personality_Fn);
#endif
+#if __has_include()
+#include
+#endif
+
+#if defined(__APPLE__) && __has_feature(ptrauth_qualifier
@@ -1877,6 +1946,32 @@ inline Registers_arm64::Registers_arm64(const void
*registers) {
memcpy(_vectorHalfRegisters,
static_cast(registers) + sizeof(GPRs),
sizeof(_vectorHalfRegisters));
+#if __has_feature(ptrauth_calls)
ojhunt wrote:
- [
@@ -93,6 +98,13 @@ class _LIBUNWIND_HIDDEN Registers_x86 {
uint32_t getEDI() const { return _registers.__edi; }
void setEDI(uint32_t value) { _registers.__edi = value; }
+ typedef uint32_t reg_t;
+ typedef uint32_t link_reg_t;
+ void loadAndAuthenticateLin
@@ -1845,10 +1871,53 @@ class _LIBUNWIND_HIDDEN Registers_arm64 {
uint64_t getSP() const { return _registers.__sp; }
void setSP(uint64_t value) { _registers.__sp = value; }
- uint64_t getIP() const { return _registers.__pc; }
- void setIP(uint
@@ -1845,10 +1871,53 @@ class _LIBUNWIND_HIDDEN Registers_arm64 {
uint64_t getSP() const { return _registers.__sp; }
void setSP(uint64_t value) { _registers.__sp = value; }
- uint64_t getIP() const { return _registers.__pc; }
- void setIP(uint
@@ -83,7 +83,13 @@ __llvm_profile_iterate_data(const __llvm_profile_data *Data)
{
/* This method is only used in value profiler mock testing. */
COMPILER_RT_VISIBILITY void *
__llvm_get_function_addr(const __llvm_profile_data *Data) {
- return Data->FunctionPointer;
+ void
@@ -1845,10 +1871,53 @@ class _LIBUNWIND_HIDDEN Registers_arm64 {
uint64_t getSP() const { return _registers.__sp; }
void setSP(uint64_t value) { _registers.__sp = value; }
- uint64_t getIP() const { return _registers.__pc; }
- void setIP(uint
@@ -83,7 +83,13 @@ __llvm_profile_iterate_data(const __llvm_profile_data *Data)
{
/* This method is only used in value profiler mock testing. */
COMPILER_RT_VISIBILITY void *
__llvm_get_function_addr(const __llvm_profile_data *Data) {
- return Data->FunctionPointer;
+ void
@@ -694,7 +705,12 @@
DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)
gcspushm x30
Lnogcs:
#endif
+
+#if __has_feature(ptrauth_calls)
+ retab
+#else
ojhunt wrote:
see earlier comment - do we want to just adopt a single flag instead of the
cur
@@ -1877,6 +1946,32 @@ inline Registers_arm64::Registers_arm64(const void
*registers) {
memcpy(_vectorHalfRegisters,
static_cast(registers) + sizeof(GPRs),
sizeof(_vectorHalfRegisters));
+#if __has_feature(ptrauth_calls)
+ uint64_t pcRegister = 0;
+ memcp
ojhunt wrote:
Converting to draft so I don't accidentally hit the big green commit button
(that is big and green despite no approvals ?!?!)
https://github.com/llvm/llvm-project/pull/144420
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https:
https://github.com/ojhunt converted_to_draft
https://github.com/llvm/llvm-project/pull/144420
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ojhunt wrote:
> It is very common for type traits to factor into the ABI of a template
> specialization, such that `my_variant` has a different layout depending on
> `is_amazing_v`. That is why changing the value of a type trait generally
> has to be considered an ABI break.
ah right, it's no
ojhunt wrote:
> I think we should make a point of implementing this for address-discriminated
> `__ptrauth` qualifiers before we release it, because changing the type trait
> in a future release will be an ABI break.
I had been talking to @cor3ntin and decided we could do it later as this is a
@@ -4467,17 +4467,25 @@ RValue CodeGenFunction::EmitBuiltinExpr(const
GlobalDecl GD, unsigned BuiltinID,
case Builtin::BI__builtin_trivially_relocate:
case Builtin::BImemmove:
case Builtin::BI__builtin_memmove: {
+QualType CopiedType = E->getArg(0)->getType()->getPoi
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/144420
>From b43a7e9295dfdbe0a11fb7dff669b82d8ed0630c Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Mon, 16 Jun 2025 20:48:57 +0300
Subject: [PATCH 1/2] [clang][PAC] Support trivially_relocating polymorphic
objects
@@ -420,6 +420,222 @@ void
CodeGenFunction::EmitPointerAuthCopy(PointerAuthQualifier Qual, QualType T,
Builder.CreateStore(Value, DestAddress);
}
+static const ConstantArrayType *tryGetTypeAsConstantArrayType(QualType T) {
+ if (!T->isConstantArrayType())
+return nullp
@@ -1727,6 +1727,11 @@ ASTContext::PointerAuthContent
ASTContext::findPointerAuthContent(QualType T) {
T = T.getCanonicalType();
if (T.hasAddressDiscriminatedPointerAuth())
return PointerAuthContent::AddressDiscriminatedData;
+
+ T = getBaseElementType(T).getCanonical
https://github.com/ojhunt created
https://github.com/llvm/llvm-project/pull/144420
Adds support for trivial relocation of polymorphic objects with address
discriminated vtable pointers.
This is implemented as a post-memmove fixup pass over the impacted objects. We
do this by traversing the ob
ojhunt wrote:
> LLVM Buildbot has detected a new failure on builder
> `ppc64le-flang-rhel-clang` running on `ppc64le-flang-rhel-test` while
> building `clang` at step 6 "test-build-unified-tree-check-flang".
>
> Full details are available at:
> https://lab.llvm.org/buildbot/#/builders/157/bui
https://github.com/ojhunt closed
https://github.com/llvm/llvm-project/pull/143969
___
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/143969
>From f47680310ed68a9f8e8cb15bc1cd474740072463 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 12 Jun 2025 13:17:11 -0700
Subject: [PATCH 1/7] [clang] Fix PointerAuth semantics of
cpp_trivially_relocatable
@@ -629,25 +629,46 @@ class ASTContext : public RefCountedBase {
void setRelocationInfoForCXXRecord(const CXXRecordDecl *,
CXXRecordDeclRelocationInfo);
- /// Examines a given type, and returns whether the T itself
+ /// Examines a give
@@ -629,25 +629,46 @@ class ASTContext : public RefCountedBase {
void setRelocationInfoForCXXRecord(const CXXRecordDecl *,
CXXRecordDeclRelocationInfo);
- /// Examines a given type, and returns whether the T itself
+ /// Examines a give
@@ -629,25 +629,46 @@ class ASTContext : public RefCountedBase {
void setRelocationInfoForCXXRecord(const CXXRecordDecl *,
CXXRecordDeclRelocationInfo);
- /// Examines a given type, and returns whether the T itself
+ /// Examines a give
https://github.com/ojhunt approved this pull request.
Looks reasonable to me -- I spent a bunch of time trying to induce some case
where this would do the wrong thing and I couldn't come up with anything as all
the failure modes that would be possible outside of constexpr already fail in
const
@@ -2753,10 +2753,18 @@ static bool resolveAllocationOverloadInterior(
if (Diagnose) {
// If this is an allocation of the form 'new (p) X' for some object
// pointer p (or an expression that will decay to such a pointer),
- // diagnose the missing inclusion
https://github.com/ojhunt requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/144270
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2753,10 +2753,18 @@ static bool resolveAllocationOverloadInterior(
if (Diagnose) {
// If this is an allocation of the form 'new (p) X' for some object
// pointer p (or an expression that will decay to such a pointer),
- // diagnose the missing inclusion
ojhunt wrote:
Sure thing :D
https://github.com/llvm/llvm-project/pull/144247
___
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/144247
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt approved this pull request.
lgtm
https://github.com/llvm/llvm-project/pull/144247
___
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/143969
>From f47680310ed68a9f8e8cb15bc1cd474740072463 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 12 Jun 2025 13:17:11 -0700
Subject: [PATCH 1/6] [clang] Fix PointerAuth semantics of
cpp_trivially_relocatable
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/143969
>From f47680310ed68a9f8e8cb15bc1cd474740072463 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 12 Jun 2025 13:17:11 -0700
Subject: [PATCH 1/5] [clang] Fix PointerAuth semantics of
cpp_trivially_relocatable
ojhunt wrote:
found how to unmark the approval as the next update will change this fairly
substantially
https://github.com/llvm/llvm-project/pull/143969
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/lis
ojhunt wrote:
Actually I've given this a lot of thought, I think we should not consider
explicitly __ptrauth qualified types to be relocatable, how does that sound?
https://github.com/llvm/llvm-project/pull/143969
___
cfe-commits mailing list
cfe-comm
ojhunt wrote:
Very glad I didn't just assume my local build was sufficient and waited for the
bots :D
https://github.com/llvm/llvm-project/pull/143969
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listi
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/143969
>From f47680310ed68a9f8e8cb15bc1cd474740072463 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 12 Jun 2025 13:17:11 -0700
Subject: [PATCH 1/4] [clang] Fix PointerAuth semantics of
cpp_trivially_relocatable
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/143969
>From f47680310ed68a9f8e8cb15bc1cd474740072463 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 12 Jun 2025 13:17:11 -0700
Subject: [PATCH 1/3] [clang] Fix PointerAuth semantics of
cpp_trivially_relocatable
@@ -628,10 +628,13 @@ class ASTContext : public RefCountedBase {
getRelocationInfoForCXXRecord(const CXXRecordDecl *) const;
void setRelocationInfoForCXXRecord(const CXXRecordDecl *,
CXXRecordDeclRelocationInfo);
+ bool containsAddressD
@@ -15121,6 +15155,21 @@ ASTContext::baseForVTableAuthentication(const
CXXRecordDecl *ThisClass) {
return PrimaryBase;
}
+bool ASTContext::hasAddressDiscriminatedVTableAuthentication(
ojhunt wrote:
Which function?
https://github.com/llvm/llvm-project/pull
@@ -1705,6 +1705,40 @@ void ASTContext::setRelocationInfoForCXXRecord(
RelocatableClasses.insert({D, Info});
}
+bool ASTContext::containsAddressDiscriminatedPointerAuth(QualType T) {
+ if (!LangOpts.PointerAuthCalls && !LangOpts.PointerAuthIntrinsics)
+return false;
+
+
https://github.com/ojhunt edited
https://github.com/llvm/llvm-project/pull/143969
___
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/143969
>From f47680310ed68a9f8e8cb15bc1cd474740072463 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 12 Jun 2025 13:17:11 -0700
Subject: [PATCH 1/2] [clang] Fix PointerAuth semantics of
cpp_trivially_relocatable
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/143969
>From f47680310ed68a9f8e8cb15bc1cd474740072463 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 12 Jun 2025 13:17:11 -0700
Subject: [PATCH 1/2] [clang] Fix PointerAuth semantics of
cpp_trivially_relocatable
@@ -557,7 +596,19 @@ 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 defined(__A
@@ -807,7 +812,12 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
strd31, [x0, #0x208]
#endif
movx0, #0 // return UNW_ESUCCESS
+
+#if __has_feature(ptrauth_calls)
+ retab
+#else
ojhunt wrote:
This is what we have downstream, i
@@ -126,6 +130,36 @@ _LIBUNWIND_HIDDEN int __unw_set_reg(unw_cursor_t *cursor,
unw_regnum_t regNum,
// First, get the FDE for the old location and then update it.
co->getInfo(&info);
co->setInfoBasedOnIPRegister(false);
+
+#if __has_feature(ptrauth_calls)
+
@@ -32,22 +32,23 @@
#endif
#if defined(_WIN32)
- #if defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS) ||
(defined(__MINGW32__) && !defined(_LIBCXXABI_BUILDING_LIBRARY))
- #define _LIBCXXABI_HIDDEN
- #define _LIBCXXABI_DATA_VIS
- #define _LIBCXXABI_FUNC_VIS
- #define _LI
@@ -32,22 +32,23 @@
#endif
#if defined(_WIN32)
- #if defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS) ||
(defined(__MINGW32__) && !defined(_LIBCXXABI_BUILDING_LIBRARY))
- #define _LIBCXXABI_HIDDEN
- #define _LIBCXXABI_DATA_VIS
- #define _LIBCXXABI_FUNC_VIS
- #define _LI
https://github.com/ojhunt created
https://github.com/llvm/llvm-project/pull/143969
This adds a function to ASTContext to query whether a type contains values with
address discriminated pointer auth, and performs the required semantic checks
to ensure correct reporting of relocatablity in those
https://github.com/ojhunt closed
https://github.com/llvm/llvm-project/pull/143796
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ojhunt wrote:
Closing this PR because there's a lot of noise in it that is just completely
reverted/gone at this point.
https://github.com/llvm/llvm-project/pull/143796
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi
@@ -292,77 +294,129 @@ Sema::CheckCXX2CRelocatableAndReplaceable(const
CXXRecordDecl *D) {
return HasSuitableSMP();
// is a union with no user-declared special member functions, or
-if (IsUnion())
+if (IsTrivialUnion())
return HasSuitableSMP();
@@ -292,77 +294,129 @@ Sema::CheckCXX2CRelocatableAndReplaceable(const
CXXRecordDecl *D) {
return HasSuitableSMP();
// is a union with no user-declared special member functions, or
-if (IsUnion())
+if (IsTrivialUnion())
return HasSuitableSMP();
@@ -10615,7 +10615,7 @@ void Sema::checkIllFormedTrivialABIStruct(CXXRecordDecl
&RD) {
}
}
- if (IsCXXTriviallyRelocatableType(RD))
+ if (CheckCXX2CRelocatableAndReplaceable(&RD).IsRelocatable)
ojhunt wrote:
I think I did restore it for QualType an
@@ -621,17 +621,24 @@ class ASTContext : public RefCountedBase {
public:
struct CXXRecordDeclRelocationInfo {
+static CXXRecordDeclRelocationInfo NonRelocatable() {
+ return {false, false};
+}
+
unsigned IsRelocatable;
unsigned IsReplaceable;
-
https://github.com/ojhunt created
https://github.com/llvm/llvm-project/pull/143796
This reworks the way we compute relocatability and replaceability of types. We
do this by having a single interface the provides a full `TypeRelocationInfo`
for a QualType. This simplifies the reasoning for all
@@ -65,6 +65,17 @@ enum class PointerAuthenticationMode : unsigned {
SignAndAuth
};
+static constexpr llvm::StringLiteral PointerAuthenticationOptionStrip =
"strip";
ojhunt wrote:
ah so what @erichkeane was suggesting is that places needing the string woul
@@ -121,8 +121,10 @@ static bool hasSuitableConstructorForRelocation(Sema
&SemaRef,
CXXMethodDecl *Decl =
LookupSpecialMemberFromXValue(SemaRef, D, /*Assign=*/false);
ojhunt wrote:
Is it reasonable to have LookupSpecialMemberFromXValue simply return
ojhunt wrote:
> Thank you for the fix!
sorry for the delay, just completely forgot about it
https://github.com/llvm/llvm-project/pull/143448
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co
https://github.com/ojhunt closed
https://github.com/llvm/llvm-project/pull/143448
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1434,10 +1446,13 @@ namespace {
QualType ArgType;
};
-unsigned NumPlacementArgs : 31;
-LLVM_PREFERRED_TYPE(bool)
+unsigned NumPlacementArgs : 30;
+LLVM_PREFERRED_TYPE(AlignedAllocationMode)
unsigned PassAlignmentToPlacementDelete : 1;
+LL
https://github.com/ojhunt created
https://github.com/llvm/llvm-project/pull/143448
The CallDeleteDuringNew::PassTypeToPlacementDelete field became unneeded during
the many refactorings of P2719 but I didn't actually remove it.
>From c1fa0ea448210ab10e71bd7b2f4dc4d575056b39 Mon Sep 17 00:00:00
@@ -1434,10 +1446,13 @@ namespace {
QualType ArgType;
};
-unsigned NumPlacementArgs : 31;
-LLVM_PREFERRED_TYPE(bool)
+unsigned NumPlacementArgs : 30;
+LLVM_PREFERRED_TYPE(AlignedAllocationMode)
unsigned PassAlignmentToPlacementDelete : 1;
+LL
@@ -2052,7 +2052,7 @@ static void DiagnoseNonTriviallyRelocatableReason(Sema
&SemaRef,
}
if (!D->hasSimpleMoveConstructor() && !D->hasSimpleCopyConstructor()) {
-const auto *Decl = cast(
+const auto *Decl = cast_or_null(
ojhunt wrote:
I didn't re
https://github.com/ojhunt edited
https://github.com/llvm/llvm-project/pull/143350
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt approved this pull request.
Looks good
https://github.com/llvm/llvm-project/pull/143350
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ojhunt wrote:
unused variable errors are likely fallout from refactoring and workaround
removals I did as part of the prep, will do some cleanup/diagnostics work later
this week.
I mostly wanted to get this available to others to see whether they were ok
adopting this rather than rolling thei
ojhunt wrote:
Updating formatting before review - had discussed with Louis and he expressed a
preference for some of it, but this llvm.org style bot complains many other
cases (likely a local config issue when I was trying to cleanup the downstream
code.
So I've updated with a direct clang-fo
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/143230
>From 637245f9be6ed0163c9129d27a572f153b6f8523 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Fri, 6 Jun 2025 18:50:28 -0700
Subject: [PATCH] [runtimes][PAC] Harden unwinding when possible (#138571)
This harde
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/143230
>From 68103962b254565fdfad069c350af90ede7109b4 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Fri, 6 Jun 2025 18:50:28 -0700
Subject: [PATCH] [runtimes][PAC] Harden unwinding when possible (#138571)
This harde
ojhunt wrote:
I've finally got our downstream hardening to the point where it should be sane:
https://github.com/llvm/llvm-project/pull/143230
https://github.com/llvm/llvm-project/pull/113368
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
htt
https://github.com/ojhunt created
https://github.com/llvm/llvm-project/pull/143230
This hardens the unwinding logic and datastructures on systems that support
pointer authentication.
The approach taken to hardening is to harden the schemas of as many high value
fields in the myriad structs as
ojhunt wrote:
This obviously cases https://github.com/llvm/llvm-project/issues/143065
@AaronBallman @erichkeane @zygoloid commented in the RFC - this change
regresses the checks in ubsan for default compilation modes in order to make
the use of sanitize=undefined easier in non-default scenario
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/136828
>From 927380bdf377581e6e40507a12c374023352c613 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Wed, 30 Apr 2025 22:26:59 -0700
Subject: [PATCH 1/6] [clang][PAC] add support for options parameter to
__ptrauth
T
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/138482
>From ecea44f2965cda3a4e6e1ccec096066830ddfa41 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Sun, 4 May 2025 21:07:33 -0700
Subject: [PATCH 1/2] [clang][ptrauth] Add support for querying the ptrauth
schema of
@@ -605,6 +605,11 @@ KEYWORD(__private_extern__ , KEYALL)
KEYWORD(__module_private__ , KEYALL)
UNARY_EXPR_OR_TYPE_TRAIT(__builtin_ptrauth_type_discriminator,
PtrAuthTypeDiscriminator, KEYALL)
+UNARY_EXPR_OR_TYPE_TRAIT(__builtin_ptrauth_has_authentication,
P
@@ -9619,6 +9620,65 @@ ObjCInterfaceDecl *ASTContext::getObjCProtocolDecl()
const {
return ObjCProtocolClassDecl;
}
+std::optional
+ASTContext::getExplicitOrImplicitPointerAuth(QualType T) {
+ auto ExplicitQualifier = T.getPointerAuth();
ojhunt wrote:
god
@@ -9619,6 +9620,65 @@ ObjCInterfaceDecl *ASTContext::getObjCProtocolDecl()
const {
return ObjCProtocolClassDecl;
}
+std::optional
+ASTContext::getExplicitOrImplicitPointerAuth(QualType T) {
+ auto ExplicitQualifier = T.getPointerAuth();
ojhunt wrote:
- [
@@ -3981,7 +3981,9 @@ class Parser : public CodeCompletionHandler {
ExprResult ParseArrayTypeTrait();
ExprResult ParseExpressionTrait();
+ ExprResult ParseBuiltinUnaryExprOrTypeTrait(UnaryExprOrTypeTrait ExprKind);
ojhunt wrote:
... if something like `Pa
@@ -9619,6 +9620,65 @@ ObjCInterfaceDecl *ASTContext::getObjCProtocolDecl()
const {
return ObjCProtocolClassDecl;
}
+std::optional
+ASTContext::getExplicitOrImplicitPointerAuth(QualType T) {
+ auto ExplicitQualifier = T.getPointerAuth();
+ if (ExplicitQualifier.isPresent(
@@ -3981,7 +3981,9 @@ class Parser : public CodeCompletionHandler {
ExprResult ParseArrayTypeTrait();
ExprResult ParseExpressionTrait();
+ ExprResult ParseBuiltinUnaryExprOrTypeTrait(UnaryExprOrTypeTrait ExprKind);
ojhunt wrote:
@cor3ntin @AaronBallman
@@ -9619,6 +9620,65 @@ ObjCInterfaceDecl *ASTContext::getObjCProtocolDecl()
const {
return ObjCProtocolClassDecl;
}
+std::optional
+ASTContext::getExplicitOrImplicitPointerAuth(QualType T) {
+ auto ExplicitQualifier = T.getPointerAuth();
+ if (ExplicitQualifier.isPresent(
@@ -1883,6 +1883,9 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args,
Args.addOptInFlag(
CmdArgs, options::OPT_fptrauth_function_pointer_type_discrimination,
options::OPT_fno_ptrauth_function_pointer_type_discrimination);
+ Args.addOptInFlag(
--
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -triple aarch64-linux-gnu -mbranch-target-enforce
-msign-return-address=all -emit-llvm %s -o - | FileCheck
--check-prefixes=CHECK,BTI-SIGNRA %s
ojhunt wrote:
none of the other ptrauth tests are in a subdirectory, are yo
ojhunt wrote:
Sorry, I missed this
Now that the ptrauth qualifier is available I'm going to be preparing and
pushing the darwin libunwind+personality function changes, which are very
aggressive in there protection of data and pointers
https://github.com/llvm/llvm-project/pull/113368
_
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/135562
>From 5dc1e5fbb57f88e412e044605d8fe30a66255a35 Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Sun, 13 Apr 2025 13:21:49 -0700
Subject: [PATCH 1/4] [clang][CGObjC] Sign the v-table pointer in ObjC
exception RTT
https://github.com/ojhunt edited
https://github.com/llvm/llvm-project/pull/140276
___
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/139790
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1883,6 +1883,9 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args,
Args.addOptInFlag(
CmdArgs, options::OPT_fptrauth_function_pointer_type_discrimination,
options::OPT_fno_ptrauth_function_pointer_type_discrimination);
+ Args.addOptInFlag(
--
https://github.com/ojhunt commented:
This basically looks good to me, sans the "can this just be on by default for
elf/linux/etc" question
https://github.com/llvm/llvm-project/pull/140276
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https:/
@@ -4451,6 +4451,8 @@ defm ptrauth_init_fini_address_discrimination :
OptInCC1FFlag<"ptrauth-init-fini
"Enable address discrimination of function pointers in init/fini arrays">;
defm ptrauth_elf_got : OptInCC1FFlag<"ptrauth-elf-got", "Enable authentication
of pointers from G
@@ -3074,6 +3074,39 @@ following way:
Query for this feature with ``__has_builtin(__builtin_offsetof)``.
+``__builtin_get_vtable_pointer``
+
+
+``__builtin_get_vtable_pointer`` loads and authenticates the primary vtable
+pointer from an instanc
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/139790
>From a933679801bde89b53584c4c65118658477db4da Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Tue, 13 May 2025 13:35:55 -0700
Subject: [PATCH 1/5] [clang][PAC] Add __builtin_get_vtable_pointer
With pointer aut
@@ -1825,6 +1825,37 @@ static ExprResult PointerAuthStringDiscriminator(Sema
&S, CallExpr *Call) {
return Call;
}
+static ExprResult GetVTablePointer(Sema &S, CallExpr *Call) {
+ if (S.checkArgCount(Call, 1))
+return ExprError();
+ ExprResult ThisArg = S.DefaultFuncti
ojhunt wrote:
The docs failure is #142387
https://github.com/llvm/llvm-project/pull/141148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ojhunt wrote:
this is tripping on CI and my machine.
To repro I need to delete `$BUILD_DIR/tools/clang/docs` and build with `TZ=UTC
ninja docs-clang-man`
I find it necessary to delete the doc directory to trigger this.
https://github.com/llvm/llvm-project/pull/142387
___
ojhunt wrote:
I can't reproduce this locally so I've ensured my tree is up to date and
pushing again to see if it fails again
https://github.com/llvm/llvm-project/pull/141148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.o
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/141148
>From 0db205bb8f6925dd725885395f58a688000c7b8b Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 22 May 2025 02:38:26 -0700
Subject: [PATCH 1/5] [clang] Correct FixIt ranges for unused capture warnings
Fixes
1 - 100 of 561 matches
Mail list logo