Commit d5de970d authored by John Ericson's avatar John Ericson Committed by Marge Bot
Browse files

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-...
parent fc350dba
Pipeline #39406 canceled with stages
in 1 second
......@@ -75,14 +75,14 @@ _darcs/
/driver/ghc/dist/
/driver/haddock/dist/
/driver/ghci/dist/
/includes/dist/
/includes/dist-*/
/libffi/dist-install/
/libraries/*/dist-boot/
/libraries/*/dist-install/
/libraries/*/dist-newstyle/
/libraries/dist-haddock/
/rts/dist/
/rts/include/dist/
/rts/include/dist-*/
/utils/*/dist*/
/compiler/stage1/
/compiler/stage2/
......@@ -104,6 +104,11 @@ _darcs/
/ch01.html
/ch02.html
/compiler/dist/
/compiler/Bytecodes.h
/compiler/ClosureTypes.h
/compiler/FunTypes.h
/compiler/MachDeps.h
/compiler/MachRegs.h
/compiler/ghc.cabal
/compiler/ghc.cabal.old
/distrib/configure.ac
......@@ -139,7 +144,6 @@ _darcs/
/settings
/ghc.spec
/ghc/ghc-bin.cabal
/includes/dist/
/index.html
/inplace/
/libffi/build/
......@@ -184,6 +188,7 @@ _darcs/
/mk/project.mk
/mk/project.mk.old
/mk/validate.mk
/rts/include/dist/
/rts/rts.cabal
/rts/package.conf.inplace
/rts/package.conf.inplace.raw
......
......@@ -13,13 +13,13 @@
[RTS-like things]
/rts/ @bgamari @simonmar @osa1 @Phyx @angerman
/rts/linker/ @angerman @Phyx @simonmar
/includes/ @bgamari @simonmar @osa1
/rts/include/ @bgamari @simonmar @osa1
[RTS heap profiling]
/docs/users_guide/profiling.rst @DanielG
/includes/rts/ProfHeap.h @DanielG
/includes/rts/TraverseHeap.h @DanielG
/includes/rts/storage/ClosureMacros.h @DanielG
/rts/include/rts/ProfHeap.h @DanielG
/rts/include/rts/TraverseHeap.h @DanielG
/rts/include/rts/storage/ClosureMacros.h @DanielG
/rts/LdvProfile* @DanielG
/rts/ProfHeap* @DanielG
/rts/Retainer* @DanielG
......
......@@ -7,7 +7,7 @@ import GHC.Utils.Panic.Plain
#endif
import GHC.Platform.Reg
#include "stg/MachRegs.h"
#include "MachRegs.h"
#if defined(MACHREGS_i386) || defined(MACHREGS_x86_64)
......
......@@ -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
......
......@@ -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.
......
......@@ -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
......
......@@ -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.
--
......
......@@ -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.
-}
......
......@@ -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:
......
......@@ -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
......
......@@ -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.
}
......
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
Supports Markdown
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