[clang] [Clang][attr] Add cfi_salt attribute (PR #141846)

2025-06-05 Thread Bill Wendling via cfe-commits
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

[clang] [Clang][attr] Add cfi_salt attribute (PR #141846)

2025-06-09 Thread Bill Wendling via cfe-commits
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

[clang] [Clang][attr] Add cfi_salt attribute (PR #141846)

2025-06-04 Thread Bill Wendling via 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/2] [Clang][attr] Add cfi_salt attribute The new 'cfi_salt' a

[clang] [Clang][attr] Add cfi_salt attribute (PR #141846)

2025-06-04 Thread Bill Wendling via cfe-commits
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

[clang] [Clang][attr] Add cfi_salt attribute (PR #141846)

2025-06-04 Thread Bill Wendling via 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/2] [Clang][attr] Add cfi_salt attribute The new 'cfi_salt' a

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-07-09 Thread Bill Wendling via cfe-commits
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

[clang] [Clang][attr] Add cfi_salt attribute (PR #141846)

2025-07-08 Thread Bill Wendling via 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

[clang] [Clang][attr] Add cfi_salt attribute (PR #141846)

2025-07-08 Thread Bill Wendling via 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/3] [Clang][attr] Add cfi_salt attribute The new 'cfi_salt' a

[clang] [Clang][attr] Add cfi_salt attribute (PR #141846)

2025-07-08 Thread Bill Wendling via 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/5] [Clang][attr] Add cfi_salt attribute The new 'cfi_salt' a

[clang] [Clang][attr] Add cfi_salt attribute (PR #141846)

2025-07-01 Thread Bill Wendling via cfe-commits
@@ -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 ---

[clang] [Clang][attr] Add cfi_salt attribute (PR #141846)

2025-06-30 Thread Bill Wendling via cfe-commits
@@ -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 ---

[clang] [Clang][attr] Add cfi_salt attribute (PR #141846)

2025-07-02 Thread Bill Wendling via 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/2] [Clang][attr] Add cfi_salt attribute The new 'cfi_salt' a

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-07-17 Thread Bill Wendling via 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/6] [Clang][attr] Add cfi_salt attribute The new 'cfi_salt' a

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-07-23 Thread Bill Wendling via cfe-commits
@@ -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

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-07-28 Thread Bill Wendling via cfe-commits
@@ -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

[clang] [CodeGen][counted_by] See past parentheses and no-op casts (PR #151266)

2025-07-30 Thread Bill Wendling via cfe-commits
@@ -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

[clang] [CodeGen][counted_by] See past parentheses and no-op casts (PR #151266)

2025-07-29 Thread Bill Wendling via cfe-commits
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

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-07-31 Thread Bill Wendling via cfe-commits
@@ -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

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-08-01 Thread Bill Wendling via 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/17] [Clang][attr] Add cfi_salt attribute The new 'cfi_salt'

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-08-01 Thread Bill Wendling via 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/13] [Clang][attr] Add cfi_salt attribute The new 'cfi_salt'

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-08-01 Thread Bill Wendling via cfe-commits
@@ -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

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-08-01 Thread Bill Wendling via 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/15] [Clang][attr] Add cfi_salt attribute The new 'cfi_salt'

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-08-01 Thread Bill Wendling via 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/14] [Clang][attr] Add cfi_salt attribute The new 'cfi_salt'

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-08-01 Thread Bill Wendling via 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/12] [Clang][attr] Add cfi_salt attribute The new 'cfi_salt'

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-08-01 Thread Bill Wendling via cfe-commits
@@ -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

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-08-01 Thread Bill Wendling via cfe-commits
@@ -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

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-08-01 Thread Bill Wendling via cfe-commits
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

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-08-01 Thread Bill Wendling via 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'

[clang] [CodeGen][counted_by] See past parentheses and no-op casts (PR #151266)

2025-08-01 Thread Bill Wendling via cfe-commits
@@ -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

<    3   4   5   6   7   8