tree.h (memmodel_from_int, [...]): Move to ...
authorThomas Preud'homme <thomas.preudhomme@arm.com>
Mon, 26 Sep 2016 17:20:39 +0000 (17:20 +0000)
committerThomas Preud'homme <thopre01@gcc.gnu.org>
Mon, 26 Sep 2016 17:20:39 +0000 (17:20 +0000)
2016-09-26  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed,
    is_mm_consume, is_mm_acquire, is_mm_release, is_mm_acq_rel,
    is_mm_seq_cst, is_mm_sync): Move to ...
    * memmodel.h: This.  New file.
    * builtins.c: Include memmodel.h.
    * optabs.c: Likewise.
    * tsan.c: Likewise.
    * config/aarch64/aarch64.c: Likewise.
    * config/alpha/alpha.c: Likewise.
    * config/arm/arm.c: Likewise.
    * config/i386/i386.c: Likewise.
    * config/ia64/ia64.c: Likewise.
    * config/mips/mips.c: Likewise.
    * config/rs6000/rs6000.c: Likewise.
    * config/sparc/sparc.c: Likewise.
    * genconditions.c: Include memmodel.h in generated file.
    * genemit.c: Likewise.
    * genoutput.c: Likewise.
    * genpeep.c: Likewise.
    * genpreds.c: Likewise.
    * genrecog.c: Likewise.

    gcc/c-family/
    * c-common.c: Include memmodel.h.

From-SVN: r240504

22 files changed:
gcc/ChangeLog
gcc/builtins.c
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/config/aarch64/aarch64.c
gcc/config/alpha/alpha.c
gcc/config/arm/arm.c
gcc/config/i386/i386.c
gcc/config/ia64/ia64.c
gcc/config/mips/mips.c
gcc/config/rs6000/rs6000.c
gcc/config/sparc/sparc.c
gcc/genconditions.c
gcc/genemit.c
gcc/genoutput.c
gcc/genpeep.c
gcc/genpreds.c
gcc/genrecog.c
gcc/memmodel.h [new file with mode: 0644]
gcc/optabs.c
gcc/tree.h
gcc/tsan.c

index e88c664..a1c1620 100644 (file)
@@ -1,3 +1,27 @@
+2016-09-26  Thomas Preud'homme  <thomas.preudhomme@arm.com>
+
+       * tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed,
+       is_mm_consume, is_mm_acquire, is_mm_release, is_mm_acq_rel,
+       is_mm_seq_cst, is_mm_sync): Move to ...
+       * memmodel.h: This.  New file.
+       * builtins.c: Include memmodel.h.
+       * optabs.c: Likewise.
+       * tsan.c: Likewise.
+       * config/aarch64/aarch64.c: Likewise.
+       * config/alpha/alpha.c: Likewise.
+       * config/arm/arm.c: Likewise.
+       * config/i386/i386.c: Likewise.
+       * config/ia64/ia64.c: Likewise.
+       * config/mips/mips.c: Likewise.
+       * config/rs6000/rs6000.c: Likewise.
+       * config/sparc/sparc.c: Likewise.
+       * genconditions.c: Include memmodel.h in generated file.
+       * genemit.c: Likewise.
+       * genoutput.c: Likewise.
+       * genpeep.c: Likewise.
+       * genpreds.c: Likewise.
+       * genrecog.c: Likewise.
+
 2016-09-26  David Malcolm  <dmalcolm@redhat.com>
 
        * read-rtl.c (read_rtx_code): Rename local "i" to "idx", and use
index 93cbe15..04dcf95 100644 (file)
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "rtl.h"
 #include "tree.h"
+#include "memmodel.h"
 #include "gimple.h"
 #include "predict.h"
 #include "tm_p.h"
index 6eec895..e0b1333 100644 (file)
@@ -1,3 +1,7 @@
+2016-09-26  Thomas Preud'homme  <thomas.preudhomme@arm.com>
+
+       * c-common.c: Include memmodel.h.
+
 2016-09-26  Marek Polacek  <polacek@redhat.com>
 
        * c-lex.c (c_common_has_attribute): Handle attribute fallthrough.
index e9f619f..2652259 100644 (file)
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "function.h"
 #include "tree.h"
+#include "memmodel.h"
 #include "c-common.h"
 #include "gimple-expr.h"
 #include "tm_p.h"
index 6078b16..c65b826 100644 (file)
@@ -26,6 +26,7 @@
 #include "target.h"
 #include "rtl.h"
 #include "tree.h"
+#include "memmodel.h"
 #include "gimple.h"
 #include "cfghooks.h"
 #include "cfgloop.h"
index 6d4af04..d646879 100644 (file)
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "rtl.h"
 #include "tree.h"
+#include "memmodel.h"
 #include "gimple.h"
 #include "df.h"
 #include "tm_p.h"
