jamesr added a comment.
In http://reviews.llvm.org/D18347#380792, @EricWF wrote:
> And looking at the current state of the single-threaded test suite this isn't
> the only test that needs this fix applied.
>
> http://lab.llvm.org:8011/builders/libcxx-libcxxabi-singlethreaded-x86_64-linux-debian/
jamesr updated this revision to Diff 50793.
jamesr added a comment.
Add LLVM license headers to new test files
http://reviews.llvm.org/D14731
Files:
include/__config
include/__mutex_base
test/libcxx/test/config.py
test/libcxx/thread/thread.mutex/thread_safety_annotations_not_enabled.pas
jamesr updated this revision to Diff 50791.
jamesr added a comment.
Use // REQUIRES: thread-safety instead of macros to feature guard tests
http://reviews.llvm.org/D14731
Files:
include/__config
include/__mutex_base
test/libcxx/test/config.py
test/libcxx/thread/thread.mutex/thread_safet
jamesr added a comment.
In http://reviews.llvm.org/D14731#376138, @EricWF wrote:
> So this LGTM except for one last change (I'm sorry). LIT now knows when
> "-Werror=thread-safety" is being passed. Could you change the tests guarded
> by "#if !defined(__clang__) || !__has_attribute(aquire_capab
jamesr added a comment.
In http://reviews.llvm.org/D14731#376128, @EricWF wrote:
> So I fixed up LIT so that it also adds "-Werror=thread-safety" for both
> ".pass.cpp" and ".fail.cpp" tests. Could you apply it to your patch?
> https://gist.github.com/EricWF/8a0bfb6ff02f8c9f9940
Cool! Applied
jamesr updated this revision to Diff 50790.
http://reviews.llvm.org/D14731
Files:
include/__config
include/__mutex_base
test/libcxx/test/config.py
test/libcxx/thread/thread.mutex/thread_safety_annotations_not_enabled.pass.cpp
test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass
jamesr updated this revision to Diff 50788.
http://reviews.llvm.org/D14731
Files:
include/__config
include/__mutex_base
test/libcxx/test/format.py
test/libcxx/thread/thread.mutex/thread_safety_annotations_not_enabled.pass.cpp
test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass
jamesr marked 5 inline comments as done.
jamesr added a comment.
Thank you for the comments, new patch coming.. (is there a way to post comments
and upload a new patch at the same time?)
http://reviews.llvm.org/D14731
___
cfe-commits mailing list
c
jamesr updated this revision to Diff 50481.
jamesr added a comment.
This patch guards the new annotations with
_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS and adds a number of tests to check
that the annotations produce errors when the annotations are enabled that code
violates the thread safety r
jamesr added a comment.
In http://reviews.llvm.org/D14731#373289, @EricWF wrote:
> My suggestion would be to make these annotations OFF by default and allow
> users to turn them on with a macro.
Our comments crossed streams but suggested the same thing :). Any suggestions
on a naming convent
jamesr added a comment.
Ah, that's true. I didn't think of that case. With the design of these
annotations the author of that function would have to disable checks in each
piece of code that uses these patterns.
What about adding a different guard for these annotations in libc++ that
consume
jamesr added a comment.
Thank you for posting the LIT changes - that's the part I was unable to figure
out. I have a number of additional failure test cases that I will add.
I don't know what sort of code this could break, although I certainly don't
claim to know more about these annotations t
jamesr added a comment.
Marshall - friendly ping. If you know a way to test functionality guarded by a
compile-time flag in the libcxx test suite I'd be happy to wire in tests for
this, but if that doesn't exist (and I think it does not currently) then I
think the only way to verify this is by
jamesr added a subscriber: aaron.ballman.
jamesr added a comment.
It looks like Aaron Ballman was involved with adding parsing for these
attributes in clang - perhaps he has an idea of a better way to detect these
than __has_attribute(acquire_capability).
http://reviews.llvm.org/D14731
jamesr added a comment.
In http://reviews.llvm.org/D14731#299152, @mclow.lists wrote:
> Where are the tests?
There aren't any yet. I investigated a few avenues for testing but none seem
very useful.
The most obvious testing strategy would be to write some code that fails the
-Wthread-safety
jamesr updated this revision to Diff 41581.
jamesr added a comment.
Updates the macros to avoid defining anything if _LIBCPP_THREAD_ANNOTATION is
already defined and to define _LIBCPP_THREAD_ANNOTATION to nothing if __clang__
is not set, __has_attribute(acquire_capability) is not set, or
_LIBCP
jamesr created this revision.
jamesr added a subscriber: cfe-commits.
This adds clang thread safety annotations to std::mutex and
std::lock_guard so code using these types can use these types directly
instead of having to wrap the types to provide annotations. These checks
when enabled by -Wthread
17 matches
Mail list logo