summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2019-09-13 17:55:31 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-09-17 19:24:20 -0400
commitc77fc3b20e93ba3215791d8d087a096853c4dd67 (patch)
tree20e9a500dace9446c33bc1aa125fb55ec4e3a3b1
parent1c3af277582be677a11b1f292acb8c88ca3368b1 (diff)
downloadhaskell-c77fc3b20e93ba3215791d8d087a096853c4dd67.tar.gz
Deduplicate `HaskellMachRegs.h` and `RtsMachRegs.h` headers
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.
-rw-r--r--includes/Cmm.h2
-rw-r--r--includes/Stg.h2
-rw-r--r--includes/stg/HaskellMachRegs.h66
-rw-r--r--includes/stg/MachRegsForHost.h (renamed from includes/stg/RtsMachRegs.h)6
-rw-r--r--rts/rts.cabal.in3
-rw-r--r--utils/genapply/Main.hs2
6 files changed, 7 insertions, 74 deletions
diff --git a/includes/Cmm.h b/includes/Cmm.h
index e7d4b4944f..21d5da310c 100644
--- a/includes/Cmm.h
+++ b/includes/Cmm.h
@@ -358,7 +358,7 @@
* 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"
diff --git a/includes/Stg.h b/includes/Stg.h
index f50c352a7e..7f1764a944 100644
--- a/includes/Stg.h
+++ b/includes/Stg.h
@@ -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
index 917365778b..0000000000
--- a/includes/stg/HaskellMachRegs.h
+++ /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"
diff --git a/includes/stg/RtsMachRegs.h b/includes/stg/MachRegsForHost.h
index dff389aa93..135c7974bd 100644
--- a/includes/stg/RtsMachRegs.h
+++ b/includes/stg/MachRegsForHost.h
@@ -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
diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in
index a3f74bebac..7ce3c7f5aa 100644
--- a/rts/rts.cabal.in
+++ b/rts/rts.cabal.in
@@ -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
diff --git a/utils/genapply/Main.hs b/utils/genapply/Main.hs
index 4a9d1e1526..4d25054a1c 100644
--- a/utils/genapply/Main.hs
+++ b/utils/genapply/Main.hs
@@ -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"