https://github.com/asl requested changes to this pull request.
Submit your PRs to `main` branch
https://github.com/llvm/llvm-project/pull/92871
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailm
@@ -1261,6 +1262,10 @@ class ASTContext : public RefCountedBase {
/// space.
QualType removeAddrSpaceQualType(QualType T) const;
+ /// Return the "other" type-specific discriminator for the given type.
asl wrote:
The comment here looks a bit misleading w
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-intrinsics -emit-llvm %s
-o - | FileCheck %s
asl wrote:
@kovdan01 If you're having a RUN line locally, can you just suggest a change
here?
https://github.com/llvm/llvm-project/pull/93904
_
https://github.com/asl commented:
See mostly code style nits above
https://github.com/llvm/llvm-project/pull/93903
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commi
https://github.com/asl edited https://github.com/llvm/llvm-project/pull/93903
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -2156,6 +2156,24 @@ static ExprResult PointerAuthAuthAndResign(Sema &S,
CallExpr *Call) {
return Call;
}
+static ExprResult PointerAuthStringDiscriminator(Sema &S, CallExpr *call) {
asl wrote:
```suggestion
static ExprResult PointerAuthStringDiscriminat
@@ -2156,6 +2156,24 @@ static ExprResult PointerAuthAuthAndResign(Sema &S,
CallExpr *Call) {
return Call;
}
+static ExprResult PointerAuthStringDiscriminator(Sema &S, CallExpr *call) {
+ if (checkPointerAuthEnabled(S, call)) return ExprError();
+
+ // We've already perfor
@@ -2156,6 +2156,24 @@ static ExprResult PointerAuthAuthAndResign(Sema &S,
CallExpr *Call) {
return Call;
}
+static ExprResult PointerAuthStringDiscriminator(Sema &S, CallExpr *call) {
+ if (checkPointerAuthEnabled(S, call)) return ExprError();
asl wrote:
@@ -2156,6 +2156,24 @@ static ExprResult PointerAuthAuthAndResign(Sema &S,
CallExpr *Call) {
return Call;
}
+static ExprResult PointerAuthStringDiscriminator(Sema &S, CallExpr *call) {
+ if (checkPointerAuthEnabled(S, call)) return ExprError();
+
+ // We've already perfor
@@ -2156,6 +2156,24 @@ static ExprResult PointerAuthAuthAndResign(Sema &S,
CallExpr *Call) {
return Call;
}
+static ExprResult PointerAuthStringDiscriminator(Sema &S, CallExpr *call) {
+ if (checkPointerAuthEnabled(S, call)) return ExprError();
+
+ // We've already perfor
@@ -2156,6 +2156,24 @@ static ExprResult PointerAuthAuthAndResign(Sema &S,
CallExpr *Call) {
return Call;
}
+static ExprResult PointerAuthStringDiscriminator(Sema &S, CallExpr *call) {
+ if (checkPointerAuthEnabled(S, call)) return ExprError();
+
+ // We've already perfor
@@ -2156,6 +2156,24 @@ static ExprResult PointerAuthAuthAndResign(Sema &S,
CallExpr *Call) {
return Call;
}
+static ExprResult PointerAuthStringDiscriminator(Sema &S, CallExpr *call) {
+ if (checkPointerAuthEnabled(S, call)) return ExprError();
+
+ // We've already perfor
@@ -2156,6 +2156,24 @@ static ExprResult PointerAuthAuthAndResign(Sema &S,
CallExpr *Call) {
return Call;
}
+static ExprResult PointerAuthStringDiscriminator(Sema &S, CallExpr *call) {
+ if (checkPointerAuthEnabled(S, call)) return ExprError();
+
+ // We've already perfor
@@ -2126,14 +2219,16 @@ static ExprResult PointerAuthSignGenericData(Sema &S,
CallExpr *Call) {
}
static ExprResult PointerAuthSignOrAuth(Sema &S, CallExpr *Call,
-PointerAuthOpKind OpKind) {
+Poi
https://github.com/asl edited https://github.com/llvm/llvm-project/pull/93904
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -2126,14 +2219,16 @@ static ExprResult PointerAuthSignGenericData(Sema &S,
CallExpr *Call) {
}
static ExprResult PointerAuthSignOrAuth(Sema &S, CallExpr *Call,
-PointerAuthOpKind OpKind) {
+Poi
@@ -1261,6 +1262,10 @@ class ASTContext : public RefCountedBase {
/// space.
QualType removeAddrSpaceQualType(QualType T) const;
+ /// Return the "other" type-specific discriminator for the given type.
asl wrote:
@ojhunt This looks much better, thanks!
https://github.com/asl approved this pull request.
https://github.com/llvm/llvm-project/pull/93902
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
asl wrote:
So, regarding big-endian things. Original siphash is always "little-endian"
regardless of the host platform. On big endian hosts it essentially does byte
swap in the end. We do not have it here, so we will end with different hashes
on platforms with different endianness.
>From the
@@ -15,6 +15,29 @@ typedef enum {
ptrauth_key_asib = 1,
ptrauth_key_asda = 2,
ptrauth_key_asdb = 3,
+
+#ifdef __APPLE__
asl wrote:
Looks like this is something from already merged commit. Worth rebasing?
https://github.com/llvm/llvm-project/pull/93903
_
@@ -47,6 +47,17 @@ void test_blend_discriminator(int *dp, int (*fp)(int), int
value) {
float *mismatch = __builtin_ptrauth_blend_discriminator(dp, value); //
expected-error {{incompatible integer to pointer conversion initializing 'float
*' with an expression of type}}
}
https://github.com/asl edited https://github.com/llvm/llvm-project/pull/93903
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -162,20 +162,27 @@ struct ThunkInfo {
/// Holds a pointer to the overridden method this thunk is for,
/// if needed by the ABI to distinguish different thunks with equal
- /// adjustments. Otherwise, null.
+ /// adjustments.
+ /// In the Itanium ABI, this field can h
@@ -3088,6 +3089,17 @@ QualType ASTContext::removeAddrSpaceQualType(QualType T)
const {
return QualType(TypeNode, Quals.getFastQualifiers());
}
+uint16_t ASTContext::getPointerAuthVTablePointerDiscriminator(
+const CXXRecordDecl *record) {
+ assert(record->isPolymorp
@@ -7037,8 +7036,64 @@ void ItaniumMangleContextImpl::mangleCXXDtorComdat(const
CXXDestructorDecl *D,
Mangler.mangle(GlobalDecl(D, Dtor_Comdat));
}
+static void mangleOverrideDiscrimination(CXXNameMangler &mangler,
+ ASTContext &conte
@@ -7064,21 +7119,29 @@ void ItaniumMangleContextImpl::mangleThunk(const
CXXMethodDecl *MD,
Thunk.Return.Virtual.Itanium.VBaseOffsetOffset);
Mangler.mangleFunctionEncoding(MD);
+ if (!elideOverrideInfo) {
+mangleOverrideDiscrimination(Mangl
https://github.com/asl edited https://github.com/llvm/llvm-project/pull/94056
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -3094,9 +3188,10 @@ void VFTableBuilder::AddMethods(BaseSubobject Base,
unsigned BaseDepth,
ReturnAdjustmentOffset.VirtualBase);
}
}
-
+auto thisType = (OverriddenMD ? OverriddenMD :
MD)->getThisType().getTypePtr();
---
@@ -3094,9 +3188,10 @@ void VFTableBuilder::AddMethods(BaseSubobject Base,
unsigned BaseDepth,
ReturnAdjustmentOffset.VirtualBase);
}
}
-
+auto thisType = (OverriddenMD ? OverriddenMD :
MD)->getThisType().getTypePtr();
Ad
@@ -2588,6 +2588,12 @@ void CodeGenFunction::InitializeVTablePointer(const VPtr
&Vptr) {
// the same addr space. Note that this might not be LLVM address space 0.
VTableField = VTableField.withElementType(PtrTy);
+ if (auto authenticationInfo = CGM.getVTablePointerAuthIn
https://github.com/asl edited https://github.com/llvm/llvm-project/pull/94056
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -2588,6 +2588,12 @@ void CodeGenFunction::InitializeVTablePointer(const VPtr
&Vptr) {
// the same addr space. Note that this might not be LLVM address space 0.
VTableField = VTableField.withElementType(PtrTy);
+ if (auto authenticationInfo = CGM.getVTablePointerAuthIn
@@ -2681,12 +2687,35 @@ void CodeGenFunction::InitializeVTablePointers(const
CXXRecordDecl *RD) {
llvm::Value *CodeGenFunction::GetVTablePtr(Address This,
llvm::Type *VTableTy,
- const CXXRec
@@ -2681,12 +2687,35 @@ void CodeGenFunction::InitializeVTablePointers(const
CXXRecordDecl *RD) {
llvm::Value *CodeGenFunction::GetVTablePtr(Address This,
llvm::Type *VTableTy,
- const CXXRec
@@ -2681,12 +2687,35 @@ void CodeGenFunction::InitializeVTablePointers(const
CXXRecordDecl *RD) {
llvm::Value *CodeGenFunction::GetVTablePtr(Address This,
llvm::Type *VTableTy,
- const CXXRec
@@ -2681,12 +2687,35 @@ void CodeGenFunction::InitializeVTablePointers(const
CXXRecordDecl *RD) {
llvm::Value *CodeGenFunction::GetVTablePtr(Address This,
llvm::Type *VTableTy,
- const CXXRec
@@ -2681,12 +2687,35 @@ void CodeGenFunction::InitializeVTablePointers(const
CXXRecordDecl *RD) {
llvm::Value *CodeGenFunction::GetVTablePtr(Address This,
llvm::Type *VTableTy,
- const CXXRec
@@ -803,6 +803,14 @@ bool ConstStructBuilder::Build(const APValue &Val, const
RecordDecl *RD,
llvm::Constant *VTableAddressPoint =
CGM.getCXXABI().getVTableAddressPoint(BaseSubobject(CD, Offset),
VTableClass);
+
@@ -803,6 +803,14 @@ bool ConstStructBuilder::Build(const APValue &Val, const
RecordDecl *RD,
llvm::Constant *VTableAddressPoint =
CGM.getCXXABI().getVTableAddressPoint(BaseSubobject(CD, Offset),
VTableClass);
+
@@ -23,11 +23,53 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/IR/ValueMap.h"
#include "llvm/Analysis/ValueTracking.h"
+#include "llvm/Support/SipHash.h"
#include
using namespace clang;
using namespace CodeGen;
+/// Given a pointer-authentication schema, return a con
@@ -90,6 +90,11 @@ CodeGenVTables::EmitVTTDefinition(llvm::GlobalVariable *VTT,
llvm::Constant *Init = llvm::ConstantExpr::getGetElementPtr(
VTable->getValueType(), VTable, Idxs, /*InBounds=*/true, InRange);
+ if (auto &schema =
asl wrote:
`
@@ -90,6 +90,11 @@ CodeGenVTables::EmitVTTDefinition(llvm::GlobalVariable *VTT,
llvm::Constant *Init = llvm::ConstantExpr::getGetElementPtr(
VTable->getValueType(), VTable, Idxs, /*InBounds=*/true, InRange);
+ if (auto &schema =
+ CGM.getCodeGenOp
@@ -219,8 +219,10 @@ CodeGenFunction::GenerateVarArgsThunk(llvm::Function *Fn,
"Store of this should be in entry block?");
// Adjust "this", if necessary.
Builder.SetInsertPoint(&*ThisStore);
- llvm::Value *AdjustedThisPtr =
- CGM.getCXXABI().performThisAdjus
@@ -219,8 +219,10 @@ CodeGenFunction::GenerateVarArgsThunk(llvm::Function *Fn,
"Store of this should be in entry block?");
// Adjust "this", if necessary.
Builder.SetInsertPoint(&*ThisStore);
- llvm::Value *AdjustedThisPtr =
- CGM.getCXXABI().performThisAdjus
@@ -307,10 +309,15 @@ void
CodeGenFunction::EmitCallAndReturnForThunk(llvm::FunctionCallee Callee,
const CXXMethodDecl *MD = cast(CurGD.getDecl());
// Adjust the 'this' pointer if necessary
+ const CXXRecordDecl *thisValueClass =
asl wrote:
```suggestio
@@ -307,10 +309,15 @@ void
CodeGenFunction::EmitCallAndReturnForThunk(llvm::FunctionCallee Callee,
const CXXMethodDecl *MD = cast(CurGD.getDecl());
// Adjust the 'this' pointer if necessary
+ const CXXRecordDecl *thisValueClass =
+ MD->getThisType()->getPointeeCXXRe
@@ -307,10 +309,15 @@ void
CodeGenFunction::EmitCallAndReturnForThunk(llvm::FunctionCallee Callee,
const CXXMethodDecl *MD = cast(CurGD.getDecl());
// Adjust the 'this' pointer if necessary
+ const CXXRecordDecl *thisValueClass =
+ MD->getThisType()->getPointeeCXXRe
@@ -841,6 +866,9 @@ void
CodeGenVTables::addVTableComponent(ConstantArrayBuilder &builder,
if (FnAS != GVAS)
fnPtr =
llvm::ConstantExpr::getAddrSpaceCast(fnPtr, CGM.GlobalsInt8PtrTy);
+ if (auto &schema =
asl wrote:
```suggestio
@@ -841,6 +866,9 @@ void
CodeGenVTables::addVTableComponent(ConstantArrayBuilder &builder,
if (FnAS != GVAS)
fnPtr =
llvm::ConstantExpr::getAddrSpaceCast(fnPtr, CGM.GlobalsInt8PtrTy);
+ if (auto &schema =
+ CGM.getCodeGenOpts().PointerAu
https://github.com/asl edited https://github.com/llvm/llvm-project/pull/94056
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -3063,3 +3063,66 @@ void CodeGenFunction::EmitPointerAuthOperandBundle(
llvm::Value *args[] = {key, discriminator};
bundles.emplace_back("ptrauth", args);
}
+
+static llvm::Value *EmitPointerAuthCommon(CodeGenFunction &CGF,
asl wrote:
ditto about code s
@@ -2456,10 +2456,20 @@ class CodeGenFunction : public CodeGenTypeCache {
void InitializeVTablePointers(const CXXRecordDecl *ClassDecl);
+ // VTableTrapMode - whether we guarantee that loading the
+ // vtable is guaranteed to trap on authentication failure,
+ // even if
@@ -4406,10 +4416,19 @@ class CodeGenFunction : public CodeGenTypeCache {
}
bool isPointerKnownNonNull(const Expr *E);
+
+ /// Create the discriminator from the storage address and the entity hash.
+ llvm::Value *EmitPointerAuthBlendDiscriminator(llvm::Value *storageAddr
@@ -4406,10 +4416,19 @@ class CodeGenFunction : public CodeGenTypeCache {
}
bool isPointerKnownNonNull(const Expr *E);
+
+ /// Create the discriminator from the storage address and the entity hash.
+ llvm::Value *EmitPointerAuthBlendDiscriminator(llvm::Value *storageAddr
asl wrote:
> @asl It would be nice if you submit the next round of review as a single
> review, instead of 29 individual comments.
Oh, strange. I thought it was a single review...
https://github.com/llvm/llvm-project/pull/94056
___
llvm-branch-commit
@@ -1,185 +1,149 @@
-/*
- SipHash reference C implementation
-
- Copyright (c) 2012-2022 Jean-Philippe Aumasson
-
- Copyright (c) 2012-2014 Daniel J. Bernstein
-
- To the extent possible under law, the author(s) have dedicated all copyright
- and related and neighbor
@@ -1,185 +1,149 @@
-/*
- SipHash reference C implementation
-
- Copyright (c) 2012-2022 Jean-Philippe Aumasson
-
- Copyright (c) 2012-2014 Daniel J. Bernstein
-
- To the extent possible under law, the author(s) have dedicated all copyright
- and related and neighbor
@@ -1,185 +1,149 @@
-/*
- SipHash reference C implementation
-
- Copyright (c) 2012-2022 Jean-Philippe Aumasson
-
- Copyright (c) 2012-2014 Daniel J. Bernstein
-
- To the extent possible under law, the author(s) have dedicated all copyright
- and related and neighbor
asl wrote:
@ahmedbougacha Anything left here? I think it is good to go after the two
changes mentioned above. We can deal with cross-endian things afterwards as
soon as we will have tests & buildbots
https://github.com/llvm/llvm-project/pull/94394
asl wrote:
@ahatanak Looks like there are some conflicts that should be resolved
https://github.com/llvm/llvm-project/pull/93906
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llv
asl wrote:
@kbeyls There are (some) tests in the follow-up commit
https://github.com/llvm/llvm-project/pull/93902/files#diff-8df159460fc7a128734566054df883f3192b1b261dc8eac667933b4042e9af5f
https://github.com/llvm/llvm-project/pull/94394
___
llvm-bran
https://github.com/asl approved this pull request.
+1
https://github.com/llvm/llvm-project/pull/94394
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/asl approved this pull request.
Thanks!
https://github.com/llvm/llvm-project/pull/94056
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -296,3 +296,21 @@
ConstantAggregateBuilderBase::finishStruct(llvm::StructType *ty) {
buffer.erase(buffer.begin() + Begin, buffer.end());
return constant;
}
+
asl wrote:
Yeah, LGTM!
https://github.com/llvm/llvm-project/pull/94056
__
https://github.com/asl approved this pull request.
https://github.com/llvm/llvm-project/pull/100484
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/asl approved this pull request.
https://github.com/llvm/llvm-project/pull/100716
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/asl approved this pull request.
https://github.com/llvm/llvm-project/pull/101044
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/asl approved this pull request.
https://github.com/llvm/llvm-project/pull/101043
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/asl approved this pull request.
This is one of two small frontend changes require to close the chain of changes
required for end-to-end support of pointer authentication in LLVM 19.
The change does not affect any other target and essentially just propagate
command line optio
Should be there - I kicked the updates for all the repos.
Note that in general the branches will be created with the first
commit to trunk after the branch point.
On Mon, Jul 18, 2016 at 9:32 PM, Anton Korobeynikov
wrote:
> Yep, doing this right now :)
>
> On Mon, Jul 18, 2016 at 9:29 PM, Hans W
Yep, doing this right now :)
On Mon, Jul 18, 2016 at 9:29 PM, Hans Wennborg wrote:
> Hi Anton,
>
> On Mon, Jul 18, 2016 at 10:52 AM, Hans Wennborg via
> llvm-branch-commits wrote:
>> Author: hans
>> Date: Mon Jul 18 12:52:41 2016
>> New Revision: 275828
>>
>> URL: http://llvm.org/viewvc/llvm-pro
Sure, will do.
On Thu, Jan 12, 2017 at 3:13 PM, Hans Wennborg wrote:
> Hi Anton,
>
> On Thu, Jan 12, 2017 at 1:25 PM, Hans Wennborg via llvm-branch-commits
> wrote:
>> Author: hans
>> Date: Thu Jan 12 15:25:21 2017
>> New Revision: 291816
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=291816
Should appear after first commit.
On Thu, Jan 12, 2017 at 3:22 PM, Anton Korobeynikov
wrote:
> Sure, will do.
>
> On Thu, Jan 12, 2017 at 3:13 PM, Hans Wennborg wrote:
>> Hi Anton,
>>
>> On Thu, Jan 12, 2017 at 1:25 PM, Hans Wennborg via llvm-branch-commits
>> wrote:
>>> Author: hans
>>> Date:
https://github.com/asl approved this pull request.
This is the second change similar to
https://github.com/llvm/llvm-project/pull/102670
It is a small frontend change require to close the chain of changes required
for end-to-end support of pointer authentication in LLVM 19.
The change does no
https://github.com/asl created https://github.com/llvm/llvm-project/pull/104657
None
>From 0232f080dce628f473d9ceae599109fe2be0fa11 Mon Sep 17 00:00:00 2001
From: Anton Korobeynikov
Date: Fri, 16 Aug 2024 18:09:53 -0700
Subject: [PATCH] Add some brief LLVM 19 release notes for Pointer
Authenti
asl wrote:
Feel free to add more, I decided to go brief as the documentation is not there
yet.
Thanks!
https://github.com/llvm/llvm-project/pull/104657
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi
https://github.com/asl updated https://github.com/llvm/llvm-project/pull/104657
>From 92c76c04d8a3142ee569fcd705df08e566402b1d Mon Sep 17 00:00:00 2001
From: Anton Korobeynikov
Date: Fri, 16 Aug 2024 18:09:53 -0700
Subject: [PATCH] Add some brief LLVM 19 release notes for Pointer
Authentication
https://github.com/asl updated https://github.com/llvm/llvm-project/pull/104657
>From a01e5a8d95e48bd195b471ae2e5416531c37663d Mon Sep 17 00:00:00 2001
From: Anton Korobeynikov
Date: Fri, 16 Aug 2024 18:09:53 -0700
Subject: [PATCH] Add some brief LLVM 19 release notes for Pointer
Authentication
https://github.com/asl updated https://github.com/llvm/llvm-project/pull/104657
>From 4b6c656ca145e15ee59b16c5adb974b4767ec585 Mon Sep 17 00:00:00 2001
From: Anton Korobeynikov
Date: Fri, 16 Aug 2024 18:09:53 -0700
Subject: [PATCH] Add some brief LLVM 19 release notes for Pointer
Authentication
79 matches
Mail list logo