[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Florian Mayer via cfe-commits
@@ -84,6 +84,29 @@ void test_macro_expansion4() { #undef MY_NULL } +template struct pear { + // If you say __null (or NULL), we assume that T will always be a pointer fmayer wrote: why are we only testing one of those? https://github.com/llvm/llvm-project/

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Florian Mayer via cfe-commits
@@ -84,6 +84,29 @@ void test_macro_expansion4() { #undef MY_NULL } +template struct pear { + // If you say __null (or NULL), we assume that T will always be a pointer fmayer wrote: Sorry, the implication of my comment was: explain why in a comment, because

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

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

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Florian Mayer via cfe-commits
@@ -84,6 +84,29 @@ void test_macro_expansion4() { #undef MY_NULL } +template struct pear { + // If you say __null (or NULL), we assume that T will always be a pointer fmayer wrote: Thanks, otherwise this comment will only cause confusion. https://github.co

[clang] [llvm] [sanitizer] Document AddressSanitizer security considerations (PR #100937)

2024-09-30 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. LGTM % vitaly's comment https://github.com/llvm/llvm-project/pull/100937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Florian Mayer via cfe-commits
@@ -84,6 +84,28 @@ void test_macro_expansion4() { #undef MY_NULL } +template struct pear { + // If you say __null (or NULL), we assume that T will always be a pointer + // type, so we suggest replacing it with nullptr. + void f() { x = __null; } + // CHECK-MESSAGES: :[[@L

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Florian Mayer via cfe-commits
@@ -84,6 +84,28 @@ void test_macro_expansion4() { #undef MY_NULL } +template struct pear { + // If you say __null (or NULL), we assume that T will always be a pointer + // type, so we suggest replacing it with nullptr. + void f() { x = __null; } + // CHECK-MESSAGES: :[[@L

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Florian Mayer via cfe-commits
@@ -84,6 +84,28 @@ void test_macro_expansion4() { #undef MY_NULL } +template struct pear { + // If you say __null (or NULL), we assume that T will always be a pointer + // type, so we suggest replacing it with nullptr. + void f() { x = __null; } + // CHECK-MESSAGES: :[[@L

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Florian Mayer via cfe-commits
@@ -84,6 +84,28 @@ void test_macro_expansion4() { #undef MY_NULL } +template struct pear { + // If you say __null (or NULL), we assume that T will always be a pointer + // type, so we suggest replacing it with nullptr. + void f() { x = __null; } + // CHECK-MESSAGES: :[[@L

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

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

[clang] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-10-15 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/111918 >From 3a962270521aa7b48b64e5ac5fa0edb900990023 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 10 Oct 2024 16:05:50 -0700 Subject: [PATCH 1/4] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

[clang] [FlowSensitive] Allow to dump nested RecordStorageLocation (PR #112457)

2024-10-15 Thread Florian Mayer via cfe-commits
fmayer wrote: An example dump that is now possible but crashed before ![image](https://github.com/user-attachments/assets/21e4ce35-4bf2-41dd-9a65-32dedb82723a) https://github.com/llvm/llvm-project/pull/112457 ___ cfe-commits mailing list cfe-commits@l

[clang] [FlowSensitive] Allow to dump nested RecordStorageLocation (PR #112457)

2024-10-15 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/112457 We have an internal analysis that uses them, and the HTML dump would fail on the assertion. >From 4264fe1dfed3fc54f339ad4a769d76158c5ee7d5 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Tue, 15 Oct 2024 17:

[clang] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-10-15 Thread Florian Mayer via cfe-commits
@@ -764,11 +764,17 @@ void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) { const DataLayout &DL = GV->getDataLayout(); uint64_t Size = DL.getTypeAllocSize(GV->getValueType()); + if (GV->isTagged()) +Size = alignTo(Size, 16); // If the alignment is spe

[clang] [rtsan][NFC] Documentation of suppression flag (PR #112727)

2024-10-17 Thread Florian Mayer via cfe-commits
@@ -194,12 +198,43 @@ Some issues with flags can be debugged using the ``verbosity=$NUM`` flag: misspelled_flag ... -Disabling -- +Disabling and suppressing +- -In some circumstances, you may want to suppress error reporting in a specif

[clang-tools-extra] [clang-tidy][NFC]remove deps of clang in clang tidy test (PR #116588)

2024-11-20 Thread Florian Mayer via cfe-commits
fmayer wrote: > LLVM Buildbot has detected a new failure on builder > `sanitizer-aarch64-linux-bootstrap-hwasan` running on `sanitizer-buildbot11` > while building `clang-tools-extra` at step 2 "annotate". > > Full details are available at: > https://lab.llvm.org/buildbot/#/builders/55/builds

[clang] [docs][asan][lsan] Drop list of supported architechures (PR #116302)

2024-11-15 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. https://github.com/llvm/llvm-project/pull/116302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [dataflow] use unqualified type for smart pointer matching (PR #125958)

2025-02-05 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/125958 one would assume that `getCanonicalTypeUnqualified` returns an unqualified type, but sadly one would be wrong. the current logic fails for std::optional as implemented in libcxx, because Star and Arrow types misma

[clang] [clang] [dataflow] use unqualified type for smart pointer matching (PR #125958)

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

[clang] [sanitizer] [clang] Introduce fsanitize-bounds-strict-flex-arrays (PR #126163)

2025-02-07 Thread Florian Mayer via cfe-commits
@@ -7,6 +7,16 @@ // RUN: %clang_cc1 -emit-llvm -triple x86_64 -fstrict-flex-arrays=2 -fsanitize=array-bounds -x c++ %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-STRICT-2,CXX // RUN: %clang_cc1 -emit-llvm -triple x86_64 -fstrict-flex-arrays=3 -fsanitize=array-bounds

[clang] [sanitizer] [clang] Introduce fsanitize-bounds-strict-flex-arrays (PR #126163)

2025-02-07 Thread Florian Mayer via cfe-commits
@@ -444,6 +444,19 @@ class LangOptionsBase { IncompleteOnly = 3, }; + enum class ArrayBoundsStrictFlexArraysLevelKind { fmayer wrote: we can't use -1 because it's a bitfield, but I can use 4 https://github.com/llvm/llvm-project/pull/126163 ___

[clang] [sanitizer] [clang] Introduce fsanitize-bounds-strict-flex-arrays (PR #126163)

2025-02-07 Thread Florian Mayer via cfe-commits
@@ -444,6 +444,19 @@ class LangOptionsBase { IncompleteOnly = 3, }; + enum class ArrayBoundsStrictFlexArraysLevelKind { fmayer wrote: Wouldn't that mean that cc1 and clang have different semantics for this flag? https://github.com/llvm/llvm-project/pu

[clang] [sanitizer] [clang] Introduce fsanitize-bounds-strict-flex-arrays (PR #126163)

2025-02-07 Thread Florian Mayer via cfe-commits
@@ -1192,13 +1193,40 @@ llvm::Value *CodeGenFunction::EmitLoadOfCountedByField( return nullptr; } +LangOptions::StrictFlexArraysLevelKind +CodeGenFunction::effectiveArrayBoundsFlexArraysLevel() { + using StrictFlexArraysLevelKind = LangOptions::StrictFlexArraysLevelKind; +

[clang] [sanitizer] [clang] Introduce fsanitize-bounds-strict-flex-arrays (PR #126163)

2025-02-07 Thread Florian Mayer via cfe-commits
@@ -444,6 +444,19 @@ class LangOptionsBase { IncompleteOnly = 3, }; + enum class ArrayBoundsStrictFlexArraysLevelKind { fmayer wrote: because we currently only store 3 bits for this, using -1 would be out of range of that and just truncate to 111 = 7

[clang] [sanitizer] [clang] Introduce fsanitize-bounds-strict-flex-arrays (PR #126163)

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

[clang] [sanitizer] [clang] Introduce fsanitize-bounds-strict-flex-arrays (PR #126163)

2025-02-07 Thread Florian Mayer via cfe-commits
@@ -444,6 +444,19 @@ class LangOptionsBase { IncompleteOnly = 3, }; + enum class ArrayBoundsStrictFlexArraysLevelKind { fmayer wrote: i have a weak preference for flags to have a value that can represent the state that is the same as if they were not

[clang] [sanitizer] [clang] Introduce fsanitize-bounds-strict-flex-arrays (PR #126163)

2025-02-07 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/126163 >From e9f2dbecb2b4836100a565b4c741fc3425d08966 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 6 Feb 2025 16:50:02 -0800 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF

[clang] [sanitizer] [clang] Introduce fsanitize-bounds-strict-flex-arrays (PR #126163)

2025-02-07 Thread Florian Mayer via cfe-commits
@@ -1192,13 +1193,40 @@ llvm::Value *CodeGenFunction::EmitLoadOfCountedByField( return nullptr; } +LangOptions::StrictFlexArraysLevelKind +CodeGenFunction::effectiveArrayBoundsFlexArraysLevel() { + using StrictFlexArraysLevelKind = LangOptions::StrictFlexArraysLevelKind; +

[clang] [sanitizer] [clang] Introduce fsanitize-bounds-strict-flex-arrays (PR #126163)

2025-02-07 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/126163 >From e9f2dbecb2b4836100a565b4c741fc3425d08966 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 6 Feb 2025 16:50:02 -0800 Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF

[clang] [sanitizer] [clang] Introduce fsanitize-undefined-strict-flex-arrays (PR #126163)

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

[clang] [sanitizer] [clang] Introduce fsanitize-undefined-strict-flex-arrays (PR #126163)

2025-02-07 Thread Florian Mayer via cfe-commits
fmayer wrote: > Usually our tweak flags looks like -fsanitize-- > > "bounds" is a group for (array-bounds + local-bounds) "undefined" is also > group, but we already have -fsanitize-undefined-, but they kind of affect a > few sanitizers > > so: `-fsanitize-undefined-strict-flex-arrays` or >

[clang] [sanitizer] [clang] Introduce fsanitize-bounds-strict-flex-arrays (PR #126163)

2025-02-07 Thread Florian Mayer via cfe-commits
fmayer wrote: > What else even uses the level? __builtin_object_size codegen? Can you add a > DocBrief to the flag explaining when you'd want to use it? Let me find out details. We have some code that miscompiles with `-fstrict-flex-arrays=1`, so something is exploiting the UB. https://githu

[clang] [clang] Assert the enum FPOpts and LangOpts fit into the storage (PR #126166)

2025-02-06 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/126166 Fix existing failure >From 85540ede2e0ba1b6f0b8a69ac6d5a6ddf56fdfc8 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 6 Feb 2025 17:41:59 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=9

[clang] [clang] Assert the enum FPOpts and LangOpts fit into the storage (PR #126166)

2025-02-06 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/126166 >From 85540ede2e0ba1b6f0b8a69ac6d5a6ddf56fdfc8 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 6 Feb 2025 17:41:59 -0800 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF

[clang] [clang] [dataflow] use unqualified type for smart pointer matching (PR #125958)

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

[clang] [sanitizer] [clang] Introduce fsanitize-bounds-strict-flex-arrays (PR #126163)

2025-02-06 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/126163 This is the control the definition of flex arrays separately for bounds sanitizer than for the codegen. >From e9f2dbecb2b4836100a565b4c741fc3425d08966 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 6 F

[clang] [sanitizer] [clang] Introduce fsanitize-bounds-strict-flex-arrays (PR #126163)

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

[clang] [clang] Assert the enum FPOpts and LangOpts fit into the storage (PR #126166)

2025-02-06 Thread Florian Mayer via cfe-commits
fmayer wrote: @zahiraam the default of the `ComplexRange`, `CX_None` does overflow the `2` storage bits. That means we were probably still using `CX_Full` (4 should overflow to `0`) even after https://github.com/llvm/llvm-project/pull/78330 (I am not sure why "make sure why that changed the de

[clang] [clang] Assert the enum FPOpts and LangOpts fit into the storage (PR #126166)

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

[clang] [clang] Assert the enum FPOpts and LangOpts fit into the storage (PR #126166)

2025-02-10 Thread Florian Mayer via cfe-commits
fmayer wrote: > > @zahiraam the default of the `ComplexRange`, `CX_None` does overflow the > > `2` storage bits. That means we were probably still using `CX_Full` (4 > > should overflow to `0`) even after #78330 (I am not sure why why that > > changed the default in the first place). Also it's

[clang] [clang] Assert the enum FPOpts and LangOpts fit into the storage (PR #126166)

2025-02-10 Thread Florian Mayer via cfe-commits
fmayer wrote: > > > Not sure I understand your question? Which assertion? `clang.exe t.c` is > > > triggering an assertion? > > > > > > I don't understand why you say > > > The value `CX_None` is the defaut value given to the `Range` when no > > > `fcomplex-arithmetic` is used on the command

[clang] [clang] Assert the enum FPOpts and LangOpts fit into the storage (PR #126166)

2025-02-10 Thread Florian Mayer via cfe-commits
fmayer wrote: > Not sure I understand your question? Which assertion? `clang.exe t.c` is > triggering an assertion? I don't understand why you say > The value `CX_None` is the defaut value given to the `Range` when no > `fcomplex-arithmetic` is used on the command lin but imply it does not n

[clang] [libc] [libcxx] [llvm] Revert "[NVPTX] Make ctor/dtor lowering always enabled in NVPTX" (PR #126610)

2025-02-10 Thread Florian Mayer via cfe-commits
fmayer wrote: > A fix-forward for a `-Werror` failure is much easier > [07f2154](https://github.com/llvm/llvm-project/commit/07f21541424c95b4451292b288e5d69272c8020c). Yeah I realised, so I closed this :) Sorry for the spam https://github.com/llvm/llvm-project/pull/126610 _

[clang] [clang] Assert the enum FPOpts and LangOpts fit into the storage (PR #126166)

2025-02-10 Thread Florian Mayer via cfe-commits
fmayer wrote: > > > > > Not sure I understand your question? Which assertion? `clang.exe t.c` > > > > > is triggering an assertion? > > > > > > > > > > > > I don't understand why you say > > > > > The value `CX_None` is the defaut value given to the `Range` when no > > > > > `fcomplex-arithme

[clang] [NFC] [clang] simplify isDesignatorAtObjectEnd (PR #126658)

2025-02-10 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/126658 IsLastOrInvalidFieldDecl would always return true if `Invalid=true`, so we know that !IsLastOrInvalidFieldDecl(...) means !Invalid. >From cc8aa7242294c5af5ae839396f02acc22b3afbb5 Mon Sep 17 00:00:00 2001 From: F

[clang] [NFC] [clang] simplify isDesignatorAtObjectEnd (PR #126658)

2025-02-10 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/126658 >From cc8aa7242294c5af5ae839396f02acc22b3afbb5 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 10 Feb 2025 19:10:56 -0800 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

[clang] [libc] [libcxx] [llvm] Revert "[NVPTX] Make ctor/dtor lowering always enabled in NVPTX" (PR #126610)

2025-02-10 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/126610 Reverts llvm/llvm-project#126544 This broke the build on sanitizer buildbots: https://lab.llvm.org/buildbot/#/builders/66/builds/9811 >From 7d3737f2374f489256bc3fce9cb96283e8307f75 Mon Sep 17 00:00:00 2001 From

[clang] [libc] [libcxx] [llvm] Revert "[NVPTX] Make ctor/dtor lowering always enabled in NVPTX" (PR #126610)

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

[clang] [NFC] [clang] fix unused variable warning (PR #126796)

2025-02-11 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/126796 None >From 9811b24583640d9d70e5a496d1e3444ee86fea77 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Tue, 11 Feb 2025 13:14:26 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=

[clang] [NFC] [clang] fix unused variable warning (PR #126796)

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

[clang] [clang] Assert the enum FPOpts and LangOpts fit into the storage (PR #126166)

2025-02-11 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/126166 >From 85540ede2e0ba1b6f0b8a69ac6d5a6ddf56fdfc8 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 6 Feb 2025 17:41:59 -0800 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF

[clang] [clang] Assert the enum FPOpts and LangOpts fit into the storage (PR #126166)

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

[clang] [NFC] [clang] simplify isDesignatorAtObjectEnd (PR #126658)

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

[clang] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-12-11 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/111918 >From 3a962270521aa7b48b64e5ac5fa0edb900990023 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 10 Oct 2024 16:05:50 -0700 Subject: [PATCH 1/5] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

[clang] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-12-11 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/111918 >From 3a962270521aa7b48b64e5ac5fa0edb900990023 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 10 Oct 2024 16:05:50 -0700 Subject: [PATCH 1/5] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

[clang] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-12-11 Thread Florian Mayer via cfe-commits
fmayer wrote: sorry, messed up the upload https://github.com/llvm/llvm-project/pull/111918 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-12-11 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/111918 error: too big or took too long to generate ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-12-11 Thread Florian Mayer via cfe-commits
fmayer wrote: @pcc does this look better now? https://github.com/llvm/llvm-project/pull/111918 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-12-12 Thread Florian Mayer via cfe-commits
@@ -808,6 +808,10 @@ void Verifier::visitGlobalValue(const GlobalValue &GV) { "visibility must be dso_local!", &GV); + if (GV.isTagged()) { fmayer wrote: The codegen has "is section == precisely honor alignment" ``` Align DataLayout::get

[clang] [clang-tools-extra] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-12-16 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/111918 error: too big or took too long to generate ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-12-16 Thread Florian Mayer via cfe-commits
@@ -2406,12 +2406,55 @@ void AsmPrinter::emitRemarksSection(remarks::RemarkStreamer &RS) { OutStreamer->emitBinaryData(Buf); } +static void tagGlobalDefinition(Module &M, GlobalVariable *G) { + Constant *Initializer = G->getInitializer(); + uint64_t SizeInBytes = + M

[clang] [clang-tools-extra] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

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

[clang] [clang][dataflow] Add matchers for smart pointer accessors to be cached (PR #120102)

2024-12-17 Thread Florian Mayer via cfe-commits
@@ -0,0 +1,194 @@ +//===- unittests/Analysis/FlowSensitive/SmartPointerAccessorCachingTest.cpp ==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang][dataflow] Add matchers for smart pointer accessors to be cached (PR #120102)

2024-12-17 Thread Florian Mayer via cfe-commits
@@ -0,0 +1,134 @@ +#include "clang/Analysis/FlowSensitive/SmartPointerAccessorCaching.h" + +#include "clang/AST/CanonicalType.h" +#include "clang/AST/DeclCXX.h" +#include "clang/ASTMatchers/ASTMatchers.h" +#include "clang/Basic/OperatorKinds.h" + +namespace clang::dataflow { + +na

[clang] [clang-tools-extra] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-12-17 Thread Florian Mayer via cfe-commits
fmayer wrote: > > I had to do something very similar for CHERI downstream: We have to ensure > > that all globals are precisely representable (which may require rounding up > > the size+alignment) so you don't end up creating bounds that include > > adjacent ones. The original patch from 2019

[clang] [llvm] [rtsan][llvm] Remove functional pass, only support module pass (PR #119739)

2024-12-12 Thread Florian Mayer via cfe-commits
fmayer wrote: > Remove functional pass function pass? https://github.com/llvm/llvm-project/pull/119739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [rtsan][llvm] Remove function pass, only support module pass (PR #119739)

2024-12-13 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. https://github.com/llvm/llvm-project/pull/119739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-12-13 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/111918 error: too big or took too long to generate ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-12-13 Thread Florian Mayer via cfe-commits
@@ -2406,12 +2406,55 @@ void AsmPrinter::emitRemarksSection(remarks::RemarkStreamer &RS) { OutStreamer->emitBinaryData(Buf); } +static void tagGlobalDefinition(Module &M, GlobalVariable *G) { + Constant *Initializer = G->getInitializer(); + uint64_t SizeInBytes = + M

[clang] [rtsan][clang] NFC: Move rtsan init to addSanitizers (PR #119904)

2024-12-13 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. https://github.com/llvm/llvm-project/pull/119904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombine] Infer nuw for gep inbounds from base of object (PR #119225)

2024-12-19 Thread Florian Mayer via cfe-commits
fmayer wrote: I was working on this miscompile. I cannot give a reproducer right now, but the following observations: The generated IR is clearly incorrect (the `inbounds nuw`), of the form: ``` %x = alloca [12 x i32], align 16 [...] %59 = getelementptr inbounds nuw i8, ptr %x, i64 -4 %wide.ma

[clang] [llvm] [InstCombine] Infer nuw for gep inbounds from base of object (PR #119225)

2024-12-20 Thread Florian Mayer via cfe-commits
fmayer wrote: Seems like the root cause was an vectorizer bug, sent https://github.com/llvm/llvm-project/pull/120730 that fixes it. https://github.com/llvm/llvm-project/pull/119225 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [llvm] [RISCV] Support __builtin_cpu_is (PR #116231)

2024-11-22 Thread Florian Mayer via cfe-commits
fmayer wrote: Fails buildbot: https://lab.llvm.org/buildbot/#/builders/24/builds/2791/steps/10/logs/stdio ``` -- Testing: 83950 of 83951 tests, 48 workers -- Testing: 0.. 10.. FAIL: Clang :: Preprocessor/has_builtin_cpuid.c (15996 of 83950) TEST 'Clang :: Preprocessor/has_

[clang] [rtsan] NFC: Update docs with suppress_equal_stacks (PR #117187)

2024-11-21 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. https://github.com/llvm/llvm-project/pull/117187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][rtsan] Add module pass to initialize rtsan (PR #118989)

2024-12-06 Thread Florian Mayer via cfe-commits
@@ -25,3 +25,7 @@ attributes #0 = { mustprogress noinline sanitize_realtime optnone ssp uwtable(sy ; RealtimeSanitizer pass should insert __rtsan_realtime_exit right before function return ; CHECK: call{{.*}}@__rtsan_realtime_exit ; CHECK-NEXT: ret{{.*}}void + +; RealtimeSani

[clang] [llvm] [LLVM][rtsan] Add module pass to initialize rtsan (PR #118989)

2024-12-06 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. https://github.com/llvm/llvm-project/pull/118989 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombine] Infer nuw for gep inbounds from base of object (PR #119225)

2025-01-16 Thread Florian Mayer via cfe-commits
fmayer wrote: > Seems like the root cause was an vectorizer bug, sent > https://github.com/llvm/llvm-project/pull/120730 that fixes it. This is landed, so from that side we could reland this. https://github.com/llvm/llvm-project/pull/119225 ___ cfe-c

[clang] [NFC] [BoundsSan] use structured bindings (PR #123228)

2025-01-16 Thread Florian Mayer via cfe-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/123228 This slightly simplifies the code. >From 010c9738c2182d3e269c305fd97dbb498a5dc717 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 16 Jan 2025 11:23:54 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9

[clang] [NFC] [BoundsSan] use structured bindings (PR #123228)

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

[clang] [NFC] [BoundsSan] use structured bindings (PR #123228)

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

[clang] [clang] Assert the enum FPOpts and LangOpts fit into the storage (PR #126166)

2025-02-11 Thread Florian Mayer via cfe-commits
fmayer wrote: > The idea here makes sense to me and I don't mind if it lands without "NFC" in > the title, but I think enforcing this at compile time would be more robust. > Could we use `static_assert` with something like `llvm::BitWidth` and > supporting infrastructure from `llvm/include/ADT

[clang] ad905f1 - [NFC] [clang] Use isa instead of dyn_cast

2025-02-11 Thread Florian Mayer via cfe-commits
Author: Florian Mayer Date: 2025-02-11T13:42:31-08:00 New Revision: ad905f133c5b22896900f3f335de990d0daf1ff4 URL: https://github.com/llvm/llvm-project/commit/ad905f133c5b22896900f3f335de990d0daf1ff4 DIFF: https://github.com/llvm/llvm-project/commit/ad905f133c5b22896900f3f335de990d0daf1ff4.diff

[clang] [NFC] [clang] fix unused variable warning (PR #126796)

2025-02-11 Thread Florian Mayer via cfe-commits
fmayer wrote: > I think isa should be preferred if the result of dyncast is not used. Same > applied to the surrounding ifs too. https://github.com/llvm/llvm-project/commit/ad905f133c5b22896900f3f335de990d0daf1ff4 https://github.com/llvm/llvm-project/pull/126796 ___

[clang] [NFC] [clang] fix unused variable warning (PR #126796)

2025-02-11 Thread Florian Mayer via cfe-commits
https://github.com/fmayer closed https://github.com/llvm/llvm-project/pull/126796 ___ 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] [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
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] [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
@@ -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] [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 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] [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] [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/2] =?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] [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] [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] [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-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

<    1   2   3   >