aaron.ballman added reviewers: aaronpuchert, delesley.
aaron.ballman added a comment.

In D72635#1822686 <https://reviews.llvm.org/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 should be allowed to declare our class with 
> CAPABILITY("context"), but it turns out that only "mutex" and "role" are 
> allowed.
>  I could otherwise update this CL to allow any string (single word 
> lowercase?) as CAPABILITY?


I had to hop in a time machine to figure out what we were thinking with 
restricting the names to just `role` and `mutex` and did not see any reasonable 
rationale for the restriction and I'm in favor of lifting it now. I think the 
correct way forward here is to remove the diagnostic (allowing arbitrary 
capability names), remove the `isRole()` and `isMutex()` accessors from the 
attribute definition in Attr.td (they're unused), and then update the 
documentation to make it more clear that we allow arbitrary names for 
capabilities.

Adding a few more people who use these attributes to see if there are concerns 
with this approach.


Repository:
  rC Clang

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

https://reviews.llvm.org/D72635



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to