[clang] [clang][ThreadSafety] Check trylock function success and return types (PR #95290)

2024-06-30 Thread Aaron Puchert via cfe-commits
https://github.com/aaronpuchert edited https://github.com/llvm/llvm-project/pull/95290 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ThreadSafety] Check trylock function success and return types (PR #95290)

2024-06-30 Thread Aaron Puchert via cfe-commits
https://github.com/aaronpuchert commented: Don't want to give the wrong impression, I like the idea of this change a lot. But I think we need to be clearer about the attribute, the return value, and the relation between them. The attribute needs to be a constant expression for sure, and it's p

[clang] [clang][ThreadSafety] Check trylock function success and return types (PR #95290)

2024-06-30 Thread Aaron Puchert via cfe-commits
@@ -608,15 +606,31 @@ static bool checkTryLockFunAttrCommon(Sema &S, Decl *D, const ParsedAttr &AL, if (!AL.checkAtLeastNumArgs(S, 1)) return false; - if (!isIntOrBool(AL.getArgAsExpr(0))) { + // The attribute's first argument defines the success value. + const Expr

[clang] [clang][ThreadSafety] Check trylock function success and return types (PR #95290)

2024-06-30 Thread Aaron Puchert via cfe-commits
@@ -1954,6 +1954,125 @@ struct TestTryLock { } // end namespace TrylockTest +// Regression test for trylock attributes with an enumerator success argument. +// Prior versions of the analysis silently failed to evaluate success arguments +// that were neither `CXXBoolLiteralEx

[clang] [clang][ThreadSafety] Check trylock function success and return types (PR #95290)

2024-06-30 Thread Aaron Puchert via cfe-commits
@@ -1359,17 +1361,18 @@ void ThreadSafetyAnalyzer::getMutexIDs(CapExprSet &Mtxs, AttrType *Attr, const Expr *Exp, const NamedDecl *D, const CFGBlock *PredBlock,

[clang] [clang] Disable C++14 sized deallocation by default for MinGW targets (PR #97232)

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

[clang] Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (PR #95455)

2024-06-30 Thread Aaron Puchert via cfe-commits
@@ -764,12 +764,6 @@ doesn't know that munl.mu == mutex. The SCOPED_CAPABILITY attribute handles aliasing for MutexLocker, but does so only for that particular pattern. -ACQUIRED_BEFORE(...) and ACQUIRED_AFTER(...) are currently unimplemented. --

[clang] Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (PR #95455)

2024-06-30 Thread Aaron Puchert via cfe-commits
@@ -29,6 +30,22 @@ struct LOCKABLE Mutex {}; struct Foo { struct Mutex *mu_; + int a_value GUARDED_BY(mu_); + + struct Bar { +struct Mutex *other_mu ACQUIRED_AFTER(mu_); aaronpuchert wrote: I'm not entirely sure how nested `struct`s work in C, but sh

[clang] Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (PR #95455)

2024-06-30 Thread Aaron Puchert via cfe-commits
@@ -29,6 +30,22 @@ struct LOCKABLE Mutex {}; struct Foo { struct Mutex *mu_; + int a_value GUARDED_BY(mu_); + + struct Bar { +struct Mutex *other_mu ACQUIRED_AFTER(mu_); +struct Mutex *third_mu ACQUIRED_BEFORE(other_mu); + } bar; + + int* a_ptr PT_GUARDED_BY(bar

[clang] [Serialization] Clear moved-from deque to ensure valid state post-move (PR #97221)

2024-06-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/97221 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Default to -fno-sized-deallocation for AIX (PR #97076)

2024-06-30 Thread Pengcheng Wang via cfe-commits
https://github.com/wangpc-pp approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/97076 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Bring initFeatureMap back to AArch64TargetInfo. (PR #96832)

2024-06-30 Thread weiwei chen via cfe-commits
weiweichen wrote: Here is a self contained simple repro test cpp file: ``` #include "clang/Basic/Diagnostic.h" #include "clang/Basic/DiagnosticIDs.h" #include "clang/Basic/DiagnosticOptions.h" #include "clang/Basic/TargetInfo.h" #include "llvm/ADT/SmallString.h" #include "llvm/TargetParser/Host

[clang] [llvm] [X86][CodeGen] security check cookie execute only when needed (PR #95904)

2024-06-30 Thread via cfe-commits
https://github.com/mahesh-attarde updated https://github.com/llvm/llvm-project/pull/95904 >From 6d6619f8f7a37906ac45791487a4d63b51a48ad1 Mon Sep 17 00:00:00 2001 From: mahesh-attarde Date: Wed, 12 Jun 2024 06:15:51 -0700 Subject: [PATCH 1/7] added regcall strct by reg support --- clang/lib/Co

[clang-tools-extra] [clangd] Enable passing a `FeatureModuleSet` to `clangdMain`. (PR #97255)

2024-06-30 Thread Michael Park via cfe-commits
https://github.com/mpark created https://github.com/llvm/llvm-project/pull/97255 This diff adds an overload of `clangdMain` that makes a `FeatureModuleSet`. `clangdMain` was initially added in 56ac9d46a7c1 to allow custom builds of clangd outside of the LLVM repo that link against clangd. Curre

[clang-tools-extra] [clangd] Enable passing a `FeatureModuleSet` to `clangdMain`. (PR #97255)

2024-06-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangd @llvm/pr-subscribers-clang-tools-extra Author: Michael Park (mpark) Changes This diff adds an overload of `clangdMain` that makes a `FeatureModuleSet`. `clangdMain` was initially added in 56ac9d46a7c1 to allow custom builds of clangd outside of

[clang-tools-extra] [clangd] Enable passing a `FeatureModuleSet` to `clangdMain`. (PR #97255)

2024-06-30 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 8598bcb9934dca16ea16d87304e00defc85d986c 01ae6c9aee33d3b2b0a00484bf7c041f6b90e710 --

[clang-tools-extra] [clangd] Enable passing a `FeatureModuleSet` to `clangdMain`. (PR #97255)

2024-06-30 Thread Michael Park via cfe-commits
https://github.com/mpark closed https://github.com/llvm/llvm-project/pull/97255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Comments] Attach comments to decl even if preproc directives are in between (PR #88367)

2024-06-30 Thread via cfe-commits
https://github.com/hdoc updated https://github.com/llvm/llvm-project/pull/88367 >From 5a07a5d133a86b229bdfd42343820f0877735f04 Mon Sep 17 00:00:00 2001 From: hdoc Date: Thu, 11 Apr 2024 01:54:18 -0700 Subject: [PATCH 1/5] Attach comments to decl even if preproc directives are in between --- c

[clang] [Clang][Comments] Attach comments to decl even if preproc directives are in between (PR #88367)

2024-06-30 Thread via cfe-commits
hdoc wrote: This is rebased onto the latest rev of the main branch and should be ready to go. We do not have commit permissions, so @AaronBallman could you please help merge this in? Thank you :) https://github.com/llvm/llvm-project/pull/88367 ___ c

<    1   2