[PATCH] D129755: Thread safety analysis: Support copy-elided production of scoped capabilities through arbitrary calls

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 21 08:20:14 PDT 2022


aaron.ballman added a comment.

In D129755#3796799 <https://reviews.llvm.org/D129755#3796799>, @aaronpuchert wrote:

> In D129755#3779997 <https://reviews.llvm.org/D129755#3779997>, @aaron.ballman wrote:
>
>> Please be sure to add a release note for the changes!
>
> Any opinion as to what the release note might say? I'm asking since we dropped the documentation changes.

No strong opinion, but `Technically this could break existing code, but the current handling seems unexpected enough to justify this change.` suggests we should be mentioning to users what we changed and what code could theoretically break.

> Perhaps I should add them back in, but without function bodies (thus eliminating the need to add `NO_THREAD_SAFETY_ANALYSIS`)? Something like this:
>
>   // Same as constructors, but without tag types. (Requires C++17 copy elision.)
>   static MutexLocker Lock(Mutex *mu) ACQUIRE(mu);
>   static MutexLocker Adopt(Mutex *mu) REQUIRES(mu);
>   static MutexLocker ReaderLock(Mutex *mu) ACQUIRE_SHARED(mu);
>   static MutexLocker AdoptReaderLock(Mutex *mu) REQUIRES_SHARED(mu);
>   static MutexLocker DeferLock(Mutex *mu) EXCLUDES(mu);
>
> Then I could write in the note that this is now possible, and annotations on move constructors are without effect.

I'd be okay with that!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129755/new/

https://reviews.llvm.org/D129755



More information about the cfe-commits mailing list