https://github.com/aaronpuchert closed
https://github.com/llvm/llvm-project/pull/149660
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
aaronpuchert wrote:
I've been trying to implement this in `ThreadSafety.cpp`, and it does seem to
work, but I ended up at the same conclusion that you had originally: that we
don't need to warn about this. It's certainly a strange thing to write, but
warnings are mostly about preventing accide
aaronpuchert wrote:
/cherry-pick a048aeb06e5de571eadd646860c320b9a67d1efc
https://github.com/llvm/llvm-project/pull/150857
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/aaronpuchert milestoned
https://github.com/llvm/llvm-project/pull/150857
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/aaronpuchert updated
https://github.com/llvm/llvm-project/pull/149660
>From 1b1d3114602505618fa9bf7c7009ca848f53f814 Mon Sep 17 00:00:00 2001
From: Aaron Puchert
Date: Sat, 19 Jul 2025 17:33:01 +0200
Subject: [PATCH] Thread safety analysis: Allocate FactEntrys with
BumpPtrAl
@@ -941,43 +966,68 @@ class LockableFactEntry : public FactEntry {
}
};
-class ScopedLockableFactEntry : public FactEntry {
+enum UnderlyingCapabilityKind {
+ UCK_Acquired, ///< Any kind of acquired capability.
+ UCK_ReleasedShared,///< Shared capability that
https://github.com/aaronpuchert closed
https://github.com/llvm/llvm-project/pull/150857
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/aaronpuchert created
https://github.com/llvm/llvm-project/pull/150857
The point of reentrant capabilities is that they can be acquired multiple
times, so they should probably be excluded from requiring a negative capability
on acquisition via -Wthread-safety-negative.
Howev
@@ -241,7 +242,21 @@ CapabilityExpr SExprBuilder::translateAttrExpr(const Expr
*AttrExp,
return CapabilityExpr(E, AttrExp->getType(), Neg);
}
-til::LiteralPtr *SExprBuilder::createVariable(const VarDecl *VD) {
+til::SExpr *SExprBuilder::translateVarDecl(const VarDecl *VD,
+
https://github.com/aaronpuchert commented:
Sorry for the delay, but I still need to wrap my head around this. For now just
some very high-level comments.
https://github.com/llvm/llvm-project/pull/142955
___
cfe-commits mailing list
cfe-commits@lists.l
@@ -1012,6 +1030,107 @@ void SExprBuilder::exitCFG(const CFGBlock *Last) {
IncompleteArgs.clear();
}
+bool SExprBuilder::isVariableReassigned(const VarDecl *VD) {
+ // Note: The search is performed lazily per-variable and result is cached. An
+ // alternative would have be
https://github.com/aaronpuchert edited
https://github.com/llvm/llvm-project/pull/142955
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
aaronpuchert wrote:
> Overall compilation before the change takes 327,801,317 instructions, and
> 327,433,878 after the change
Accidentally left assertions on. Without it's 277,111,134 versus 276,855,186,
but this is also 0.1%, and Thread Safety Analysis is still roughly 1% of the
overall com
aaronpuchert wrote:
> Does this have measurable performance impacts? Or was there some other
> benefit driving the change?
Thread Safety Analysis is not very expensive overall. I just benchmarked
compilation of `clang/test/SemaCXX/warn-thread-safety-analysis.cpp` and it
comes out at around 1%
aaronpuchert wrote:
@rupprecht, maybe you want to try this out?
https://github.com/llvm/llvm-project/pull/148551
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/aaronpuchert edited
https://github.com/llvm/llvm-project/pull/148551
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/aaronpuchert updated
https://github.com/llvm/llvm-project/pull/148551
>From b6bd8b5da8007b28469011989171cd050ba60113 Mon Sep 17 00:00:00 2001
From: Aaron Puchert
Date: Sun, 13 Jul 2025 23:48:49 +0200
Subject: [PATCH] Thread Safety Analysis: Compare values of literals
The typ
@@ -941,43 +966,68 @@ class LockableFactEntry : public FactEntry {
}
};
-class ScopedLockableFactEntry : public FactEntry {
+enum UnderlyingCapabilityKind {
+ UCK_Acquired, ///< Any kind of acquired capability.
+ UCK_ReleasedShared,///< Shared capability that
https://github.com/aaronpuchert created
https://github.com/llvm/llvm-project/pull/149660
The FactManager managing the FactEntrys stays alive for the analysis of a
single function. We are already using that by allocating TIL S-expressions via
BumpPtrAllocator. We can do the same with FactEntrys
https://github.com/aaronpuchert created
https://github.com/llvm/llvm-project/pull/148551
The typical case for literals is an array of mutexes, where we want to
distinguish `mutex[0]` from `mutex[1]` and so on. Currently they're treated as
the same expression, in fact all literals are treated a
Author: Aaron Puchert
Date: 2025-07-14T00:10:15+02:00
New Revision: bfb686bb5ba503e9386dc899e1ebbe2488e6a0a8
URL:
https://github.com/llvm/llvm-project/commit/bfb686bb5ba503e9386dc899e1ebbe2488e6a0a8
DIFF:
https://github.com/llvm/llvm-project/commit/bfb686bb5ba503e9386dc899e1ebbe2488e6a0a8.diff
aaronpuchert wrote:
> My software currently contains a nasty global recursive lock that we hope to
> (over a long period of time, likely years) convert to non-recursive.
>
> In the meantime, and during the refactor, it's helpful to be able to mark
> some functions as `EXCLUSIVE_LOCKS_REQUIRED(
aaronpuchert wrote:
> > On a related note, do we emit `-Wthread-safety-negative` for reentrant
> > locks? I don't remember that we carved out an exception for that, and we
> > probably should.
>
> We do - and it's deliberate on my part as I've been trying to indicate that
> there might be val
@@ -286,51 +291,76 @@ static bool checkRecordTypeForScopedCapability(Sema &S,
QualType Ty) {
return checkRecordDeclForAttr(RT->getDecl());
}
-static bool checkTypedefTypeForCapability(QualType Ty) {
+static std::optional checkTypedefTypeForCapability(QualType Ty) {
const
@@ -0,0 +1,251 @@
+// RUN: %clang_cc1 -fsyntax-only -verify=expected,c_diagnostics
-Wmissing-format-attribute %s
+// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -fsyntax-only -x c++ -verify=ex
@@ -5918,6 +5918,181 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D,
const ParsedAttr &AL) {
D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI));
}
+// Diagnosing missing format attributes is implemented in two steps:
+// 1. Detect missing forma
@@ -5918,6 +5918,181 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D,
const ParsedAttr &AL) {
D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI));
}
+// Diagnosing missing format attributes is implemented in two steps:
+// 1. Detect missing forma
@@ -5918,6 +5918,181 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D,
const ParsedAttr &AL) {
D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI));
}
+// Diagnosing missing format attributes is implemented in two steps:
+// 1. Detect missing forma
@@ -0,0 +1,259 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wmissing-format-attribute %s
+// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -fsyntax-only -x c++ -verify -Wmissing-format-attribute
@@ -5335,6 +5335,230 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D,
const ParsedAttr &AL) {
D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI));
}
+// Returns vector of format attributes. There are no two attributes with same
+// arguments in r
@@ -0,0 +1,259 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wmissing-format-attribute %s
+// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -fsyntax-only -x c++ -verify -Wmissing-format-attribute
@@ -5918,6 +5918,181 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D,
const ParsedAttr &AL) {
D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI));
}
+// Diagnosing missing format attributes is implemented in two steps:
+// 1. Detect missing forma
@@ -3460,8 +3460,10 @@ void Sema::checkCall(NamedDecl *FDecl, const
FunctionProtoType *Proto,
}
}
- if (FD)
+ if (FD) {
diagnoseArgDependentDiagnoseIfAttrs(FD, ThisArg, Args, Loc);
+DetectMissingFormatAttributes(FD, Args, Loc);
aaronpuchert w
@@ -5918,6 +5918,181 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D,
const ParsedAttr &AL) {
D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI));
}
+// Diagnosing missing format attributes is implemented in two steps:
+// 1. Detect missing forma
https://github.com/aaronpuchert edited
https://github.com/llvm/llvm-project/pull/105479
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/aaronpuchert commented:
> As I understand your change, it can only trip when `-Wformat-nonliteral` also
> trips. I think that you should implement this as a note/fixit on
> `-Wformat-nonliteral`.
Good observation, and I agree. It's even documented that this is one way to fix
@@ -4222,6 +4222,11 @@ def warn_fun_requires_lock_precise :
InGroup, DefaultIgnore;
def note_found_mutex_near_match : Note<"found near match '%0'">;
+// Pedantic thread safety warnings enabled by default
+def warn_thread_reentrant_with_negative_capability : Warning<
+ "%0 i
https://github.com/aaronpuchert commented:
On a related note, do we emit `-Wthread-safety-negative` for reentrant locks? I
don't remember that we carved out an exception for that, and we probably should.
https://github.com/llvm/llvm-project/pull/141599
__
@@ -286,51 +291,76 @@ static bool checkRecordTypeForScopedCapability(Sema &S,
QualType Ty) {
return checkRecordDeclForAttr(RT->getDecl());
}
-static bool checkTypedefTypeForCapability(QualType Ty) {
+static std::optional checkTypedefTypeForCapability(QualType Ty) {
const
https://github.com/aaronpuchert edited
https://github.com/llvm/llvm-project/pull/141599
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/aaronpuchert closed
https://github.com/llvm/llvm-project/pull/142967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
aaronpuchert wrote:
Yes, it doesn't seem to build the docs. The Windows failure looks unrelated:
```
llvm-lit.py:
C:\_work\llvm-project\llvm-project\llvm\utils\lit\lit\llvm\config.py:312:
fatal: Couldn't find the include dir for Clang
('c:\_work\llvm-project\llvm-project\build\bin\clang.exe')
@@ -3918,6 +3918,75 @@ have their lifetimes extended.
}];
}
+def LifetimeCaptureByDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+Similar to `lifetimebound`_, the ``lifetime_capture_by(X)`` attribute on a
function
+parameter or implicit obj
https://github.com/aaronpuchert created
https://github.com/llvm/llvm-project/pull/142967
Anchors are automatically generated, but adding another anchor with the same
name hides the anchor that we actually want. Simply removing the unnecessary
self-referential anchor `lifetimebound` fixes the l
@@ -271,26 +271,32 @@ class CFGWalker {
// translateAttrExpr needs it, but that should be moved too.
class CapabilityExpr {
private:
- /// The capability expression and whether it's negated.
- llvm::PointerIntPair CapExpr;
+ /// The capability expression and flags.
+ llvm::
aaronpuchert wrote:
@melver, this request came from @AaronBallman. But since you're also working on
Thread Safety Analysis in C, you might have some thoughts of your own about
this.
I haven't checked any real-world code yet. (Specifically, how many functions
would be affected by this exclusio
https://github.com/aaronpuchert created
https://github.com/llvm/llvm-project/pull/141432
The analysis already excludes functions with a zero-argument acquire or release
attribute. According to the requirements enforced by
-Wthread-safety-attributes, these are methods of a capability class wher
https://github.com/aaronpuchert edited
https://github.com/llvm/llvm-project/pull/137133
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -235,6 +266,20 @@ class FactSet {
return false;
}
+ std::optional replaceLock(FactManager &FM, iterator It,
+std::unique_ptr Entry) {
+if (It == end())
+ return std::nullopt;
+FactID F = FM.newFact(std::move(Entry));
+
https://github.com/aaronpuchert approved this pull request.
I think this looks good, thanks for your contribution!
https://github.com/llvm/llvm-project/pull/137133
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/m
https://github.com/aaronpuchert closed
https://github.com/llvm/llvm-project/pull/135390
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1011,6 +979,30 @@ void SExprBuilder::exitCFG(const CFGBlock *Last) {
IncompleteArgs.clear();
}
+static CapabilityExpr makeCapabilityExpr(const til::SExpr *E, QualType VDT,
+ bool Neg) {
+ // We need to look at the declaration of t
@@ -0,0 +1,34 @@
+//===--- UseEnumClassCheck.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: Apa
@@ -0,0 +1,34 @@
+//===--- UseEnumClassCheck.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: Apa
aaronpuchert wrote:
Could also add this under "Bug Fixes to C++ Support". The entries about type
traits [don't seem to be consistently
categorized](https://releases.llvm.org/19.1.0/tools/clang/docs/ReleaseNotes.html#bug-fixes-in-this-version),
but I think this is all C++-only.
https://github.
https://github.com/aaronpuchert updated
https://github.com/llvm/llvm-project/pull/135390
>From d8bc5ebd7976d25e800987b3c95057364dc1c07c Mon Sep 17 00:00:00 2001
From: Aaron Puchert
Date: Fri, 11 Apr 2025 13:47:02 +0200
Subject: [PATCH] Suppress errors from well-formed-testing type traits in
SF
@@ -12240,16 +12240,16 @@ class Sema final : public SemaBase {
bool PrevLastDiagnosticIgnored;
public:
-explicit SFINAETrap(Sema &SemaRef, bool AccessCheckingSFINAE = false)
+explicit SFINAETrap(Sema &SemaRef, bool TestWellformedSFINAE = false)
a
@@ -12240,16 +12240,16 @@ class Sema final : public SemaBase {
bool PrevLastDiagnosticIgnored;
public:
-explicit SFINAETrap(Sema &SemaRef, bool AccessCheckingSFINAE = false)
+explicit SFINAETrap(Sema &SemaRef, bool TestWellformedSFINAE = false)
a
@@ -0,0 +1,34 @@
+//===--- UseEnumClassCheck.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: Apa
@@ -0,0 +1,34 @@
+//===--- UseEnumClassCheck.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: Apa
@@ -0,0 +1,34 @@
+//===--- UseEnumClassCheck.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: Apa
https://github.com/aaronpuchert closed
https://github.com/llvm/llvm-project/pull/137477
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/aaronpuchert created
https://github.com/llvm/llvm-project/pull/137477
Support for attribute parameter packs was added some time ago in commit
ead1690d31f815c00fdd2bc23db4766191bbeabc. But template substitution didn't
expand the packs yet. For now expansion can only happen wi
@@ -114,31 +112,39 @@ class FactEntry : public CapabilityExpr {
};
private:
- const FactEntryKind Kind : 8;
+ const FactEntryKind Kind : 4;
/// Exclusive or shared.
- LockKind LKind : 8;
+ const LockKind LKind : 4;
+
+ /// How it was acquired.
+ const SourceKind S
@@ -168,6 +197,8 @@ class FactManager {
public:
FactID newFact(std::unique_ptr Entry) {
Facts.push_back(std::move(Entry));
+assert(Facts.size() - 1 <= std::numeric_limits::max() &&
aaronpuchert wrote:
```suggestion
assert(Facts.size() - 1 <= std:
@@ -235,6 +266,20 @@ class FactSet {
return false;
}
+ std::optional replaceLock(FactManager &FM, iterator It,
+std::unique_ptr Entry) {
+if (It == end())
+ return std::nullopt;
+FactID F = FM.newFact(std::move(Entry));
+
https://github.com/aaronpuchert commented:
Two more things come to mind:
* Consider adding a check to `SemaDeclAttr.cpp` that the new attribute is
always accompanied by `capability` or `lockable`. Although I wonder whether
that's too early. I'm not sure if we can see the other attributes alread
@@ -114,31 +112,39 @@ class FactEntry : public CapabilityExpr {
};
private:
- const FactEntryKind Kind : 8;
+ const FactEntryKind Kind : 4;
/// Exclusive or shared.
- LockKind LKind : 8;
+ const LockKind LKind : 4;
+
+ /// How it was acquired.
+ const SourceKind S
@@ -114,31 +112,39 @@ class FactEntry : public CapabilityExpr {
};
private:
- const FactEntryKind Kind : 8;
+ const FactEntryKind Kind : 4;
/// Exclusive or shared.
- LockKind LKind : 8;
+ const LockKind LKind : 4;
+
+ /// How it was acquired.
+ const SourceKind S
@@ -388,7 +395,7 @@ class SExprBuilder {
til::LiteralPtr *createVariable(const VarDecl *VD);
// Create placeholder for this: we don't know the VarDecl on construction
yet.
- std::pair
+ std::pair
aaronpuchert wrote:
Nice idea, but I'm not sure if it's
@@ -271,26 +271,32 @@ class CFGWalker {
// translateAttrExpr needs it, but that should be moved too.
class CapabilityExpr {
private:
- /// The capability expression and whether it's negated.
- llvm::PointerIntPair CapExpr;
+ /// The capability expression and flags.
+ llvm::
@@ -163,15 +184,15 @@ using FactID = unsigned short;
/// the analysis of a single routine.
class FactManager {
private:
- std::vector> Facts;
+ std::vector> Facts;
aaronpuchert wrote:
The FactEntries themselves should never be replaced, they are immutable. W
@@ -81,26 +81,25 @@ static bool isCalleeArrow(const Expr *E) {
return ME ? ME->isArrow() : false;
}
-static StringRef ClassifyDiagnostic(const CapabilityAttr *A) {
- return A->getName();
-}
-
-static StringRef ClassifyDiagnostic(QualType VDT) {
+static CapabilityExpr makeCa
https://github.com/aaronpuchert edited
https://github.com/llvm/llvm-project/pull/137133
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/aaronpuchert edited
https://github.com/llvm/llvm-project/pull/137133
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -271,26 +271,32 @@ class CFGWalker {
// translateAttrExpr needs it, but that should be moved too.
class CapabilityExpr {
private:
- /// The capability expression and whether it's negated.
- llvm::PointerIntPair CapExpr;
+ /// The capability expression and flags.
+ llvm::
@@ -103,6 +103,23 @@ static StringRef ClassifyDiagnostic(QualType VDT) {
return "mutex";
}
+static unsigned getCapabilityExprFlags(QualType VDT) {
+ unsigned Flags = 0;
+
+ if (const auto *RT = VDT->getAs()) {
+if (const auto *RD = RT->getDecl())
+ if (RD->hasAttr
@@ -271,26 +271,32 @@ class CFGWalker {
// translateAttrExpr needs it, but that should be moved too.
class CapabilityExpr {
private:
- /// The capability expression and whether it's negated.
- llvm::PointerIntPair CapExpr;
+ /// The capability expression and flags.
+ llvm::
@@ -6708,15 +6708,15 @@ int testAdoptShared() {
} // namespace ReturnScopedLockable
-#endif
+#endif // __cpp_guaranteed_copy_elision
aaronpuchert wrote:
These changes are fine, but please just commit them separately. (No review
required.)
https://github.co
@@ -163,15 +184,15 @@ using FactID = unsigned short;
/// the analysis of a single routine.
class FactManager {
private:
- std::vector> Facts;
+ std::vector> Facts;
aaronpuchert wrote:
This does not work, `FactEntry` has to remain `const`. See Delesley's comm
@@ -434,6 +434,16 @@ class can be used as a capability. The string argument
specifies the kind of
capability in error messages, e.g. ``"mutex"``. See the ``Container`` example
given above, or the ``Mutex`` class in :ref:`mutexheader`.
+REENTRANT
aaronpucher
@@ -434,6 +434,16 @@ class can be used as a capability. The string argument
specifies the kind of
capability in error messages, e.g. ``"mutex"``. See the ``Container`` example
given above, or the ``Mutex`` class in :ref:`mutexheader`.
+REENTRANT
+-
+
+``REENTRANT``
@@ -1831,15 +1852,15 @@ void BuildLockset::handleCall(const Expr *Exp, const
NamedDecl *D,
assert(!Self);
const auto *TagT = Exp->getType()->getAs();
if (D->hasAttrs() && TagT && Exp->isPRValue()) {
- std::pair Placeholder =
- Analyzer->SxBuilder.crea
https://github.com/aaronpuchert commented:
I think the biggest issue is that removing `const` from `FactEntry` does not
work. You'll have to undo all those changes and instead create a new
`FactEntry` for every lock/unlock.
https://github.com/llvm/llvm-project/pull/137133
_
https://github.com/aaronpuchert closed
https://github.com/llvm/llvm-project/pull/135561
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
aaronpuchert wrote:
I think it's obscure enough to not need to be mentioned. Since I went with the
less intrusive variant of downgrading an error to warning, it should not break
anyone's code.
I'd be open to add `ErrorDiag` on all thread safety attributes, but I'd do so
in a separate change i
aaronpuchert wrote:
This seems to have fixed #60112. Thanks!
https://github.com/llvm/llvm-project/pull/89154
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/aaronpuchert updated
https://github.com/llvm/llvm-project/pull/135561
>From 372bfceceec7ba618d7651559f1071baacaf2fcc Mon Sep 17 00:00:00 2001
From: Aaron Puchert
Date: Sun, 13 Apr 2025 22:28:23 +0200
Subject: [PATCH] Merge similar Clang Thread Safety attributes
Some of the o
https://github.com/aaronpuchert created
https://github.com/llvm/llvm-project/pull/135561
Some of the old lock-based and new capability-based spellings behave basically
in the same way, so merging them simplifies the code significantly.
There are two minor functional changes: we only warn (inst
https://github.com/aaronpuchert updated
https://github.com/llvm/llvm-project/pull/135390
>From af21e7bb441c13714f299600966bff28befe5191 Mon Sep 17 00:00:00 2001
From: Aaron Puchert
Date: Fri, 11 Apr 2025 13:47:02 +0200
Subject: [PATCH] Suppress errors from well-formed-testing type traits in
SF
https://github.com/aaronpuchert updated
https://github.com/llvm/llvm-project/pull/135390
>From ef1b40c0247205f8147fe6050c1303628833c247 Mon Sep 17 00:00:00 2001
From: Aaron Puchert
Date: Fri, 11 Apr 2025 13:47:02 +0200
Subject: [PATCH] Suppress errors from well-formed-testing type traits in
SF
https://github.com/aaronpuchert updated
https://github.com/llvm/llvm-project/pull/135390
>From 20219354f6a5a59cb36554fb26c5864b5d9be74e Mon Sep 17 00:00:00 2001
From: Aaron Puchert
Date: Fri, 11 Apr 2025 13:47:02 +0200
Subject: [PATCH] Suppress errors from well-formed-testing type traits in
SF
aaronpuchert wrote:
> (It should be noted that the standard doesn't always base this on the
> immediate context being well-formed: for `std::common_type` it's based on
> whether some expression "denotes a valid type." But I assume that's an
> editorial issue and means the same thing.)
Filed c
https://github.com/aaronpuchert edited
https://github.com/llvm/llvm-project/pull/135390
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/aaronpuchert updated
https://github.com/llvm/llvm-project/pull/135390
>From a1eda3b0d5b54ffc3d3ad4288d1d7685f6486143 Mon Sep 17 00:00:00 2001
From: Aaron Puchert
Date: Fri, 11 Apr 2025 13:47:02 +0200
Subject: [PATCH] Suppress errors from well-formed-testing type traits in
SF
aaronpuchert wrote:
The tests would produce without the change:
```
error: 'expected-error' diagnostics seen but not expected:
File clang/test/SemaCXX/type-traits.cpp Line 2676: calling a private
constructor of class 'AllPrivate'
File clang/test/SemaCXX/type-traits.cpp Line 2833: 'operator='
aaronpuchert wrote:
Maybe the test needs to be relaxed a bit because of stack layout differences in
other OS targets? Although I'm not sure why they're different. See
https://lab.llvm.org/buildbot/#/builders/186/builds/7896:
```
TEST 'AddressSanitizer-arm-android ::
TestCa
@@ -2041,15 +2042,16 @@ void BuildLockset::handleCall(const Expr *Exp, const
NamedDecl *D,
if (!a.has_value()) {
Analyzer->Handler.handleExpectFewerUnderlyingMutexes(
Exp->getExprLoc(), D->getLocation(), Scope->toString(),
- b.value
@@ -3566,6 +3565,38 @@ void releaseMemberCall() {
ReleasableMutexLock lock(&obj.mu);
releaseMember(obj, lock);
}
+#ifdef __cpp_guaranteed_copy_elision
+// expected-note@+2{{mutex acquired here}}
+// expected-note@+1{{see attribute on function here}}
+RelockableScope returnU
https://github.com/aaronpuchert edited
https://github.com/llvm/llvm-project/pull/131831
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
1 - 100 of 429 matches
Mail list logo