[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Balazs Benics via cfe-commits
steakhal wrote: Could you also add this test case? ```c++ namespace std { struct __mutex_base { void lock(); }; struct mutex : __mutex_base { void unlock(); bool try_lock(); }; template struct scoped_lock { explicit scoped_lock(MutexTypes&... m); ~scoped_lock(); }; template class scop

[clang] 3dbb6be - [NFC] Comment fix: "does specify state that" -> "does specify that" (#106338)

2024-08-28 Thread via cfe-commits
Author: Michael Park Date: 2024-08-28T09:05:43+02:00 New Revision: 3dbb6befa837c5daa07de1e0daa45e5943ee9520 URL: https://github.com/llvm/llvm-project/commit/3dbb6befa837c5daa07de1e0daa45e5943ee9520 DIFF: https://github.com/llvm/llvm-project/commit/3dbb6befa837c5daa07de1e0daa45e5943ee9520.diff

[clang] [NFC] Comment fix: "does specify state that" -> "does specify that" (PR #106338)

2024-08-28 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/106338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/106240 >From 0c86e46516466f9513652a04ba87aa2a018ff6b8 Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 27 Aug 2024 17:52:25 +0200 Subject: [PATCH 1/6] [analyzer] Fix false positive for mutexes inheriting m

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Arseniy Zaostrovnykh via cfe-commits
necto wrote: > Could you also add this test case? > > ```c++ > ``` > > Or is it already implied by other tests? My first test ``` C++ void no_false_positive_gh_104241() { std::mutex m; m.lock(); // If inheritance not handled properly, this unlock might not match the lock // above beca

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Thanks, I'm lovin it! https://github.com/llvm/llvm-project/pull/106240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/106240 >From 0c86e46516466f9513652a04ba87aa2a018ff6b8 Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 27 Aug 2024 17:52:25 +0200 Subject: [PATCH 1/7] [analyzer] Fix false positive for mutexes inheriting m

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-28 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr commented: Are these the only unary operators supported on vectors or are more to come? Since all (except for `+`, which doesn't do anything) cases call `prepareResult()` and `createTemp()` unconditionally, it would probably be cleaner to reject the unhandled cases

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-28 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr edited https://github.com/llvm/llvm-project/pull/105996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-28 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,120 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-28 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,120 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/106240 >From 0c86e46516466f9513652a04ba87aa2a018ff6b8 Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 27 Aug 2024 17:52:25 +0200 Subject: [PATCH 1/8] [analyzer] Fix false positive for mutexes inheriting m

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Arseniy Zaostrovnykh via cfe-commits
necto wrote: @steakhal I added a fix for multiple-inheritance fn, please take another look https://github.com/llvm/llvm-project/pull/106240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/106240 >From 0c86e46516466f9513652a04ba87aa2a018ff6b8 Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 27 Aug 2024 17:52:25 +0200 Subject: [PATCH 1/9] [analyzer] Fix false positive for mutexes inheriting m

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: This patch breaks: https://lab.llvm.org/buildbot/#/builders/25/builds/1952 https://lab.llvm.org/buildbot/#/builders/52/builds/1775 https://github.com/llvm/llvm-project/pull/105496 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] Revert "[clang] Add nuw attribute to GEPs" (PR #106343)

2024-08-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-powerpc @llvm/pr-subscribers-clang Author: Vitaly Buka (vitalybuka) Changes Reverts llvm/llvm-project#105496 This patch breaks: https://lab.llvm.org/buildbot/#/builders/25/builds/1952 https://lab.llvm.org/buildbot/#/builders/52/builds/1775 Some

[clang] Revert "[clang] Add nuw attribute to GEPs" (PR #106343)

2024-08-28 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Please let me know if you have a fix for that. I'll land revert in the morning by PDT. https://github.com/llvm/llvm-project/pull/106343 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/106240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Still looks good. https://github.com/llvm/llvm-project/pull/106240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Balazs Benics via cfe-commits
@@ -241,10 +241,14 @@ BlockInCriticalSectionChecker::checkDescriptorMatch(const CallEvent &Call, return std::nullopt; } -static const MemRegion *skipBaseClassRegion(const MemRegion *Reg) { - while (const auto *BaseClassRegion = dyn_cast(Reg)) { +static const MemRegion *ski

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread David Sherwood via cfe-commits
david-arm wrote: > This patch breaks: https://lab.llvm.org/buildbot/#/builders/25/builds/1952 > https://lab.llvm.org/buildbot/#/builders/52/builds/1775 >From the buildbot run I can see 12 or 13 changes in the build that failed. >Just out of curiosity how did you find out it was this patch that

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > > This patch breaks: https://lab.llvm.org/buildbot/#/builders/25/builds/1952 > > https://lab.llvm.org/buildbot/#/builders/52/builds/1775 > > From the buildbot run I can see 12 or 13 changes in the build that failed. > Just out of curiosity how did you find out it was this p

[clang] [clang] mangle placeholder for deduced type as a template-prefix (PR #106335)

2024-08-28 Thread via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -std=c++20 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s + +template class S> +void create_unique() + requires (S{0}, true) {} + +template struct A { + constexpr A(Fn) {}; +}; + +template void create_unique(); +// CHECK: @_

[clang] [clang-format] js handle anonymous classes (PR #106242)

2024-08-28 Thread Krasimir Georgiev via cfe-commits
https://github.com/krasimirgg updated https://github.com/llvm/llvm-project/pull/106242 >From 32e94bde5a8ed401a9fb1255d8394c552da82dd7 Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Tue, 27 Aug 2024 16:08:07 + Subject: [PATCH 1/3] [clang-format] js handle anonymous classes Addresses

[clang] [clang-format] js handle anonymous classes (PR #106242)

2024-08-28 Thread Krasimir Georgiev via cfe-commits
@@ -579,6 +579,14 @@ TEST_F(FormatTestJS, GoogScopes) { "});"); } +TEST_F(FormatTestJS, GoogAnonymousClass) { krasimirgg wrote: Thanks! Added one. https://github.com/llvm/llvm-project/pull/106242 ___

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread David Sherwood via cfe-commits
david-arm wrote: > > > This patch breaks: > > > https://lab.llvm.org/buildbot/#/builders/25/builds/1952 > > > https://lab.llvm.org/buildbot/#/builders/52/builds/1775 > > > > > > From the buildbot run I can see 12 or 13 changes in the build that failed. > > Just out of curiosity how did you f

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Maybe the patch introduced some miscompile? The patch affects only clang, but failing tests are LLVM, but tools compiled with patched clang with UBSAN enabled. Also there are branches checking sanitizers. https://github.com/llvm/llvm-project/pull/105496 __

[clang] Revert "[clang] Add nuw attribute to GEPs" (PR #106343)

2024-08-28 Thread Hari Limaye via cfe-commits
hazzlim wrote: > Please let me know if you have a fix for that. I'll land revert in the > morning by PDT. Thank you for flagging this up and opening this @vitalybuka - I'm taking a look now to see if there's an easy enough fix to save reverting. https://github.com/llvm/llvm-project/pull/10634

[clang] [clang] Add lifetimebound attr to std::span/std::string_view constructor (PR #103716)

2024-08-28 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/103716 >From 24a84b35dba03ca80027efcc87b4628c378991ff Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 14 Aug 2024 10:18:09 +0200 Subject: [PATCH] [clang] Add lifetimebound attr to std::span/std::string_view constr

[clang] [clang] Add lifetimebound attr to std::span/std::string_view constructor (PR #103716)

2024-08-28 Thread Haojian Wu via cfe-commits
@@ -216,6 +216,59 @@ void Sema::inferGslOwnerPointerAttribute(CXXRecordDecl *Record) { inferGslPointerAttribute(Record, Record); } +void Sema::inferLifetimeBoundAttribute(FunctionDecl *FD) { + if (FD->getNumParams() == 0) +return; + + if (unsigned BuiltinID = FD->getB

[clang] Revert "[clang] Add nuw attribute to GEPs" (PR #106343)

2024-08-28 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > > Please let me know if you have a fix for that. I'll land revert in the > > morning by PDT. > > Thank you for flagging this up and opening this @vitalybuka - I'm taking a > look now to see if there's an easy enough fix to save reverting. Thanks. Please merge the revert if

[clang] [clang] Cleanup IncludeLocMap (PR #106241)

2024-08-28 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/106241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Cleanup IncludeLocMap (PR #106241)

2024-08-28 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov requested changes to this pull request. This looks good, but I wanted to explore if we could write a unit test for this... https://github.com/llvm/llvm-project/pull/106241 ___ cfe-commits mailing list cfe-commits@lists

[clang] [clang] Cleanup IncludeLocMap (PR #106241)

2024-08-28 Thread Ilya Biryukov via cfe-commits
@@ -350,6 +350,7 @@ void SourceManager::clearIDTables() { LastLineNoContentCache = nullptr; LastFileIDLookup = FileID(); + IncludedLocMap.clear(); ilya-biryukov wrote: Is there a way to write a unit test checking this behavior? SourceManager should be r

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-08-28 Thread Dan Liew via cfe-commits
@@ -2099,6 +2099,70 @@ class Sema final : public SemaBase { bool CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, bool OrNull); + // AssignmentAction - This is used by all the assignment diagnostic functions + // to repr

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-08-28 Thread Dan Liew via cfe-commits
https://github.com/delcypher edited https://github.com/llvm/llvm-project/pull/106321 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP] [analyzer] Refactor MallocChecker to use `BindExpr` in `evalCall` (PR #106081)

2024-08-28 Thread Pavel Skripkin via cfe-commits
@@ -67,19 +67,6 @@ void testGlobalNoThrowPlacementExprNewBeforeOverload() { int *p = new(std::nothrow) int; } // leak-warning{{Potential leak of memory pointed to by 'p'}} -//- Standard pointer placement operators -void testGlobalPointerPlacementNew() {

[clang] [WIP] [analyzer] Refactor MallocChecker to use `BindExpr` in `evalCall` (PR #106081)

2024-08-28 Thread Pavel Skripkin via cfe-commits
@@ -1736,6 +1816,25 @@ MallocChecker::MallocMemReturnsAttr(CheckerContext &C, const CallEvent &Call, return MallocMemAux(C, Call, UnknownVal(), UndefinedVal(), State, Family); } +ProgramStateRef MallocChecker::MallocBindRetval(CheckerContext &C, +

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-08-28 Thread via cfe-commits
https://github.com/Discookie created https://github.com/llvm/llvm-project/pull/106350 Adds the check options `bugprone-unsafe-functions.CustomNormalFunctions` and `CustomAnnexKFunctions` to be able to match user-defined functions as part of the checker. Adds the option `bugprone-unsafe-functio

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-08-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Discookie (Discookie) Changes Adds the check options `bugprone-unsafe-functions.CustomNormalFunctions` and `CustomAnnexKFunctions` to be able to match user-defined functions as part of the checker. Adds the option `bugprone-un

[clang] [clang] Add lifetimebound attr to std::span/std::string_view constructor (PR #103716)

2024-08-28 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/103716 >From 24a84b35dba03ca80027efcc87b4628c378991ff Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 14 Aug 2024 10:18:09 +0200 Subject: [PATCH 1/2] [clang] Add lifetimebound attr to std::span/std::string_view co

[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

2024-08-28 Thread Chuanqi Xu via cfe-commits
@@ -523,6 +523,12 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) { NormalCleanupDest = Address::invalid(); } + if (getLangOpts().Coroutines && isCoroutine()) { +auto *Record = FnRetTy->getAsCXXRecordDecl(); +if (Record && Record->hasAttr()) +

[clang-tools-extra] [clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-28 Thread via cfe-commits
@@ -0,0 +1,50 @@ +.. title:: clang-tidy - bugprone-suspicious-pointer-arithmetics-using-sizeof + +bugprone-suspicious-pointer-arithmetics-using-sizeof + + +Finds suspicious pointer arithmetic calculations where the pointer is off

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-08-28 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 5f15c1776a462940464743dbc9e82c46fe7e14aa 80694ad203d0d37cd8d186d823bb536c921ae9bf --e

[clang] 902b2a2 - [clang] Add lifetimebound attr to std::span/std::string_view constructor (#103716)

2024-08-28 Thread via cfe-commits
Author: Haojian Wu Date: 2024-08-28T10:50:17+02:00 New Revision: 902b2a26ab9e1e78dfb66b52fba4512c91472e09 URL: https://github.com/llvm/llvm-project/commit/902b2a26ab9e1e78dfb66b52fba4512c91472e09 DIFF: https://github.com/llvm/llvm-project/commit/902b2a26ab9e1e78dfb66b52fba4512c91472e09.diff LO

[clang] [clang] Add lifetimebound attr to std::span/std::string_view constructor (PR #103716)

2024-08-28 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/103716 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-28 Thread via cfe-commits
whisperity wrote: @nicovank > Add check and alias entries to > [clang-tools-extra/docs/clang-tidy/checks/list.rst](https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/docs/clang-tidy/checks/list.rst). > > Check name: this is not only sizeof. Maybe > `bugprone-suspicious-pointer-s

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-08-28 Thread via cfe-commits
https://github.com/Discookie updated https://github.com/llvm/llvm-project/pull/106350 >From c4e05bdb36e270cbf0557f38fad7c04edf011905 Mon Sep 17 00:00:00 2001 From: Viktor Date: Wed, 28 Aug 2024 08:47:20 + Subject: [PATCH 1/3] [clang-tidy] Add user-defined functions to bugprone-unsafe-funct

[clang] [WIP] [analyzer] Refactor MallocChecker to use `BindExpr` in `evalCall` (PR #106081)

2024-08-28 Thread Pavel Skripkin via cfe-commits
@@ -1736,6 +1816,25 @@ MallocChecker::MallocMemReturnsAttr(CheckerContext &C, const CallEvent &Call, return MallocMemAux(C, Call, UnknownVal(), UndefinedVal(), State, Family); } +ProgramStateRef MallocChecker::MallocBindRetval(CheckerContext &C, +

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-08-28 Thread via cfe-commits
Discookie wrote: Note: I copied over the header from the test `unsafe-functions.c` about the tests not working on some targets into my new tests. How could I test these files on the targets? (Other than just pushing this branch I suppose.) https://github.com/llvm/llvm-project/pull/106350 _

[clang] [clang-format] js handle anonymous classes (PR #106242)

2024-08-28 Thread Owen Pan via cfe-commits
@@ -3238,6 +3238,12 @@ TEST_F(TokenAnnotatorTest, BraceKind) { EXPECT_BRACE_KIND(Tokens[8], BK_BracedInit); EXPECT_BRACE_KIND(Tokens[11], BK_BracedInit); EXPECT_BRACE_KIND(Tokens[13], BK_Block); + + Tokens = annotate("a = class extends goog.a {}", +ge

[clang] [clang-format] js handle anonymous classes (PR #106242)

2024-08-28 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. LG except some nits. https://github.com/llvm/llvm-project/pull/106242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] js handle anonymous classes (PR #106242)

2024-08-28 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/106242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Donát Nagy via cfe-commits
@@ -241,10 +241,14 @@ BlockInCriticalSectionChecker::checkDescriptorMatch(const CallEvent &Call, return std::nullopt; } -static const MemRegion *skipBaseClassRegion(const MemRegion *Reg) { - while (const auto *BaseClassRegion = dyn_cast(Reg)) { +static const MemRegion *ski

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/106240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/106240 >From 0c86e46516466f9513652a04ba87aa2a018ff6b8 Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 27 Aug 2024 17:52:25 +0200 Subject: [PATCH 01/10] [analyzer] Fix false positive for mutexes inheriting

[clang] [clang-format] js handle anonymous classes (PR #106242)

2024-08-28 Thread Krasimir Georgiev via cfe-commits
https://github.com/krasimirgg updated https://github.com/llvm/llvm-project/pull/106242 >From 32e94bde5a8ed401a9fb1255d8394c552da82dd7 Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Tue, 27 Aug 2024 16:08:07 + Subject: [PATCH 1/4] [clang-format] js handle anonymous classes Addresses

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-08-28 Thread via cfe-commits
@@ -5057,6 +5057,21 @@ struct FormatStyle { /// \version 11 std::vector WhitespaceSensitiveMacros; + /// Insert a newline at the begging and at the end of namespace definition + /// \code + /// false: vs. true: + /// + /// namespace

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-08-28 Thread via cfe-commits
https://github.com/dmasloff edited https://github.com/llvm/llvm-project/pull/106145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 07514fa - [Coroutines] Salvage the debug information for coroutine frames within optimizations

2024-08-28 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-08-28T17:02:12+08:00 New Revision: 07514fa9b607fd80a72a80270d714e22d842fa39 URL: https://github.com/llvm/llvm-project/commit/07514fa9b607fd80a72a80270d714e22d842fa39 DIFF: https://github.com/llvm/llvm-project/commit/07514fa9b607fd80a72a80270d714e22d842fa39.diff LO

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-08-28 Thread via cfe-commits
@@ -1493,6 +1511,18 @@ static auto computeNewlines(const AnnotatedLine &Line, Newlines = 1; } + // Insert empty line after "{" that opens namespace scope + if (Style.WrapNamespaceBodyWithNewlines && + LineStartsNamespaceScope(&Line, PreviousLine, PrevPrevLine)) {

[clang] [WIP] [analyzer] Refactor MallocChecker to use `BindExpr` in `evalCall` (PR #106081)

2024-08-28 Thread Pavel Skripkin via cfe-commits
@@ -2815,7 +2906,7 @@ MallocChecker::ReallocMemAux(CheckerContext &C, const CallEvent &Call, // Get the from and to pointer symbols as in toPtr = realloc(fromPtr, size). SymbolRef FromPtr = arg0Val.getLocSymbolInBase(); -SVal RetVal = C.getSVal(CE); +SVal Ret

[clang] [WIP] [analyzer] Refactor MallocChecker to use `BindExpr` in `evalCall` (PR #106081)

2024-08-28 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/106081 >From 82e3d871766b132d0ce0b9e8e74371d8598d2431 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Tue, 6 Aug 2024 19:12:01 +0300 Subject: [PATCH 1/4] wip --- .../Core/PathSensitive/DynamicExtent.h|

[clang] [WIP] [analyzer] Refactor MallocChecker to use `BindExpr` in `evalCall` (PR #106081)

2024-08-28 Thread Pavel Skripkin via cfe-commits
pskrgag wrote: Thank you so much for review! After invalidating location in `FreeMemAux` everything started working as it should. Also changed `getConjuredHeapSymbolVal` to return `DefinedSVal`. https://github.com/llvm/llvm-project/pull/106081 ___ cf

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread Rainer Orth via cfe-commits
https://github.com/rorth created https://github.com/llvm/llvm-project/pull/106353 Recently, Solaris bootstrap got broken because Solaris uses a non-standard mangling of `std::tm` and a few others. This was fixed with a hack in PR Solaris ABI requirements, mangling `std::tm` as `tm` and simila

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Rainer Orth (rorth) Changes Recently, Solaris bootstrap got broken because Solaris uses a non-standard mangling of `std::tm` and a few others. This was fixed with a hack in PR Solaris ABI requirements, mangling `std::tm` as `tm` and simi

[clang] [clang] Properly set file and line info for -ftime-trace (PR #106277)

2024-08-28 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/106277 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Properly set file and line info for -ftime-trace (PR #106277)

2024-08-28 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov commented: Suggestion: could we update the PR title to say something like "Output location in separate fields of `-ftime-trace`"? "properly" is open to interpretation and requires reading the full change description. https://github.com/llvm/llvm-project/pull/1

[clang] [clang] Properly set file and line info for -ftime-trace (PR #106277)

2024-08-28 Thread Ilya Biryukov via cfe-commits
@@ -1255,8 +1256,12 @@ Parser::DeclGroupPtrTy Parser::ParseDeclarationOrFunctionDefinition( // Add an enclosing time trace scope for a bunch of small scopes with // "EvaluateAsConstExpr". llvm::TimeTraceScope TimeScope("ParseDeclarationOrFunctionDefinition", [&]() { -

[clang] [clang] Properly set file and line info for -ftime-trace (PR #106277)

2024-08-28 Thread Ilya Biryukov via cfe-commits
@@ -1255,8 +1256,12 @@ Parser::DeclGroupPtrTy Parser::ParseDeclarationOrFunctionDefinition( // Add an enclosing time trace scope for a bunch of small scopes with // "EvaluateAsConstExpr". llvm::TimeTraceScope TimeScope("ParseDeclarationOrFunctionDefinition", [&]() { -

[clang] [clang] Properly set file and line info for -ftime-trace (PR #106277)

2024-08-28 Thread Ilya Biryukov via cfe-commits
@@ -223,15 +223,15 @@ Frontend (test.cc) | | | | EvaluateAsRValue () | | | EvaluateAsBooleanCondition () | | | | EvaluateAsRValue () -| ParseDeclarationOrFunctionDefinition (test.cc:16:1) +| ParseDeclarationOrFunctionDefinition (test.cc:16) | | ParseFunctionDefinition (slow_te

[clang] [clang] Properly set file and line info for -ftime-trace (PR #106277)

2024-08-28 Thread Ilya Biryukov via cfe-commits
@@ -1255,8 +1256,12 @@ Parser::DeclGroupPtrTy Parser::ParseDeclarationOrFunctionDefinition( // Add an enclosing time trace scope for a bunch of small scopes with // "EvaluateAsConstExpr". llvm::TimeTraceScope TimeScope("ParseDeclarationOrFunctionDefinition", [&]() { -

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -241,10 +241,14 @@ BlockInCriticalSectionChecker::checkDescriptorMatch(const CallEvent &Call, return std::nullopt; } -static const MemRegion *skipBaseClassRegion(const MemRegion *Reg) { - while (const auto *BaseClassRegion = dyn_cast(Reg)) { +static const MemRegion *ski

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Let's merge this. https://github.com/llvm/llvm-project/pull/106240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 82e314e - [analyzer] Fix false positive for mutexes inheriting mutex_base (#106240)

2024-08-28 Thread via cfe-commits
Author: Arseniy Zaostrovnykh Date: 2024-08-28T11:30:18+02:00 New Revision: 82e314e3664d2c8768212e74f751187d51950b87 URL: https://github.com/llvm/llvm-project/commit/82e314e3664d2c8768212e74f751187d51950b87 DIFF: https://github.com/llvm/llvm-project/commit/82e314e3664d2c8768212e74f751187d51950b8

[clang] [analyzer] Fix false positive for mutexes inheriting mutex_base (PR #106240)

2024-08-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/106240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Update TidyFastChecks for release/19.x (PR #106354)

2024-08-28 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet created https://github.com/llvm/llvm-project/pull/106354 Run for clang-tidy checks available in release/19.x branch. Some notable findings: - altera-id-dependent-backward-branch, stays slow with 13%. - misc-const-correctness become faster, going from 261% to 67%, but

[clang-tools-extra] [clangd] Update TidyFastChecks for release/19.x (PR #106354)

2024-08-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: kadir çetinkaya (kadircet) Changes Run for clang-tidy checks available in release/19.x branch. Some notable findings: - altera-id-dependent-backward-branch, stays slow with 13%. - misc-const-correctness become faster, going fro

[clang-tools-extra] [clangd] Update TidyFastChecks for release/19.x (PR #106354)

2024-08-28 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 22e55ba3293f72df84de509db821b4d8a2c4c55e 38df7489ff2fa15a5bc7fc66d18ef78b489cd9d8 --e

[clang-tools-extra] [clangd] Update TidyFastChecks for release/19.x (PR #106354)

2024-08-28 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/106354 From c2248b8f0b6255774c7cf2aa80e7330696fd9c40 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Wed, 28 Aug 2024 11:27:47 +0200 Subject: [PATCH] [clangd] Update TidyFastChecks for release/19.x Run for clang

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread via cfe-commits
https://github.com/cor3ntin commented: Can you also add a changelog entry? Thanks! https://github.com/llvm/llvm-project/pull/106353 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/106353 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread via cfe-commits
@@ -1604,10 +1604,12 @@ static bool isTargetVariantEnvironment(const TargetInfo &TI, return false; } -#if defined(__sun__) && defined(__svr4__) +#if defined(__sun__) && defined(__svr4__) && defined(__clang__) && \ +__clang__ < 20 cor3ntin w

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread via cfe-commits
@@ -6953,6 +6954,27 @@ bool CXXNameMangler::mangleStandardSubstitution(const NamedDecl *ND) { return false; } + if (getASTContext().getTargetInfo().getTriple().isOSSolaris()) { +if (const RecordDecl *RD = dyn_cast(ND)) { + if (!isStdNamespace(Context.getEffect

[clang] [llvm] [AArch64] Make apple-m4 armv8.7-a again (from armv9.2-a). (PR #106312)

2024-08-28 Thread Tomas Matheson via cfe-commits
@@ -895,7 +895,10 @@ def ProcessorFeatures { FeatureLSE, FeaturePAuth, FeatureFPAC, FeatureRAS, FeatureRCPC, FeatureRDM, FeatureBF16, FeatureDotProd, FeatureMatMulInt

[clang] [clang] Update C++ DR page (PR #106299)

2024-08-28 Thread via cfe-commits
@@ -33,7 +33,7 @@ void *operator new(std::size_t, void *p) { return p; } void* operator new[] (std::size_t, void* p) {return p;} -namespace cwg2922 { // cwg2922: 20 open 2024-07-10 +namespace cwg2922 { // cwg2922: 20 tentatively ready 2024-07-10 cor3ntin wrot

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-08-28 Thread via cfe-commits
@@ -7,6 +7,8 @@ //===--===// #include "UnsafeFunctionsCheck.h" +#include "../utils/Matchers.h" whisperity wrote: (This include is superfluous, ClangTidyCheck automatically pulls the related

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread Rainer Orth via cfe-commits
@@ -1604,10 +1604,12 @@ static bool isTargetVariantEnvironment(const TargetInfo &TI, return false; } -#if defined(__sun__) && defined(__svr4__) +#if defined(__sun__) && defined(__svr4__) && defined(__clang__) && \ +__clang__ < 20 rorth wrot

[clang] [clang] Add lifetimebound attr to std::span/std::string_view constructor (PR #103716)

2024-08-28 Thread Nikita Popov via cfe-commits
nikic wrote: Just as a FYI this inference introduces a small amount of overhead: http://llvm-compile-time-tracker.com/compare.php?from=866bec7d3ff8803b68e9972939c1a76ccf5fdc62&to=902b2a26ab9e1e78dfb66b52fba4512c91472e09&stat=instructions:u https://github.com/llvm/llvm-project/pull/103716 __

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread Rainer Orth via cfe-commits
@@ -6953,6 +6954,27 @@ bool CXXNameMangler::mangleStandardSubstitution(const NamedDecl *ND) { return false; } + if (getASTContext().getTargetInfo().getTriple().isOSSolaris()) { +if (const RecordDecl *RD = dyn_cast(ND)) { + if (!isStdNamespace(Context.getEffect

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread Rainer Orth via cfe-commits
rorth wrote: > Can you also add a changelog entry? Thanks! I've never seen them used in LLVM. Has that changed recently? https://github.com/llvm/llvm-project/pull/106353 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2024-08-28 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/102857 >From 1119f0a8d180e482bff45c999d488827ac5ae49e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 12 Aug 2024 23:32:34 +0800 Subject: [PATCH 01/13] [Clang][NFCI] Slightly refactor getTemplateInstantiationAr

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-28 Thread via cfe-commits
https://github.com/ivanaivanovska updated https://github.com/llvm/llvm-project/pull/103039 >From 1294a50b0da22e2904d3e43942a6be702c93d133 Mon Sep 17 00:00:00 2001 From: Ivana Ivanovska Date: Tue, 13 Aug 2024 10:30:34 + Subject: [PATCH 1/2] Added instant events and marking defered templated

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2024-08-28 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/102857 >From 1119f0a8d180e482bff45c999d488827ac5ae49e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 12 Aug 2024 23:32:34 +0800 Subject: [PATCH 01/14] [Clang][NFCI] Slightly refactor getTemplateInstantiationAr

[clang] [clang] Update C++ DR page (PR #106299)

2024-08-28 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/106299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9cf052d - [clang] Update C++ DR page (#106299)

2024-08-28 Thread via cfe-commits
Author: Vlad Serebrennikov Date: 2024-08-28T14:01:21+04:00 New Revision: 9cf052df90418697c05810f69c588064f7b3ce71 URL: https://github.com/llvm/llvm-project/commit/9cf052df90418697c05810f69c588064f7b3ce71 DIFF: https://github.com/llvm/llvm-project/commit/9cf052df90418697c05810f69c588064f7b3ce71.

[clang-tools-extra] [clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-28 Thread via cfe-commits
https://github.com/whisperity edited https://github.com/llvm/llvm-project/pull/106061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-08-28 Thread Vlad Serebrennikov via cfe-commits
@@ -2099,6 +2099,70 @@ class Sema final : public SemaBase { bool CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, bool OrNull); + // AssignmentAction - This is used by all the assignment diagnostic functions + // to repr

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2024-08-28 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/102857 >From 1119f0a8d180e482bff45c999d488827ac5ae49e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 12 Aug 2024 23:32:34 +0800 Subject: [PATCH 01/15] [Clang][NFCI] Slightly refactor getTemplateInstantiationAr

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread via cfe-commits
zmodem wrote: We're seeing many test failures in Chromium after this change as well: https://crbug.com/362522336 https://github.com/llvm/llvm-project/pull/105496 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

  1   2   3   4   5   6   >