[clang] [clang] Respect field alignment when evaluating layout compatibility of structs (PR #84313)

2024-03-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/84313 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Mention possibility of underflow in array overflow errors (PR #84201)

2024-03-07 Thread Balázs Kéri via cfe-commits
@@ -603,6 +611,8 @@ void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext ) const { auto [WithinUpperBound, ExceedsUpperBound] = compareValueToThreshold(State, ByteOffset, *KnownSize, SVB); +bool AssumedNonNegative = SUR.assumedNonNegative();

[clang] [clang] Respect field alignment when evaluating layout compatiblity of structs (PR #84313)

2024-03-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes This patch implements [CWG2586](https://cplusplus.github.io/CWG/issues/2583.html) "Common initial sequence should consider over-alignment". Note that alignment of union members doesn't have to match,

[clang] [clang] Respect field alignment when evaluating layout compatiblity of structs (PR #84313)

2024-03-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/84313 This patch implements [CWG2586](https://cplusplus.github.io/CWG/issues/2583.html) "Common initial sequence should consider over-alignment". Note that alignment of union members doesn't have to match, as layout

[clang] [clang][nullability] Don't discard expression state before end of full-expression. (PR #82611)

2024-03-07 Thread via cfe-commits
martinboehme wrote: > > Yes, significantly faster, and fewer SAT solver timeouts. > > The Clang Static Analyzer is going one step further. It is pruning the > analysis state really aggressively, it is relying on liveness analysis, and > whenever the value of a variable is dead (would not be

[clang] [Clang][Sema] Allow access to a public template alias declaration that refers to friend's private nested type (PR #83847)

2024-03-07 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/83847 >From 52a0191c1e817942dae080b70bd86e48018d4811 Mon Sep 17 00:00:00 2001 From: huqizhi Date: Mon, 4 Mar 2024 21:51:07 +0800 Subject: [PATCH] [Clang][Sema] Allow access to a public template alias declaration that

[clang] [Clang][Sema] Allow access to a public template alias declaration that refers to friend's private nested type (PR #83847)

2024-03-07 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/83847 >From d60f27e47318b12aac3b462bc074af53ae1296bd Mon Sep 17 00:00:00 2001 From: huqizhi Date: Mon, 4 Mar 2024 21:51:07 +0800 Subject: [PATCH] [Clang][Sema] Allow access to a public template alias declaration that

[clang] [clang][nullability] Don't discard expression state before end of full-expression. (PR #82611)

2024-03-07 Thread via cfe-commits
@@ -307,7 +310,22 @@ computeBlockInputState(const CFGBlock , AnalysisContext ) { } } - JoinedStateBuilder Builder(AC); + // If any of the predecessor blocks contains an expression consumed in a + // different block, we need to keep expression state. + // Note that

[clang] [clang][nullability] Don't discard expression state before end of full-expression. (PR #82611)

2024-03-07 Thread via cfe-commits
@@ -94,6 +94,38 @@ static llvm::BitVector findReachableBlocks(const CFG ) { return BlockReachable; } +static llvm::DenseSet +buildContainsExprConsumedInDifferentBlock( +const CFG , +const llvm::DenseMap ) { + llvm::DenseSet Result; + + auto CheckChildExprs = [,

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-03-07 Thread via cfe-commits
Sirraide wrote: I seem to have missed a test that needs to be updated—I suppose that’s what I get for only running the Sema and Codegen tests locally instead of the entire test suite. https://github.com/llvm/llvm-project/pull/81014 ___ cfe-commits

[clang] [clang][nullability] allow _Nonnull etc on nullable class types (PR #82705)

2024-03-07 Thread Dmitri Gribenko via cfe-commits
@@ -96,8 +146,16 @@ void AssignAndInitNonNullFromFn() { void *_Nonnull nonnull; nonnull = ReturnNullable(); // expected-warning{{implicit conversion from nullable pointer 'void * _Nullable' to non-nullable pointer type 'void * _Nonnull'}} nonnull = {ReturnNullable()};

[clang-tools-extra] [clang-tidy][missing-std-forward]report diagnotics for using forward in lambda body (PR #83930)

2024-03-07 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/83930 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][nullability] Don't discard expression state before end of full-expression. (PR #82611)

2024-03-07 Thread via cfe-commits
@@ -94,6 +94,38 @@ static llvm::BitVector findReachableBlocks(const CFG ) { return BlockReachable; } +static llvm::DenseSet +buildContainsExprConsumedInDifferentBlock( +const CFG , +const llvm::DenseMap ) { + llvm::DenseSet Result; martinboehme

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-07 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: Fixed `auto-var-init.cpp` test failures, believe now it should be aligned with the original intent. https://github.com/llvm/llvm-project/pull/84230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-07 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/84230 >From e5af3e3242b34811eb56d91597bfc58e89f9e2db Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 6 Mar 2024 23:49:40 +0100 Subject: [PATCH] [clang][CodeGen] Allow memcpy replace with trivial

[clang] [clang][dataflow] Fix u8 string error with C++20. (PR #84302)

2024-03-07 Thread via cfe-commits
https://github.com/martinboehme closed https://github.com/llvm/llvm-project/pull/84302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] a11ab13 - [clang][dataflow] Fix u8 string error with C++20. (#84302)

2024-03-07 Thread via cfe-commits
Author: martinboehme Date: 2024-03-07T12:53:26+01:00 New Revision: a11ab139e4de9cdad41c299f198515c09be6f05d URL: https://github.com/llvm/llvm-project/commit/a11ab139e4de9cdad41c299f198515c09be6f05d DIFF: https://github.com/llvm/llvm-project/commit/a11ab139e4de9cdad41c299f198515c09be6f05d.diff

[clang] [flang] [flang][draft] Improve debug info generation. (PR #84202)

2024-03-07 Thread Tom Eccles via cfe-commits
tblah wrote: Thank you for this patch! I like the approach so far using the existing debug pass. My gut feeling is that I would rather this happen in a pass rather than earlier on (lowering or even semantics) because lowering is already too complicated and monolithic. In the past it has

[clang] [clang] Fix crash when declaring invalid lambda member (PR #74110)

2024-03-07 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/74110 >From 563f86bddc0ec59b63c6aeffee2342f027c09119 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 1 Dec 2023 18:16:36 +0100 Subject: [PATCH 1/2] [clang] Fix crash when declaring invalid lambda member

[clang] [clang][dataflow] Fix u8 string error with C++20. (PR #84302)

2024-03-07 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM - cheers https://github.com/llvm/llvm-project/pull/84302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [dataflow][nfc] Fix u8 string usage with c++20 (PR #84291)

2024-03-07 Thread via cfe-commits
martinboehme wrote: New attempt: https://github.com/llvm/llvm-project/pull/84302 https://github.com/llvm/llvm-project/pull/84291 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Fix u8 string error with C++20. (PR #84302)

2024-03-07 Thread via cfe-commits
https://github.com/martinboehme updated https://github.com/llvm/llvm-project/pull/84302 >From 66ba3d492bc09b1244d1b0abdee58e1015a19974 Mon Sep 17 00:00:00 2001 From: Martin Braenne Date: Thu, 7 Mar 2024 10:50:57 + Subject: [PATCH 1/2] [clang][dataflow] Fix u8 string error with C++20. See

[clang] [clang] Add CodeGen tests for CWG 5xx issues (PR #84303)

2024-03-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes This patch covers [CWG519](https://cplusplus.github.io/CWG/issues/519.html) "Null pointer preservation in `void*` conversions", [CWG571](https://cplusplus.github.io/CWG/issues/571.html) "References

[clang] [clang] Add CodeGen tests for CWG 5xx issues (PR #84303)

2024-03-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/84303 This patch covers [CWG519](https://cplusplus.github.io/CWG/issues/519.html) "Null pointer preservation in `void*` conversions", [CWG571](https://cplusplus.github.io/CWG/issues/571.html) "References declared

[clang] [clang][dataflow] Fix u8 string error with C++20. (PR #84302)

2024-03-07 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 5830d1a2dff24d752459f215a0c8fc366f393596 66ba3d492bc09b1244d1b0abdee58e1015a19974 --

[clang] [clang][dataflow] Fix u8 string error with C++20. (PR #84302)

2024-03-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (martinboehme) Changes See also discussion on https://github.com/llvm/llvm-project/pull/84291. --- Full diff: https://github.com/llvm/llvm-project/pull/84302.diff 1 Files Affected: - (modified)

[clang] [clang][dataflow] Fix u8 string error with C++20. (PR #84302)

2024-03-07 Thread via cfe-commits
https://github.com/martinboehme created https://github.com/llvm/llvm-project/pull/84302 See also discussion on https://github.com/llvm/llvm-project/pull/84291. >From 66ba3d492bc09b1244d1b0abdee58e1015a19974 Mon Sep 17 00:00:00 2001 From: Martin Braenne Date: Thu, 7 Mar 2024 10:50:57 +

[clang] Revert "[dataflow][nfc] Fix u8 string usage with c++20" (PR #84301)

2024-03-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (martinboehme) Changes Reverts llvm/llvm-project#84291 The patch broke Windows builds. --- Full diff: https://github.com/llvm/llvm-project/pull/84301.diff 1 Files Affected: - (modified)

[clang] Revert "[dataflow][nfc] Fix u8 string usage with c++20" (PR #84301)

2024-03-07 Thread via cfe-commits
https://github.com/martinboehme closed https://github.com/llvm/llvm-project/pull/84301 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 5830d1a - Revert "[dataflow][nfc] Fix u8 string usage with c++20" (#84301)

2024-03-07 Thread via cfe-commits
Author: martinboehme Date: 2024-03-07T11:48:51+01:00 New Revision: 5830d1a2dff24d752459f215a0c8fc366f393596 URL: https://github.com/llvm/llvm-project/commit/5830d1a2dff24d752459f215a0c8fc366f393596 DIFF: https://github.com/llvm/llvm-project/commit/5830d1a2dff24d752459f215a0c8fc366f393596.diff

[clang] Revert "[dataflow][nfc] Fix u8 string usage with c++20" (PR #84301)

2024-03-07 Thread via cfe-commits
https://github.com/martinboehme created https://github.com/llvm/llvm-project/pull/84301 Reverts llvm/llvm-project#84291 The patch broke Windows builds. >From c4eae28f1eb14bb8a588d866aa561d676c6bdd67 Mon Sep 17 00:00:00 2001 From: martinboehme Date: Thu, 7 Mar 2024 11:48:25 +0100 Subject:

[clang] [dataflow][nfc] Fix u8 string usage with c++20 (PR #84291)

2024-03-07 Thread via cfe-commits
@@ -500,7 +500,7 @@ class HTMLLogger : public Logger { for (unsigned I = 0; I < CFG.getNumBlockIDs(); ++I) { std::string Name = blockID(I); // Rightwards arrow, vertical line - char ConvergenceMarker[] = u8"\\n\u2192\u007c"; + char ConvergenceMarker[]

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,171 @@ +//===--- NullCheckAfterDereferenceCheck.cpp - clang-tidy---===// +// +// 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:

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,625 @@ +//===-- NullPointerAnalysisModel.cpp *- C++ -*-===// +// +// 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:

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,330 @@ +// RUN: %check_clang_tidy %s bugprone-null-check-after-dereference %t + +struct S { + int a; +}; + +int warning_deref(int *p) { + *p = 42; + + if (p) { +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: pointer value is checked even though it cannot be null

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,112 @@ +//===-- NullPointerAnalysisModel.h --*- C++ -*-===// +// +// 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:

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,330 @@ +// RUN: %check_clang_tidy %s bugprone-null-check-after-dereference %t + +struct S { + int a; +}; + +int warning_deref(int *p) { + *p = 42; + + if (p) { +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: pointer value is checked even though it cannot be null

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,330 @@ +// RUN: %check_clang_tidy %s bugprone-null-check-after-dereference %t + +struct S { + int a; +}; + +int warning_deref(int *p) { + *p = 42; + + if (p) { +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: pointer value is checked even though it cannot be null

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,330 @@ +// RUN: %check_clang_tidy %s bugprone-null-check-after-dereference %t + +struct S { + int a; +}; + +int warning_deref(int *p) { + *p = 42; + + if (p) { +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: pointer value is checked even though it cannot be null

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,330 @@ +// RUN: %check_clang_tidy %s bugprone-null-check-after-dereference %t + +struct S { + int a; +}; + +int warning_deref(int *p) { + *p = 42; + + if (p) { +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: pointer value is checked even though it cannot be null

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,171 @@ +//===--- NullCheckAfterDereferenceCheck.cpp - clang-tidy---===// +// +// 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:

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,171 @@ +//===--- NullCheckAfterDereferenceCheck.cpp - clang-tidy---===// +// +// 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:

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,112 @@ +//===-- NullPointerAnalysisModel.h --*- C++ -*-===// +// +// 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:

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,171 @@ +//===--- NullCheckAfterDereferenceCheck.cpp - clang-tidy---===// +// +// 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:

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,162 @@ +.. title:: clang-tidy - bugprone-null-check-after-dereference + +bugprone-null-check-after-dereference += + +.. note:: + + This check uses a flow-sensitive static analysis to produce its + results. Therefore, it may be

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,171 @@ +//===--- NullCheckAfterDereferenceCheck.cpp - clang-tidy---===// +// +// 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:

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,162 @@ +.. title:: clang-tidy - bugprone-null-check-after-dereference + +bugprone-null-check-after-dereference += + +.. note:: + + This check uses a flow-sensitive static analysis to produce its + results. Therefore, it may be

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread via cfe-commits
@@ -0,0 +1,625 @@ +//===-- NullPointerAnalysisModel.cpp *- C++ -*-===// +// +// 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:

[clang] [dataflow][nfc] Fix u8 string usage with c++20 (PR #84291)

2024-03-07 Thread Simon Pilgrim via cfe-commits
@@ -500,7 +500,7 @@ class HTMLLogger : public Logger { for (unsigned I = 0; I < CFG.getNumBlockIDs(); ++I) { std::string Name = blockID(I); // Rightwards arrow, vertical line - char ConvergenceMarker[] = u8"\\n\u2192\u007c"; + char ConvergenceMarker[]

[clang] [FMV] Remove duplicate features from mangled name. (PR #84165)

2024-03-07 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea closed https://github.com/llvm/llvm-project/pull/84165 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 6f54a54 - [FMV] Remove duplicate features from mangled name. (#84165)

2024-03-07 Thread via cfe-commits
Author: Alexandros Lamprineas Date: 2024-03-07T10:33:26Z New Revision: 6f54a54c6f5f644b4f4c79882154fd9737568c8e URL: https://github.com/llvm/llvm-project/commit/6f54a54c6f5f644b4f4c79882154fd9737568c8e DIFF:

[clang] [X86] Finally handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-07 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon edited https://github.com/llvm/llvm-project/pull/84136 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Allow access to a public template alias declaration that refers to friend's private nested type (PR #83847)

2024-03-07 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/83847 >From a38ad9098c7f4dcffaa22b269bc2a36b5eb0fc4e Mon Sep 17 00:00:00 2001 From: huqizhi Date: Mon, 4 Mar 2024 21:51:07 +0800 Subject: [PATCH] [Clang][Sema] Allow access to a public template alias declaration that

[clang] 6e79f77 - [dataflow][nfc] Fix u8 string usage with c++20 (#84291)

2024-03-07 Thread via cfe-commits
Author: Vincent Lee Date: 2024-03-07T10:46:36+01:00 New Revision: 6e79f77adbbd338848ea770f2f2b110bc57a3990 URL: https://github.com/llvm/llvm-project/commit/6e79f77adbbd338848ea770f2f2b110bc57a3990 DIFF: https://github.com/llvm/llvm-project/commit/6e79f77adbbd338848ea770f2f2b110bc57a3990.diff

[clang] [dataflow][nfc] Fix u8 string usage with c++20 (PR #84291)

2024-03-07 Thread via cfe-commits
https://github.com/martinboehme closed https://github.com/llvm/llvm-project/pull/84291 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [dataflow][nfc] Fix u8 string usage with c++20 (PR #84291)

2024-03-07 Thread via cfe-commits
https://github.com/martinboehme approved this pull request. Thanks, and sorry for the breeakage! https://github.com/llvm/llvm-project/pull/84291 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][ExprConst] Can't be past an invalid LValue designator (PR #84293)

2024-03-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes For the test case in C, both `LV.getLValueOffset()` and `Ctx.getTypeSizeInChars(Ty)` are zero, so we return `true` from `isOnePastTheEndOfCompleteObject()` and ultimately diagnose this as being one past

[clang] [clang][ExprConst] Can't be past an invalid LValue designator (PR #84293)

2024-03-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/84293 For the test case in C, both `LV.getLValueOffset()` and `Ctx.getTypeSizeInChars(Ty)` are zero, so we return `true` from `isOnePastTheEndOfCompleteObject()` and ultimately diagnose this as being one past the

[clang] [alpha.webkit.UncountedCallArgsChecker] Don't assume local variables are safe & treat guarded local variable as safe function arguments (PR #82305)

2024-03-07 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/82305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [dataflow][nfc] Fix u8 string usage with c++20 (PR #84291)

2024-03-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-analysis @llvm/pr-subscribers-clang Author: Vincent Lee (thevinster) Changes Clang returns an error when compiling this file with c++20 ``` error: ISO C++20 does not permit initialization of char array with UTF-8 string literal ``` It seems like

[clang] [dataflow][nfc] Fix u8 string usage with c++20 (PR #84291)

2024-03-07 Thread Vincent Lee via cfe-commits
https://github.com/thevinster created https://github.com/llvm/llvm-project/pull/84291 Clang returns an error when compiling this file with c++20 ``` error: ISO C++20 does not permit initialization of char array with UTF-8 string literal ``` It seems like c++20 treats u8strings differently than

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: Rebased on top of main to solve conflicts. https://github.com/llvm/llvm-project/pull/83027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From 5c919832f9176d4b1af1312a4ee7cf30b788958a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 21 Feb 2024 14:46:01 +0100 Subject: [PATCH 1/2]

[clang] [clang][analyzer] Fix StreamChecker `ftell` and `fgetpos` at indeterminate file position. (PR #84191)

2024-03-07 Thread via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/84191 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Fix StreamChecker `ftell` and `fgetpos` at indeterminate file position. (PR #84191)

2024-03-07 Thread via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/84191 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Fix StreamChecker `ftell` and `fgetpos` at indeterminate file position. (PR #84191)

2024-03-07 Thread via cfe-commits
@@ -880,6 +883,24 @@ void StreamChecker::preReadWrite(const FnDescription *Desc, } } +void StreamChecker::preWrite(const FnDescription *Desc, const CallEvent , NagyDonat wrote: I agree that `std::bind` is hard to follow, and dedicated handlers dispatching

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-03-07 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/82229 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 7ce1cfe - [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (#82229)

2024-03-07 Thread via cfe-commits
Author: Ryosuke Niwa Date: 2024-03-07T01:06:20-08:00 New Revision: 7ce1cfed9a11735f0f4ee8a3a8bebfa87ee76d07 URL: https://github.com/llvm/llvm-project/commit/7ce1cfed9a11735f0f4ee8a3a8bebfa87ee76d07 DIFF: https://github.com/llvm/llvm-project/commit/7ce1cfed9a11735f0f4ee8a3a8bebfa87ee76d07.diff

[clang] [clang][analyzer] Fix StreamChecker `ftell` and `fgetpos` at indeterminate file position. (PR #84191)

2024-03-07 Thread Balazs Benics via cfe-commits
@@ -880,6 +883,24 @@ void StreamChecker::preReadWrite(const FnDescription *Desc, } } +void StreamChecker::preWrite(const FnDescription *Desc, const CallEvent , steakhal wrote: Let me share my experience with `std::bind` and with this checker.

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/84184 >From 23f4208fb9978370f59cae16db0747acb3e2c906 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 6 Mar 2024 18:01:35 +0300 Subject: [PATCH 1/4] [clang] Factor out OpenACC part of `Sema` This patch

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-07 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/83774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-07 Thread Fangrui Song via cfe-commits
@@ -7105,10 +7105,15 @@ void Clang::ConstructJob(Compilation , const JobAction , Args.addOptInFlag(CmdArgs, options::OPT_frelaxed_template_template_args, options::OPT_fno_relaxed_template_template_args); - // -fsized-deallocation is off by default, as

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-07 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay requested changes to this pull request. This needs sign-off from Apple reviewers whether the version table in Darwin.cpp is correct. https://github.com/llvm/llvm-project/pull/83774 ___ cfe-commits mailing list

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: `Sema.h` changes look good. https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -0,0 +1,327 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.unix.Stream,debug.ExprInspection -verify %s + +#include "Inputs/system-header-simulator.h" +#include "Inputs/system-header-simulator-for-malloc.h" +#include "Inputs/system-header-simulator-for-valist.h" +

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -13,6 +13,9 @@ #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_CHECKERHELPERS_H #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_CHECKERHELPERS_H +#include "ProgramState_Fwd.h" +#include "SVals.h" + alejandro-alvarez-sonarsource wrote: Removed.

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1158,6 +1173,123 @@ void StreamChecker::evalUngetc(const FnDescription *Desc, const CallEvent , C.addTransition(StateFailed); } +ProgramStateRef +StreamChecker::ensurePtrNotNull(SVal PtrVal, const Expr *PtrExpr, +CheckerContext ,

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From 997501888aacdbae59ace767e085922c9aa96a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 21 Feb 2024 14:46:01 +0100 Subject: [PATCH 1/2]

[clang] [clang][analyzer] Fix StreamChecker `ftell` and `fgetpos` at indeterminate file position. (PR #84191)

2024-03-07 Thread Balázs Kéri via cfe-commits
@@ -880,6 +883,24 @@ void StreamChecker::preReadWrite(const FnDescription *Desc, } } +void StreamChecker::preWrite(const FnDescription *Desc, const CallEvent , balazske wrote: The `CallDescriptionMap` was uncomfortable to handle because too many

[clang] [clang][analyzer] Fix StreamChecker `ftell` and `fgetpos` at indeterminate file position. (PR #84191)

2024-03-07 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/84191 From dbaf3348510582c013254ed48b69663b42816be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 6 Mar 2024 16:01:01 +0100 Subject: [PATCH] [clang][analyzer] Fix StreamChecker `ftell`

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread Haojian Wu via cfe-commits
@@ -96,6 +96,10 @@ C++20 Feature Support behavior can use the flag '-Xclang -fno-skip-odr-check-in-gmf'. (`#79240 `_). +- Initial support for class template argument deduciton (CTAD) for type alias + templates (`P1814R0

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread Haojian Wu via cfe-commits
@@ -10598,10 +10598,38 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread Haojian Wu via cfe-commits
@@ -96,6 +96,10 @@ C++20 Feature Support behavior can use the flag '-Xclang -fno-skip-odr-check-in-gmf'. (`#79240 `_). +- Initial support for class template argument deduciton (CTAD) for type alias hokein

[clang] [Clang][NFC] Remove '--' separator in the linker wrapper usage (PR #84253)

2024-03-07 Thread Fangrui Song via cfe-commits
MaskRay wrote: > [NFC] >From a strict interpretation, this is not NFC as this changes clang driver >behavior. The overall behavior combining clang + clang-linker-wrapper may not >change, though... https://github.com/llvm/llvm-project/pull/84253 ___

[clang] [Clang][NFC] Remove '--' separator in the linker wrapper usage (PR #84253)

2024-03-07 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/84253 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][NFC] Remove '--' separator in the linker wrapper usage (PR #84253)

2024-03-07 Thread Fangrui Song via cfe-commits
MaskRay wrote: If a LLVMOption users needs to parse `--`, DashDashParsing from https://reviews.llvm.org/D152286 is better :) https://github.com/llvm/llvm-project/pull/84253 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-03-07 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon closed https://github.com/llvm/llvm-project/pull/77753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 99500e8 - [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (#77753)

2024-03-07 Thread via cfe-commits
Author: Mariya Podchishchaeva Date: 2024-03-07T09:36:50+01:00 New Revision: 99500e8c08a4d941acb8a7eb00523296fb2acf7a URL: https://github.com/llvm/llvm-project/commit/99500e8c08a4d941acb8a7eb00523296fb2acf7a DIFF:

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Chuanqi Xu (ChuanqiXu9) Changes I suddenly found that the clang scan deps may use all concurrent threads to scan the files. It makes sense in the batch mode. But in P1689 per file mode, it simply wastes times and resources.

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/84285 I suddenly found that the clang scan deps may use all concurrent threads to scan the files. It makes sense in the batch mode. But in P1689 per file mode, it simply wastes times and resources. This patch

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-03-07 Thread Matt Arsenault via cfe-commits
@@ -137,6 +137,12 @@ Removed Compiler Flags Attribute Changes in Clang -- +- Introduced a new function attribute ``__attribute__((amdgpu_max_num_work_groups(x, y, z)))`` or arsenm wrote: I think some of the AMDGPUUsage work-groups

<    1   2   3   4   5