This revision was automatically updated to reflect the committed changes.
Closed by commit rL264413: Implement is_always_lock_free (authored by jfb).
Changed prior to commit:
http://reviews.llvm.org/D17951?vs=51607&id=51638#toc
Repository:
rL LLVM
http://reviews.llvm.org/D17951
Files:
lib
jfb updated this revision to Diff 51607.
jfb added a comment.
Herald added a subscriber: jfb.
- Check feature test macro exists
http://reviews.llvm.org/D17951
Files:
include/atomic
test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
Index: test/std/atomics/atomics.lockfree/isalways
EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.
LGTM.
http://reviews.llvm.org/D17951
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c
jfb added inline comments.
Comment at: include/atomic:859
@@ +858,3 @@
+#if defined(__cpp_lib_atomic_is_always_lock_free)
+ static _LIBCPP_CONSTEXPR bool is_always_lock_free =
__atomic_always_lock_free(sizeof(__a_), 0);
+#endif
EricWF wrote:
> jfb wrote:
> > I d
jfb updated this revision to Diff 51473.
jfb added a comment.
- Add definition.
http://reviews.llvm.org/D17951
Files:
include/atomic
test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
Index: test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
==
EricWF added inline comments.
Comment at: include/atomic:859
@@ +858,3 @@
+#if defined(__cpp_lib_atomic_is_always_lock_free)
+ static _LIBCPP_CONSTEXPR bool is_always_lock_free =
__atomic_always_lock_free(sizeof(__a_), 0);
+#endif
jfb wrote:
> I don't think so:
jfb added inline comments.
Comment at: include/atomic:859
@@ +858,3 @@
+#if defined(__cpp_lib_atomic_is_always_lock_free)
+ static _LIBCPP_CONSTEXPR bool is_always_lock_free =
__atomic_always_lock_free(sizeof(__a_), 0);
+#endif
I don't think so: it's similar to
jfb updated this revision to Diff 51346.
jfb added a comment.
- Define __cpp_lib_atomic_is_always_lock_free in libc++
http://reviews.llvm.org/D17951
Files:
include/atomic
test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
Index: test/std/atomics/atomics.lockfree/isalwayslockfree.p
EricWF added a comment.
Re-building clang now so I can test the most recent changes.
Comment at: include/atomic:850
@@ +849,3 @@
+#if defined(__cpp_lib_atomic_is_always_lock_free)
+ static _LIBCPP_CONSTEXPR bool is_always_lock_free =
__atomic_always_lock_free(sizeof(__a_), 0);
jfb added a comment.
As discussed in now-abandoned http://reviews.llvm.org/D17950 I'll implement
everything in libc++. I just have to move the feature test macro to libc++.
http://reviews.llvm.org/D17951
___
cfe-commits mailing list
cfe-commits@lis
bcraig added a comment.
Visual Studio has a flag, /Zc:wchar_t-, that turns wchar_t into a short. This
flag is for people that need to maintain ABI compatibility with ancient Visual
Studios (MSVC6? MSVC5?). It is definitely non-conformant, and many things
support it poorly.
I still have night
EricWF added a comment.
In http://reviews.llvm.org/D17951#376546, @bcraig wrote:
> Visual Studio has a flag, /Zc:wchar_t-, that turns wchar_t into a short.
> This flag is for people that need to maintain ABI compatibility with ancient
> Visual Studios (MSVC6? MSVC5?). It is definitely non-con
EricWF added inline comments.
Comment at: include/atomic:859
@@ +858,3 @@
+template <> _LIBCPP_CONSTEXPR bool __libcpp_always_lock_free = 2 ==
ATOMIC_CHAR32_T_LOCK_FREE;
+template <> _LIBCPP_CONSTEXPR bool __libcpp_always_lock_free = 2 ==
ATOMIC_WCHAR_T_LOCK_FREE;
+template <> _
jfb updated this revision to Diff 50903.
jfb added a comment.
- Size is based on __a_ not _Tp
- Check value is consistent with C macros
http://reviews.llvm.org/D17951
Files:
include/atomic
test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
test/std/atomics/atomics.lockfree/lockfr
EricWF added a comment.
@jfb: Actually I changed my mind about guarding the new tests. Can you move the
new tests (other than the missing additions) to a new test file? Then add `//
UNSUPPORTED: c++98, c++03, c++11, c++14` to the top of it?
http://reviews.llvm.org/D17951
___
jfb updated this revision to Diff 50846.
jfb added a comment.
- Split up tests.
http://reviews.llvm.org/D17951
Files:
include/atomic
test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
test/std/atomics/atomics.lockfree/lockfree.pass.cpp
Index: test/std/atomics/atomics.lockfree/lo
jfb added a comment.
In http://reviews.llvm.org/D17951#376546, @bcraig wrote:
> Visual Studio has a flag, /Zc:wchar_t-, that turns wchar_t into a short.
> This flag is for people that need to maintain ABI compatibility with ancient
> Visual Studios (MSVC6? MSVC5?). It is definitely non-confor
jfb added inline comments.
Comment at: include/atomic:900
@@ +899,3 @@
+# if defined(_LIBCPP_LOCK_FREE_IS_SIZE_BASED)
+ static _LIBCPP_CONSTEXPR bool is_always_lock_free =
__libcpp_always_lock_free;
+# else
Actually, this should be based on `sizeof(__a_)` and *n
jfb added inline comments.
Comment at: include/atomic:859
@@ +858,3 @@
+template <> _LIBCPP_CONSTEXPR bool __libcpp_always_lock_free = 2 ==
ATOMIC_CHAR32_T_LOCK_FREE;
+template <> _LIBCPP_CONSTEXPR bool __libcpp_always_lock_free = 2 ==
ATOMIC_WCHAR_T_LOCK_FREE;
+template <> _LIB
jfb added inline comments.
Comment at: include/atomic:859
@@ +858,3 @@
+template <> _LIBCPP_CONSTEXPR bool __libcpp_always_lock_free = 2 ==
ATOMIC_CHAR32_T_LOCK_FREE;
+template <> _LIBCPP_CONSTEXPR bool __libcpp_always_lock_free = 2 ==
ATOMIC_WCHAR_T_LOCK_FREE;
+template <> _LIB
jfb updated this revision to Diff 51049.
jfb added a comment.
- Use __atomic_always_lock_free instead
http://reviews.llvm.org/D17951
Files:
include/atomic
test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
Index: test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
bcraig added a subscriber: bcraig.
Comment at: include/atomic:859
@@ +858,3 @@
+template <> _LIBCPP_CONSTEXPR bool __libcpp_always_lock_free = 2 ==
ATOMIC_CHAR32_T_LOCK_FREE;
+template <> _LIBCPP_CONSTEXPR bool __libcpp_always_lock_free = 2 ==
ATOMIC_WCHAR_T_LOCK_FREE;
+template
EricWF added inline comments.
Comment at: include/atomic:859
@@ +858,3 @@
+template <> _LIBCPP_CONSTEXPR bool __libcpp_always_lock_free = 2 ==
ATOMIC_CHAR32_T_LOCK_FREE;
+template <> _LIBCPP_CONSTEXPR bool __libcpp_always_lock_free = 2 ==
ATOMIC_WCHAR_T_LOCK_FREE;
+template <> _
jfb added inline comments.
Comment at: include/atomic:840
@@ +839,3 @@
+#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
+#define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
+
Moving these from the bottom of the file since I need them.
jfb created this revision.
jfb added reviewers: mclow.lists, rsmith.
jfb added a subscriber: cfe-commits.
This was voted into C++17 at last week's Jacksonville meeting. The final
P0152R1 paper will be in the upcoming post-Jacksonville mailing, and is also
available here:
http://jfbastien.githu
25 matches
Mail list logo