Skip to content

Commit e2a077f

Browse files
authored
Thread Safety Analysis: Graduate ACQUIRED_BEFORE() and ACQUIRED_AFTER() from beta features (#152853)
Both these attributes were introduced in ab1dc2d ("Thread Safety Analysis: add support for before/after annotations on mutexes") back in 2015 as "beta" features. Anecdotally, we've been using `-Wthread-safety-beta` for years without problems. Furthermore, this feature requires the user to explicitly use these attributes in the first place. After 10 years, let's graduate the feature to the stable feature set, and reserve `-Wthread-safety-beta` for new upcoming features.
1 parent d6a688f commit e2a077f

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

clang/docs/ThreadSafetyAnalysis.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -825,13 +825,6 @@ doesn't know that munl.mu == mutex. The SCOPED_CAPABILITY attribute handles
825825
aliasing for MutexLocker, but does so only for that particular pattern.
826826

827827

828-
ACQUIRED_BEFORE(...) and ACQUIRED_AFTER(...) support is still experimental.
829-
---------------------------------------------------------------------------
830-
831-
ACQUIRED_BEFORE(...) and ACQUIRED_AFTER(...) are currently being developed under
832-
the ``-Wthread-safety-beta`` flag.
833-
834-
835828
.. _mutexheader:
836829

837830
mutex.h

clang/lib/Analysis/ThreadSafety.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,8 +1392,7 @@ void ThreadSafetyAnalyzer::addLock(FactSet &FSet, const FactEntry *Entry,
13921392
}
13931393

13941394
// Check before/after constraints
1395-
if (Handler.issueBetaWarnings() &&
1396-
!Entry->asserted() && !Entry->declared()) {
1395+
if (!Entry->asserted() && !Entry->declared()) {
13971396
GlobalBeforeSet->checkBeforeAfter(Entry->valueDecl(), FSet, *this,
13981397
Entry->loc(), Entry->getKind());
13991398
}

0 commit comments

Comments
 (0)