[clang] [sanitizers] do not accept out of bounds -fsanitize-skip-hot-cutoff (PR #145806)

2025-06-25 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/145806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Change the coercion type of structs with pointer members. (PR #135064)

2025-06-23 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > The tests fail with SIGSEGV without hwasan, so there is some problem revealed > by this change either in the compiler or in the tests. Bailing out under > hwasan is not a fix. > > Disallowing function pointers makes the problem go away, so might be a useful > hint. Another

[clang] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

2025-06-06 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/141997 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

2025-06-06 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > By "switch to" do you mean remove I mean downstream we already like how nice e.g `__ubsan_check_array_bounds` in the top of the crash thread. If we have `__clang_trap_msg_array_bounds`, it's as good as `__ubsan_check_array_bounds` now. https://github.com/llvm/llvm-pro

[clang] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

2025-06-04 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Should we just rename stuff of this patch __clang_trap_msg ? https://github.com/llvm/llvm-project/pull/141997 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sanitizer][Doc][NFI] Update the doc for prefix:*=sanitize (PR #142659)

2025-06-03 Thread Vitaly Buka via cfe-commits
@@ -813,19 +813,19 @@ changes to one object won't affect the others, the object's initializer will run once per copy, etc. Specifically, this warning fires when it detects an object which: - 1. Is defined as ``inline`` in a header file (so it might get compiled into multipl

[clang] [Sanitizer][Doc][NFI] Update the doc for prefix:*=sanitize (PR #142659)

2025-06-03 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/142659 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sanitizer][Doc][NFI] Update the doc for prefix:*=sanitize (PR #142659)

2025-06-03 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka reopened https://github.com/llvm/llvm-project/pull/142659 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Doc] Fix clang doc build. (PR #142700)

2025-06-03 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/142700 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sanitizer][Doc][NFI] Update the doc for prefix:*=sanitize (PR #142659)

2025-06-03 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Closed? https://github.com/llvm/llvm-project/pull/142659 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sanitizer][Doc][NFI] Update the doc for prefix:*=sanitize (PR #142659)

2025-06-03 Thread Vitaly Buka via cfe-commits
@@ -813,19 +813,19 @@ changes to one object won't affect the others, the object's initializer will run once per copy, etc. Specifically, this warning fires when it detects an object which: - 1. Is defined as ``inline`` in a header file (so it might get compiled into multipl

[clang] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

2025-06-03 Thread Vitaly Buka via cfe-commits
@@ -2817,7 +2817,9 @@ void CodeGenFunction::EmitVTablePtrCheckForCall(const CXXRecordDecl *RD, RD = LeastDerivedClassWithSameLayout(RD); auto [Ordinal, _] = SanitizerInfoFromCFICheckKind(TCK); - ApplyDebugLocation ApplyTrapDI(*this, SanitizerAnnotateDebugInfo(Ordinal))

[clang] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

2025-06-03 Thread Vitaly Buka via cfe-commits
@@ -2817,7 +2817,9 @@ void CodeGenFunction::EmitVTablePtrCheckForCall(const CXXRecordDecl *RD, RD = LeastDerivedClassWithSameLayout(RD); auto [Ordinal, _] = SanitizerInfoFromCFICheckKind(TCK); - ApplyDebugLocation ApplyTrapDI(*this, SanitizerAnnotateDebugInfo(Ordinal))

[clang] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

2025-06-02 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/141997 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][CodeGen] Extract SanitizerHandler into own header (PR #142527)

2025-06-02 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/142527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][CodeGen] Extract SanitizerHandler into own header (PR #142527)

2025-06-02 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/142527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][CodeGen] Exctact SanitizerHandler into own header (PR #142527)

2025-06-02 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/142527 >From b0bed4bdd6e1ee86d31a1f45824c731673a6f20e Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 2 Jun 2025 21:54:00 -0700 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?U

[clang] [NFC][CodeGen] Exctact SanitizerHandler into own header (PR #142527)

2025-06-02 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/142527 None >From b0bed4bdd6e1ee86d31a1f45824c731673a6f20e Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 2 Jun 2025 21:54:00 -0700 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?

[clang] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

2025-06-02 Thread Vitaly Buka via cfe-commits
@@ -2756,10 +2758,23 @@ CodeGenFunction::SanitizerScope::SanitizerScope(CodeGenFunction *CGF) : CGF(CGF) { assert(!CGF->IsSanitizerScope); CGF->IsSanitizerScope = true; + + assert(!this->ApplyTrapDI); +} + +CodeGenFunction::SanitizerScope::SanitizerScope( +CodeGen

[clang] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

2025-06-02 Thread Vitaly Buka via cfe-commits
@@ -1134,18 +1136,32 @@ void ScalarExprEmitter::EmitIntegerTruncationCheck(Value *Src, QualType SrcType, (!SrcSigned && DstSigned)) return; - CodeGenFunction::SanitizerScope SanScope(&CGF); - std::pair> - Check = - EmitIntegerTruncationCheckHelper(

[clang] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

2025-06-02 Thread Vitaly Buka via cfe-commits
@@ -2755,9 +2757,18 @@ CodeGenFunction::CGCapturedStmtInfo::~CGCapturedStmtInfo() { } CodeGenFunction::SanitizerScope::SanitizerScope(CodeGenFunction *CGF) : CGF(CGF) { assert(!CGF->IsSanitizerScope); + assert(!ApplyTrapDI); CGF->IsSanitizerScope = true; } +CodeGe

[clang] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

2025-06-02 Thread Vitaly Buka via cfe-commits
@@ -2755,9 +2757,18 @@ CodeGenFunction::CGCapturedStmtInfo::~CGCapturedStmtInfo() { } CodeGenFunction::SanitizerScope::SanitizerScope(CodeGenFunction *CGF) : CGF(CGF) { assert(!CGF->IsSanitizerScope); + assert(!ApplyTrapDI); vitalybuka wrote: ```sugges

[clang] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

2025-06-02 Thread Vitaly Buka via cfe-commits
@@ -2756,10 +2758,23 @@ CodeGenFunction::SanitizerScope::SanitizerScope(CodeGenFunction *CGF) : CGF(CGF) { assert(!CGF->IsSanitizerScope); CGF->IsSanitizerScope = true; + + assert(!this->ApplyTrapDI); +} + +CodeGenFunction::SanitizerScope::SanitizerScope( +CodeGen

[clang] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

2025-06-02 Thread Vitaly Buka via cfe-commits
@@ -2756,10 +2758,23 @@ CodeGenFunction::SanitizerScope::SanitizerScope(CodeGenFunction *CGF) : CGF(CGF) { assert(!CGF->IsSanitizerScope); CGF->IsSanitizerScope = true; + + assert(!this->ApplyTrapDI); +} + +CodeGenFunction::SanitizerScope::SanitizerScope( +CodeGen

[clang] [UBSan][Ignorelist] Expanding =sanitize to fun. (PR #142074)

2025-06-02 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/142074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [UBSan][Ignorelist] Expanding =sanitize to fun. (PR #142074)

2025-06-02 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: could be "Expanding =sanitize for fun" :) https://github.com/llvm/llvm-project/pull/142074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NoSanitizeList][NFI] Add containsPrefix to remove duplicated logics. (PR #142027)

2025-05-29 Thread Vitaly Buka via cfe-commits
@@ -48,11 +59,7 @@ bool NoSanitizeList::containsFunction(SanitizerMask Mask, bool NoSanitizeList::containsFile(SanitizerMask Mask, StringRef FileName, StringRef Category) const { - auto NoSan = SSCL->inSectionBlame(Mask, "src", FileName, Cate

[clang] [NoSanitizeList][NFI] Add containsPrefix to remove duplicated logics. (PR #142027)

2025-05-29 Thread Vitaly Buka via cfe-commits
@@ -29,6 +29,8 @@ class SanitizerSpecialCaseList; class NoSanitizeList { std::unique_ptr SSCL; SourceManager &SM; + bool containsPrefix(SanitizerMask Mask, StringRef Prefix, StringRef Name, vitalybuka wrote: we have one spot where we can use default, we w

[clang] [NoSanitizeList][NFI] Add containsPrefix to remove duplicated logics. (PR #142027)

2025-05-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/142027 >From 3b8af2c0d05fdd1fd95facd0afe0b52bacfe5690 Mon Sep 17 00:00:00 2001 From: Qinkun Bao Date: Thu, 29 May 2025 19:58:08 + Subject: [PATCH 1/5] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?= =?U

[clang] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

2025-05-29 Thread Vitaly Buka via cfe-commits
@@ -1245,30 +1245,23 @@ void CodeGenFunction::EmitBoundsCheckImpl(const Expr *E, llvm::Value *Bound, } llvm::DILocation *CodeGenFunction::SanitizerAnnotateDebugInfo( -SanitizerKind::SanitizerOrdinal CheckKindOrdinal) { - std::string Label; - switch (CheckKindOrdinal) {

[clang] [UBSan] Move type:*=sanitize handling. (PR #142006)

2025-05-29 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: It does not let to add contributors into reviewers so just CC @JustinStitt https://github.com/llvm/llvm-project/pull/142006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [UBSan] Move type:*=sanitize handling. (PR #142006)

2025-05-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/142006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFCI][ubsan] Precommit tests for -fsanitize-annotate-debug-info (PR #141814)

2025-05-28 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/141814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFCI][ubsan] Precommit tests for -fsanitize-annotate-debug-info (PR #141814)

2025-05-28 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/141814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFCI][ubsan] Precommit tests for -fsanitize-annotate-debug-info (PR #141814)

2025-05-28 Thread Vitaly Buka via cfe-commits
@@ -0,0 +1,74 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// RUN: %clang_cc1 -emit-llvm -triple x86_64 -std=c17 -fsanitize=function %s -o - \ vitalybuka wrote: -O1 or -O2 to reduce the bloat? https:/

[clang] Implement src:*=sanitize for UBSan (PR #139772)

2025-05-28 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/139772 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Implement src:*=sanitize for UBSan (PR #139772)

2025-05-28 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka reopened https://github.com/llvm/llvm-project/pull/139772 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [UBSan] Support src:*=sanitize for multiple ignorelists. (PR #141640)

2025-05-28 Thread Vitaly Buka via cfe-commits
@@ -44,13 +44,11 @@ bool NoSanitizeList::containsFunction(SanitizerMask Mask, bool NoSanitizeList::containsFile(SanitizerMask Mask, StringRef FileName, StringRef Category) const { - unsigned NoSanLine = SSCL->inSectionBlame(Mask, "src", FileN

[clang] [llvm] [NFCI] Change SpecialCaseList::inSectionBlame to return pair (FileIdx, LineNo). (PR #141540)

2025-05-27 Thread Vitaly Buka via cfe-commits
@@ -70,7 +70,7 @@ class FileSystem; /// --- class SpecialCaseList { public: - constexpr static std::pair NotFound = {0, 0}; + static constexpr std::pair NotFound = {0, 0}; vitalybuka wrote: yes, for consistency https://github.com/llvm/llvm-project/pull/1415

[clang] [llvm] [NFCI] Change SpecialCaseList::inSectionBlame to return pair (FileIdx, LineNo). (PR #141540)

2025-05-27 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/141540 >From e7540c31c69df827d646e88b271a355c587bd9da Mon Sep 17 00:00:00 2001 From: Qinkun Bao Date: Tue, 27 May 2025 02:36:29 + Subject: [PATCH 1/5] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?= =?U

[clang] [llvm] [NFCI] Change SpecialCaseList::inSectionBlame to return pair (FileIdx, LineNo). (PR #141540)

2025-05-27 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/141540 >From e7540c31c69df827d646e88b271a355c587bd9da Mon Sep 17 00:00:00 2001 From: Qinkun Bao Date: Tue, 27 May 2025 02:36:29 + Subject: [PATCH 1/4] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?= =?U

[clang] [llvm] [NFCI] Change SpecialCaseList::inSectionBlame to return pair (FileIdx, LineNo). (PR #141540)

2025-05-27 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. Please double check and merge https://github.com/llvm/llvm-project/pull/141540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFCI] Change SpecialCaseList::inSectionBlame to return pair (FileIdx, LineNo). (PR #141540)

2025-05-27 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/141540 >From e7540c31c69df827d646e88b271a355c587bd9da Mon Sep 17 00:00:00 2001 From: Qinkun Bao Date: Tue, 27 May 2025 02:36:29 + Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?= =?U

[clang] [llvm] [NFCI] Change SpecialCaseList::inSectionBlame to return pair (FileIdx, LineNo). (PR #141540)

2025-05-27 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: I have local changes, I'll push update https://github.com/llvm/llvm-project/pull/141540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-27 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/140529 >From b83755d2aa0c5417ab8f359aa842449213437a7a Mon Sep 17 00:00:00 2001 From: Qinkun Bao Date: Mon, 19 May 2025 11:14:01 + Subject: [PATCH 01/17] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20?= =?U

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-27 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/140529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-27 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/140529 >From b83755d2aa0c5417ab8f359aa842449213437a7a Mon Sep 17 00:00:00 2001 From: Qinkun Bao Date: Mon, 19 May 2025 11:14:01 + Subject: [PATCH 01/16] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20?= =?U

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-26 Thread Vitaly Buka via cfe-commits
@@ -56,10 +56,20 @@ void SanitizerSpecialCaseList::createSanitizerSections() { bool SanitizerSpecialCaseList::inSection(SanitizerMask Mask, StringRef Prefix, StringRef Query, StringRef Category) c

[clang] [llvm] [NFCI][Sanitizer] Convert Matcher::Globs from StringMap to vector. (PR #140964)

2025-05-23 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/140964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFCI][Sanitizer] Convert Matcher::Globs from StringMap to vector. (PR #140964)

2025-05-23 Thread Vitaly Buka via cfe-commits
@@ -125,7 +125,7 @@ class SpecialCaseList { // Returns zero if no match is found. LLVM_ABI unsigned match(StringRef Query) const; -StringMap> Globs; +std::vector>> Globs; vitalybuka wrote: Glob(Glob&&) = delete; // no copy, no move, because

[clang] [llvm] [NFCI][Sanitizer] Convert Matcher::Globs from StringMap to vector. (PR #140964)

2025-05-23 Thread Vitaly Buka via cfe-commits
@@ -125,7 +125,7 @@ class SpecialCaseList { // Returns zero if no match is found. LLVM_ABI unsigned match(StringRef Query) const; -StringMap> Globs; +std::vector>> Globs; vitalybuka wrote: Could be easier with: ``` class Glob { name patt

[clang] [llvm] [NFCI][Sanitizer] Convert Matcher::Globs from StringMap to vector. (PR #140964)

2025-05-23 Thread Vitaly Buka via cfe-commits
@@ -53,24 +53,27 @@ Error SpecialCaseList::Matcher::insert(StringRef Pattern, unsigned LineNumber, return Error::success(); } - auto [It, DidEmplace] = Globs.try_emplace(Pattern); - if (DidEmplace) { -// We must be sure to use the string in the map rather than the

[clang] [llvm] [NFCI][Sanitizer] Convert Matcher::Globs from StringMap to vector. (PR #140964)

2025-05-23 Thread Vitaly Buka via cfe-commits
@@ -553,7 +553,10 @@ void WarningsSpecialCaseList::processSections(DiagnosticsEngine &Diags) { // Each section has a matcher with that section's name, attached to that // line. const auto &DiagSectionMatcher = Entry.SectionMatcher; -unsigned DiagLine = DiagSect

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-21 Thread Vitaly Buka via cfe-commits
@@ -71,9 +76,9 @@ unsigned SpecialCaseList::Matcher::match(StringRef Query) const { for (const auto &[Pattern, Pair] : Globs) if (Pair.first.match(Query)) return Pair.second; - for (const auto &[Regex, LineNumber] : RegExes) -if (Regex->match(Query)) - re

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-21 Thread Vitaly Buka via cfe-commits
@@ -63,6 +63,11 @@ Error SpecialCaseList::Matcher::insert(StringRef Pattern, unsigned LineNumber, .moveInto(Pair.first)) return Err; Pair.second = LineNumber; + } else { vitalybuka wrote: Please move llvm/lib/Support/SpecialC

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-21 Thread Vitaly Buka via cfe-commits
@@ -103,6 +101,22 @@ supported sanitizers. char c = toobig; // also not instrumented } +Conflicting entries are resolved by the latest entry, which takes precedence. vitalybuka wrote: If multiple entries match the source, than the latest entry takes the

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-20 Thread Vitaly Buka via cfe-commits
@@ -63,6 +63,11 @@ Error SpecialCaseList::Matcher::insert(StringRef Pattern, unsigned LineNumber, .moveInto(Pair.first)) return Err; Pair.second = LineNumber; + } else { vitalybuka wrote: And "Pair.second = LineNumber;" is no

[clang] [NFC] Ubsan a few corner cases for `=sanitize` (PR #140855)

2025-05-20 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/140855 None >From 46288061d9d6acbed8cb3ada1fb2265c379f5d67 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Tue, 20 May 2025 23:45:52 -0700 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-20 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/140529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-20 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/140529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-20 Thread Vitaly Buka via cfe-commits
@@ -63,6 +63,11 @@ Error SpecialCaseList::Matcher::insert(StringRef Pattern, unsigned LineNumber, .moveInto(Pair.first)) return Err; Pair.second = LineNumber; + } else { vitalybuka wrote: Also we need a patch to Matcher::Glob

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-20 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/140529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-20 Thread Vitaly Buka via cfe-commits
@@ -77,10 +77,8 @@ For example, supplying the above ``ignorelist.txt`` to ``-fsanitize-ignorelist=ignorelist.txt`` disables overflow sanitizer instrumentation for arithmetic operations containing values of type ``int``. -The ``=sanitize`` category is also supported. Any types

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-20 Thread Vitaly Buka via cfe-commits
@@ -58,7 +58,7 @@ Usage with UndefinedBehaviorSanitizer ability to adjust instrumentation based on type. By default, supported sanitizers will have their instrumentation disabled for -types specified within an ignorelist. +entris specified within an ignorelist. ---

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-20 Thread Vitaly Buka via cfe-commits
@@ -960,6 +960,7 @@ Sanitizers -- - ``-fsanitize=vptr`` is no longer a part of ``-fsanitize=undefined``. +- UBSan ignorelists now support the syntax ``src:*=sanitize``. vitalybuka wrote: I think it applies to all Sanitizers, with src: syntax https://

[clang] [llvm] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-20 Thread Vitaly Buka via cfe-commits
@@ -78,9 +78,7 @@ For example, supplying the above ``ignorelist.txt`` to instrumentation for arithmetic operations containing values of type ``int``. The ``=sanitize`` category is also supported. Any types assigned to the vitalybuka wrote: type -> entry? htt

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Also I don't mind we fix multifile and sections in followup patches. But this one needs at least documentation update. https://github.com/llvm/llvm-project/pull/140529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Note: Use to download my updates `spr patch 140529` https://github.com/llvm/llvm-project/pull/140529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
@@ -3,11 +3,11 @@ // RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow -fsanitize-ignorelist=%t/src.ignorelist -emit-llvm %t/test2.c -o - | FileCheck %s --check-prefixes=CHECK2 -// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=sig

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
@@ -3,11 +3,11 @@ // RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow -fsanitize-ignorelist=%t/src.ignorelist -emit-llvm %t/test2.c -o - | FileCheck %s --check-prefixes=CHECK2 -// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=sig

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/140529 >From b83755d2aa0c5417ab8f359aa842449213437a7a Mon Sep 17 00:00:00 2001 From: Qinkun Bao Date: Mon, 19 May 2025 11:14:01 + Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?U

[clang] 5db4aea - [NFC] Extend ubsan-src-ignorelist-category.test

2025-05-19 Thread Vitaly Buka via cfe-commits
Author: Vitaly Buka Date: 2025-05-19T15:45:43-07:00 New Revision: 5db4aeae3c413d586faed03771626818d6a807a9 URL: https://github.com/llvm/llvm-project/commit/5db4aeae3c413d586faed03771626818d6a807a9 DIFF: https://github.com/llvm/llvm-project/commit/5db4aeae3c413d586faed03771626818d6a807a9.diff L

[clang] b93bc77 - [NFC] Extend ubsan-src-ignorelist-category.test

2025-05-19 Thread Vitaly Buka via cfe-commits
Author: Vitaly Buka Date: 2025-05-19T15:42:59-07:00 New Revision: b93bc773f86b3746f8023c5dda9a8ab892fa0499 URL: https://github.com/llvm/llvm-project/commit/b93bc773f86b3746f8023c5dda9a8ab892fa0499 DIFF: https://github.com/llvm/llvm-project/commit/b93bc773f86b3746f8023c5dda9a8ab892fa0499.diff L

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: llvm-project/clang/docs/SanitizerSpecialCaseList.rst needs to be updated And nice to mention in llvm-project/clang/docs/ReleaseNotes.rst https://github.com/llvm/llvm-project/pull/140529 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/140529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/140529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
@@ -1,17 +1,16 @@ // RUN: rm -rf %t // RUN: split-file %s %t -// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow -fsanitize-ignorelist=%t/src.ignorelist -emit-llvm %t/test1.c -o - | FileCheck %s --check-prefixes=CHECK1,IGNORE +// RUN: %c

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
@@ -44,6 +44,12 @@ bool NoSanitizeList::containsFunction(SanitizerMask Mask, bool NoSanitizeList::containsFile(SanitizerMask Mask, StringRef FileName, StringRef Category) const { + unsigned NoSanLine = SSCL->inSectionBlame(Mask, "src", FileNa

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/140529 >From b83755d2aa0c5417ab8f359aa842449213437a7a Mon Sep 17 00:00:00 2001 From: Qinkun Bao Date: Mon, 19 May 2025 11:14:01 + Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?U

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/140529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Pre-commit UBSAN src:*=sanitize test (PR #140602)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/140602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/140529 >From b83755d2aa0c5417ab8f359aa842449213437a7a Mon Sep 17 00:00:00 2001 From: Qinkun Bao Date: Mon, 19 May 2025 11:14:01 + Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?U

[clang] [NFC] Pre-commit UBSAN src:*=sanitize test (PR #140602)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/140602 >From 210f005ecccbbd4fed439d3e156d5e0146807bed Mon Sep 17 00:00:00 2001 From: Qinkun Bao Date: Mon, 19 May 2025 19:49:33 + Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?U

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: rm -rf %t vitalybuka wrote: But in this case we failed to do so, if reordering of patches is needed, SPR often fails. https://github.com/llvm/llvm-project/pull/140529 ___ cfe-commits mailing

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/140529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Pre-commit UBSAN src:*=sanitize test (PR #140602)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/140602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Pre-commit UBSAN src:*=sanitize test (PR #140602)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/140602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DO not merge] demo test for https://github.com/llvm/llvm-project/pull/140529 (PR #140602)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/140602 >From 210f005ecccbbd4fed439d3e156d5e0146807bed Mon Sep 17 00:00:00 2001 From: Qinkun Bao Date: Mon, 19 May 2025 19:49:33 + Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?= =?U

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/140529 >From b83755d2aa0c5417ab8f359aa842449213437a7a Mon Sep 17 00:00:00 2001 From: Qinkun Bao Date: Mon, 19 May 2025 11:14:01 + Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?U

[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)

2025-05-19 Thread Vitaly Buka via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: rm -rf %t vitalybuka wrote: THe point of SPR to have stacked PR, so this one will already be rebased on #140602 https://github.com/llvm/llvm-project/pull/140529 ___ cfe-commits mailing list

[clang] [DO not merge] demo test for https://github.com/llvm/llvm-project/pull/140529 (PR #140602)

2025-05-19 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > > The linked pull request (#140529) introduces a new feature rather than > > correcting a bug. > > I would argue that since the `src:*=sanitize` syntax could reasonably be > expected to work, but it did not work, then that is both a missing feature > and a bug (not working

[clang] [DO not merge] demo test for https://github.com/llvm/llvm-project/pull/140529 (PR #140602)

2025-05-19 Thread Vitaly Buka via cfe-commits
@@ -0,0 +1,43 @@ +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow -fsanitize-ignorelist=%t/src.ignorelist -emit-llvm %t/test1.c -o - | FileCheck %s --check-prefixes=CHECK1,IGNORE +// RUN: %cl

[clang] [DO not merge] demo test for https://github.com/llvm/llvm-project/pull/140529 (PR #140602)

2025-05-19 Thread Vitaly Buka via cfe-commits
@@ -0,0 +1,43 @@ +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow -fsanitize-ignorelist=%t/src.ignorelist -emit-llvm %t/test1.c -o - | FileCheck %s --check-prefixes=CHECK1,IGNORE

[clang] [DO not merge] demo test for https://github.com/llvm/llvm-project/pull/140529 (PR #140602)

2025-05-19 Thread Vitaly Buka via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow -fsanitize-ignorelist=%t/src.ignorelist -emit-llvm %t/test1.c -o - | FileCheck %s -check-prefix=CHECK-ALLOWLIST +// RUN: %clang_cc1 -trip

[clang] [DO not merge] demo test for https://github.com/llvm/llvm-project/pull/140529 (PR #140602)

2025-05-19 Thread Vitaly Buka via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow -fsanitize-ignorelist=%t/src.ignorelist -emit-llvm %t/test1.c -o - | FileCheck %s -check-prefix=CHECK-ALLOWLIST vitalybu

[clang] [DO not merge] demo test for https://github.com/llvm/llvm-project/pull/140529 (PR #140602)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/140602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DO not merge] demo test for https://github.com/llvm/llvm-project/pull/140529 (PR #140602)

2025-05-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/140602 >From 210f005ecccbbd4fed439d3e156d5e0146807bed Mon Sep 17 00:00:00 2001 From: Qinkun Bao Date: Mon, 19 May 2025 19:49:33 + Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?= =?U

[clang] [llvm] [NFC] Run code formatter on Diagnostic.h/cpp ProfileList.cpp SpecialCaseList.cpp (PR #140316)

2025-05-17 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. I don't have issues with reformatting the entire files, and https://www.llvm.org/docs/Contributing.html says nothing about that. But I guess convention is to reformat only parts you are going to change - less noise in blame output, and

[clang] [Basic] Use llvm::erase_if (NFC) (PR #140309)

2025-05-16 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/140309 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFCI][cfi] Refactor into 'SanitizerInfoFromCFICheckKind' (PR #140117)

2025-05-16 Thread Vitaly Buka via cfe-commits
@@ -2779,6 +2779,29 @@ void CodeGenFunction::EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD, } } +/// Converts the CFITypeCheckKind into SanitizerKind::SanitizerOrdinal and +/// llvm::SanitizerStatKind. +static std::pair +SanitizerInfoFromCFICheckKind(CodeGenFunction:

  1   2   3   4   5   6   7   8   9   10   >