index 619c329..feb54cb 100644 (file)
@@ -27,6 +27,7 @@
 #include "target.h"
 #include "rtl.h"
 #include "tree.h"
+#include "memmodel.h"
 #include "cfghooks.h"
 #include "df.h"
 #include "tm_p.h"
index 143b905..01e2ad8 100644 (file)
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "backend.h"
 #include "rtl.h"
 #include "tree.h"
+#include "memmodel.h"
 #include "gimple.h"
 #include "cfghooks.h"
 #include "cfgloop.h"
index 5f0bf43..573872e 100644 (file)
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "rtl.h"
 #include "tree.h"
+#include "memmodel.h"
 #include "cfghooks.h"
 #include "df.h"
 #include "tm_p.h"
index 88f4038..3586a10 100644 (file)
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "rtl.h"
 #include "tree.h"
+#include "memmodel.h"
 #include "gimple.h"
 #include "cfghooks.h"
 #include "df.h"
index d76f479..6897b5c 100644 (file)
@@ -24,6 +24,7 @@
 #include "backend.h"
 #include "rtl.h"
 #include "tree.h"
+#include "memmodel.h"
 #include "gimple.h"
 #include "cfghooks.h"
 #include "cfgloop.h"
index 5efed3d..5936f96 100644 (file)
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "rtl.h"
 #include "tree.h"
+#include "memmodel.h"
 #include "gimple.h"
 #include "df.h"
 #include "tm_p.h"
index e4f45b0..d8b0ebb 100644 (file)
@@ -94,6 +94,7 @@ write_header (void)
 #include \"resource.h\"\n\
 #include \"diagnostic-core.h\"\n\
 #include \"reload.h\"\n\
+#include \"memmodel.h\"\n\
 #include \"tm-constrs.h\"\n");
 
   if (saw_eh_return)
index 33040aa..d5e07a9 100644 (file)
@@ -792,6 +792,7 @@ from the machine description file `md'.  */\n\n");
   printf ("#include \"reload.h\"\n");
   printf ("#include \"diagnostic-core.h\"\n");
   printf ("#include \"regs.h\"\n");
+  printf ("#include \"memmodel.h\"\n");
   printf ("#include \"tm-constrs.h\"\n");
   printf ("#include \"ggc.h\"\n");
   printf ("#include \"dumpfile.h\"\n");
index f8c25ac..5909258 100644 (file)
@@ -231,6 +231,7 @@ output_prologue (void)
   printf ("#include \"diagnostic-core.h\"\n");
   printf ("#include \"output.h\"\n");
   printf ("#include \"target.h\"\n");
+  printf ("#include \"memmodel.h\"\n");
   printf ("#include \"tm-constrs.h\"\n");
 }
 
index 132cdce..e1997e0 100644 (file)
@@ -373,6 +373,7 @@ from the machine description file `md'.  */\n\n");
   printf ("#include \"except.h\"\n");
   printf ("#include \"diagnostic-core.h\"\n");
   printf ("#include \"flags.h\"\n");
+  printf ("#include \"memmodel.h\"\n");
   printf ("#include \"tm-constrs.h\"\n\n");
 
   printf ("extern rtx peep_operand[];\n\n");
index d18ebd2..6db1b7b 100644 (file)
@@ -1580,6 +1580,7 @@ write_insn_preds_c (void)
 #include \"reload.h\"\n\
 #include \"regs.h\"\n\
 #include \"emit-rtl.h\"\n\
+#include \"memmodel.h\"\n\
 #include \"tm-constrs.h\"\n");
 
   FOR_ALL_PREDICATES (p)
index 056798c..7786107 100644 (file)
@@ -4192,6 +4192,7 @@ write_header (void)
 #include \"diagnostic-core.h\"\n\
 #include \"reload.h\"\n\
 #include \"regs.h\"\n\
+#include \"memmodel.h\"\n\
 #include \"tm-constrs.h\"\n\
 \n");
 
