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

2024-11-18 Thread Justin Stitt via cfe-commits
JustinStitt wrote: @vitalybuka > Would it make sense to support attributes like > `__attribute__((no_sanitize("-undefined")))` ? Seems like better > representation of the fact that we want to undo sanitizer suppression. I am working on the PR for supporting `__attribute__((no_sanitize()))` fo

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

2024-11-14 Thread Justin Stitt via cfe-commits
JustinStitt wrote: > > @vitalybuka any idea how lldb-server is failing with `UNRESOLVED`? How in > > the world are any of the changes here affecting lldb-server? > > flake? I believe it was unrelated to this PR https://github.com/llvm/llvm-project/pull/107332 ___

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

2024-11-12 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/115094 >From b5515eba87ffd96d010952bf18fe4044861df298 Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 5 Mar 2024 03:14:49 + Subject: [PATCH 01/15] add wraps, no_wraps attributes --- clang/docs/ReleaseN

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

2024-11-12 Thread Justin Stitt 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-12 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/115094 >From b5515eba87ffd96d010952bf18fe4044861df298 Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 5 Mar 2024 03:14:49 + Subject: [PATCH 01/14] add wraps, no_wraps attributes --- clang/docs/ReleaseN

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

2024-11-12 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-12 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-12 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-12 Thread Justin Stitt 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-12 Thread Justin Stitt via cfe-commits
@@ -4852,6 +4862,10 @@ BinaryOperator::BinaryOperator(const ASTContext &Ctx, Expr *lhs, Expr *rhs, if (hasStoredFPFeatures()) setStoredFPFeatures(FPFeatures); setDependence(computeDependence(this)); + if (hasWrappingOperand(Ctx)) JustinStitt wrote: A

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

2024-11-12 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-12 Thread Justin Stitt via cfe-commits
@@ -10818,11 +10819,39 @@ static bool IsImplicitBoolFloatConversion(Sema &S, Expr *Ex, bool ToBool) { FloatCandidateBT && (FloatCandidateBT->isFloatingPoint())); } +/// Check to see if the wraps or no_wraps attribute may have been lost through +/// a function call.

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

2024-11-12 Thread Justin Stitt via cfe-commits
@@ -6664,6 +6664,13 @@ def err_builtin_counted_by_ref_invalid_lhs_use : Error< def err_builtin_counted_by_ref_has_side_effects : Error< "'__builtin_counted_by_ref' argument cannot have side-effects">; +def warn_wraps_attr_var_decl_type_not_integer : Warning< + "using attrib

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

2024-11-12 Thread Justin Stitt via cfe-commits
@@ -6664,6 +6664,13 @@ def err_builtin_counted_by_ref_invalid_lhs_use : Error< def err_builtin_counted_by_ref_has_side_effects : Error< "'__builtin_counted_by_ref' argument cannot have side-effects">; +def warn_wraps_attr_var_decl_type_not_integer : Warning<

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

