summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-09-10 00:15:48 -0400
committerJohn Ericson <git@JohnEricson.me>2019-10-05 00:11:58 -0400
commitee8118caf12526456c619e17cbc0f729c6cd2391 (patch)
tree01c437c7e588987f35494e24c98aaa9260251f03
parent8039b6257ce5288e9e38c2593ff2d5d6d316efd4 (diff)
downloadhaskell-ee8118caf12526456c619e17cbc0f729c6cd2391.tar.gz
Clean up `#include`s in the compiler
- Remove unneeded ones - Use <..> for inter-package. Besides general clean up, helps distinguish between the RTS we link against vs the RTS we compile for.
-rw-r--r--compiler/GHC/StgToCmm/Closure.hs2
-rw-r--r--compiler/HsVersions.h5
-rw-r--r--compiler/cbits/genSym.c2
-rw-r--r--compiler/ghci/ByteCodeInstr.hs1
-rw-r--r--compiler/ghci/keepCAFsForGHCi.c2
-rw-r--r--compiler/main/CodeOutput.hs6
-rw-r--r--compiler/main/DriverPipeline.hs1
-rw-r--r--compiler/main/SysTools/ExtraObj.hs4
-rw-r--r--compiler/nativeGen/PPC/CodeGen.hs1
-rw-r--r--compiler/nativeGen/SPARC/CodeGen.hs1
-rw-r--r--compiler/nativeGen/X86/CodeGen.hs1
-rw-r--r--compiler/parser/cutils.c4
-rw-r--r--compiler/parser/cutils.h2
-rw-r--r--compiler/prelude/PrelRules.hs1
-rw-r--r--compiler/prelude/TysWiredIn.hs1
-rw-r--r--compiler/utils/Binary.hs3
16 files changed, 11 insertions, 26 deletions
diff --git a/compiler/GHC/StgToCmm/Closure.hs b/compiler/GHC/StgToCmm/Closure.hs
index b56b06f399..8552bfa905 100644
--- a/compiler/GHC/StgToCmm/Closure.hs
+++ b/compiler/GHC/StgToCmm/Closure.hs
@@ -62,8 +62,6 @@ module GHC.StgToCmm.Closure (
staticClosureNeedsLink,
) where
-#include "../includes/MachDeps.h"
-
#include "HsVersions.h"
import GhcPrelude
diff --git a/compiler/HsVersions.h b/compiler/HsVersions.h
index daeec9dd3d..d488a0f0c5 100644
--- a/compiler/HsVersions.h
+++ b/compiler/HsVersions.h
@@ -9,11 +9,6 @@ you will screw up the layout where they are used in case expressions!
#endif
-/* Pull in the autoconf defines (HAVE_FOO), and all the platform defines
- * for this build (foo_HOST_ARCH etc.)
- */
-#include "ghcconfig.h"
-
#define GLOBAL_VAR(name,value,ty) \
{-# NOINLINE name #-}; \
name :: IORef (ty); \
diff --git a/compiler/cbits/genSym.c b/compiler/cbits/genSym.c
index 6943ab15d6..769c09358c 100644
--- a/compiler/cbits/genSym.c
+++ b/compiler/cbits/genSym.c
@@ -1,5 +1,5 @@
#include <assert.h>
-#include "Rts.h"
+#include <Rts.h>
#include "Unique.h"
static HsInt GenSymCounter = 0;
diff --git a/compiler/ghci/ByteCodeInstr.hs b/compiler/ghci/ByteCodeInstr.hs
index 4347aa3867..c386ece52a 100644
--- a/compiler/ghci/ByteCodeInstr.hs
+++ b/compiler/ghci/ByteCodeInstr.hs
@@ -10,7 +10,6 @@ module ByteCodeInstr (
) where
#include "HsVersions.h"
-#include "../includes/MachDeps.h"
import GhcPrelude
diff --git a/compiler/ghci/keepCAFsForGHCi.c b/compiler/ghci/keepCAFsForGHCi.c
index 234823351e..ba635b0d95 100644
--- a/compiler/ghci/keepCAFsForGHCi.c
+++ b/compiler/ghci/keepCAFsForGHCi.c
@@ -1,4 +1,4 @@
-#include "Rts.h"
+#include <Rts.h>
// This file is only included in the dynamic library.
// It contains an __attribute__((constructor)) function (run prior to main())
diff --git a/compiler/main/CodeOutput.hs b/compiler/main/CodeOutput.hs
index 4109e50c02..96a754d6f0 100644
--- a/compiler/main/CodeOutput.hs
+++ b/compiler/main/CodeOutput.hs
@@ -224,12 +224,12 @@ outputForeignStubs dflags mod location stubs
-- wrapper code mentions the ffi_arg type, which comes from ffi.h
ffi_includes
- | platformMisc_libFFI $ platformMisc dflags = "#include \"ffi.h\"\n"
+ | platformMisc_libFFI $ platformMisc dflags = "#include <ffi.h>\n"
| otherwise = ""
stub_h_file_exists
<- outputForeignStubs_help stub_h stub_h_output_w
- ("#include \"HsFFI.h\"\n" ++ cplusplus_hdr) cplusplus_ftr
+ ("#include <HsFFI.h>\n" ++ cplusplus_hdr) cplusplus_ftr
dumpIfSet_dyn dflags Opt_D_dump_foreign
"Foreign export stubs" stub_c_output_d
@@ -237,7 +237,7 @@ outputForeignStubs dflags mod location stubs
stub_c_file_exists
<- outputForeignStubs_help stub_c stub_c_output_w
("#define IN_STG_CODE 0\n" ++
- "#include \"Rts.h\"\n" ++
+ "#include <Rts.h>\n" ++
rts_includes ++
ffi_includes ++
cplusplus_hdr)
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 38403940bd..87128c2b6e 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -33,6 +33,7 @@ module DriverPipeline (
linkingNeeded, checkLinkInfo, writeInterfaceOnlyMode
) where
+#include <ghcplatform.h>
#include "HsVersions.h"
import GhcPrelude
diff --git a/compiler/main/SysTools/ExtraObj.hs b/compiler/main/SysTools/ExtraObj.hs
index c930389c95..13236933e6 100644
--- a/compiler/main/SysTools/ExtraObj.hs
+++ b/compiler/main/SysTools/ExtraObj.hs
@@ -93,7 +93,7 @@ mkExtraObjToLinkIntoBinary dflags = do
_ -> exeMain
exeMain = vcat [
- text "#include \"Rts.h\"",
+ text "#include <Rts.h>",
text "extern StgClosure ZCMain_main_closure;",
text "int main(int argc, char *argv[])",
char '{',
@@ -119,7 +119,7 @@ mkExtraObjToLinkIntoBinary dflags = do
]
dllMain = vcat [
- text "#include \"Rts.h\"",
+ text "#include <Rts.h>",
text "#include <windows.h>",
text "#include <stdbool.h>",
char '\n',
diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs
index ad8c18b4f2..5f852973ae 100644
--- a/compiler/nativeGen/PPC/CodeGen.hs
+++ b/compiler/nativeGen/PPC/CodeGen.hs
@@ -21,7 +21,6 @@ module PPC.CodeGen (
where
#include "HsVersions.h"
-#include "../includes/MachDeps.h"
-- NCG stuff:
import GhcPrelude
diff --git a/compiler/nativeGen/SPARC/CodeGen.hs b/compiler/nativeGen/SPARC/CodeGen.hs
index 7c862ff69c..e24180e535 100644
--- a/compiler/nativeGen/SPARC/CodeGen.hs
+++ b/compiler/nativeGen/SPARC/CodeGen.hs
@@ -18,7 +18,6 @@ module SPARC.CodeGen (
where
#include "HsVersions.h"
-#include "../includes/MachDeps.h"
-- NCG stuff:
import GhcPrelude
diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs
index 864013efb4..670950d754 100644
--- a/compiler/nativeGen/X86/CodeGen.hs
+++ b/compiler/nativeGen/X86/CodeGen.hs
@@ -30,7 +30,6 @@ module X86.CodeGen (
where
#include "HsVersions.h"
-#include "../includes/MachDeps.h"
-- NCG stuff:
import GhcPrelude
diff --git a/compiler/parser/cutils.c b/compiler/parser/cutils.c
index a1461763c0..fb7e3f7335 100644
--- a/compiler/parser/cutils.c
+++ b/compiler/parser/cutils.c
@@ -3,9 +3,9 @@ These utility routines are used various
places in the GHC library.
*/
-#include "Rts.h"
+#include <Rts.h>
-#include "HsFFI.h"
+#include <HsFFI.h>
void
enableTimingStats( void ) /* called from the driver */
diff --git a/compiler/parser/cutils.h b/compiler/parser/cutils.h
index 009fffa86f..1d9104910d 100644
--- a/compiler/parser/cutils.h
+++ b/compiler/parser/cutils.h
@@ -4,7 +4,7 @@
*
* -------------------------------------------------------------------------- */
-#include "HsFFI.h"
+#include <HsFFI.h>
void enableTimingStats( void );
void setHeapSize( HsInt size );
diff --git a/compiler/prelude/PrelRules.hs b/compiler/prelude/PrelRules.hs
index d44c940d35..ffee79da36 100644
--- a/compiler/prelude/PrelRules.hs
+++ b/compiler/prelude/PrelRules.hs
@@ -24,7 +24,6 @@ module PrelRules
where
#include "HsVersions.h"
-#include "../includes/MachDeps.h"
import GhcPrelude
diff --git a/compiler/prelude/TysWiredIn.hs b/compiler/prelude/TysWiredIn.hs
index 0798f05195..be2c7eb735 100644
--- a/compiler/prelude/TysWiredIn.hs
+++ b/compiler/prelude/TysWiredIn.hs
@@ -127,7 +127,6 @@ module TysWiredIn (
) where
#include "HsVersions.h"
-#include "MachDeps.h"
import GhcPrelude
diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs
index 164549fe58..503dd31690 100644
--- a/compiler/utils/Binary.hs
+++ b/compiler/utils/Binary.hs
@@ -64,9 +64,6 @@ module Binary
#include "HsVersions.h"
--- The *host* architecture version:
-#include "../includes/MachDeps.h"
-
import GhcPrelude
import {-# SOURCE #-} Name (Name)