[m-rev.] diff: support hlc.par.gc with clang

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Aug 26 16:17:33 AEST 2011


In principle, this should also work on Mac OS X.

--------

Branches: main, 11.07

Make hlc.par.gc bootstrap with clang on Linux.

runtime/mercury_atomic_ops.h:
 	Use the GCC definitions of MR_COMPARE_AND_SWAP_WORD_BODY and
 	MR_CPU_SFENCE with clang.

Julien.

Index: runtime/mercury_atomic_ops.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_atomic_ops.h,v
retrieving revision 1.18
diff -u -r1.18 mercury_atomic_ops.h
--- runtime/mercury_atomic_ops.h	1 Aug 2011 07:06:20 -0000	1.18
+++ runtime/mercury_atomic_ops.h	26 Aug 2011 05:34:20 -0000
@@ -148,7 +148,7 @@
  /*---------------------------------------------------------------------------*/
  /*---------------------------------------------------------------------------*/

-#if (MR_GNUC > 4 || (MR_GNUC == 4 && __GNUC_MINOR__ >= 1)) && \
+#if (defined(MR_CLANG) || (MR_GNUC > 4 || (MR_GNUC == 4 && __GNUC_MINOR__ >= 1))) && \
      !defined(MR_AVOID_COMPILER_INTRINSICS)

      /*
@@ -569,7 +569,8 @@
  /*
  ** Memory fence operations.
  */
-#if defined(MR_GNUC) && ( defined(__i386__) || defined(__x86_64__) ) && \
+#if ( defined(MR_CLANG) || defined(MR_GNUC) ) &&    \
+    ( defined(__i386__) || defined(__x86_64__) ) && \
      !defined(MR_AVOID_HANDWRITTEN_ASSEMBLER)

      /*

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list