[clang] Thread Safety Analysis: Support warning on taking address of guarded variables (PR #123063)

2025-02-26 Thread Marco Elver via cfe-commits
https://github.com/melver closed https://github.com/llvm/llvm-project/pull/123063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-26 Thread Marco Elver via cfe-commits
melver wrote: Committed! > Looks good to me, and thanks for the contribution! Thanks for your review! Fingers crossed the Linux kernel changes will also land soon. > > Note, I think for now it might be safer to not enable by default yet, but > > I've made a note (and hinted at in changelog)

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-26 Thread Marco Elver via cfe-commits
https://github.com/melver closed https://github.com/llvm/llvm-project/pull/127396 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 3c8c0d4 - Thread Safety Analysis: Handle address-of followed by dereference

2025-02-26 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2025-02-26T16:34:33+01:00 New Revision: 3c8c0d4d8d9bbc160d160e683f7a74fd28574dc6 URL: https://github.com/llvm/llvm-project/commit/3c8c0d4d8d9bbc160d160e683f7a74fd28574dc6 DIFF: https://github.com/llvm/llvm-project/commit/3c8c0d4d8d9bbc160d160e683f7a74fd28574dc6.diff L

[clang] de10e44 - Thread Safety Analysis: Support warning on passing/returning pointers to guarded variables

2025-02-26 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2025-02-26T16:34:33+01:00 New Revision: de10e44b6fe7f3d3cfde3afd8e1222d251172ade URL: https://github.com/llvm/llvm-project/commit/de10e44b6fe7f3d3cfde3afd8e1222d251172ade DIFF: https://github.com/llvm/llvm-project/commit/de10e44b6fe7f3d3cfde3afd8e1222d251172ade.diff L

[clang] Thread Safety Analysis: Support warning on taking address of guarded variables (PR #123063)

2025-02-26 Thread Marco Elver via cfe-commits
https://github.com/melver edited https://github.com/llvm/llvm-project/pull/123063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-26 Thread Marco Elver via cfe-commits
https://github.com/melver edited https://github.com/llvm/llvm-project/pull/127396 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-26 Thread Marco Elver via cfe-commits
https://github.com/melver updated https://github.com/llvm/llvm-project/pull/127396 >From f9fec4c8415b2b9c802b1d7ecdcc9f5cb038f7be Mon Sep 17 00:00:00 2001 From: Marco Elver Date: Sun, 16 Feb 2025 14:53:41 +0100 Subject: [PATCH 1/2] Thread Safety Analysis: Handle address-of followed by derefere

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-26 Thread Marco Elver via cfe-commits
melver wrote: > I think this looks very good! I just have some minor remarks. > > Thanks to @aoates for trying this out, this is always appreciated! > > And sorry for the delay. Thanks for the review! I addressed the comments, PTAL. Note, I think for now it might be safer to not enable by def

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-26 Thread Marco Elver via cfe-commits
https://github.com/melver updated https://github.com/llvm/llvm-project/pull/127396 >From f9fec4c8415b2b9c802b1d7ecdcc9f5cb038f7be Mon Sep 17 00:00:00 2001 From: Marco Elver Date: Sun, 16 Feb 2025 14:53:41 +0100 Subject: [PATCH 1/2] Thread Safety Analysis: Handle address-of followed by derefere

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-26 Thread Marco Elver via cfe-commits
https://github.com/melver edited https://github.com/llvm/llvm-project/pull/127396 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-26 Thread Marco Elver via cfe-commits
@@ -4955,13 +4968,18 @@ class Foo { //showDataCell(*datap2_); // xpected-warning {{reading the value pointed to by 'datap2_' requires holding mutex 'mu_'}} int a = data_[0]; // expected-warning {{reading variable 'data_' requires holding mutex 'mu_'}} + +(v

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-26 Thread Marco Elver via cfe-commits
@@ -528,6 +529,9 @@ for a period of time, after which they are migrated into the standard analysis. * ``-Wthread-safety-beta``: New features. Off by default. + + ``-Wthread-safety-pointer``: Checks when passing or returning pointers to +guarded variables, or pointers

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-26 Thread Marco Elver via cfe-commits
@@ -528,6 +529,9 @@ for a period of time, after which they are migrated into the standard analysis. * ``-Wthread-safety-beta``: New features. Off by default. + + ``-Wthread-safety-pointer``: Checks when passing or returning pointers to +guarded variables, or pointers

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-25 Thread Marco Elver via cfe-commits
@@ -6087,9 +6215,37 @@ class Return { const Foo &returns_constref_shared_locks_required() SHARED_LOCKS_REQUIRED(mu) { return foo; } + + Foo *returns_ptr_exclusive_locks_required() EXCLUSIVE_LOCKS_REQUIRED(mu) { +return &foo; + } + + Foo *returns_pt_ptr_exclusive

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-25 Thread Marco Elver via cfe-commits
melver wrote: > I only have a few comments about documenting the caveats (no alias analysis). > > The actual code changes look very simple and this looks like a clear > improvement that would catch many useful cases. > > I don't have much experience with this code and would still advise to wai

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-25 Thread Marco Elver via cfe-commits
@@ -143,6 +143,11 @@ Improvements to Clang's diagnostics - A statement attribute applied to a ``case`` label no longer suppresses 'bypassing variable initialization' diagnostics (#84072). +- The :doc:`ThreadSafetyAnalysis` now supports ``-Wthread-safety-pointer`` ---

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-25 Thread Marco Elver via cfe-commits
https://github.com/melver updated https://github.com/llvm/llvm-project/pull/127396 >From a70f021becb2888d6c2a63b2d1e619393a996058 Mon Sep 17 00:00:00 2001 From: Marco Elver Date: Sun, 16 Feb 2025 14:53:41 +0100 Subject: [PATCH 1/2] Thread Safety Analysis: Handle address-of followed by derefere

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-25 Thread Marco Elver via cfe-commits
melver wrote: > > I need to commit this by end of day Wednesday - if I should wait a little > > longer, let me know so I can plan around it. Thanks. > > Sorry, but I'm at C standards meetings this week, so I don't think I'll be > able to review it by then. CC @aaronpuchert who maybe can help?

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-24 Thread Marco Elver via cfe-commits
melver wrote: Gentle ping. Thanks! https://github.com/llvm/llvm-project/pull/127396 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Support warning on taking address of guarded variables (PR #123063)

2025-02-19 Thread Marco Elver via cfe-commits
melver wrote: > I'm very excited about this, as I have wanted it for many years for my C > codebase, and TSA is not super useful in C without this! This PR is being superseded by https://github.com/llvm/llvm-project/pull/127396 (implementation changed completely) - we agreed to go with the mor

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-19 Thread Marco Elver via cfe-commits
melver wrote: FWIW, I'm ready for sending a v2 series to the Linux kernel mailing list: https://git.kernel.org/pub/scm/linux/kernel/git/melver/linux.git/log/?h=cap-analysis/dev But I'd like to sort out this PR first before sending the v2 series. https://github.com/llvm/llvm-project/pull/127396

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-17 Thread Marco Elver via cfe-commits
melver wrote: (Side-note: I cannot figure out what the canonical way to do "stacked commits" is for LLVM these days, so I'm just doing this the "old" way i.e. plain and simple normal git commits which I will commit separately after PR review.) https://github.com/llvm/llvm-project/pull/127396 _

[clang] Thread Safety Analysis: Support warning on passing/returning pointers to guarded variables (PR #127396)

2025-02-17 Thread Marco Elver via cfe-commits
https://github.com/melver edited https://github.com/llvm/llvm-project/pull/127396 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Support warning on taking address of guarded variables (PR #123063)

2025-02-17 Thread Marco Elver via cfe-commits
https://github.com/melver converted_to_draft https://github.com/llvm/llvm-project/pull/123063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Support warning on taking address of guarded variables (PR #123063)

2025-02-17 Thread Marco Elver via cfe-commits
melver wrote: [...] > Then we only need to make sure that `checkPtAccess` can look through `&`, as > mentioned above. (Casts should already be unwrapped.) This might not even > need a new flag, it's just closing a gap in the existing analysis. Thanks for the suggestions! I implemented both -

[clang] Thread Safety Analysis: Handle address-of followed by dereference (PR #127397)

2025-02-17 Thread Marco Elver via cfe-commits
melver wrote: Superseded by https://github.com/llvm/llvm-project/pull/127396 https://github.com/llvm/llvm-project/pull/127397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Handle address-of followed by dereference (PR #127397)

2025-02-17 Thread Marco Elver via cfe-commits
https://github.com/melver closed https://github.com/llvm/llvm-project/pull/127397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-17 Thread Marco Elver via cfe-commits
https://github.com/melver edited https://github.com/llvm/llvm-project/pull/127396 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-17 Thread Marco Elver via cfe-commits
https://github.com/melver edited https://github.com/llvm/llvm-project/pull/127396 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Support warning on passing/returning pointers to guarded variables (PR #127396)

2025-02-16 Thread Marco Elver via cfe-commits
https://github.com/melver updated https://github.com/llvm/llvm-project/pull/127396 >From a70f021becb2888d6c2a63b2d1e619393a996058 Mon Sep 17 00:00:00 2001 From: Marco Elver Date: Sun, 16 Feb 2025 14:53:41 +0100 Subject: [PATCH 1/2] Thread Safety Analysis: Handle address-of followed by derefere

[clang] Thread Safety Analysis: Support warning on passing/returning pointers to guarded variables (PR #127396)

2025-02-16 Thread Marco Elver via cfe-commits
https://github.com/melver updated https://github.com/llvm/llvm-project/pull/127396 >From 13e86fc43071af4c926d3c2d4662423f5c5b4fe8 Mon Sep 17 00:00:00 2001 From: Marco Elver Date: Sun, 16 Feb 2025 12:42:06 +0100 Subject: [PATCH] Thread Safety Analysis: Support warning on passing/returning point

[clang] Thread Safety Analysis: Handle address-of followed by dereference (PR #127397)

2025-02-16 Thread Marco Elver via cfe-commits
https://github.com/melver created https://github.com/llvm/llvm-project/pull/127397 Correctly analyze expressions where the address of a guarded variable is taken and immediately dereferenced, such as (*(type-specifier *)&x). Previously, such patterns would result in false negatives. >From a70

[clang] Thread Safety Analysis: Support warning on passing/returning pointers to guarded variables (PR #127396)

2025-02-16 Thread Marco Elver via cfe-commits
https://github.com/melver created https://github.com/llvm/llvm-project/pull/127396 Introduce `-Wthread-safety-pointer` (under `-Wthread-safety-beta`) to warn when passing or returning pointers to guarded variables or guarded data. This is is analogous to `-Wthread-safety-reference`, which perf

[clang] Thread Safety Analysis: Support warning on taking address of guarded variables (PR #123063)

2025-02-12 Thread Marco Elver via cfe-commits
melver wrote: Addressed comments so far. > > The equivalent of passing a `pt_guarded_by` variable by value doesn't seem > > to warn. > > This inconsistency is probably my largest concern. If you have > > ```c > int x GUARDED_BY(mu); > int *p PT_GUARDED_BY(mu); > ``` > > then `&x` should basi

[clang] Thread Safety Analysis: Support warning on taking address of guarded variables (PR #123063)

2025-02-12 Thread Marco Elver via cfe-commits
@@ -515,8 +515,18 @@ Warning flags + ``-Wthread-safety-analysis``: The core analysis. + ``-Wthread-safety-precise``: Requires that mutex expressions match precisely. This warning can be disabled for code which has a lot of aliases. - + ``-Wthread-safety-reference``

[clang] Thread Safety Analysis: Support warning on taking address of guarded variables (PR #123063)

2025-02-12 Thread Marco Elver via cfe-commits
https://github.com/melver updated https://github.com/llvm/llvm-project/pull/123063 >From 6727047d25b8b72f8e23b03a84c0b23f6dad566a Mon Sep 17 00:00:00 2001 From: Marco Elver Date: Wed, 15 Jan 2025 13:23:14 +0100 Subject: [PATCH 1/5] Thread Safety Analysis: Support warning on obtaining address o

[clang] Thread Safety Analysis: Support warning on taking address of guarded variables (PR #123063)

2025-02-05 Thread Marco Elver via cfe-commits
https://github.com/melver edited https://github.com/llvm/llvm-project/pull/123063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Support warning on obtaining address of guarded variables (PR #123063)

2025-02-05 Thread Marco Elver via cfe-commits
https://github.com/melver edited https://github.com/llvm/llvm-project/pull/123063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Support warning on obtaining address of guarded variables (PR #123063)

2025-02-04 Thread Marco Elver via cfe-commits
melver wrote: > Doesn't `counted_by` have the same requirements? If not, why does guarded_by? It does, AFAIK. > Sure, I can imagine where there might be pushback, but perhaps its worthwhile > to see how far you can get with either marking structs that don't need > `-fexperimental-late-parse-a

[clang] Thread Safety Analysis: Support warning on obtaining address of guarded variables (PR #123063)

2025-02-04 Thread Marco Elver via cfe-commits
melver wrote: > Can any of the members in the structs be reorganized to put the mutex member > declaration BEFORE the members they guard? Probably not always, but perhaps > that's possible for most structures? It's an option I considered, but I can already hear "what is this crap ... NACK". I

[clang] Thread Safety Analysis: Support warning on obtaining address of guarded variables (PR #123063)

2025-02-04 Thread Marco Elver via cfe-commits
melver wrote: > Looks like the kernel patches > [use](https://github.com/google/kernel-sanitizers/commit/81883e1fa377d866c288192b6eb8334bcf10f38f) > `-fexperimental-late-parse-attributes`? :( Yeah, no way around it if we want to have guarded_by in structs work properly. If the problem is cost

[clang] Thread Safety Analysis: Support warning on obtaining address of guarded variables (PR #123063)

2025-02-04 Thread Marco Elver via cfe-commits
melver wrote: FWIW, the Linux kernel integration (draft, WIP) currently lives here: https://github.com/google/kernel-sanitizers/tree/cap-analysis It currently enables -Wthread-safety-addressof if available. Thus far, I have not found any false positives due to -Wthread-safety-addressof in the 2

[clang] [Clang] add wraps and no_wraps attributes (PR #115094)

2025-02-03 Thread Marco Elver via cfe-commits
melver wrote: > RFC regarding canonical wrapping/non-wrapping types in Clang: > https://discourse.llvm.org/t/rfc-clang-canonical-wrapping-and-non-wrapping-types/84356 > > Ultimately, a type like what the RFC describes would supersede this PR in > terms of feature completeness and usefulness. I

[clang] [Clang] add wraps and no_wraps attributes (PR #115094)

2025-02-03 Thread Marco Elver via cfe-commits
@@ -433,6 +433,26 @@ Attribute Changes in Clang - Fix a bug where clang doesn't automatically apply the ``[[gsl::Owner]]`` or ``[[gsl::Pointer]]`` to STL explicit template specialization decls. (#GH109442) +- Introduced ``__attribute__((wraps))`` which can be added to type

[clang] Thread Safety Analysis: Support warning on obtaining address of guarded variables (PR #123063)

2025-01-21 Thread Marco Elver via cfe-commits
https://github.com/melver updated https://github.com/llvm/llvm-project/pull/123063 >From 6727047d25b8b72f8e23b03a84c0b23f6dad566a Mon Sep 17 00:00:00 2001 From: Marco Elver Date: Wed, 15 Jan 2025 13:23:14 +0100 Subject: [PATCH 1/3] Thread Safety Analysis: Support warning on obtaining address o

[clang] Thread Safety Analysis: Support warning on obtaining address of guarded variables (PR #123063)

2025-01-21 Thread Marco Elver via cfe-commits
https://github.com/melver edited https://github.com/llvm/llvm-project/pull/123063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Support warning on obtaining address of guarded variables (PR #123063)

2025-01-21 Thread Marco Elver via cfe-commits
https://github.com/melver updated https://github.com/llvm/llvm-project/pull/123063 >From 6727047d25b8b72f8e23b03a84c0b23f6dad566a Mon Sep 17 00:00:00 2001 From: Marco Elver Date: Wed, 15 Jan 2025 13:23:14 +0100 Subject: [PATCH 1/3] Thread Safety Analysis: Support warning on obtaining address o

[clang] Thread Safety Analysis: Support warning on obtaining address of guarded variables (PR #123063)

2025-01-20 Thread Marco Elver via cfe-commits
melver wrote: > We had a discussion on https://reviews.llvm.org/D52395 that might be relevant > here. To quote @delesley: > > > When you pass an object to a function, either by pointer or by reference, > > no actual load from memory has yet occurred. Thus, there is a real risk of > > false po

[clang] [clang-tools-extra] thread-safety: Support the new capability-based names for all related attributes. (PR #99919)

2025-01-15 Thread Marco Elver via cfe-commits
melver wrote: Was this dropped? It'd be nice to see this change land. https://github.com/llvm/llvm-project/pull/99919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Support warning on obtaining address of guarded variables (PR #123063)

2025-01-15 Thread Marco Elver via cfe-commits
melver wrote: For additional background: I'm trying to work out how to bring -Wthread-safety to the Linux kernel. Since -fexperimental-late-parse-attributes made the feature practical for complex C structs, I started to look at a strategy to enable the feature. The current strategy is to cre

[clang] Thread Safety Analysis: Support warning on obtaining address of guarded variables (PR #123063)

2025-01-15 Thread Marco Elver via cfe-commits
https://github.com/melver updated https://github.com/llvm/llvm-project/pull/123063 >From 6727047d25b8b72f8e23b03a84c0b23f6dad566a Mon Sep 17 00:00:00 2001 From: Marco Elver Date: Wed, 15 Jan 2025 13:23:14 +0100 Subject: [PATCH] Thread Safety Analysis: Support warning on obtaining address of gu

[clang] Thread Safety Analysis: Support warning on obtaining address of guarded variables (PR #123063)

2025-01-15 Thread Marco Elver via cfe-commits
https://github.com/melver created https://github.com/llvm/llvm-project/pull/123063 Add the optional ability, via `-Wthread-safety-addressof`, to warn when obtaining the address of guarded variables. This is required to avoid false negatives in large C codebases, where data structures are typi

[clang] [Clang] add wraps and no_wraps attributes (PR #115094)

2024-11-08 Thread Marco Elver via cfe-commits
@@ -433,6 +433,26 @@ Attribute Changes in Clang - Fix a bug where clang doesn't automatically apply the ``[[gsl::Owner]]`` or ``[[gsl::Pointer]]`` to STL explicit template specialization decls. (#GH109442) +- Introduced ``__attribute__((wraps))`` which can be added to type

[clang] [Clang] add wraps and no_wraps attributes (PR #115094)

2024-11-08 Thread Marco Elver via cfe-commits
@@ -8710,3 +8710,103 @@ Declares that a function potentially allocates heap memory, and prevents any pot of ``nonallocating`` by the compiler. }]; } + +def WrapsDocs : Documentation { + let Category = DocCatField; + let Content = [{ +The ``wraps`` attribute can be used wit

[clang] [Clang] add wraps and no_wraps attributes (PR #115094)

2024-11-08 Thread Marco Elver via cfe-commits
@@ -0,0 +1,48 @@ +// RUN: %clang_cc1 %s -verify -fsyntax-only -triple x86_64-pc-linux-gnu +typedef int __attribute__((wraps)) wrapping_int; melver wrote: Can we test more types? Can the attributes be applied to pointers? Both the pointer itself and the pointee?

[clang] [Clang] add wraps and no_wraps attributes (PR #115094)

2024-11-08 Thread Marco Elver via cfe-commits
https://github.com/melver requested changes to this pull request. https://github.com/llvm/llvm-project/pull/115094 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] add wraps and no_wraps attributes (PR #115094)

2024-11-08 Thread Marco Elver via cfe-commits
@@ -8710,3 +8710,103 @@ Declares that a function potentially allocates heap memory, and prevents any pot of ``nonallocating`` by the compiler. }]; } + +def WrapsDocs : Documentation { + let Category = DocCatField; + let Content = [{ +The ``wraps`` attribute can be used wit

[clang] [ubsan] Suppression by type for `-fsanitize=enum` (PR #114754)

2024-11-04 Thread Marco Elver via cfe-commits
https://github.com/melver approved this pull request. https://github.com/llvm/llvm-project/pull/114754 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement labelled type filtering for overflow/truncation sanitizers w/ SSCLs (PR #107332)

2024-10-30 Thread Marco Elver via cfe-commits
melver wrote: > > I wished that we could just attach attributes to type, e.g. `typedef int > > __attribute__((no_sanitize("signed-integer-overflow")) wrapping_int` or > > something. One thing here is that this should _not_ be a type modifier > > (like volatile and such), so it does not change

[clang] [Clang] Implement labelled type filtering for overflow/truncation sanitizers w/ SSCLs (PR #107332)

2024-10-30 Thread Marco Elver via cfe-commits
https://github.com/melver approved this pull request. https://github.com/llvm/llvm-project/pull/107332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement labelled type filtering for overflow/truncation sanitizers w/ SSCLs (PR #107332)

2024-10-30 Thread Marco Elver via cfe-commits
@@ -15,8 +15,9 @@ file at compile-time. Goal and usage == -Users of sanitizer tools, such as :doc:`AddressSanitizer`, :doc:`ThreadSanitizer` -or :doc:`MemorySanitizer` may want to disable or alter some checks for +Users of sanitizer tools, such as :doc:`AddressSan

[clang] [Clang] Implement labelled type filtering for overflow/truncation sanitizers w/ SSCLs (PR #107332)

2024-10-30 Thread Marco Elver via cfe-commits
melver wrote: > We could make custom types that are filtered out in an ignorelist, allowing > for types to be more expressive -- without the need for annotations Having this sort of semantic information detached from the code may cause some maintenance headaches. For example, if the type is re

[clang] [llvm] [SanitizerBinaryMetadata] Fix multi-version sanitizer metadata (PR #97848)

2024-07-08 Thread Marco Elver via cfe-commits
https://github.com/melver closed https://github.com/llvm/llvm-project/pull/97848 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SanitizerBinaryMetadata] Fix multi-version sanitizer metadata (PR #97848)

2024-07-05 Thread Marco Elver via cfe-commits
https://github.com/melver created https://github.com/llvm/llvm-project/pull/97848 It should be valid to combine TUs that have different versions of sanitizer metadata. However, this had not been possible due to giving sanitizer metadata sections, constructors, and destructors (that call callba

[clang] 5f605e2 - [SanitizerBinaryMetadata] Respect no_sanitize("thread") function attribute

2023-04-19 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2023-04-19T14:49:56+02:00 New Revision: 5f605e254a0f81a41fd69025c572d597f3059ebc URL: https://github.com/llvm/llvm-project/commit/5f605e254a0f81a41fd69025c572d597f3059ebc DIFF: https://github.com/llvm/llvm-project/commit/5f605e254a0f81a41fd69025c572d597f3059ebc.diff L

[clang] 61ed649 - [SanitizerBinaryMetadata] Do not add to GPU code

2023-03-09 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2023-03-09T10:15:28+01:00 New Revision: 61ed64954b979df0d5bfdfbe54a7c27e20be9001 URL: https://github.com/llvm/llvm-project/commit/61ed64954b979df0d5bfdfbe54a7c27e20be9001 DIFF: https://github.com/llvm/llvm-project/commit/61ed64954b979df0d5bfdfbe54a7c27e20be9001.diff L

[clang] dac423b - [SanitizerBinaryMetadata] Fix ignorelist test with -Assert

2023-02-10 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2023-02-11T00:33:13+01:00 New Revision: dac423bd571858a85f3b388904392f0e55421d7d URL: https://github.com/llvm/llvm-project/commit/dac423bd571858a85f3b388904392f0e55421d7d DIFF: https://github.com/llvm/llvm-project/commit/dac423bd571858a85f3b388904392f0e55421d7d.diff L

[clang] bb8bd8c - [SanitizerBinaryMetadata] Fix ignorelist test under Windows

2023-02-10 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2023-02-10T11:24:25+01:00 New Revision: bb8bd8c232e893441937d057a8b32760065c6e1d URL: https://github.com/llvm/llvm-project/commit/bb8bd8c232e893441937d057a8b32760065c6e1d DIFF: https://github.com/llvm/llvm-project/commit/bb8bd8c232e893441937d057a8b32760065c6e1d.diff L

[clang] 421215b - [SanitizerBinaryMetadata] Support ignore list

2023-02-10 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2023-02-10T10:25:48+01:00 New Revision: 421215b919d037a912cd4fffa73242852da41fc0 URL: https://github.com/llvm/llvm-project/commit/421215b919d037a912cd4fffa73242852da41fc0 DIFF: https://github.com/llvm/llvm-project/commit/421215b919d037a912cd4fffa73242852da41fc0.diff L

[clang] b95646f - Revert "Use-after-return sanitizer binary metadata"

2022-11-30 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2022-11-30T23:35:50+01:00 New Revision: b95646fe7058471cc0ecda1efa25003009af0317 URL: https://github.com/llvm/llvm-project/commit/b95646fe7058471cc0ecda1efa25003009af0317 DIFF: https://github.com/llvm/llvm-project/commit/b95646fe7058471cc0ecda1efa25003009af0317.diff L

[clang] c4842bb - [Clang] Introduce -fexperimental-sanitize-metadata=

2022-09-07 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2022-09-07T21:25:40+02:00 New Revision: c4842bb2e98e2f1ee23bb3bc753752816927b7b3 URL: https://github.com/llvm/llvm-project/commit/c4842bb2e98e2f1ee23bb3bc753752816927b7b3 DIFF: https://github.com/llvm/llvm-project/commit/c4842bb2e98e2f1ee23bb3bc753752816927b7b3.diff L

[clang] 17ce89f - [SanitizerBounds] Add support for NoSanitizeBounds function

2022-03-01 Thread Marco Elver via cfe-commits
Author: Tong Zhang Date: 2022-03-01T18:47:02+01:00 New Revision: 17ce89fa8016758be2ec879c5560e506cad4c362 URL: https://github.com/llvm/llvm-project/commit/17ce89fa8016758be2ec879c5560e506cad4c362 DIFF: https://github.com/llvm/llvm-project/commit/17ce89fa8016758be2ec879c5560e506cad4c362.diff LO

[clang] c65186c - [clang] Improve -Wdeclaration-after-statement

2022-01-20 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2022-01-20T19:56:34+01:00 New Revision: c65186c89f35b7b599c41183def666a2bde62ddd URL: https://github.com/llvm/llvm-project/commit/c65186c89f35b7b599c41183def666a2bde62ddd DIFF: https://github.com/llvm/llvm-project/commit/c65186c89f35b7b599c41183def666a2bde62ddd.diff L

[clang] 732ad8e - [clang][auto-init] Provide __builtin_alloca*_uninitialized variants

2022-01-12 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2022-01-12T15:13:10+01:00 New Revision: 732ad8ea62edc403727af57537b5d83dcfa937aa URL: https://github.com/llvm/llvm-project/commit/732ad8ea62edc403727af57537b5d83dcfa937aa DIFF: https://github.com/llvm/llvm-project/commit/732ad8ea62edc403727af57537b5d83dcfa937aa.diff L

[clang] 4fbc66c - [Clang] Enable __has_feature(coverage_sanitizer)

2021-05-27 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2021-05-27T18:24:21+02:00 New Revision: 4fbc66cd6d90d8d5169c43fcc1b1e26e8a98d3a9 URL: https://github.com/llvm/llvm-project/commit/4fbc66cd6d90d8d5169c43fcc1b1e26e8a98d3a9 DIFF: https://github.com/llvm/llvm-project/commit/4fbc66cd6d90d8d5169c43fcc1b1e26e8a98d3a9.diff L

[clang] 2803330 - [SanitizeCoverage] Add support for NoSanitizeCoverage function attribute

2021-05-25 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2021-05-25T12:57:14+02:00 New Revision: 280333021e9550d80f5c1152a34e33e81df1e178 URL: https://github.com/llvm/llvm-project/commit/280333021e9550d80f5c1152a34e33e81df1e178 DIFF: https://github.com/llvm/llvm-project/commit/280333021e9550d80f5c1152a34e33e81df1e178.diff L

[clang] 85feebf - [NFC][SanitizeCoverage] Test always_inline functions work

2021-05-25 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2021-05-25T12:57:14+02:00 New Revision: 85feebf5a3401eab4c71288e2dc089faf547ab4c URL: https://github.com/llvm/llvm-project/commit/85feebf5a3401eab4c71288e2dc089faf547ab4c DIFF: https://github.com/llvm/llvm-project/commit/85feebf5a3401eab4c71288e2dc089faf547ab4c.diff L

[clang] ca6df73 - [NFC][CodeGenOptions] Refactor checking SanitizeCoverage options

2021-05-25 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2021-05-25T12:57:14+02:00 New Revision: ca6df734069ae590d1632e920ceba03bea317549 URL: https://github.com/llvm/llvm-project/commit/ca6df734069ae590d1632e920ceba03bea317549 DIFF: https://github.com/llvm/llvm-project/commit/ca6df734069ae590d1632e920ceba03bea317549.diff L

[clang] c28b18a - [KernelAddressSanitizer] Fix globals exclusion for indirect aliases

2020-12-11 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2020-12-11T12:20:40+01:00 New Revision: c28b18af19621e6b5cca257ef7139ba93833df0c URL: https://github.com/llvm/llvm-project/commit/c28b18af19621e6b5cca257ef7139ba93833df0c DIFF: https://github.com/llvm/llvm-project/commit/c28b18af19621e6b5cca257ef7139ba93833df0c.diff L

[clang] 52cae05 - [ASan][Test] Fix expected strings for globals test

2020-06-10 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2020-06-10T20:26:24+02:00 New Revision: 52cae05e087b3d4fd02849fc37c387c720055ffb URL: https://github.com/llvm/llvm-project/commit/52cae05e087b3d4fd02849fc37c387c720055ffb DIFF: https://github.com/llvm/llvm-project/commit/52cae05e087b3d4fd02849fc37c387c720055ffb.diff L

[clang] 0f04f10 - [ASan][Test] Split out global alias test

2020-06-10 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2020-06-10T19:58:50+02:00 New Revision: 0f04f104537bf037d07933cc306d0a0c0772e78f URL: https://github.com/llvm/llvm-project/commit/0f04f104537bf037d07933cc306d0a0c0772e78f DIFF: https://github.com/llvm/llvm-project/commit/0f04f104537bf037d07933cc306d0a0c0772e78f.diff L

[clang] d3f8931 - [KernelAddressSanitizer] Make globals constructors compatible with kernel [v2]

2020-06-10 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2020-06-10T15:08:42+02:00 New Revision: d3f89314ff20ce1612bd5e09f9f90ff5dd5205a7 URL: https://github.com/llvm/llvm-project/commit/d3f89314ff20ce1612bd5e09f9f90ff5dd5205a7 DIFF: https://github.com/llvm/llvm-project/commit/d3f89314ff20ce1612bd5e09f9f90ff5dd5205a7.diff L

[clang] c6ec352 - Revert "[KernelAddressSanitizer] Make globals constructors compatible with kernel"

2020-06-08 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2020-06-08T10:34:03+02:00 New Revision: c6ec352a6bde1995794c523adc2ebab802ccdf0a URL: https://github.com/llvm/llvm-project/commit/c6ec352a6bde1995794c523adc2ebab802ccdf0a DIFF: https://github.com/llvm/llvm-project/commit/c6ec352a6bde1995794c523adc2ebab802ccdf0a.diff L

[clang] 97a6709 - [ASan][Test] Fix globals test on 32-bit architectures

2020-06-06 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2020-06-06T11:23:16+02:00 New Revision: 97a670958c240d469c6baf2d3c601d4dea286069 URL: https://github.com/llvm/llvm-project/commit/97a670958c240d469c6baf2d3c601d4dea286069 DIFF: https://github.com/llvm/llvm-project/commit/97a670958c240d469c6baf2d3c601d4dea286069.diff L

[clang] 2dd83a9 - [ASan][Test] Fix globals test for Mach-O

2020-06-05 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2020-06-05T23:08:11+02:00 New Revision: 2dd83a923046a5cd9585dbf9f90daeab6c37265c URL: https://github.com/llvm/llvm-project/commit/2dd83a923046a5cd9585dbf9f90daeab6c37265c DIFF: https://github.com/llvm/llvm-project/commit/2dd83a923046a5cd9585dbf9f90daeab6c37265c.diff L

[clang] 866ee23 - [KernelAddressSanitizer] Make globals constructors compatible with kernel

2020-06-05 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2020-06-05T20:20:46+02:00 New Revision: 866ee2353f7d0224644799d0d1faed53c7f3a06d URL: https://github.com/llvm/llvm-project/commit/866ee2353f7d0224644799d0d1faed53c7f3a06d DIFF: https://github.com/llvm/llvm-project/commit/866ee2353f7d0224644799d0d1faed53c7f3a06d.diff L

[clang] 69935d8 - [Clang][Sanitizers] Expect test failure on {arm, thumb}v7

2020-05-28 Thread Marco Elver via cfe-commits
Author: Marco Elver Date: 2020-05-28T11:33:32+02:00 New Revision: 69935d86aed1b691c5f33a2141f15cb3aaee1af6 URL: https://github.com/llvm/llvm-project/commit/69935d86aed1b691c5f33a2141f15cb3aaee1af6 DIFF: https://github.com/llvm/llvm-project/commit/69935d86aed1b691c5f33a2141f15cb3aaee1af6.diff L