bwendling wrote:
@erichkeane If the Arm attribute code were merged into `ExtraAttributeInfo`, it
would save us a bit in `FunctionTypeExtraBitfields`.
I can add more testing I suppose, but the tests I have here are a copy of the
current CFI tests, which test all of the ways CFI is used. So I'm
bwendling wrote:
@AaronBallman I know of no other CFI attribute requests. (But keep in mind that
I'm not the CFI expert I play on TV.)
https://github.com/llvm/llvm-project/pull/141846
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lis
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/141846
>From bfdf16cee252dc6491f15c0715c7a39538fbf120 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 23 Apr 2025 13:14:24 -0700
Subject: [PATCH 1/2] [Clang][attr] Add cfi_salt attribute
The new 'cfi_salt' a
bwendling wrote:
I moved the `cfi_salt` into the `FunctionProtoType` fields. I left it open for
further additions. One bit of optimization I could do is merge the Arm stuff
into this new struct, but wanted to do something a bit less cluttered first.
https://github.com/llvm/llvm-project/pull/14
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/141846
>From bfdf16cee252dc6491f15c0715c7a39538fbf120 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 23 Apr 2025 13:14:24 -0700
Subject: [PATCH 1/2] [Clang][attr] Add cfi_salt attribute
The new 'cfi_salt' a
https://github.com/bwendling edited
https://github.com/llvm/llvm-project/pull/141846
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/141846
>From bfdf16cee252dc6491f15c0715c7a39538fbf120 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 23 Apr 2025 13:14:24 -0700
Subject: [PATCH 1/4] [Clang][attr] Add cfi_salt attribute
The new 'cfi_salt' a
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/141846
>From bfdf16cee252dc6491f15c0715c7a39538fbf120 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 23 Apr 2025 13:14:24 -0700
Subject: [PATCH 1/3] [Clang][attr] Add cfi_salt attribute
The new 'cfi_salt' a
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/141846
>From bfdf16cee252dc6491f15c0715c7a39538fbf120 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 23 Apr 2025 13:14:24 -0700
Subject: [PATCH 1/5] [Clang][attr] Add cfi_salt attribute
The new 'cfi_salt' a
@@ -3639,6 +3639,64 @@ make the function's CFI jump table canonical. See
:ref:`the CFI documentation
}];
}
+def CFISaltDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+Use ``__attribute__((cfi_salt("")))`` on a function declaration, function
---
@@ -3639,6 +3639,64 @@ make the function's CFI jump table canonical. See
:ref:`the CFI documentation
}];
}
+def CFISaltDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+Use ``__attribute__((cfi_salt("")))`` on a function declaration, function
---
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/141846
>From bfdf16cee252dc6491f15c0715c7a39538fbf120 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 23 Apr 2025 13:14:24 -0700
Subject: [PATCH 1/2] [Clang][attr] Add cfi_salt attribute
The new 'cfi_salt' a
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/141846
>From bfdf16cee252dc6491f15c0715c7a39538fbf120 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 23 Apr 2025 13:14:24 -0700
Subject: [PATCH 1/6] [Clang][attr] Add cfi_salt attribute
The new 'cfi_salt' a
@@ -0,0 +1,190 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fsanitize=kcfi
-o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fsanitize=kcfi
-x c++ -o - %s | FileCheck %s --check-prefixes=CHECK,MEMBER
+// RUN: %clang_cc
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -fsyntax-only -fsanitize=kcfi -verify %s
+
+#define __cfi_salt(S) __attribute__((cfi_salt(S)))
+
+int foo(int a, int b) __cfi_salt("pepper"); // ok
+int foo(int a, int b) __cfi_salt("pepper"); // ok
+
+typedef int (*bar_t)(void) __cfi_salt("pep
@@ -471,3 +471,80 @@ size_t test9(struct annotated_sized_ptr *p, int index) {
size_t test10(struct annotated_sized_ptr *p, int index) {
return __bdos(&((unsigned int *) p->buf)[index]);
}
+
+struct pr151236_struct {
+int *a __counted_by(a_count);
+short a_coun
https://github.com/bwendling created
https://github.com/llvm/llvm-project/pull/151266
Parentheses and no-op casts don't change the value. Skip past them to get to a
MemberExpr.
Fixes #151236
>From e3e6589b55127e78ecdc7fe5fcc01c93c8e48be2 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Tue
@@ -3929,6 +3929,14 @@ def CFICanonicalJumpTable : InheritableAttr {
let SimpleHandler = 1;
}
+def CFISalt : DeclOrTypeAttr {
+ let Spellings = [Clang<"cfi_salt">];
+ let Args = [StringArgument<"Salt">];
+ let Subjects = SubjectList<[Function, Field, Var, TypedefName], Er
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/141846
>From bfdf16cee252dc6491f15c0715c7a39538fbf120 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 23 Apr 2025 13:14:24 -0700
Subject: [PATCH 01/17] [Clang][attr] Add cfi_salt attribute
The new 'cfi_salt'
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/141846
>From bfdf16cee252dc6491f15c0715c7a39538fbf120 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 23 Apr 2025 13:14:24 -0700
Subject: [PATCH 01/13] [Clang][attr] Add cfi_salt attribute
The new 'cfi_salt'
@@ -3643,6 +3643,64 @@ make the function's CFI jump table canonical. See
:ref:`the CFI documentation
}];
}
+def KCFISaltDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+Use ``__attribute__((kcfi_salt("")))`` on a function declaration,
function
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/141846
>From bfdf16cee252dc6491f15c0715c7a39538fbf120 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 23 Apr 2025 13:14:24 -0700
Subject: [PATCH 01/15] [Clang][attr] Add cfi_salt attribute
The new 'cfi_salt'
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/141846
>From bfdf16cee252dc6491f15c0715c7a39538fbf120 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 23 Apr 2025 13:14:24 -0700
Subject: [PATCH 01/14] [Clang][attr] Add cfi_salt attribute
The new 'cfi_salt'
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/141846
>From bfdf16cee252dc6491f15c0715c7a39538fbf120 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 23 Apr 2025 13:14:24 -0700
Subject: [PATCH 01/12] [Clang][attr] Add cfi_salt attribute
The new 'cfi_salt'
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -fsyntax-only -fsanitize=kcfi -verify %s
+
+#define __cfi_salt(S) __attribute__((cfi_salt(S)))
+
+int foo(int a, int b) __cfi_salt("pepper"); // ok
+int foo(int a, int b) __cfi_salt("pepper"); // ok
+
+typedef int (*bar_t)(void) __cfi_salt("pep
@@ -3929,6 +3929,14 @@ def CFICanonicalJumpTable : InheritableAttr {
let SimpleHandler = 1;
}
+def CFISalt : DeclOrTypeAttr {
+ let Spellings = [Clang<"cfi_salt">];
+ let Args = [StringArgument<"Salt">];
+ let Subjects = SubjectList<[Function, Field, Var, TypedefName], Er
https://github.com/bwendling edited
https://github.com/llvm/llvm-project/pull/141846
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/141846
>From bfdf16cee252dc6491f15c0715c7a39538fbf120 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 23 Apr 2025 13:14:24 -0700
Subject: [PATCH 01/16] [Clang][attr] Add cfi_salt attribute
The new 'cfi_salt'
@@ -471,3 +471,80 @@ size_t test9(struct annotated_sized_ptr *p, int index) {
size_t test10(struct annotated_sized_ptr *p, int index) {
return __bdos(&((unsigned int *) p->buf)[index]);
}
+
+struct pr151236_struct {
+int *a __counted_by(a_count);
+short a_coun
701 - 729 of 729 matches
Mail list logo