ghc-prim: Refactor and document __sync_fetch_and_nand workaround
authorBen Gamari <bgamari.foss@gmail.com>
Mon, 23 Apr 2018 14:40:34 +0000 (10:40 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 24 Apr 2018 13:55:01 +0000 (09:55 -0400)
commite7322107d3647e5d3097eeca878e036b1c98557b
tree0e0509964ab78bcedd01ab91d486ad9082e23abb
parentf04ac4d4d0811f48c68fecacefb262039ee33239
ghc-prim: Refactor and document __sync_fetch_and_nand workaround

ed6f9fb9d5a684d2159c29633159c3254cf04deb reduced the scope of this hack
to only include Clangs which actually lack __sync_fetch_and_nand.
However, this causes GHC to fail to build with -Werror on Clang due to
the lack of the -Wsync-nand warning flag. As it turns out a flag
controlling the warning is available under a different name, however.

Test Plan: Validate with Clang, GCC

Subscribers: thomie, carter

GHC Trac Issues: #9678

Differential Revision: https://phabricator.haskell.org/D4613
libraries/ghc-prim/cbits/atomic.c