[clang] [sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-05 Thread Thurston Dang via cfe-commits
https://github.com/thurstond edited https://github.com/llvm/llvm-project/pull/138577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-05 Thread Thurston Dang via cfe-commits
https://github.com/thurstond edited https://github.com/llvm/llvm-project/pull/138577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-05 Thread Thurston Dang via cfe-commits
thurstond wrote: > In description ? > > > Florian1 > > @fmayer would be nicer for cross-linking Done https://github.com/llvm/llvm-project/pull/138577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-05 Thread Thurston Dang via cfe-commits
@@ -2533,6 +2533,31 @@ def fno_sanitize_merge_handlers : Flag<["-"], "fno-sanitize-merge">, Group, AliasArgs<["all"]>, Visibility<[ClangOption, CLOption]>, HelpText<"Do not allow compiler to merge handlers for any sanitizers">;

[clang] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functions and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-05 Thread Thurston Dang via cfe-commits
@@ -2533,6 +2533,31 @@ def fno_sanitize_merge_handlers : Flag<["-"], "fno-sanitize-merge">, Group, AliasArgs<["all"]>, Visibility<[ClangOption, CLOption]>, HelpText<"Do not allow compiler to merge handlers for any sanitizers">;

[clang] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functions and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-05 Thread Thurston Dang via cfe-commits
@@ -2533,6 +2533,31 @@ def fno_sanitize_merge_handlers : Flag<["-"], "fno-sanitize-merge">, Group, AliasArgs<["all"]>, Visibility<[ClangOption, CLOption]>, HelpText<"Do not allow compiler to merge handlers for any sanitizers">;

[clang] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functions and part… (PR #138577)

2025-05-05 Thread Thurston Dang via cfe-commits
https://github.com/thurstond created https://github.com/llvm/llvm-project/pull/138577 …ly replace '-mllvm -array-bounds-pseudofn' Florian1 introduced '-mllvm -array-bounds-pseudofn' (https://github.com/llvm/llvm-project/pull/128977/) to make it easier to see why crashes occurred, and to estim

[clang] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functions and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-05 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/138577 >From 1cb28ef0b3313c3fd60667cc7928f0fed8d1838a Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Mon, 5 May 2025 20:11:09 + Subject: [PATCH 1/2] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functio

[clang] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functions and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-05 Thread Thurston Dang via cfe-commits
https://github.com/thurstond edited https://github.com/llvm/llvm-project/pull/138577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functions and part… (PR #138577)

2025-05-05 Thread Thurston Dang via cfe-commits
https://github.com/thurstond edited https://github.com/llvm/llvm-project/pull/138577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functions and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-05 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/138577 >From 1cb28ef0b3313c3fd60667cc7928f0fed8d1838a Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Mon, 5 May 2025 20:11:09 + Subject: [PATCH 1/3] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functio

[clang] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functions and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-05 Thread Thurston Dang via cfe-commits
@@ -1228,7 +1228,10 @@ void CodeGenFunction::EmitBoundsCheckImpl(const Expr *E, llvm::Value *Bound, SanitizerScope SanScope(this); llvm::DILocation *CheckDI = Builder.getCurrentDebugLocation(); - if (ClArrayBoundsPseudoFn && CheckDI) { + if ((ClArrayBoundsPseudoFn || --

[clang] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functions and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-05 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/138577 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans

[clang] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functions and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-05 Thread Thurston Dang via cfe-commits
@@ -2533,6 +2533,30 @@ def fno_sanitize_merge_handlers : Flag<["-"], "fno-sanitize-merge">, Group, AliasArgs<["all"]>, Visibility<[ClangOption, CLOption]>, HelpText<"Do not allow compiler to merge handlers for any sanitizers">;

[clang] [cfi] Fix one -fno-sanitize-merge case, and add two TODOs (PR #135438)

2025-04-23 Thread Thurston Dang via cfe-commits
https://github.com/thurstond closed https://github.com/llvm/llvm-project/pull/135438 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sanitizer] Apply AlwaysIn/Out in parseSanitizeArgs (PR #129405)

2025-04-18 Thread Thurston Dang via cfe-commits
https://github.com/thurstond closed https://github.com/llvm/llvm-project/pull/129405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sanitizer] Apply AlwaysIn/Out in parseSanitizeArgs (PR #129405)

2025-03-01 Thread Thurston Dang via cfe-commits
https://github.com/thurstond created https://github.com/llvm/llvm-project/pull/129405 For backwards compatibility, `parseSanitizeArgs`/`parseSanitizeTrapArgs` had an incomplete refactoring in https://github.com/llvm/llvm-project/pull/119819, in order to accommodate the special case of vptr in

[clang] [clang] Implement __attribute__((format_matches)) (PR #116708)

2025-02-24 Thread Thurston Dang via cfe-commits
=?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q

[clang] [ubsan] Remove -fsanitizer=vptr from -fsanitizer=undefined (PR #121115)

2025-02-25 Thread Thurston Dang via cfe-commits
@@ -214,13 +214,14 @@ Available checks are: the wrong dynamic type, or that its lifetime has not begun or has ended. Incompatible with ``-fno-rtti``. Link must be performed by ``clang++``, not ``clang``, to make sure C++-specific parts of the runtime library and

[clang] [clang] Implement __attribute__((format_matches)) (PR #116708)

2025-02-25 Thread Thurston Dang via cfe-commits
=?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q

[clang] [clang] [sanitizer] predict trap checks succeed (PR #134310)

2025-04-03 Thread Thurston Dang via cfe-commits
thurstond wrote: > Trap checks fail at most once (when the program crashes). It's technically possible to have a signal handler that consumes SIGILL and then jumps over the offending instruction. The UBSan docs allude to this: "-fsanitize-trap=...: execute a trap instruction (doesn’t require U

[clang] [sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-07 Thread Thurston Dang via cfe-commits
thurstond wrote: YOLO https://github.com/llvm/llvm-project/pull/138577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-07 Thread Thurston Dang via cfe-commits
https://github.com/thurstond closed https://github.com/llvm/llvm-project/pull/138577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [cfi][NFCI] Pre-commit -fsanitize-annotate-debug-info tests for CFI (PR #139149)

2025-05-09 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/139149 >From c2a5ecf9d89b4942fb1e95c7a7713585155099d0 Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Thu, 8 May 2025 20:18:22 + Subject: [PATCH 1/4] [cfi][NFCI] Pre-commit -fsanitize-annotate-debug-info test

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-13 Thread Thurston Dang via cfe-commits
https://github.com/thurstond created https://github.com/llvm/llvm-project/pull/139809 This connects the -fsanitize-annotate-debug-info plumbing (https://github.com/llvm/llvm-project/pull/138577) to CFI check codegen. Updates the tests from https://github.com/llvm/llvm-project/pull/139149. A s

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-13 Thread Thurston Dang via cfe-commits
https://github.com/thurstond edited https://github.com/llvm/llvm-project/pull/139809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-13 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/139809 >From ead256dfd33d04877766ddb26830f264682e9b48 Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 7 May 2025 23:33:21 + Subject: [PATCH 1/2] [cfi] Enable -fsanitize-annotate-debug-info functionality

[clang] [cfi][NFCI] Pre-commit -fsanitize-annotate-debug-info tests for CFI (PR #139149)

2025-05-12 Thread Thurston Dang via cfe-commits
thurstond wrote: > windows bot fails. argument ordering strikes again? Test output fixed in https://github.com/llvm/llvm-project/pull/139149/commits/bb3df7d6a0f7c90afff5a05b31bda5fe763a2484, tests now pass https://github.com/llvm/llvm-project/pull/139149 __

[clang] [cfi][NFCI] Pre-commit -fsanitize-annotate-debug-info tests for CFI (PR #139149)

2025-05-12 Thread Thurston Dang via cfe-commits
https://github.com/thurstond closed https://github.com/llvm/llvm-project/pull/139149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [cfi][NFCI] Pre-commit -fsanitize-annotate-debug-info tests for CFI (PR #139149)

2025-05-08 Thread Thurston Dang via cfe-commits
https://github.com/thurstond created https://github.com/llvm/llvm-project/pull/139149 These tests will show progress as the -fsanitize-annotate-debug-info plumbing (https://github.com/llvm/llvm-project/pull/138577) gets connected to CFI check codegen. >From c2a5ecf9d89b4942fb1e95c7a7713585155

[clang] [cfi][NFCI] Pre-commit -fsanitize-annotate-debug-info tests for CFI (PR #139149)

2025-05-08 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/139149 >From c2a5ecf9d89b4942fb1e95c7a7713585155099d0 Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Thu, 8 May 2025 20:18:22 + Subject: [PATCH 1/3] [cfi][NFCI] Pre-commit -fsanitize-annotate-debug-info test

[clang] [cfi][NFCI] Pre-commit -fsanitize-annotate-debug-info tests for CFI (PR #139149)

2025-05-08 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/139149 >From c2a5ecf9d89b4942fb1e95c7a7713585155099d0 Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Thu, 8 May 2025 20:18:22 + Subject: [PATCH 1/2] [cfi][NFCI] Pre-commit -fsanitize-annotate-debug-info test

[clang] [cfi][NFCI] Pre-commit -fsanitize-annotate-debug-info tests for CFI (PR #139149)

2025-05-08 Thread Thurston Dang via cfe-commits
@@ -0,0 +1,47 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// RUN: %clang_cc1 -triple x86_64-unknown-linux -O0 -fsanitize-cfi-cross-dso \ thurstond wrote: Changed to -O2 in https://github.com/llvm/llvm

[clang] [sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-06 Thread Thurston Dang via cfe-commits
thurstond wrote: > Seems like the fsanitize test is failing now Fixed https://github.com/llvm/llvm-project/pull/138577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-06 Thread Thurston Dang via cfe-commits
@@ -1228,7 +1228,10 @@ void CodeGenFunction::EmitBoundsCheckImpl(const Expr *E, llvm::Value *Bound, SanitizerScope SanScope(this); llvm::DILocation *CheckDI = Builder.getCurrentDebugLocation(); - if (ClArrayBoundsPseudoFn && CheckDI) { + if ((ClArrayBoundsPseudoFn || --

[clang] [sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-06 Thread Thurston Dang via cfe-commits
thurstond wrote: > Thanks for making changes. I have some very minor suggestions but I'll > approve now and you can decide if it's worth making my suggested changes. Thanks, I like your wording improvements! I've modified the HelpText and comment. https://github.com/llvm/llvm-project/pull/138

[clang] [sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-06 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/138577 >From 1cb28ef0b3313c3fd60667cc7928f0fed8d1838a Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Mon, 5 May 2025 20:11:09 + Subject: [PATCH 1/9] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functio

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-13 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/139809 >From ead256dfd33d04877766ddb26830f264682e9b48 Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 7 May 2025 23:33:21 + Subject: [PATCH 1/4] [cfi] Enable -fsanitize-annotate-debug-info functionality

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-13 Thread Thurston Dang via cfe-commits
thurstond wrote: > > > I am not a fan of the change to the function used for array-bounds. > > > > > > More specific? I like it in general. It's about just about the name of a > > new fake function? > > Sorry, I meant the new name. > > I don't like that it has a `-` in it, and I don't like t

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-13 Thread Thurston Dang via cfe-commits
https://github.com/thurstond edited https://github.com/llvm/llvm-project/pull/139809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-13 Thread Thurston Dang via cfe-commits
@@ -89,7 +89,7 @@ double f1(int b, int i) { // CHECK-TRAP: [[DBG21]] = !DILocation(line: 65, column: 3, scope: [[DBG4]]) // CHECK-TRAP: [[DBG22]] = !DILocation(line: 66, column: 12, scope: [[DBG4]]) // CHECK-TRAP: [[DBG23]] = !DILocation(line: 0, scope: [[META24:![0-9]+]], inl

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-13 Thread Thurston Dang via cfe-commits
@@ -3353,6 +3353,17 @@ class CodeGenFunction : public CodeGenTypeCache { SanitizerSet SkippedChecks = SanitizerSet(), llvm::Value *ArraySize = nullptr); + /// Returns debug info, with additional annotation if enabled by + /// CGM.get

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-13 Thread Thurston Dang via cfe-commits
@@ -2779,13 +2779,47 @@ void CodeGenFunction::EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD, } } +void CodeGenFunction::ParseCFITypeCheckKind(CFITypeCheckKind TCK, thurstond wrote: Fixed in https://github.com/llvm/llvm-project/pull/139809/commits/f

[clang] [sanitizer][NFCI] Add 'SanitizerAnnotateDebugInfo' (PR #139965)

2025-05-14 Thread Thurston Dang via cfe-commits
https://github.com/thurstond created https://github.com/llvm/llvm-project/pull/139965 This generalizes the debug info annotation code from https://github.com/llvm/llvm-project/pull/139149 and moves it into a helper function, SanitizerAnnotateDebugInfo(). Future work can use 'ApplyDebugLocatio

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-14 Thread Thurston Dang via cfe-commits
@@ -1217,6 +1217,35 @@ void CodeGenFunction::EmitBoundsCheck(const Expr *E, const Expr *Base, EmitBoundsCheckImpl(E, Bound, Index, IndexType, IndexedType, Accessed); } +llvm::DILocation *CodeGenFunction::SanitizerAnnotateDebugInfo( thurstond wrote: Spun of

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/139809 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond edited https://github.com/llvm/llvm-project/pull/139809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/139809 >From 3c8c0d59725092fdc51ceeaef913852ba930acce Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 7 May 2025 23:33:21 + Subject: [PATCH 1/9] [cfi] Enable -fsanitize-annotate-debug-info functionality

[clang] [sanitizer] Fix empty string in unsupported argument error for -fsanitize-trap (PR #136549)

2025-05-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/136549 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-15 Thread Thurston Dang via cfe-commits
@@ -2779,13 +2779,50 @@ void CodeGenFunction::EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD, } } +std::pair +CodeGenFunction::ParseCFITypeCheckKind(CFITypeCheckKind TCK) { + SanitizerKind::SanitizerOrdinal M; + llvm::SanitizerStatKind SSK; + + switch (TCK) { + ca

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-15 Thread Thurston Dang via cfe-commits
@@ -2842,24 +2882,12 @@ void CodeGenFunction::EmitVTablePtrCheck(const CXXRecordDecl *RD, !CGM.HasHiddenLTOVisibility(RD)) return; - SanitizerKind::SanitizerOrdinal M; - llvm::SanitizerStatKind SSK; + auto [M, SSK] = ParseCFITypeCheckKind(TCK); switch (TCK) {

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond converted_to_draft https://github.com/llvm/llvm-project/pull/139809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sanitizer] Fix empty string in unsupported argument error for -fsanitize-trap (PR #136549)

2025-05-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond closed https://github.com/llvm/llvm-project/pull/136549 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sanitizer] Fix empty string in unsupported argument error for -fsanitize-trap (PR #136549)

2025-05-15 Thread Thurston Dang via cfe-commits
thurstond wrote: > @thurstond can you please merge this? I don't have write access. Sure! Thanks for the fix :-) https://github.com/llvm/llvm-project/pull/136549 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [sanitizer] Fix empty string in unsupported argument error for -fsanitize-trap (PR #136549)

2025-05-15 Thread Thurston Dang via cfe-commits
thurstond wrote: > > Perhaps a better fix would be to correct the toString function > > I agree, but adding groups to `toString` breaks its other uses. What do you > think about separate `toStringWithGroups`? Hmm, that's a good point. I like your `toStringWithGroups` idea! https://github.com/

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-15 Thread Thurston Dang via cfe-commits
thurstond wrote: Marking as draft - I'll pull out ParseCFITypeCheckKind as a separate NFC patch https://github.com/llvm/llvm-project/pull/139809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

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

2025-05-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond created https://github.com/llvm/llvm-project/pull/140117 This refactors existing code into a 'ParseCFITypeCheckKind' helper function. This will be useful in future work to annotate CFI checks with debug info (https://github.com/llvm/llvm-project/pull/139809). >Fro

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-14 Thread Thurston Dang via cfe-commits
@@ -96,9 +96,9 @@ double f1(int b, int i) { // CHECK-TRAP: [[DBG28]] = !DILocation(line: 66, column: 3, scope: [[DBG4]]) //. // CHECK-NOTRAP: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], isOptimized: false, runtimeVersion: 0, emi

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-14 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/139809 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-14 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/139809 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-14 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/139809 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-14 Thread Thurston Dang via cfe-commits
@@ -68,9 +68,9 @@ double f1(int b, int i) { //. // CHECK-TRAP: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) -// CHEC

[clang] [sanitizer] Fix empty string in unsupported argument error for -fsanitize-trap (PR #136549)

2025-05-14 Thread Thurston Dang via cfe-commits
@@ -259,6 +259,9 @@ // RUN: not %clang --target=aarch64-linux -fsanitize=memtag -I +mte %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANMT-NOMT-1 // CHECK-SANMT-NOMT-1: '-fsanitize=memtag-stack' requires hardware support (+memtag) +// RUN: not %clang --target=aarch64-lin

[clang] [sanitizer] Fix empty string in unsupported argument error for -fsanitize-trap (PR #136549)

2025-05-14 Thread Thurston Dang via cfe-commits
thurstond wrote: Sorry, I didn't notice being tagged earlier. It didn't show up in my review queue since the "Request Review" wasn't used. Thanks for the patch! I agree this is an improvement over the empty output, but it's arguably confusing to tell the user `unsupported argument 'memtag-sta

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-14 Thread Thurston Dang via cfe-commits
@@ -2842,24 +2882,12 @@ void CodeGenFunction::EmitVTablePtrCheck(const CXXRecordDecl *RD, !CGM.HasHiddenLTOVisibility(RD)) return; - SanitizerKind::SanitizerOrdinal M; - llvm::SanitizerStatKind SSK; + auto [M, SSK] = ParseCFITypeCheckKind(TCK); switch (TCK) {

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

2025-05-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/140117 >From 97c6fe5ac09e5ad7663de556753d5e31c05f7aa5 Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Thu, 15 May 2025 18:22:05 + Subject: [PATCH 1/2] [NFCI] Refactor into 'ParseCFITypeCheckKind' This refacto

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

2025-05-15 Thread Thurston Dang via cfe-commits
@@ -3358,6 +3358,11 @@ class CodeGenFunction : public CodeGenTypeCache { SanitizerSet SkippedChecks = SanitizerSet(), llvm::Value *ArraySize = nullptr); + /// Converts the CFITypeCheckKind into SanitizerKind::SanitizerOrdinal and + /

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

2025-05-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond edited https://github.com/llvm/llvm-project/pull/140117 ___ 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-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond closed https://github.com/llvm/llvm-project/pull/140117 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sanitizer][NFCI] Add 'SanitizerAnnotateDebugInfo' (PR #139965)

2025-05-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond closed https://github.com/llvm/llvm-project/pull/139965 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/140117 >From 97c6fe5ac09e5ad7663de556753d5e31c05f7aa5 Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Thu, 15 May 2025 18:22:05 + Subject: [PATCH 1/3] [NFCI] Refactor into 'ParseCFITypeCheckKind' This refacto

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

2025-05-15 Thread Thurston Dang via cfe-commits
@@ -2779,6 +2779,39 @@ void CodeGenFunction::EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD, } } +/// Converts the CFITypeCheckKind into SanitizerKind::SanitizerOrdinal and +/// llvm::SanitizerStatKind. +static std::pair +ParseCFITypeCheckKind(CodeGenFunction::CFIType

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

2025-05-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond edited https://github.com/llvm/llvm-project/pull/140117 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-15 Thread Thurston Dang via cfe-commits
@@ -2779,13 +2779,47 @@ void CodeGenFunction::EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD, } } +std::pair +CodeGenFunction::ParseCFITypeCheckKind(CFITypeCheckKind TCK) { + SanitizerKind::SanitizerOrdinal M; + llvm::SanitizerStatKind SSK; + + switch (TCK) { + ca

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

2025-05-15 Thread Thurston Dang via cfe-commits
@@ -2779,6 +2779,39 @@ void CodeGenFunction::EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD, } } +/// Converts the CFITypeCheckKind into SanitizerKind::SanitizerOrdinal and +/// llvm::SanitizerStatKind. +static std::pair +ParseCFITypeCheckKind(CodeGenFunction::CFIType

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

2025-05-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond edited https://github.com/llvm/llvm-project/pull/140117 ___ 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-15 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/140117 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans

[clang] [Clang] Add missing macro undefs in AttributeSpellingList emitter (PR #141090)

2025-05-22 Thread Thurston Dang via cfe-commits
thurstond wrote: > > Could you please merge this to bring the buildbots back to green? Thanks! > > Done! Thank you! https://github.com/llvm/llvm-project/pull/141090 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [Clang] Add missing macro undefs in AttributeSpellingList emitter (PR #141090)

2025-05-22 Thread Thurston Dang via cfe-commits
thurstond wrote: Could you please merge this to bring the buildbots back to green? Thanks! https://github.com/llvm/llvm-project/pull/141090 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] 57763b7 - Fix-forward excess ';' from 9459c8309c6768cf6aa7956885b2540e16582a93 (#134632)

2025-05-21 Thread Thurston Dang via cfe-commits
Author: Thurston Dang Date: 2025-05-21T17:05:58Z New Revision: 57763b7c6481daed40f412d4b302cc7479a9839e URL: https://github.com/llvm/llvm-project/commit/57763b7c6481daed40f412d4b302cc7479a9839e DIFF: https://github.com/llvm/llvm-project/commit/57763b7c6481daed40f412d4b302cc7479a9839e.diff LOG:

[clang] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-19 Thread Thurston Dang via cfe-commits
https://github.com/thurstond closed https://github.com/llvm/llvm-project/pull/139809 ___ 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 Thurston Dang via cfe-commits
@@ -44,6 +44,13 @@ 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 Thurston Dang via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: rm -rf %t thurstond wrote: Consider pre-committing this test (with the "bad" output) as a separate patch, so that the current patch will show how the test output is fixed. https://github.com/llvm/llvm-project/pull/140529 __

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

2025-05-19 Thread Thurston Dang via cfe-commits
thurstond wrote: This patch should be "[NFC] Precommit test for src:*=sanitize for UBSan" (or similar), have the test output "passing" for the current build of clang (i.e., probably "incorrect" output), reviewed and then merged. https://github.com/llvm/llvm-project/pull/140602

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

2025-05-19 Thread Thurston Dang via cfe-commits
https://github.com/thurstond requested changes to this pull request. Per comment above 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 Thurston Dang via cfe-commits
thurstond 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 as intended)

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

2025-05-19 Thread Thurston Dang via cfe-commits
https://github.com/thurstond 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

<    1   2   3   4