diff --git a/gcc/memmodel.h b/gcc/memmodel.h
new file mode 100644 (file)
index 0000000..d53eb7b
--- /dev/null
@@ -0,0 +1,86 @@
+/* Prototypes of memory model helper functions.
+   Copyright (C) 2015-2016 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef GCC_MEMMODEL_H
+#define GCC_MEMMODEL_H
+
+/* Return the memory model from a host integer.  */
+static inline enum memmodel
+memmodel_from_int (unsigned HOST_WIDE_INT val)
+{
+  return (enum memmodel) (val & MEMMODEL_MASK);
+}
+
+/* Return the base memory model from a host integer.  */
+static inline enum memmodel
+memmodel_base (unsigned HOST_WIDE_INT val)
+{
+  return (enum memmodel) (val & MEMMODEL_BASE_MASK);
+}
+
+/* Return TRUE if the memory model is RELAXED.  */
+static inline bool
+is_mm_relaxed (enum memmodel model)
+{
+  return (model & MEMMODEL_BASE_MASK) == MEMMODEL_RELAXED;
+}
+
+/* Return TRUE if the memory model is CONSUME.  */
+static inline bool
+is_mm_consume (enum memmodel model)
+{
+  return (model & MEMMODEL_BASE_MASK) == MEMMODEL_CONSUME;
+}
+
+/* Return TRUE if the memory model is ACQUIRE.  */
+static inline bool
+is_mm_acquire (enum memmodel model)
+{
+  return (model & MEMMODEL_BASE_MASK) == MEMMODEL_ACQUIRE;
+}
+
+/* Return TRUE if the memory model is RELEASE.  */
+static inline bool
+is_mm_release (enum memmodel model)
+{
+  return (model & MEMMODEL_BASE_MASK) == MEMMODEL_RELEASE;
+}
+
+/* Return TRUE if the memory model is ACQ_REL.  */
+static inline bool
+is_mm_acq_rel (enum memmodel model)
+{
+  return (model & MEMMODEL_BASE_MASK) == MEMMODEL_ACQ_REL;
+}
+
+/* Return TRUE if the memory model is SEQ_CST.  */
+static inline bool
+is_mm_seq_cst (enum memmodel model)
+{
+  return (model & MEMMODEL_BASE_MASK) == MEMMODEL_SEQ_CST;
+}
+
+/* Return TRUE if the memory model is a SYNC variant.  */
+static inline bool
+is_mm_sync (enum memmodel model)
+{
+  return (model & MEMMODEL_SYNC);
+}
+
+#endif  /* GCC_MEMMODEL_H  */
index e41747a..c5e9b4f 100644 (file)
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "rtl.h"
 #include "tree.h"
+#include "memmodel.h"
 #include "predict.h"
 #include "tm_p.h"
 #include "expmed.h"
index 0d9ad01..563e6d9 100644 (file)
@@ -4675,69 +4675,6 @@ extern void warn_deprecated_use (tree, tree);
 extern void cache_integer_cst (tree);
 extern const char *combined_fn_name (combined_fn);
 
-/* Return the memory model from a host integer.  */
-static inline enum memmodel
-memmodel_from_int (unsigned HOST_WIDE_INT val)
-{
-  return (enum memmodel) (val & MEMMODEL_MASK);
-}
-
-/* Return the base memory model from a host integer.  */
-static inline enum memmodel
-memmodel_base (unsigned HOST_WIDE_INT val)
-{
-  return (enum memmodel) (val & MEMMODEL_BASE_MASK);
-}
-
-/* Return TRUE if the memory model is RELAXED.  */
-static inline bool
-is_mm_relaxed (enum memmodel model)
-{
-  return (model & MEMMODEL_BASE_MASK) == MEMMODEL_RELAXED;
-}
-
-/* Return TRUE if the memory model is CONSUME.  */
-static inline bool
-is_mm_consume (enum memmodel model)
-{
-  return (model & MEMMODEL_BASE_MASK) == MEMMODEL_CONSUME;
-}
-
-/* Return TRUE if the memory model is ACQUIRE.  */
-static inline bool
-is_mm_acquire (enum memmodel model)
-{
-  return (model & MEMMODEL_BASE_MASK) == MEMMODEL_ACQUIRE;
-}
-
-/* Return TRUE if the memory model is RELEASE.  */
-static inline bool
-is_mm_release (enum memmodel model)
-{
-  return (model & MEMMODEL_BASE_MASK) == MEMMODEL_RELEASE;
-}
-
-/* Return TRUE if the memory model is ACQ_REL.  */
-static inline bool
-is_mm_acq_rel (enum memmodel model)
-{
-  return (model & MEMMODEL_BASE_MASK) == MEMMODEL_ACQ_REL;
-}
-
-/* Return TRUE if the memory model is SEQ_CST.  */
-static inline bool
-is_mm_seq_cst (enum memmodel model)
-{
-  return (model & MEMMODEL_BASE_MASK) == MEMMODEL_SEQ_CST;
-}
-
-/* Return TRUE if the memory model is a SYNC variant.  */
-static inline bool
-is_mm_sync (enum memmodel model)
-{
-  return (model & MEMMODEL_SYNC);
-}
-
 /* Compare and hash for any structure which begins with a canonical
    pointer.  Assumes all pointers are interchangeable, which is sort
    of already assumed by gcc elsewhere IIRC.  */
index 91dbd41..cc19474 100644 (file)
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "backend.h"
 #include "rtl.h"
 #include "tree.h"
+#include "memmodel.h"
 #include "gimple.h"
 #include "tree-pass.h"
 #include "ssa.h"