Commit ee8118ca authored by John Ericson's avatar John Ericson
Browse files

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.
parent 8039b625
Pipeline #10951 passed with stages
in 421 minutes and 14 seconds
......@@ -62,8 +62,6 @@ module GHC.StgToCmm.Closure (
staticClosureNeedsLink,
) where
#include "../includes/MachDeps.h"
#include "HsVersions.h"
import GhcPrelude
......
......@@ -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); \
......
#include <assert.h>
#include "Rts.h"
#include <Rts.h>
#include "Unique.h"
static HsInt GenSymCounter = 0;
......
......@@ -10,7 +10,6 @@ module ByteCodeInstr (
) where
#include "HsVersions.h"
#include "../includes/MachDeps.h"
import GhcPrelude
......
#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())
......
......@@ -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)
......
......@@ -33,6 +33,7 @@ module DriverPipeline (
linkingNeeded, checkLinkInfo, writeInterfaceOnlyMode
) where
#include <ghcplatform.h>
#include "HsVersions.h"
import GhcPrelude
......
......@@ -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',
......
......@@ -21,7 +21,6 @@ module PPC.CodeGen (
where
#include "HsVersions.h"
#include "../includes/MachDeps.h"
-- NCG stuff:
import GhcPrelude
......
......@@ -18,7 +18,6 @@ module SPARC.CodeGen (
where
#include "HsVersions.h"
#include "../includes/MachDeps.h"
-- NCG stuff:
import GhcPrelude
......
......@@ -30,7 +30,6 @@ module X86.CodeGen (
where
#include "HsVersions.h"
#include "../includes/MachDeps.h"
-- NCG stuff:
import GhcPrelude
......
......@@ -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 */
......
......@@ -4,7 +4,7 @@
*
* -------------------------------------------------------------------------- */
#include "HsFFI.h"
#include <HsFFI.h>
void enableTimingStats( void );
void setHeapSize( HsInt size );
......@@ -24,7 +24,6 @@ module PrelRules
where
#include "HsVersions.h"
#include "../includes/MachDeps.h"
import GhcPrelude
......
......@@ -127,7 +127,6 @@ module TysWiredIn (
) where
#include "HsVersions.h"
#include "MachDeps.h"
import GhcPrelude
......
......@@ -64,9 +64,6 @@ module Binary
#include "HsVersions.h"
-- The *host* architecture version:
#include "../includes/MachDeps.h"
import GhcPrelude
import {-# SOURCE #-} Name (Name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment