[PATCH] D72635: Add "context" capability to Thread Safety Analysis

2020-01-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D72635#1825219 , @aaronpuchert wrote: > Hmm, I have been wondering about this as well. The way I see it, all of these > things are what we call //capabilities//, and we treat them all the same. The > names are just mean

[PATCH] D72635: Add "context" capability to Thread Safety Analysis

2020-01-16 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert added a comment. Hmm, I have been wondering about this as well. The way I see it, all of these things are what we call //capabilities//, and we treat them all the same. The names are just meant to make warning messages more readable, because what the analysis considers a capability

[PATCH] D72635: Add "context" capability to Thread Safety Analysis

2020-01-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added reviewers: aaronpuchert, delesley. aaron.ballman added a comment. In D72635#1822686 , @eti-p-doray wrote: > I added an example in the description. > > From doc https://clang.llvm.org/docs/ThreadSafetyAnalysis.html, > it sounds like we

[PATCH] D72635: Add "context" capability to Thread Safety Analysis

2020-01-15 Thread Etienne Pierre-Doray via Phabricator via cfe-commits
eti-p-doray added a comment. I added an example in the description. From doc https://clang.llvm.org/docs/ThreadSafetyAnalysis.html, it sounds like we should be allowed to declare our class with CAPABILITY("context"), but it turns out that only "mutex" and "role" are allowed. I could otherwise

[PATCH] D72635: Add "context" capability to Thread Safety Analysis

2020-01-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Can you give some examples of code where you think the diagnostics are inappropriate? One of the goals of role-based capabilities is for you to name the capabilities as you see fit, so it's possible that there is a different way for us to surface those diagnostics

[PATCH] D72635: Add "context" capability to Thread Safety Analysis

2020-01-13 Thread Etienne Pierre-Doray via Phabricator via cfe-commits
eti-p-doray created this revision. eti-p-doray added a reviewer: aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. Main use case: Chromium has runtime "SequenceChecker" and "ThreadChecker" that enforce sequenced task context. Thread safety analysis can be used