2024-11-12 Thread Justin Stitt via cfe-commits
@@ -6536,6 +6536,30 @@ static void HandleBTFTypeTagAttribute(QualType &Type, const ParsedAttr &Attr, ::new (Ctx) BTFTypeTagAttr(Ctx, Attr, BTFTypeTag), Type); } +static void handleWrapsAttr(QualType &Type, const ParsedAttr &Attr, +TypeProcess

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

2024-11-12 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-12 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-12 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-11 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-11 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-11 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-11 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-11 Thread Justin Stitt 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-11 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/115094 >From b5515eba87ffd96d010952bf18fe4044861df298 Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 5 Mar 2024 03:14:49 + Subject: [PATCH 01/12] add wraps, no_wraps attributes --- clang/docs/ReleaseN

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

2024-11-11 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-11 Thread Justin Stitt via cfe-commits
@@ -6664,6 +6664,13 @@ def err_builtin_counted_by_ref_invalid_lhs_use : Error< def err_builtin_counted_by_ref_has_side_effects : Error< "'__builtin_counted_by_ref' argument cannot have side-effects">; +def warn_wraps_attr_var_decl_type_not_integer : Warning< + "using attrib

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

2024-11-08 Thread Justin Stitt via cfe-commits
JustinStitt wrote: @erichkeane > Also, did we have an RFC on this? I'd like to see what the community at large > has to say. Yes, here's the [RFC](https://discourse.llvm.org/t/rfc-add-wraps-attribute-for-granular-integer-overflow-handling/77670) and the [previous PR](https://github.com/llvm/

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

2024-11-08 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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 Justin Stitt via cfe-commits
@@ -6536,6 +6536,30 @@ static void HandleBTFTypeTagAttribute(QualType &Type, const ParsedAttr &Attr, ::new (Ctx) BTFTypeTagAttr(Ctx, Attr, BTFTypeTag), Type); } +static void handleWrapsAttr(QualType &Type, const ParsedAttr &Attr, +TypeProcess

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

2024-11-08 Thread Justin Stitt via cfe-commits
@@ -4852,6 +4862,10 @@ BinaryOperator::BinaryOperator(const ASTContext &Ctx, Expr *lhs, Expr *rhs, if (hasStoredFPFeatures()) setStoredFPFeatures(FPFeatures); setDependence(computeDependence(this)); + if (hasWrappingOperand(Ctx)) JustinStitt wrote: I

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

2024-11-08 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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 Justin Stitt 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; JustinStitt wrote: > Can we test more types? Yes, I'll add some more tests 😄 > > Can the attributes be applied to point

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

2024-11-08 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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 Justin Stitt 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 Justin Stitt 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 Justin Stitt 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 Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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 Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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 Justin Stitt 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 Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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 Justin Stitt 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 Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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 Justin Stitt via cfe-commits
@@ -67,9 +67,11 @@ types specified within an ignorelist. int a = 2147483647; // INT_MAX ++a;// Normally, an overflow with -fsanitize=signed-integer-overflow } + JustinStitt wrote: I don't have commit access, but I'll revert that whit

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

2024-11-08 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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 Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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 Justin Stitt 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 Justin Stitt 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 Justin Stitt 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 Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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 Justin Stitt 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-07 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/115094 >From b5515eba87ffd96d010952bf18fe4044861df298 Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 5 Mar 2024 03:14:49 + Subject: [PATCH 1/6] add wraps, no_wraps attributes --- clang/docs/ReleaseNot

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

2024-11-07 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/115094 >From f58e6481650f8cda6089b2a0637c94596a45370e Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 5 Mar 2024 03:14:49 + Subject: [PATCH 1/6] add wraps, no_wraps attributes --- clang/docs/ReleaseNot

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

2024-11-06 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/115094 >From f58e6481650f8cda6089b2a0637c94596a45370e Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 5 Mar 2024 03:14:49 + Subject: [PATCH 1/5] add wraps, no_wraps attributes --- clang/docs/ReleaseNot

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

2024-11-06 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-06 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/115094 >From f58e6481650f8cda6089b2a0637c94596a45370e Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 5 Mar 2024 03:14:49 + Subject: [PATCH 1/6] add wraps, no_wraps attributes --- clang/docs/ReleaseNot

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

2024-11-06 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-06 Thread Justin Stitt via cfe-commits
@@ -4142,6 +4142,12 @@ class BinaryOperator : public Expr { return getFPFeaturesInEffect(LO).getAllowFEnvAccess(); } + /// Does one of the subexpressions have the wraps attribute? + bool hasWrappingOperand(const ASTContext &Ctx) const; + + /// How about the no_wraps a

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

2024-11-06 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/115094 >From f58e6481650f8cda6089b2a0637c94596a45370e Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 5 Mar 2024 03:14:49 + Subject: [PATCH 1/5] add wraps, no_wraps attributes --- clang/docs/ReleaseNot

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

2024-11-06 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-06 Thread Justin Stitt via cfe-commits
@@ -67,9 +67,11 @@ types specified within an ignorelist. int a = 2147483647; // INT_MAX ++a;// Normally, an overflow with -fsanitize=signed-integer-overflow } + JustinStitt wrote: The wraps docs reference the SSCL docs and I fixed so

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

2024-11-05 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt created https://github.com/llvm/llvm-project/pull/115094 > [!NOTE] > Expansion of https://github.com/llvm/llvm-project/pull/86618, with a larger > scope including `no_wraps` and > [SSCL](https://clang.llvm.org/docs/SanitizerSpecialCaseList.html) > integration.

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

2024-11-04 Thread Justin Stitt via cfe-commits
JustinStitt wrote: @vitalybuka any idea how lldb-server is failing with `UNRESOLVED`? How in the world are any of the changes here affecting lldb-server? https://github.com/llvm/llvm-project/pull/107332 ___ cfe-commits mailing list cfe-commits@lists.l

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

2024-11-04 Thread Justin Stitt via cfe-commits
JustinStitt wrote: Hi Vitaly, thanks for expanding the usefulness of type suppression through SCLs. LGTM https://github.com/llvm/llvm-project/pull/114754 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

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

2024-11-01 Thread Justin Stitt via cfe-commits
@@ -831,6 +831,28 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( return CanonTTP; } +/// Check if a type can have its sanitizer instrumentation elided. +/// Determine this by its presence in a SCL alongside its specified categories. +/// For example: +/// ignorelist.tx

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

2024-11-01 Thread Justin Stitt via cfe-commits
@@ -48,6 +48,64 @@ Example $ clang -fsanitize=address -fsanitize-ignorelist=ignorelist.txt foo.c ; ./a.out # No error report here. +Usage with UndefinedBehaviorSanitizer += + +The arithmetic overflow sanitizers ``unsigned-integer-overfl

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

2024-11-01 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/107332 >From 548efc6414503f8ae005f1bd9ef2c7f15ad16241 Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 3 Sep 2024 18:28:53 -0700 Subject: [PATCH 01/13] hook up sscl categories with overflow/truncation saniti

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

2024-11-01 Thread Justin Stitt via cfe-commits
JustinStitt wrote: > My intuition is that @kees approach could be more efficient to get things > done :) Maintaining a list of types can be annoying. We discussed this at [Linux Plumbers '24](https://lpc.events/) and also on [lkml](https://lore.kernel.org/all/202404291502.612E0A10@keescook/) w

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

2024-11-01 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt deleted 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-11-01 Thread Justin Stitt 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-31 Thread Justin Stitt via cfe-commits
@@ -831,6 +831,28 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( return CanonTTP; } +/// Check if a type can have its sanitizer instrumentation elided. +/// Determine this by its presence in a SCL alongside its specified categories. +/// For example: +/// ignorelist.tx

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

2024-10-31 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/107332 >From 548efc6414503f8ae005f1bd9ef2c7f15ad16241 Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 3 Sep 2024 18:28:53 -0700 Subject: [PATCH 01/12] hook up sscl categories with overflow/truncation saniti

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

2024-10-31 Thread Justin Stitt via cfe-commits
JustinStitt wrote: BTW doc build failures linked to here: https://github.com/llvm/llvm-project/pull/109220 unrelated to my changes 👍 https://github.com/llvm/llvm-project/pull/107332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

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

2024-10-31 Thread Justin Stitt via cfe-commits
@@ -831,6 +831,28 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( return CanonTTP; } +/// Check if a type can have its sanitizer instrumentation elided. +/// Determine this by its presence in a SCL alongside its specified categories. +/// For example: +/// ignorelist.tx

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

2024-10-31 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-31 Thread Justin Stitt via cfe-commits
@@ -831,6 +831,28 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( return CanonTTP; } +/// Check if a type can have its sanitizer instrumentation elided. +/// Determine this by its presence in a SCL alongside its specified categories. +/// For example: +/// ignorelist.tx

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

2024-10-31 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-31 Thread Justin Stitt via cfe-commits
@@ -831,6 +831,28 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( return CanonTTP; } +/// Check if a type can have its sanitizer instrumentation elided. +/// Determine this by its presence in a SCL alongside its specified categories. +/// For example: +/// ignorelist.tx

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

2024-10-30 Thread Justin Stitt via cfe-commits
JustinStitt wrote: @vitalybuka > Is "Test documentation build" error related? I am noticing this documentation build failing in other [un-related Clang patchsets](https://github.com/llvm/llvm-project/actions/runs/11598884769/job/32295763452?pr=114281) (related to `ClangFormattedStatus`?). I d

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

2024-10-30 Thread Justin Stitt via cfe-commits
JustinStitt wrote: @melver > Oh nice. If you have that almost done, why do you still want the filterlist? > For the Linux kernel usecase, wouldn't the attribute be preferrable? My > intuition tells me that maintaining a filterlist detached from the code will > cause headaches, esp. during ref

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

2024-10-30 Thread Justin Stitt via cfe-commits
@@ -831,6 +831,28 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( return CanonTTP; } +/// Check if a type can have its sanitizer instrumentation elided. +/// Determine this by its presence in a SCL alongside its specified categories. +/// For example: +/// ignorelist.tx

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

2024-10-30 Thread Justin Stitt via cfe-commits
@@ -831,6 +831,28 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( return CanonTTP; } +/// Check if a type can have its sanitizer instrumentation elided. +/// Determine this by its presence in a SCL alongside its specified categories. +/// For example: +/// ignorelist.tx

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

2024-10-30 Thread Justin Stitt via cfe-commits
@@ -831,6 +831,28 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( return CanonTTP; } +/// Check if a type can have its sanitizer instrumentation elided. +/// Determine this by its presence in a SCL alongside its specified categories. +/// For example: +/// ignorelist.tx

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

2024-10-30 Thread Justin Stitt via cfe-commits
@@ -1,23 +0,0 @@ -// Verify ubsan vptr does not check down-casts on ignorelisted types. -// RUN: echo "type:_ZTI3Foo" > %t-type.ignorelist -// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=vptr -fsanitize-recover=vptr -emit-llvm %s -o - | FileCheck %s --check-prefix=DEFAULT

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

2024-10-30 Thread Justin Stitt via cfe-commits
@@ -0,0 +1,105 @@ +// RUN: rm -rf %t +// RUN: split-file %s %t + +// Verify ubsan doesn't emit checks for ignorelisted types +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-ignorelist=%t/int.ignorelist -emit-ll

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

2024-10-30 Thread Justin Stitt 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 Justin Stitt via cfe-commits
@@ -831,6 +831,28 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( return CanonTTP; } +/// Check if a type can have its sanitizer instrumentation elided. +/// Determine this by its presence in a SCL alongside its specified categories. +/// For example: +/// ignorelist.tx

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

2024-10-30 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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 Justin Stitt via cfe-commits
@@ -197,6 +197,18 @@ static bool CanElideOverflowCheck(const ASTContext &Ctx, const BinOpInfo &Op) { if (!Op.mayHaveIntegerOverflow()) return true; + if (Op.Ty->isSignedIntegerType() && JustinStitt wrote: I'll add a comment, good idea :) https://gith

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

2024-10-30 Thread Justin Stitt via cfe-commits
JustinStitt 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 the

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

2024-10-30 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/107332 >From 548efc6414503f8ae005f1bd9ef2c7f15ad16241 Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 3 Sep 2024 18:28:53 -0700 Subject: [PATCH 1/6] hook up sscl categories with overflow/truncation sanitize

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

2024-10-29 Thread Justin Stitt via cfe-commits
JustinStitt wrote: @vitalybuka Can we move forward with this? The most recent commit uses the `=sanitize` `=no_sanitize` wording that you preferred. https://github.com/llvm/llvm-project/pull/107332 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

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

2024-10-04 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-09-25 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-09-25 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited 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-09-25 Thread Justin Stitt via cfe-commits
@@ -817,6 +817,37 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( return CanonTTP; } +/// Check if a type can have its sanitizer instrumentation elided. +/// Determine this by its presence in a SCL alongside its specified categories. +/// For example: +/// ignorelist.tx

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

2024-09-25 Thread Justin Stitt via cfe-commits
@@ -48,6 +49,63 @@ Example $ clang -fsanitize=address -fsanitize-ignorelist=ignorelist.txt foo.c ; ./a.out # No error report here. +Usage with UndefinedBehaviorSanitizer += + +The arithmetic overflow sanitizers ``unsigned-integer-overfl

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

2024-09-25 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/107332 >From 548efc6414503f8ae005f1bd9ef2c7f15ad16241 Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 3 Sep 2024 18:28:53 -0700 Subject: [PATCH 1/5] hook up sscl categories with overflow/truncation sanitize

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

2024-09-25 Thread Justin Stitt via cfe-commits
@@ -1,7 +1,28 @@ +// Verify ubsan doesn't emit checks for ignorelisted types +// RUN: echo "[{unsigned-integer-overflow,signed-integer-overflow}]" > %t-int.ignorelist +// RUN: echo "type:int" >> %t-int.ignorelist +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-int

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

2024-09-25 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/107332 >From 548efc6414503f8ae005f1bd9ef2c7f15ad16241 Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 3 Sep 2024 18:28:53 -0700 Subject: [PATCH 1/4] hook up sscl categories with overflow/truncation sanitize

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

2024-09-25 Thread Justin Stitt via cfe-commits
@@ -817,6 +817,37 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( return CanonTTP; } +/// Check if a type can have its sanitizer instrumentation elided. +/// Determine this by its presence in a SCL alongside its specified categories. +/// For example: +/// ignorelist.tx

  1   2   3   >