[PATCH] Use __atomic_exchange_n with GCC instead of Clang's __sync_swap

David Majnemer david.majnemer at gmail.com
Fri Oct 3 12:37:01 PDT 2014


================
Comment at: src/cxa_default_handlers.cpp:109-110
@@ +108,4 @@
+#else
+    return __atomic_exchange_n(&__cxa_unexpected_handler, func,
+                               __ATOMIC_SEQ_CST);
+#endif
----------------
How about we just use `__atomic_exchange_n` instead of `#ifdef`ing between the two?

Also, I'm pretty sure we can just use `__ATOMIC_ACQ_REL` here.

================
Comment at: src/cxa_default_handlers.cpp:124-125
@@ +123,4 @@
+#else
+    return __atomic_exchange_n(&__cxa_terminate_handler, func,
+                               __ATOMIC_SEQ_CST);
+#endif
----------------
Ditto.

http://reviews.llvm.org/D5604






More information about the cfe-commits mailing list