[clang] [Sanitize] fix crash in -fsanitize-annotate-debug-info (PR #149237)

2025-07-16 Thread Florian Mayer via cfe-commits
https://github.com/fmayer ready_for_review https://github.com/llvm/llvm-project/pull/149237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sanitize] fix crash in -fsanitize-annotate-debug-info (PR #149237)

2025-07-16 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/149237 None >From 6324602575fc5310b5ff49bfcb985d531035811b Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Wed, 16 Jul 2025 20:00:45 -0700 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=

[clang] Reapply "[clang] [ubsan] add __has_feature for UBSan checks" (#148322) (PR #148323)

2025-07-11 Thread Florian Mayer via cfe-commits
https://github.com/fmayer closed https://github.com/llvm/llvm-project/pull/148323 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[clang] [ubsan] add __has_feature for UBSan checks" (#148322) (PR #148323)

2025-07-11 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/148323 >From 64b17b603b9300bb15b28d5ded80b174b8eacbb9 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Fri, 11 Jul 2025 18:06:48 -0700 Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

[clang] Reapply "[clang] [ubsan] add __has_feature for UBSan checks" (#148322) (PR #148323)

2025-07-11 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/148323 >From 64b17b603b9300bb15b28d5ded80b174b8eacbb9 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Fri, 11 Jul 2025 18:06:48 -0700 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

[clang] Reapply "[clang] [ubsan] add __has_feature for UBSan checks" (#148322) (PR #148323)

2025-07-11 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/148323 This reverts commit 102c15ad28d3c312ea8926c85dbf907ca0d07b84. >From 64b17b603b9300bb15b28d5ded80b174b8eacbb9 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Fri, 11 Jul 2025 18:06:48 -0700 Subject: [PATCH] =

[clang] Revert "[clang] [ubsan] add __has_feature for UBSan checks" (PR #148322)

2025-07-11 Thread Florian Mayer via cfe-commits
https://github.com/fmayer closed https://github.com/llvm/llvm-project/pull/148322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[clang] [ubsan] add __has_feature for UBSan checks" (PR #148322)

2025-07-11 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/148322 Reverts llvm/llvm-project#148310 Some targets don't support the flags passed in the test >From f1cc3eaf2707726d86efbb651478d7310b8a3840 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Fri, 11 Jul 2025 18:01:

[clang] [Clang][CodeGen] Emit “trap reasons” on UBSan traps (PR #145967)

2025-07-10 Thread Florian Mayer via cfe-commits
fmayer wrote: I would prefer this to be behind a flag (not necessarily in this PR), even if it's default turned on. People might not want synthetic frames added to their debug information and the top frame to point to the real code; also as this somewhat overlaps with the logic of `-fsanitize-

[clang] [llvm] [clang] Add flag fallow-runtime-check-skip-hot-cutoff (PR #145999)

2025-06-27 Thread Florian Mayer via cfe-commits
https://github.com/fmayer closed https://github.com/llvm/llvm-project/pull/145999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Add flag fallow-runtime-check-skip-hot-cutoff (PR #145999)

2025-06-27 Thread Florian Mayer via cfe-commits
https://github.com/fmayer edited https://github.com/llvm/llvm-project/pull/145999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-06-26 Thread Florian Mayer via cfe-commits
https://github.com/fmayer closed 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] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

2025-06-04 Thread Florian Mayer via cfe-commits
@@ -6435,10 +6433,44 @@ llvm::DILocation *CodeGenFunction::SanitizerAnnotateDebugInfo( #undef SANITIZER_CHECK }; + // Label doesn't require sanitization + + return Label; +} + +static std::string +SanitizerOrdinalToCheckLabel(SanitizerKind::SanitizerOrdinal Ordinal) { +

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

2025-06-04 Thread Florian Mayer via cfe-commits
@@ -6435,10 +6433,44 @@ llvm::DILocation *CodeGenFunction::SanitizerAnnotateDebugInfo( #undef SANITIZER_CHECK }; + // Label doesn't require sanitization + fmayer wrote: random newline https://github.com/llvm/llvm-project/pull/141997 _

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

2025-06-04 Thread Florian Mayer via cfe-commits
https://github.com/fmayer 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-02 Thread Florian Mayer 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 Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. Thanks 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-02 Thread Florian Mayer via cfe-commits
@@ -4734,7 +4770,16 @@ Value *ScalarExprEmitter::EmitShl(const BinOpInfo &Ops) { RHS = ConstrainShiftValue(Ops.LHS, RHS, "shl.mask"); else if ((SanitizeBase || SanitizeExponent) && isa(Ops.LHS->getType())) { -CodeGenFunction::SanitizerScope SanScope(&CGF);

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

2025-06-02 Thread Florian Mayer via cfe-commits
@@ -597,8 +597,15 @@ class CodeGenFunction : public CodeGenTypeCache { class SanitizerScope { CodeGenFunction *CGF; +// ApplyDebugLocation is undeclared: CGDebugInfo.h is not #included in this fmayer wrote: Just forward declare it. https://github.

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

2025-06-02 Thread Florian Mayer via cfe-commits
@@ -2756,10 +2758,23 @@ CodeGenFunction::SanitizerScope::SanitizerScope(CodeGenFunction *CGF) : CGF(CGF) { assert(!CGF->IsSanitizerScope); CGF->IsSanitizerScope = true; + + assert(!this->ApplyTrapDI); fmayer wrote: Why `this`? I would order this with

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

2025-06-02 Thread Florian Mayer via cfe-commits
@@ -4204,7 +4238,9 @@ static Value *emitPointerArithmetic(CodeGenFunction &CGF, PtrTy->getPointerAddressSpace())) return Ptr; // The inbounds GEP of null is valid iff the index is zero. -CodeGenFunction::SanitizerScope SanScope(&CGF);

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

2025-06-02 Thread Florian Mayer via cfe-commits
https://github.com/fmayer requested changes to 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-05-30 Thread Florian Mayer via cfe-commits
https://github.com/fmayer requested changes to this pull request. How is this going to be useful? We should make some effort to try to determine where the overhead comes from. I don't like that the specific array_bounds inline function is going away _even though we have a specific codepath for

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

2025-05-28 Thread Florian Mayer via cfe-commits
https://github.com/fmayer 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] [llvm] [NFCI] [ValueTracking] Add pass to print ConstantRanges (PR #140144)

2025-05-15 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/140144 >From 2d82539ce535f6725864815077111ead705d8ce4 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 15 May 2025 14:38:00 -0700 Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?= =?UT

[clang] [NFCI] [ValueTracking] Add pass to print ConstantRanges (PR #140144)

2025-05-15 Thread Florian Mayer via cfe-commits
https://github.com/fmayer edited https://github.com/llvm/llvm-project/pull/140144 ___ 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 Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. 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 'ParseCFITypeCheckKind' (PR #140117)

2025-05-15 Thread Florian Mayer 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] Refactor into 'ParseCFITypeCheckKind' (PR #140117)

2025-05-15 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. lgtm with optional comment 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] Refactor into 'ParseCFITypeCheckKind' (PR #140117)

2025-05-15 Thread Florian Mayer via cfe-commits
https://github.com/fmayer 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] Refactor into 'ParseCFITypeCheckKind' (PR #140117)

2025-05-15 Thread Florian Mayer 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] Refactor into 'ParseCFITypeCheckKind' (PR #140117)

2025-05-15 Thread Florian Mayer 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] [sanitizer][NFCI] Add 'SanitizerAnnotateDebugInfo' (PR #139965)

2025-05-14 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. 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] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-14 Thread Florian Mayer 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-14 Thread Florian Mayer 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-13 Thread Florian Mayer 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-13 Thread Florian Mayer 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] [cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (PR #139809)

2025-05-13 Thread Florian Mayer via cfe-commits
fmayer 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 that it changed for no g

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

2025-05-13 Thread Florian Mayer via cfe-commits
fmayer wrote: I am not a fan of the change to the function used for array-bounds. 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] [clang] Add hasAnyNameInVector matcher (PR #139594)

2025-05-13 Thread Florian Mayer via cfe-commits
fmayer wrote: > > > Are there any planned in-tree uses for this matcher? > > > > > > I had a downstream use planned. Does this mean I will have to reimplement > > `internal::HasNameMatcher`? > > Can you adapt the code to use `hasAnyName()` instead, as that can accept a > variadic number of `

[clang] [clang] Add hasAnyNameInVector matcher (PR #139594)

2025-05-12 Thread Florian Mayer via cfe-commits
fmayer wrote: > Are there any planned in-tree uses for this matcher? I had a downstream use planned. Does this mean I will have to reimplement `internal::HasNameMatcher`? https://github.com/llvm/llvm-project/pull/139594 ___ cfe-commits mailing list c

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

2025-05-12 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. 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] [clang] Add hasAnyNameInVector matcher (PR #139594)

2025-05-12 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/139594 This is useful for matching functions whose name is given as a parameter, e.g. Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e;

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

2025-05-08 Thread Florian Mayer via cfe-commits
https://github.com/fmayer requested changes to this pull request. windows bot fails. argument ordering strikes again? https://github.com/llvm/llvm-project/pull/139149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

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

2025-05-08 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. 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] [sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-06 Thread Florian Mayer via cfe-commits
https://github.com/fmayer requested changes to this pull request. Seems like the fsanitize test is failing now https://github.com/llvm/llvm-project/pull/138577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

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

2025-05-06 Thread Florian Mayer 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 Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. 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 Florian Mayer 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 Florian Mayer 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] [llvm] [MTE] generalize overalignment / size of MTE globals (PR #121957)

2025-05-05 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/121957 >From 2feb85c15f64546cb6874e1ca0a1310bd1e1bedd Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Tue, 7 Jan 2025 07:57:09 -0800 Subject: [PATCH 1/7] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF

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

2025-05-05 Thread Florian Mayer 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] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functions and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-05 Thread Florian Mayer 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 Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. lgtm 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 Florian Mayer via cfe-commits
https://github.com/fmayer 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] [clang] rename FPOptions.def's macro to FP_OPTION (PR #138374)

2025-05-02 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. LGTM, but I have only done a very isolated change on this code before. https://github.com/llvm/llvm-project/pull/138374 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [ARM, AArch64] Fix ABI bugs with over-sized bitfields (PR #126774)

2025-05-01 Thread Florian Mayer via cfe-commits
fmayer wrote: Could we make sure this gets called out in the Release Notes? Even if it's a fix, this is a change of ABI which could break stuff. https://github.com/llvm/llvm-project/pull/126774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] [ARM, AArch64] Fix ABI bugs with over-sized bitfields (PR #126774)

2025-04-29 Thread Florian Mayer via cfe-commits
fmayer wrote: This changed the size of the following struct: ``` #include struct A { bool value : 64 = false; uint64_t : 448; }; static_assert(sizeof(A) == 64); ``` Used to be 64 but became 80. I bisected to this change. ``` $ llvm-project/build/bin/clang++ -target aarch64 -c f

[clang] [Clang] Bypass TAD during overload resolution if a perfect match exists (PR #136018)

2025-04-29 Thread Florian Mayer via cfe-commits
fmayer wrote: clang now fails an assertion on this ``` class a { template < typename b > void c(); void c(int (a::*)(int, int)); template < typename b > b d(b , b) { c(&::d); } }; ``` ``` #0 0x55bc6cac8e58 llvm::sys::PrintStackTrace(l

[clang] [Driver][CFI] Allow CFI with minimal runtime (PR #137103)

2025-04-24 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. https://github.com/llvm/llvm-project/pull/137103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-22 Thread Florian Mayer via cfe-commits
fmayer wrote: > Last time I checks, if the branch endup with unreachable, compiler can figure > it out as UNLIKELY. So PR like this is effectively NOP. I built tcmalloc with and without this change and get different codegen https://github.com/llvm/llvm-project/pull/134310 _

[clang] [llvm] [MTE] do not tag zero sized globals (PR #136020)

2025-04-17 Thread Florian Mayer via cfe-commits
https://github.com/fmayer closed https://github.com/llvm/llvm-project/pull/136020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MTE] do not tag zero sized globals (PR #136020)

2025-04-17 Thread Florian Mayer via cfe-commits
https://github.com/fmayer edited https://github.com/llvm/llvm-project/pull/136020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MTE] decide whether to tag global in AsmPrinter (PR #135891)

2025-04-17 Thread Florian Mayer via cfe-commits
https://github.com/fmayer closed https://github.com/llvm/llvm-project/pull/135891 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MTE] decide whether to tag global in AsmPrinter (PR #135891)

2025-04-16 Thread Florian Mayer via cfe-commits
fmayer wrote: > Should we add AsmPrinter tests to replace the ones we're removing from Clang? We have memtag-globals-asm.cpp https://github.com/llvm/llvm-project/pull/135891 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [llvm] [MTE] decide whether to tag global in AsmPrinter (PR #135891)

2025-04-16 Thread Florian Mayer via cfe-commits
https://github.com/fmayer ready_for_review https://github.com/llvm/llvm-project/pull/135891 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MTE] decide whether to tag global in AsmPrinter (PR #135891)

2025-04-16 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/135891 >From cf7c14e486c47c03560ea4b3c6fe012bf1c7de17 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Tue, 15 Apr 2025 17:36:37 -0700 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

[clang] [NFC][Drive] Reorder boolean expression (PR #135881)

2025-04-15 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. nit: Driver nit2: I don't think this is really reordering. https://github.com/llvm/llvm-project/pull/135881 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [llvm] [MTE] decide whether to tag global in AsmPrinter (PR #135891)

2025-04-15 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/135891 there are llvm passes that would invalidate the decision we make in clang. >From cf7c14e486c47c03560ea4b3c6fe012bf1c7de17 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Tue, 15 Apr 2025 17:36:37 -0700 Subje

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

2025-04-10 Thread Florian Mayer via cfe-commits
@@ -41,31 +41,31 @@ void caller(void (*f)(void)) { // CHECK: [[CONT1]]: // CHECK: %[[NOT_1:.*]] = icmp ne i8 %[[KIND]], 1 -// CHECK: br i1 %[[NOT_1]], label %[[CONT2:.*]], label %[[HANDLE1:.*]], !nosanitize +// CHECK: br i1 %[[NOT_1]], label %[[CONT2:.*]], label %[[HAND

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

2025-04-04 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/134310 >From 44f9ccd6b4104fb07ad9cf9581c41c6d473525ec Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 3 Apr 2025 14:53:29 -0700 Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF

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

2025-04-04 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/134310 >From 44f9ccd6b4104fb07ad9cf9581c41c6d473525ec Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 3 Apr 2025 14:53:29 -0700 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF

[clang] [clang] Track final substitution for Subst* AST nodes (PR #132748)

2025-04-04 Thread Florian Mayer via cfe-commits
fmayer wrote: Looks like this CL broke the MSAN bot: https://lab.llvm.org/buildbot/#/builders/169/builds/10068 https://github.com/llvm/llvm-project/pull/132748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

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

2025-04-04 Thread Florian Mayer via cfe-commits
https://github.com/fmayer closed https://github.com/llvm/llvm-project/pull/134310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-03 Thread Florian Mayer via cfe-commits
https://github.com/fmayer edited https://github.com/llvm/llvm-project/pull/134310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-03 Thread Florian Mayer via cfe-commits
https://github.com/fmayer ready_for_review https://github.com/llvm/llvm-project/pull/134310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-03 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/134310 >From 44f9ccd6b4104fb07ad9cf9581c41c6d473525ec Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 3 Apr 2025 14:53:29 -0700 Subject: [PATCH 1/6] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF

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

2025-04-03 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/134310 >From 44f9ccd6b4104fb07ad9cf9581c41c6d473525ec Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 3 Apr 2025 14:53:29 -0700 Subject: [PATCH 1/5] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF

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

2025-04-03 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/134310 >From 44f9ccd6b4104fb07ad9cf9581c41c6d473525ec Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 3 Apr 2025 14:53:29 -0700 Subject: [PATCH 1/4] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF

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

2025-04-03 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/134310 This will improve performance, because the trap checks fail at most once (when the program crashes). >From 44f9ccd6b4104fb07ad9cf9581c41c6d473525ec Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 3 Apr

[clang] c0952a9 - [clang] [sanitizer] add pseudofunction to indicate array-bounds check (#128977)

2025-03-28 Thread Florian Mayer via cfe-commits
Author: Florian Mayer Date: 2025-03-28T13:21:03-07:00 New Revision: c0952a931c7d556ca9f0073d86d591a37eb60477 URL: https://github.com/llvm/llvm-project/commit/c0952a931c7d556ca9f0073d86d591a37eb60477 DIFF: https://github.com/llvm/llvm-project/commit/c0952a931c7d556ca9f0073d86d591a37eb60477.diff

[clang] [NFC] [dataflow] generalize smart pointer caching (PR #133350)

2025-03-28 Thread Florian Mayer via cfe-commits
https://github.com/fmayer closed https://github.com/llvm/llvm-project/pull/133350 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] [dataflow] generalize smart pointer caching (PR #133350)

2025-03-28 Thread Florian Mayer via cfe-commits
@@ -164,16 +161,19 @@ ast_matchers::StatementMatcher isPointerLikeOperatorArrow() { ofClass(pointerClass(); } -ast_matchers::StatementMatcher isSmartPointerLikeValueMethodCall() { +ast_matchers::StatementMatcher +isSmartPointerLikeValueMethodCal

[clang] [NFC] [dataflow] generalize smart pointer caching (PR #133350)

2025-03-28 Thread Florian Mayer via cfe-commits
@@ -23,12 +24,27 @@ using ast_matchers::pointerType; using ast_matchers::referenceType; using ast_matchers::returns; -bool hasSmartPointerClassShape(const CXXRecordDecl &RD, bool &HasGet, - bool &HasValue) { +CanQualType getLikeReturnType(QualType

[clang] [NFC] [dataflow] generalize smart pointer caching (PR #133350)

2025-03-28 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/133350 >From 8ece858e76fad0962b2567f03bf80bcaf2828348 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 27 Mar 2025 18:25:23 -0700 Subject: [PATCH 1/7] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

[clang] [NFC] [dataflow] generalize smart pointer caching (PR #133350)

2025-03-27 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/133350 >From 8ece858e76fad0962b2567f03bf80bcaf2828348 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 27 Mar 2025 18:25:23 -0700 Subject: [PATCH 1/5] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

[clang] [NFC] [dataflow] generalize smart pointer caching (PR #133350)

2025-03-27 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/133350 >From 8ece858e76fad0962b2567f03bf80bcaf2828348 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 27 Mar 2025 18:25:23 -0700 Subject: [PATCH 1/4] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

[clang] [NFC] [dataflow] generalize smart pointer caching (PR #133350)

2025-03-27 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/133350 >From 8ece858e76fad0962b2567f03bf80bcaf2828348 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 27 Mar 2025 18:25:23 -0700 Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

[clang] [NFC] [dataflow] generalize smart pointer caching (PR #133350)

2025-03-27 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/133350 >From 8ece858e76fad0962b2567f03bf80bcaf2828348 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 27 Mar 2025 18:25:23 -0700 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

[clang] [NFC] [clang] rename InlinedTrapFuncMap to InlinedSubprogramMap (PR #132993)

2025-03-26 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/132993 None >From 4bd5834b5f32250269e67a9b26e406b9e01a37b1 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Tue, 25 Mar 2025 14:05:31 -0700 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=

[clang] [NFC] [clang] rename InlinedTrapFuncMap to InlinedSubprogramMap (PR #132993)

2025-03-25 Thread Florian Mayer via cfe-commits
https://github.com/fmayer closed https://github.com/llvm/llvm-project/pull/132993 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add matcher for pointer-like types to be cached (PR #132314)

2025-03-21 Thread Florian Mayer via cfe-commits
https://github.com/fmayer closed https://github.com/llvm/llvm-project/pull/132314 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix UB in #131515 (PR #132091)

2025-03-19 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. https://github.com/llvm/llvm-project/pull/132091 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Offload] Handle `BoundArchitecture` for non-GPU targets (PR #132037)

2025-03-19 Thread Florian Mayer via cfe-commits
fmayer wrote: Please take a look at the sanitizer buildbot failure above. https://github.com/llvm/llvm-project/pull/132037 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix UB in #131515 (PR #132091)

2025-03-19 Thread Florian Mayer via cfe-commits
@@ -1681,7 +1681,7 @@ std::optional Sema::GetDecompositionElementCount(QualType T, llvm::APSInt TupleSize(Ctx.getTypeSize(Ctx.getSizeType())); switch (isTupleLike(*this, Loc, T, TupleSize)) { case IsTupleLike::Error: -return {}; +return std::nullopt;

[clang] [Clang] Fix UB in #131515 (PR #132091)

2025-03-19 Thread Florian Mayer via cfe-commits
@@ -1681,7 +1681,7 @@ std::optional Sema::GetDecompositionElementCount(QualType T, llvm::APSInt TupleSize(Ctx.getTypeSize(Ctx.getSizeType())); switch (isTupleLike(*this, Loc, T, TupleSize)) { case IsTupleLike::Error: -return {}; +return std::nullopt;

[clang] [llvm] [MTE] generalize overalignment / size of MTE globals (PR #121957)

2025-03-15 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/121957 >From 2feb85c15f64546cb6874e1ca0a1310bd1e1bedd Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Tue, 7 Jan 2025 07:57:09 -0800 Subject: [PATCH 1/7] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF

[clang] [llvm] [MTE] generalize overalignment / size of MTE globals (PR #121957)

2025-03-06 Thread Florian Mayer via cfe-commits
fmayer wrote: Actually, there was a bug I fixed: even if the alignment of the original variable is >= 16, we still need to fix up the size. https://github.com/llvm/llvm-project/pull/121957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [llvm] [MTE] generalize overalignment / size of MTE globals (PR #121957)

2025-03-06 Thread Florian Mayer via cfe-commits
@@ -715,8 +715,16 @@ MCSymbol *AsmPrinter::getSymbolPreferLocal(const GlobalValue &GV) const { return TM.getSymbol(&GV); } -/// EmitGlobalVariable - Emit the specified global variable to the .s file. void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) { + MaybeA

[clang] [llvm] [MTE] generalize overalignment / size of MTE globals (PR #121957)

2025-03-06 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/121957 >From 2feb85c15f64546cb6874e1ca0a1310bd1e1bedd Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Tue, 7 Jan 2025 07:57:09 -0800 Subject: [PATCH 1/7] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF

  1   2   3   4   >