https://github.com/kovdan01 updated
https://github.com/llvm/llvm-project/pull/85235
>From 919af72c09216838bfe586c3da503f5d74104a7d Mon Sep 17 00:00:00 2001
From: Daniil Kovalev
Date: Tue, 19 Mar 2024 23:57:06 +0300
Subject: [PATCH 1/8] [PAC][clang] Define ptrauth driver flags and preprocessor
@@ -0,0 +1,59 @@
+// RUN: %clang --target=aarch64-linux -S -emit-llvm -o - \
kovdan01 wrote:
Fixed, thanks, see fdb26a14024f5f8297480a74982a37ee988cd30f
https://github.com/llvm/llvm-project/pull/85235
___
cfe-commits m
https://github.com/kovdan01 closed
https://github.com/llvm/llvm-project/pull/84384
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kovdan01 created
https://github.com/llvm/llvm-project/pull/90329
After #84384, `Qualifiers::Mask` becomes 64-bit. So, operations like `Mask &=
~U32` where `U32` is `unsigned` produce undesirable results since higher 32
bits of `Mask` become zeroed while they should be preser
https://github.com/kovdan01 ready_for_review
https://github.com/llvm/llvm-project/pull/90329
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
kovdan01 wrote:
@AaronBallman Please let me know if you have some comments on this or if can be
merged
https://github.com/llvm/llvm-project/pull/90329
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listi
kovdan01 wrote:
@cor3ntin Thanks for feedback! I'll merge it myself
https://github.com/llvm/llvm-project/pull/90329
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kovdan01 closed
https://github.com/llvm/llvm-project/pull/90329
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
kovdan01 wrote:
@MaskRay I've addressed your latest comments in
fdb26a14024f5f8297480a74982a37ee988cd30f - would be glad to see your feedback
on the changes
https://github.com/llvm/llvm-project/pull/85235
___
cfe-commits mailing list
cfe-commits@list
kovdan01 wrote:
Thanks @smithp35 for a detailed description!
> Use the environment part of the triple
I suppose we should use this this option since it's harder for end users to use
that incorrectly - it looks like that many real-world code and corresponding
build environments rely on triple
kovdan01 wrote:
Ping: would be glad to see feedback on the changes from those who are
interested.
https://github.com/llvm/llvm-project/pull/96478
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/c
kovdan01 wrote:
Ping: would be glad to see feedback on the changes from those who are
interested.
https://github.com/llvm/llvm-project/pull/96160
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/c
kovdan01 wrote:
@ahatanak It would be nice if you explicitly mention the flag name
`-fptrauth-function-pointer-type-discrimination` in commit message - I think it
might be useful when grepping output of git log.
https://github.com/llvm/llvm-project/pull/96992
__
https://github.com/kovdan01 updated
https://github.com/llvm/llvm-project/pull/97237
>From 3b4b1b1739b810d758e68f30c48b648963cff740 Mon Sep 17 00:00:00 2001
From: Daniil Kovalev
Date: Mon, 1 Jul 2024 00:50:21 +0300
Subject: [PATCH 1/6] [PAC][Driver] Implement `-mbranch-protection=pauthabi`
opti
https://github.com/kovdan01 updated
https://github.com/llvm/llvm-project/pull/97237
>From 3b4b1b1739b810d758e68f30c48b648963cff740 Mon Sep 17 00:00:00 2001
From: Daniil Kovalev
Date: Mon, 1 Jul 2024 00:50:21 +0300
Subject: [PATCH 1/6] [PAC][Driver] Implement `-mbranch-protection=pauthabi`
opti
https://github.com/kovdan01 edited
https://github.com/llvm/llvm-project/pull/97237
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kovdan01 edited
https://github.com/llvm/llvm-project/pull/97237
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kovdan01 closed
https://github.com/llvm/llvm-project/pull/97237
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kovdan01 reopened
https://github.com/llvm/llvm-project/pull/97237
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
kovdan01 wrote:
@smithp35 I've implemented `pauthtest` ABI support - see new PR description for
details and tests for examples. I'm not sure if the implementation is nice and
maybe I've put some logic in wrong places while there are better ones, but the
result looks matching the requirements d
https://github.com/kovdan01 created
https://github.com/llvm/llvm-project/pull/98862
Test one feature at a time to make RUN lines shorter. See also
https://github.com/llvm/llvm-project/pull/96992#discussion_r1669394582
>From 9436a51f2545434da511c4421099f7501a5472c5 Mon Sep 17 00:00:00 2001
From
https://github.com/kovdan01 ready_for_review
https://github.com/llvm/llvm-project/pull/98862
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -165,6 +166,88 @@ CGPointerAuthInfo
CodeGenModule::getPointerAuthInfoForType(QualType T) {
return ::getPointerAuthInfoForType(*this, T);
}
+static bool isZeroConstant(llvm::Value *value) {
+ if (auto ci = dyn_cast(value))
+return ci->isZero();
+ return false;
+}
+
@@ -195,34 +195,45 @@ CodeGenFunction::CGFPOptionsRAII::~CGFPOptionsRAII() {
CGF.Builder.setDefaultConstrainedRounding(OldRounding);
}
-static LValue MakeNaturalAlignAddrLValue(llvm::Value *V, QualType T,
- bool ForPointeeType,
-
@@ -0,0 +1,77 @@
+// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple
arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - |
FileCheck -check-prefix=CHECK -check-prefix=NOPCH %s
kovdan01 wrote:
Nit: maybe use `-check-pr
@@ -3126,3 +3137,57 @@ CodeGenFunction::EmitPointerAuthAuth(const
CGPointerAuthInfo &PointerAuth,
return EmitPointerAuthCommon(*this, PointerAuth, Pointer,
llvm::Intrinsic::ptrauth_auth);
}
+
+llvm::Value *CodeGenFunction::EmitPointerAuthSign(Q
https://github.com/kovdan01 commented:
I've left a bunch of mostly cosmetic comments and minor nits which are
non-blocking in terms of merging that. However, I'll take another look at this
"with fresh eyes" within a day - I need a bit more time to drill into actual
logic.
https://github.com/l
@@ -3126,3 +3137,57 @@ CodeGenFunction::EmitPointerAuthAuth(const
CGPointerAuthInfo &PointerAuth,
return EmitPointerAuthCommon(*this, PointerAuth, Pointer,
llvm::Intrinsic::ptrauth_auth);
}
+
+llvm::Value *CodeGenFunction::EmitPointerAuthSign(Q
@@ -165,6 +166,88 @@ CGPointerAuthInfo
CodeGenModule::getPointerAuthInfoForType(QualType T) {
return ::getPointerAuthInfoForType(*this, T);
}
+static bool isZeroConstant(llvm::Value *value) {
+ if (auto ci = dyn_cast(value))
+return ci->isZero();
+ return false;
+}
+
@@ -3126,3 +3137,57 @@ CodeGenFunction::EmitPointerAuthAuth(const
CGPointerAuthInfo &PointerAuth,
return EmitPointerAuthCommon(*this, PointerAuth, Pointer,
llvm::Intrinsic::ptrauth_auth);
}
+
+llvm::Value *CodeGenFunction::EmitPointerAuthSign(Q
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 %s -triple arm64e-apple-ios13 -fptrauth-calls
-fptrauth-intrinsics -emit-llvm -o-
-fptrauth-function-pointer-type-discrimination | FileCheck %s
+
+typedef void (*fptr_t)(void);
+
+char *cptr;
+void (*fptr)(void);
+
+// CHECK-LABEL: define vo
@@ -351,3 +434,125 @@ CodeGenModule::getVTablePointerAuthInfo(CodeGenFunction
*CGF,
/* IsIsaPointer */ false,
/* AuthenticatesNullValues */ false, Discriminator);
}
+
+llvm::Value *CodeGenFunction::AuthPointerToPointerCast(
https://github.com/kovdan01 edited
https://github.com/llvm/llvm-project/pull/98847
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3126,3 +3137,57 @@ CodeGenFunction::EmitPointerAuthAuth(const
CGPointerAuthInfo &PointerAuth,
return EmitPointerAuthCommon(*this, PointerAuth, Pointer,
llvm::Intrinsic::ptrauth_auth);
}
+
+llvm::Value *CodeGenFunction::EmitPointerAuthSign(Q
kovdan01 wrote:
Could you please clarify what tests should go to ptrauth.c? The test name is
very generic, and we have more than 10 tests with clang/test/CodeGen/ptrauth*.c
names. Maybe this should be renamed to smth more specific?
https://github.com/llvm/llv
@@ -190,8 +190,8 @@ class CGBuilderTy : public CGBuilderBaseTy {
const llvm::Twine &Name = "") {
if (!Addr.hasOffset())
return Address(CreateAddrSpaceCast(Addr.getBasePointer(), Ty, Name),
- ElementTy, Addr.getAlignmen
@@ -165,6 +166,88 @@ CGPointerAuthInfo
CodeGenModule::getPointerAuthInfoForType(QualType T) {
return ::getPointerAuthInfoForType(*this, T);
}
+static bool isZeroConstant(llvm::Value *value) {
+ if (auto ci = dyn_cast(value))
+return ci->isZero();
+ return false;
+}
+
@@ -165,6 +166,88 @@ CGPointerAuthInfo
CodeGenModule::getPointerAuthInfoForType(QualType T) {
return ::getPointerAuthInfoForType(*this, T);
}
+static bool isZeroConstant(llvm::Value *value) {
+ if (auto ci = dyn_cast(value))
+return ci->isZero();
+ return false;
+}
+
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 %s -triple arm64e-apple-ios13 -fptrauth-calls
-fptrauth-intrinsics -emit-llvm -o-
-fptrauth-function-pointer-type-discrimination | FileCheck %s
kovdan01 wrote:
Nit: it would also be nice to have RUN lines against linux trip
@@ -0,0 +1,77 @@
+// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple
arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - |
FileCheck -check-prefix=CHECK -check-prefix=NOPCH %s
+// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrim
@@ -0,0 +1,77 @@
+// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple
arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - |
FileCheck -check-prefix=CHECK -check-prefix=NOPCH %s
kovdan01 wrote:
Nit: long RUN lines shoul
@@ -165,6 +166,88 @@ CGPointerAuthInfo
CodeGenModule::getPointerAuthInfoForType(QualType T) {
return ::getPointerAuthInfoForType(*this, T);
}
+static bool isZeroConstant(llvm::Value *value) {
+ if (auto ci = dyn_cast(value))
+return ci->isZero();
+ return false;
+}
+
@@ -165,6 +166,88 @@ CGPointerAuthInfo
CodeGenModule::getPointerAuthInfoForType(QualType T) {
return ::getPointerAuthInfoForType(*this, T);
}
+static bool isZeroConstant(llvm::Value *value) {
+ if (auto ci = dyn_cast(value))
kovdan01 wrote:
Nit
```suggest
@@ -3126,3 +3137,57 @@ CodeGenFunction::EmitPointerAuthAuth(const
CGPointerAuthInfo &PointerAuth,
return EmitPointerAuthCommon(*this, PointerAuth, Pointer,
llvm::Intrinsic::ptrauth_auth);
}
+
+llvm::Value *CodeGenFunction::EmitPointerAuthSign(Q
@@ -165,6 +166,88 @@ CGPointerAuthInfo
CodeGenModule::getPointerAuthInfoForType(QualType T) {
return ::getPointerAuthInfoForType(*this, T);
}
+static bool isZeroConstant(llvm::Value *value) {
+ if (auto ci = dyn_cast(value))
+return ci->isZero();
+ return false;
+}
+
@@ -3126,3 +3137,57 @@ CodeGenFunction::EmitPointerAuthAuth(const
CGPointerAuthInfo &PointerAuth,
return EmitPointerAuthCommon(*this, PointerAuth, Pointer,
llvm::Intrinsic::ptrauth_auth);
}
+
+llvm::Value *CodeGenFunction::EmitPointerAuthSign(Q
https://github.com/kovdan01 edited
https://github.com/llvm/llvm-project/pull/98847
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kovdan01 closed
https://github.com/llvm/llvm-project/pull/98862
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1,5 +1,37 @@
+// RUN: %clang -### -c --target=aarch64 %s 2>&1 | FileCheck %s --check-prefix
NONE
+// NONE: "-cc1"
+// NONE-NOT: "-fptrauth-
+
// RUN: %clang -### -c --target=aarch64 -fno-ptrauth-intrinsics
-fptrauth-intrinsics %s 2>&1 | FileCheck %s --check-prefix=INTRIN
/
https://github.com/kovdan01 updated
https://github.com/llvm/llvm-project/pull/85235
>From 919af72c09216838bfe586c3da503f5d74104a7d Mon Sep 17 00:00:00 2001
From: Daniil Kovalev
Date: Tue, 19 Mar 2024 23:57:06 +0300
Subject: [PATCH 1/9] [PAC][clang] Define ptrauth driver flags and preprocessor
@@ -1,5 +1,37 @@
+// RUN: %clang -### -c --target=aarch64 %s 2>&1 | FileCheck %s --check-prefix
NONE
+// NONE: "-cc1"
+// NONE-NOT: "-fptrauth-
+
// RUN: %clang -### -c --target=aarch64 -fno-ptrauth-intrinsics
-fptrauth-intrinsics %s 2>&1 | FileCheck %s --check-prefix=INTRIN
/
@@ -1796,6 +1796,26 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args,
Args.addOptInFlag(CmdArgs, options::OPT_fptrauth_intrinsics,
options::OPT_fno_ptrauth_intrinsics);
+
kovdan01 wrote:
Deleted, see b0f9a1985846448d01af9bacdb6e3d
kovdan01 wrote:
@MaskRay Please let me know if you have some additional feedback after the
latest updates b0f9a1985846448d01af9bacdb6e3ddb23d4588f or if this can be
merged.
https://github.com/llvm/llvm-project/pull/85235
___
cfe-commits mailing list
@@ -1190,6 +1191,36 @@ void CodeGenModule::Release() {
if (!LangOpts.isSignReturnAddressWithAKey())
getModule().addModuleFlag(llvm::Module::Min,
"sign-return-address-with-bkey", 1);
+
+if (getTriple().isOSLinux() && getTriple().isOS
https://github.com/kovdan01 updated
https://github.com/llvm/llvm-project/pull/85235
>From 919af72c09216838bfe586c3da503f5d74104a7d Mon Sep 17 00:00:00 2001
From: Daniil Kovalev
Date: Tue, 19 Mar 2024 23:57:06 +0300
Subject: [PATCH 01/10] [PAC][clang] Define ptrauth driver flags and
preprocesso
https://github.com/kovdan01 edited
https://github.com/llvm/llvm-project/pull/85235
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,59 @@
+// RUN: %clang_cc1 -triple aarch64-linux -S -emit-llvm -o - \
kovdan01 wrote:
Fixed, thanks, see 37a4d9d08fefd8c42c21b92ad2e3c1fa07fac126
https://github.com/llvm/llvm-project/pull/85235
___
cfe-commit
https://github.com/kovdan01 closed
https://github.com/llvm/llvm-project/pull/85235
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,87 @@
+// RUN: %clang_cc1 -DENABLE_TID=0 -I%S -std=c++11 -triple=arm64e-apple-darwin \
+// RUN: -fptrauth-calls -fptrauth-intrinsics \
+// RUN: -fptrauth-vtable-pointer-type-discrimination \
+// RUN: -fptrauth-vtable-pointer-address-discrimination \
+// RUN: %s
https://github.com/kovdan01 updated
https://github.com/llvm/llvm-project/pull/96160
>From f891f791dfe882389d83d3c4c4fb57d67a845c04 Mon Sep 17 00:00:00 2001
From: Daniil Kovalev
Date: Tue, 18 Jun 2024 15:38:18 +0300
Subject: [PATCH 1/3] [PAC][clang][Driver] Add signed GOT flag
Add `-fptrauth-el
https://github.com/kovdan01 updated
https://github.com/llvm/llvm-project/pull/96478
>From 5399237a71c0ccd872821034d83ea2c3a04bed3f Mon Sep 17 00:00:00 2001
From: Daniil Kovalev
Date: Fri, 21 Jun 2024 12:32:51 +0300
Subject: [PATCH 1/7] [PAC][AArch64] Support init/fini array signing
If both `-f
kovdan01 wrote:
Ping: would be glad to see feedback on the changes from those who are
interested.
https://github.com/llvm/llvm-project/pull/96478
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/c
@@ -2196,6 +2196,58 @@ 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 *
@@ -956,6 +956,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
@@ -166,6 +193,92 @@ CGPointerAuthInfo
CodeGenModule::getPointerAuthInfoForType(QualType T) {
return ::getPointerAuthInfoForType(*this, T);
}
+static std::pair
+emitLoadOfOrigPointerRValue(CodeGenFunction &CGF, const LValue &LV,
+SourceLocation L
@@ -2190,6 +2198,15 @@ RValue CodeGenFunction::EmitLoadOfAnyValue(LValue LV,
AggValueSlot Slot,
/// method emits the address of the lvalue, then loads the result as an rvalue,
/// returning the rvalue.
RValue CodeGenFunction::EmitLoadOfLValue(LValue LV, SourceLocation Loc) {
+
@@ -2196,6 +2196,58 @@ 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 *
@@ -166,6 +193,92 @@ CGPointerAuthInfo
CodeGenModule::getPointerAuthInfoForType(QualType T) {
return ::getPointerAuthInfoForType(*this, T);
}
+static std::pair
+emitLoadOfOrigPointerRValue(CodeGenFunction &CGF, const LValue &LV,
+SourceLocation L
@@ -2196,6 +2196,58 @@ 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 *
@@ -1460,6 +1467,12 @@ class QualType {
return getQualifiers().getPointerAuth();
}
+ bool hasAddressDiscriminatedPointerAuth() const {
+if (PointerAuthQualifier ptrauth = getPointerAuth())
kovdan01 wrote:
Nit
```suggestion
if (PointerAuthQuali
@@ -166,6 +193,92 @@ CGPointerAuthInfo
CodeGenModule::getPointerAuthInfoForType(QualType T) {
return ::getPointerAuthInfoForType(*this, T);
}
+static std::pair
+emitLoadOfOrigPointerRValue(CodeGenFunction &CGF, const LValue &LV,
+SourceLocation L
@@ -166,6 +193,92 @@ CGPointerAuthInfo
CodeGenModule::getPointerAuthInfoForType(QualType T) {
return ::getPointerAuthInfoForType(*this, T);
}
+static std::pair
+emitLoadOfOrigPointerRValue(CodeGenFunction &CGF, const LValue &LV,
+SourceLocation L
kovdan01 wrote:
Submitted an issue #101716 describing incorrect behavior in terms of address
discrimination (see also comments above)
https://github.com/llvm/llvm-project/pull/99726
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists
@@ -0,0 +1,132 @@
+// RUN: %clang_cc1 %s -fptrauth-function-pointer-type-discrimination
-triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics
-disable-llvm-passes -emit-llvm -o- | FileCheck %s
kovdan01 wrote:
Nit: it looks like you can use arm64
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios \
+// RUN: -fptrauth-calls -fptrauth-intrinsics -emit-llvm -fblocks \
+// RUN: %s -debug-info-kind=limited -o - | FileCheck %s
+
+// Constant initializers for data pointers.
+extern int external_int;
+
+int *__ptraut
@@ -0,0 +1,132 @@
+// RUN: %clang_cc1 %s -fptrauth-function-pointer-type-discrimination
-triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics
-disable-llvm-passes -emit-llvm -o- | FileCheck %s
kovdan01 wrote:
Nit: it's probably worth to also hav
@@ -0,0 +1,87 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls
-fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s
+
+#include
+
+// Constant initializers for data pointers.
+extern int external_int;
+
+// CHECK: @g1 = global ptr ptrauth (ptr @external_int, i32
@@ -,6 +5579,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) {
+
@@ -1758,6 +1758,34 @@ Also see the documentation for `@available
}];
}
+def PtrAuthDocs : Documentation {
+ let Category = DocCatVariable;
+ let Heading = "__ptrauth, __ptrauth_restricted_intptr";
+ let Content = [{
+The ``__ptrauth`` qualifier allows the programmer to d
@@ -0,0 +1,84 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify
-fptrauth-intrinsics %s
+
+#include
+
+#if __has_feature(ptrauth_qualifier)
+#warning __ptrauth qualifier enabled!
+// expected-warning@-1 {{__ptrauth qualifier enabled!}}
+#endif
+
+#if __aarch64
@@ -2196,6 +2196,58 @@ 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 *
@@ -2196,6 +2196,58 @@ 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 *
@@ -0,0 +1,84 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify
-fptrauth-intrinsics %s
+
+#include
+
+#if __has_feature(ptrauth_qualifier)
+#warning __ptrauth qualifier enabled!
+// expected-warning@-1 {{__ptrauth qualifier enabled!}}
+#endif
+
+#if __aarch64
@@ -0,0 +1,84 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify
-fptrauth-intrinsics %s
+
+#include
kovdan01 wrote:
It looks like this include is not needed
https://github.com/llvm/llvm-project/pull/100830
___
@@ -2196,6 +2196,58 @@ 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 *
@@ -2196,6 +2196,58 @@ 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 *
@@ -8210,6 +8228,70 @@ static void HandleNeonVectorTypeAttr(QualType &CurType,
const ParsedAttr &Attr,
CurType = S.Context.getVectorType(CurType, numElts, VecKind);
}
+/// Handle the __ptrauth qualifier.
+static void HandlePtrAuthQualifier(ASTContext &Ctx, QualType &T,
+
kovdan01 wrote:
Ping: this PR blocks merging already approved #96159 (see
https://github.com/llvm/llvm-project/pull/96159#issuecomment-2211411440), which
transitively also blocks merging already approved dependent #96164.
Would be glad to see feedback on the changes from those who are interest
https://github.com/kovdan01 closed
https://github.com/llvm/llvm-project/pull/96478
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kovdan01 updated
https://github.com/llvm/llvm-project/pull/96159
>From 4eeb1b4e82941681b6cafda8579d136e3e7cb09f Mon Sep 17 00:00:00 2001
From: Daniil Kovalev
Date: Tue, 18 Jun 2024 15:37:18 +0300
Subject: [PATCH 1/3] [PAC][ELF][AArch64] Encode signed GOT flag in PAuth core
i
https://github.com/kovdan01 updated
https://github.com/llvm/llvm-project/pull/96159
>From 4eeb1b4e82941681b6cafda8579d136e3e7cb09f Mon Sep 17 00:00:00 2001
From: Daniil Kovalev
Date: Tue, 18 Jun 2024 15:37:18 +0300
Subject: [PATCH 1/4] [PAC][ELF][AArch64] Encode signed GOT flag in PAuth core
i
kovdan01 wrote:
@piotrAMD It looks like that `__has_feature` preprocessor directive support was
implemented in gcc only in 2023:
https://github.com/gcc-mirror/gcc/commit/06280a906cb3dc80cf5e07cf3335b758848d488d
Thanks for reporting. I suppose we can just surround this chunk of code with
`#ifd
kovdan01 wrote:
@piotrAMD Submitted #102154 with a fix. Could you please check if it resolves
the issue for you?
https://github.com/llvm/llvm-project/pull/96478
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mai
https://github.com/kovdan01 edited
https://github.com/llvm/llvm-project/pull/96159
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kovdan01 closed
https://github.com/llvm/llvm-project/pull/96159
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kovdan01 updated
https://github.com/llvm/llvm-project/pull/96160
>From 1ca6cf823585b03a6c580b23caafd1ff44d83aa7 Mon Sep 17 00:00:00 2001
From: Daniil Kovalev
Date: Tue, 6 Aug 2024 20:02:07 +0300
Subject: [PATCH] [PAC][clang][Driver] Add signed GOT flag
Depends on #96159
Add
https://github.com/kovdan01 updated
https://github.com/llvm/llvm-project/pull/96160
>From 1ca6cf823585b03a6c580b23caafd1ff44d83aa7 Mon Sep 17 00:00:00 2001
From: Daniil Kovalev
Date: Tue, 6 Aug 2024 20:02:07 +0300
Subject: [PATCH 1/2] [PAC][clang][Driver] Add signed GOT flag
Depends on #96159
https://github.com/kovdan01 created
https://github.com/llvm/llvm-project/pull/102199
In #99726, `-fptrauth-type-info-vtable-pointer-discrimination` was introduced,
which is intended to enable type and address discrimination for type_info
vtable pointers. However, some codegen logic for actuall
kovdan01 wrote:
Also tagging @ojhunt (GitHub still does not let to add as a reviewer)
https://github.com/llvm/llvm-project/pull/102199
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kovdan01 ready_for_review
https://github.com/llvm/llvm-project/pull/102199
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
201 - 300 of 410 matches
Mail list logo