[PATCH] D17950: Implement is_always_lock_free

JF Bastien via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 7 18:24:46 PST 2016


jfb added inline comments.

================
Comment at: lib/Frontend/InitPreprocessor.cpp:480
@@ +479,3 @@
+  if (LangOpts.CPlusPlus1z) {
+    Builder.defineMacro("__cpp_lib_atomic_is_always_lock_free", "201603");
+  }
----------------
How do you pick these numbers before the standard is actually out? 201603 is the Jacksonville meeting, seems fine to me :)

================
Comment at: lib/Frontend/InitPreprocessor.cpp:853
@@ -830,1 +852,3 @@
+    DEFINE_LOCK_FREE_MACRO(DOUBLE, Double);
+    DEFINE_LOCK_FREE_MACRO(LDOUBLE, LongDouble);
     Builder.defineMacro("__GCC_ATOMIC_POINTER_LOCK_FREE",
----------------
Adding these which aren't in the C standard, but which `is_always_lock_free` would use. We're proposing that floating-point atomics be added so it's not crazy:
  http://open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0020r1.html

================
Comment at: test/Lexer/cxx-features.cpp:6
@@ -5,1 +5,3 @@
+// RUN: %clang_cc1 -std=c++1z -fsized-deallocation -verify %s
+// RUN: %clang_cc1 -std=c++1z -fsized-deallocation -fconcepts-ts -DCONCEPTS_TS=1 -verify %s
 // RUN: %clang_cc1 -fcoroutines -DCOROUTINES -verify %s
----------------
This was out of date, I'm updating the test to C++1z, testing C++14, and keeping c++1y for compatibility.


http://reviews.llvm.org/D17950





More information about the cfe-commits mailing list