diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2021-07-22 07:26:47 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-08-09 15:11:58 -0400 |
commit | d5de970dafd5876ef30601697576167f56b9c132 (patch) | |
tree | cb2ccf4bc4c13e39e211beb60915d7bb4ccc477d /compiler/GHC | |
parent | fc350dba63da7eefbaa2793fe9fe99f8571b75c0 (diff) | |
download | haskell-d5de970dafd5876ef30601697576167f56b9c132.tar.gz |
Move `/includes` to `/rts/include`, sort per package better
In order to make the packages in this repo "reinstallable", we need to
associate source code with a specific packages. Having a top level
`/includes` dir that mixes concerns (which packages' includes?) gets in
the way of this.
To start, I have moved everything to `rts/`, which is mostly correct.
There are a few things however that really don't belong in the rts (like
the generated constants haskell type, `CodeGen.Platform.h`). Those
needed to be manually adjusted.
Things of note:
- No symlinking for sake of windows, so we hard-link at configure time.
- `CodeGen.Platform.h` no longer as `.hs` extension (in addition to
being moved to `compiler/`) so as not to confuse anyone, since it is
next to Haskell files.
- Blanket `-Iincludes` is gone in both build systems, include paths now
more strictly respect per-package dependencies.
- `deriveConstants` has been taught to not require a `--target-os` flag
when generating the platform-agnostic Haskell type. Make takes
advantage of this, but Hadrian has yet to.
Diffstat (limited to 'compiler/GHC')
-rw-r--r-- | compiler/GHC/ByteCode/Asm.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Cmm/CLabel.hs | 6 | ||||
-rw-r--r-- | compiler/GHC/Cmm/Info.hs | 6 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/Regs.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/X86/Ppr.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToC.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Platform.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Platform/AArch64.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Platform/ARM.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Platform/NoRegs.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Platform/PPC.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Platform/RISCV64.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Platform/S390X.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Platform/SPARC.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Platform/X86.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Platform/X86_64.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Runtime/Heap/Layout.hs | 6 | ||||
-rw-r--r-- | compiler/GHC/StgToCmm/ArgRep.hs | 6 | ||||
-rw-r--r-- | compiler/GHC/StgToCmm/Layout.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/StgToCmm/Ticky.hs | 8 | ||||
-rw-r--r-- | compiler/GHC/StgToCmm/Utils.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/SysTools/BaseDir.hs | 4 |
23 files changed, 36 insertions, 36 deletions
diff --git a/compiler/GHC/ByteCode/Asm.hs b/compiler/GHC/ByteCode/Asm.hs index 6ef6ef474c..da03d2a903 100644 --- a/compiler/GHC/ByteCode/Asm.hs +++ b/compiler/GHC/ByteCode/Asm.hs @@ -340,7 +340,7 @@ inspectAsm platform long_jumps initial_offset -- count (LargeOp _) = largeArg16s platform -- Bring in all the bci_ bytecode constants. -#include "rts/Bytecodes.h" +#include "Bytecodes.h" largeArgInstr :: Word16 -> Word16 largeArgInstr bci = bci_FLAG_LARGE_ARGS .|. bci diff --git a/compiler/GHC/Cmm/CLabel.hs b/compiler/GHC/Cmm/CLabel.hs index b6ad2b3431..723970e520 100644 --- a/compiler/GHC/Cmm/CLabel.hs +++ b/compiler/GHC/Cmm/CLabel.hs @@ -307,7 +307,7 @@ isTickyLabel _ = False -- label (e.g. "extern StgWordArray(foo)"). The type is fixed to StgWordArray. -- -- Symbols from the RTS don't need "extern" declarations because they are --- exposed via "includes/Stg.h" with the appropriate type. See 'needsCDecl'. +-- exposed via "rts/include/Stg.h" with the appropriate type. See 'needsCDecl'. -- -- The fixed StgWordArray type led to "conflicting types" issues with user -- provided Cmm files (not in the RTS) that declare data of another type (#15467 @@ -659,7 +659,7 @@ mkCmmDataLabel pkg ext str = CmmLabel pkg ext str CmmData mkRtsCmmDataLabel str = CmmLabel rtsUnitId (NeedExternDecl False) str CmmData -- RTS symbols don't need "GHC.CmmToC" to -- generate \"extern\" declaration (they are - -- exposed via includes/Stg.h) + -- exposed via rts/include/Stg.h) mkLocalBlockLabel :: Unique -> CLabel mkLocalBlockLabel u = LocalBlockLabel u @@ -935,7 +935,7 @@ needsCDecl (CmmLabel pkgId (NeedExternDecl external) _ _) | not external = False -- Prototypes for labels defined in the runtime system are imported - -- into HC files via includes/Stg.h. + -- into HC files via rts/include/Stg.h. | pkgId == rtsUnitId = False -- For other labels we inline one into the HC file directly. diff --git a/compiler/GHC/Cmm/Info.hs b/compiler/GHC/Cmm/Info.hs index 1c6dc351b8..d0397c8172 100644 --- a/compiler/GHC/Cmm/Info.hs +++ b/compiler/GHC/Cmm/Info.hs @@ -98,7 +98,7 @@ cmmToRawCmm logger profile cmms -- <normal forward rest of StgInfoTable> -- <forward variable part> -- --- See includes/rts/storage/InfoTables.h +-- See rts/include/rts/storage/InfoTables.h -- -- For return-points these are as follows -- @@ -371,7 +371,7 @@ mkLivenessBits platform liveness lits = mkWordCLit platform (fromIntegral n_bits) : map (mkStgWordCLit platform) bitmap -- The first word is the size. The structure must match - -- StgLargeBitmap in includes/rts/storage/InfoTable.h + -- StgLargeBitmap in rts/include/rts/storage/InfoTable.h ------------------------------------------------------------------------- -- @@ -381,7 +381,7 @@ mkLivenessBits platform liveness -- The standard bits of an info table. This part of the info table -- corresponds to the StgInfoTable type defined in --- includes/rts/storage/InfoTables.h. +-- rts/include/rts/storage/InfoTables.h. -- -- Its shape varies with ticky/profiling/tables next to code etc -- so we can't use constant offsets from Constants diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs b/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs index 83f581cac4..cd4208bc89 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs @@ -40,7 +40,7 @@ import GHC.Utils.Panic -- TODO: Is that still true? Could we use allocatableRegsInClass -- without losing performance now? -- --- Look at includes/stg/MachRegs.h to get the numbers. +-- Look at rts/include/stg/MachRegs.h to get the numbers. -- diff --git a/compiler/GHC/CmmToAsm/SPARC/Regs.hs b/compiler/GHC/CmmToAsm/SPARC/Regs.hs index 949701cf2d..0325814c6b 100644 --- a/compiler/GHC/CmmToAsm/SPARC/Regs.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Regs.hs @@ -50,7 +50,7 @@ import GHC.Utils.Panic prepared for any eventuality. The whole fp-register pairing thing on sparcs is a huge nuisance. See - includes/stg/MachRegs.h for a description of what's going on + rts/include/stg/MachRegs.h for a description of what's going on here. -} diff --git a/compiler/GHC/CmmToAsm/X86/Ppr.hs b/compiler/GHC/CmmToAsm/X86/Ppr.hs index 5f030b8d58..e284e618da 100644 --- a/compiler/GHC/CmmToAsm/X86/Ppr.hs +++ b/compiler/GHC/CmmToAsm/X86/Ppr.hs @@ -555,7 +555,7 @@ pprDataItem config lit -- to 32-bit offset fields and modify the RTS -- appropriately -- - -- See Note [x86-64-relative] in includes/rts/storage/InfoTables.h + -- See Note [x86-64-relative] in rts/include/rts/storage/InfoTables.h -- case lit of -- A relative relocation: diff --git a/compiler/GHC/CmmToC.hs b/compiler/GHC/CmmToC.hs index b49fccbd95..3008f01c5c 100644 --- a/compiler/GHC/CmmToC.hs +++ b/compiler/GHC/CmmToC.hs @@ -905,7 +905,7 @@ mkJMP_ i = text "JMP_" <> parens i mkFN_ i = text "FN_" <> parens i -- externally visible function mkIF_ i = text "IF_" <> parens i -- locally visible --- from includes/Stg.h +-- from rts/include/Stg.h -- mkC_,mkW_,mkP_ :: SDoc diff --git a/compiler/GHC/Platform.hs b/compiler/GHC/Platform.hs index 70c8f9b658..b3f5bf830c 100644 --- a/compiler/GHC/Platform.hs +++ b/compiler/GHC/Platform.hs @@ -73,7 +73,7 @@ data Platform = Platform , platformTablesNextToCode :: !Bool -- ^ Determines whether we will be compiling info tables that reside just -- before the entry code, or with an indirection to the entry code. See - -- TABLES_NEXT_TO_CODE in includes/rts/storage/InfoTables.h. + -- TABLES_NEXT_TO_CODE in rts/include/rts/storage/InfoTables.h. , platform_constants :: !(Maybe PlatformConstants) -- ^ Constants such as structure offsets, type sizes, etc. } diff --git a/compiler/GHC/Platform/AArch64.hs b/compiler/GHC/Platform/AArch64.hs index 4e6a6bc230..5d8e044969 100644 --- a/compiler/GHC/Platform/AArch64.hs +++ b/compiler/GHC/Platform/AArch64.hs @@ -6,4 +6,4 @@ import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_aarch64 1 -#include "../../../includes/CodeGen.Platform.hs" +#include "CodeGen.Platform.h" diff --git a/compiler/GHC/Platform/ARM.hs b/compiler/GHC/Platform/ARM.hs index d1e2d9d312..df2210033a 100644 --- a/compiler/GHC/Platform/ARM.hs +++ b/compiler/GHC/Platform/ARM.hs @@ -6,5 +6,5 @@ import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_arm 1 -#include "../../../includes/CodeGen.Platform.hs" +#include "CodeGen.Platform.h" diff --git a/compiler/GHC/Platform/NoRegs.hs b/compiler/GHC/Platform/NoRegs.hs index c00f4cb7ff..27c1ec5b02 100644 --- a/compiler/GHC/Platform/NoRegs.hs +++ b/compiler/GHC/Platform/NoRegs.hs @@ -5,5 +5,5 @@ module GHC.Platform.NoRegs where import GHC.Prelude #define MACHREGS_NO_REGS 1 -#include "../../../includes/CodeGen.Platform.hs" +#include "CodeGen.Platform.h" diff --git a/compiler/GHC/Platform/PPC.hs b/compiler/GHC/Platform/PPC.hs index 5b4f3bfb14..86da0e4b05 100644 --- a/compiler/GHC/Platform/PPC.hs +++ b/compiler/GHC/Platform/PPC.hs @@ -6,5 +6,5 @@ import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_powerpc 1 -#include "../../../includes/CodeGen.Platform.hs" +#include "CodeGen.Platform.h" diff --git a/compiler/GHC/Platform/RISCV64.hs b/compiler/GHC/Platform/RISCV64.hs index 88754d4838..899776921f 100644 --- a/compiler/GHC/Platform/RISCV64.hs +++ b/compiler/GHC/Platform/RISCV64.hs @@ -6,5 +6,5 @@ import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_riscv64 1 -#include "../../../includes/CodeGen.Platform.hs" +#include "CodeGen.Platform.h" diff --git a/compiler/GHC/Platform/S390X.hs b/compiler/GHC/Platform/S390X.hs index 709d2db101..660844216e 100644 --- a/compiler/GHC/Platform/S390X.hs +++ b/compiler/GHC/Platform/S390X.hs @@ -6,5 +6,5 @@ import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_s390x 1 -#include "../../../includes/CodeGen.Platform.hs" +#include "CodeGen.Platform.h" diff --git a/compiler/GHC/Platform/SPARC.hs b/compiler/GHC/Platform/SPARC.hs index b1dad08837..d0ab5fe41a 100644 --- a/compiler/GHC/Platform/SPARC.hs +++ b/compiler/GHC/Platform/SPARC.hs @@ -6,5 +6,5 @@ import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_sparc 1 -#include "../../../includes/CodeGen.Platform.hs" +#include "CodeGen.Platform.h" diff --git a/compiler/GHC/Platform/X86.hs b/compiler/GHC/Platform/X86.hs index e065036f61..24b4ca8ab6 100644 --- a/compiler/GHC/Platform/X86.hs +++ b/compiler/GHC/Platform/X86.hs @@ -6,5 +6,5 @@ import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_i386 1 -#include "../../../includes/CodeGen.Platform.hs" +#include "CodeGen.Platform.h" diff --git a/compiler/GHC/Platform/X86_64.hs b/compiler/GHC/Platform/X86_64.hs index 27c4232975..5911bd37e7 100644 --- a/compiler/GHC/Platform/X86_64.hs +++ b/compiler/GHC/Platform/X86_64.hs @@ -6,5 +6,5 @@ import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_x86_64 1 -#include "../../../includes/CodeGen.Platform.hs" +#include "CodeGen.Platform.h" diff --git a/compiler/GHC/Runtime/Heap/Layout.hs b/compiler/GHC/Runtime/Heap/Layout.hs index 51f209f6b6..1195f83937 100644 --- a/compiler/GHC/Runtime/Heap/Layout.hs +++ b/compiler/GHC/Runtime/Heap/Layout.hs @@ -181,7 +181,7 @@ data SMRep type IsStatic = Bool -- From an SMRep you can get to the closure type defined in --- includes/rts/storage/ClosureTypes.h. Described by the function +-- rts/include/rts/storage/ClosureTypes.h. Described by the function -- rtsClosureType below. data ClosureTypeInfo @@ -404,8 +404,8 @@ cardTableSizeW platform elems = ----------------------------------------------------------------------------- -- deriving the RTS closure type from an SMRep -#include "../includes/rts/storage/ClosureTypes.h" -#include "../includes/rts/storage/FunTypes.h" +#include "ClosureTypes.h" +#include "FunTypes.h" -- Defines CONSTR, CONSTR_1_0 etc -- | Derives the RTS closure type from an 'SMRep' diff --git a/compiler/GHC/StgToCmm/ArgRep.hs b/compiler/GHC/StgToCmm/ArgRep.hs index 2ec0e177e8..cc618a16ed 100644 --- a/compiler/GHC/StgToCmm/ArgRep.hs +++ b/compiler/GHC/StgToCmm/ArgRep.hs @@ -120,11 +120,11 @@ idArgRep platform = toArgRep platform . idPrimRep -- * GHC.StgToCmm.Layout.stdPattern maybe to some degree? -- -- * the RTS_RET(stg_ap_*) and RTS_FUN_DECL(stg_ap_*_fast) --- declarations in includes/stg/MiscClosures.h +-- declarations in rts/include/stg/MiscClosures.h -- --- * the SLOW_CALL_*_ctr declarations in includes/stg/Ticky.h, +-- * the SLOW_CALL_*_ctr declarations in rts/include/stg/Ticky.h, -- --- * the TICK_SLOW_CALL_*() #defines in includes/Cmm.h, +-- * the TICK_SLOW_CALL_*() #defines in rts/include/Cmm.h, -- -- * the PR_CTR(SLOW_CALL_*_ctr) calls in rts/Ticky.c, -- diff --git a/compiler/GHC/StgToCmm/Layout.hs b/compiler/GHC/StgToCmm/Layout.hs index eeae70f747..0a74291ebd 100644 --- a/compiler/GHC/StgToCmm/Layout.hs +++ b/compiler/GHC/StgToCmm/Layout.hs @@ -541,7 +541,7 @@ mkVirtConstrSizes profile field_reps ------------------------------------------------------------------------- -- bring in ARG_P, ARG_N, etc. -#include "../includes/rts/storage/FunTypes.h" +#include "FunTypes.h" mkArgDescr :: Platform -> [Id] -> ArgDescr mkArgDescr platform args diff --git a/compiler/GHC/StgToCmm/Ticky.hs b/compiler/GHC/StgToCmm/Ticky.hs index 76748f2b0d..1317dcbe17 100644 --- a/compiler/GHC/StgToCmm/Ticky.hs +++ b/compiler/GHC/StgToCmm/Ticky.hs @@ -29,12 +29,12 @@ Some of the relevant source files: * GHC.Cmm.Parser expands some macros using generators defined in this module - * includes/stg/Ticky.h declares all of the global counters + * rts/include/stg/Ticky.h declares all of the global counters - * includes/rts/Ticky.h declares the C data type for an + * rts/include/rts/Ticky.h declares the C data type for an STG-declaration's counters - * some macros defined in includes/Cmm.h (and used within the RTS's + * some macros defined in rts/include/Cmm.h (and used within the RTS's CMM code) update the global ticky counters * at the end of execution rts/Ticky.c generates the final report @@ -247,7 +247,7 @@ emitTickyCounter cloType name args ; fun_descr_lit <- newStringCLit $ renderWithContext ctx ppr_for_ticky_name ; arg_descr_lit <- newStringCLit $ map (showTypeCategory . idType . fromNonVoid) args ; emitDataLits ctr_lbl - -- Must match layout of includes/rts/Ticky.h's StgEntCounter + -- Must match layout of rts/include/rts/Ticky.h's StgEntCounter -- -- krc: note that all the fields are I32 now; some were I16 -- before, but the code generator wasn't handling that diff --git a/compiler/GHC/StgToCmm/Utils.hs b/compiler/GHC/StgToCmm/Utils.hs index a1b13e2e8d..4913bbd3ce 100644 --- a/compiler/GHC/StgToCmm/Utils.hs +++ b/compiler/GHC/StgToCmm/Utils.hs @@ -198,7 +198,7 @@ emitRtsCallGen res lbl args safe -- Here we generate the sequence of saves/restores required around a -- foreign call instruction. --- TODO: reconcile with includes/Regs.h +-- TODO: reconcile with rts/include/Regs.h -- * Regs.h claims that BaseReg should be saved last and loaded first -- * This might not have been tickled before since BaseReg is callee save -- * Regs.h saves SparkHd, ParkT1, SparkBase and SparkLim @@ -206,7 +206,7 @@ emitRtsCallGen res lbl args safe -- This code isn't actually used right now, because callerSaves -- only ever returns true in the current universe for registers NOT in -- system_regs (just do a grep for CALLER_SAVES in --- includes/stg/MachRegs.h). It's all one giant no-op, and for +-- rts/include/stg/MachRegs.h). It's all one giant no-op, and for -- good reason: having to save system registers on every foreign call -- would be very expensive, so we avoid assigning them to those -- registers when we add support for an architecture. diff --git a/compiler/GHC/SysTools/BaseDir.hs b/compiler/GHC/SysTools/BaseDir.hs index ad16fac025..03169523c6 100644 --- a/compiler/GHC/SysTools/BaseDir.hs +++ b/compiler/GHC/SysTools/BaseDir.hs @@ -100,7 +100,7 @@ make) set in `aclocal.m4`. This allows the rest of the build system to have access to these and other values determined by configure. - Based on this file, `includes/ghc.mk` when ran will produce the settings file + Based on this file, `rts/include/ghc.mk` when ran will produce the settings file by echoing the values into a the final file. Coincidentally this is also where `ghcplatform.h` and `ghcversion.h` generated which contains information about the build platform and sets CPP for use by the entire build. @@ -118,7 +118,7 @@ hadrian) The last part of this is the `generateSettings` in `src/Rules/Generate.hs` which produces the desired settings file out of Hadrian. This is the - equivalent to `includes/ghc.mk`. + equivalent to `rts/include/ghc.mk`. -- |