Deduplicate `HaskellMachRegs.h` and `RtsMachRegs.h` headers
authorJohn Ericson <John.Ericson@Obsidian.Systems>
Fri, 13 Sep 2019 21:55:31 +0000 (17:55 -0400)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Tue, 17 Sep 2019 23:24:20 +0000 (19:24 -0400)
Until 0472f0f6a92395d478e9644c0dbd12948518099f there was a meaningful
host vs target distinction (though it wasn't used right, in genapply).
After that, they did not differ in meaningful ways, so it's best to just
only keep one.

includes/Cmm.h
includes/Stg.h
includes/stg/HaskellMachRegs.h [deleted file]
includes/stg/MachRegsForHost.h [moved from includes/stg/RtsMachRegs.h with 90% similarity]
rts/rts.cabal.in
utils/genapply/Main.hs

index e7d4b49..21d5da3 100644 (file)
  * Need MachRegs, because some of the RTS code is conditionally
  * compiled based on REG_R1, REG_R2, etc.
  */
-#include "stg/RtsMachRegs.h"
+#include "stg/MachRegsForHost.h"
 
 #include "rts/prof/LDV.h"
 
index f50c352..7f1764a 100644 (file)
@@ -314,7 +314,7 @@ external prototype return neither of these types to workaround #11395.
    -------------------------------------------------------------------------- */
 
 #include "stg/DLL.h"
-#include "stg/RtsMachRegs.h"
+#include "stg/MachRegsForHost.h"
 #include "stg/Regs.h"
 #include "stg/Ticky.h"
 
diff --git a/includes/stg/HaskellMachRegs.h b/includes/stg/HaskellMachRegs.h
deleted file mode 100644 (file)
index 9173657..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -----------------------------------------------------------------------------
- *
- * (c) The GHC Team, 1998-2011
- *
- * Registers used in STG code.  Might or might not correspond to
- * actual machine registers.
- *
- * Do not #include this file directly: #include "Rts.h" instead.
- *
- * To understand the structure of the RTS headers, see the wiki:
- *   https://gitlab.haskell.org/ghc/ghc/wikis/commentary/source-tree/includes
- *
- * ---------------------------------------------------------------------------*/
-
-#pragma once
-
-/*
- * Defining NO_REGS causes no global registers to be used.  NO_REGS is
- * typically defined by GHC, via a command-line option passed to gcc,
- * when the -funregisterised flag is given.
- *
- * NB. When NO_REGS is on, calling & return conventions may be
- * different.  For example, all function arguments will be passed on
- * the stack, and components of an unboxed tuple will be returned on
- * the stack rather than in registers.
- */
-#if defined(NO_REGS)
-
-#define MACHREGS_NO_REGS 1
-
-#else
-
-#define MACHREGS_NO_REGS 0
-
-#if defined(i386_HOST_ARCH)
-#define MACHREGS_i386     1
-#endif
-
-#if defined(x86_64_HOST_ARCH)
-#define MACHREGS_x86_64   1
-#endif
-
-#if defined(powerpc_HOST_ARCH) || defined(powerpc64_HOST_ARCH) \
-            || defined(powerpc64le_HOST_ARCH) || defined(rs6000_HOST_ARCH)
-#define MACHREGS_powerpc  1
-#endif
-
-#if defined(sparc_HOST_ARCH)
-#define MACHREGS_sparc    1
-#endif
-
-#if defined(arm_HOST_ARCH)
-#define MACHREGS_arm      1
-#endif
-
-#if defined(aarch64_HOST_ARCH)
-#define MACHREGS_aarch64  1
-#endif
-
-#if defined(darwin_HOST_OS)
-#define MACHREGS_darwin   1
-#endif
-
-#endif
-
-#include "MachRegs.h"
similarity index 90%
rename from includes/stg/RtsMachRegs.h
rename to includes/stg/MachRegsForHost.h
index dff389a..135c797 100644 (file)
@@ -2,10 +2,10 @@
  *
  * (c) The GHC Team, 1998-2011
  *
- * Registers used in STG code.  Might or might not correspond to
- * actual machine registers.
+ * This header includes MachRegs.h "selecting" regs for the current host
+ * platform.
  *
- * Do not #include this file directly: #include "Rts.h" instead.
+ * Don't #include this in the RTS directly, instead include "RTS.h".
  *
  * To understand the structure of the RTS headers, see the wiki:
  *   https://gitlab.haskell.org/ghc/ghc/wikis/commentary/source-tree/includes
index a3f74be..7ce3c7f 100644 (file)
@@ -168,12 +168,11 @@ library
                       rts/storage/MBlock.h
                       rts/storage/TSO.h
                       stg/DLL.h
-                      stg/HaskellMachRegs.h
                       stg/MachRegs.h
+                      stg/MachRegsForHost.h
                       stg/MiscClosures.h
                       stg/Prim.h
                       stg/Regs.h
-                      stg/RtsMachRegs.h
                       stg/SMP.h
                       stg/Ticky.h
                       stg/Types.h
index 4a9d1e1..4d25054 100644 (file)
@@ -16,7 +16,7 @@ module Main(main) where
 #include "../../includes/ghcconfig.h"
 
 -- .. so that this header defines the right stuff.
-#include "../../includes/stg/HaskellMachRegs.h"
+#include "../../includes/stg/MachRegsForHost.h"
 
 #include "../../includes/rts/Constants.h"