[commit: ghc] wip/angerman/reinstallable-lib-ghc: Move primops into ghc-prim (e6c0ef5)

git at git.haskell.org git at git.haskell.org
Tue Mar 5 21:44:24 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/angerman/reinstallable-lib-ghc
Link       : http://ghc.haskell.org/trac/ghc/changeset/e6c0ef53bdaa79a6faf7dfe4ca645804befc51b8/ghc

>---------------------------------------------------------------

commit e6c0ef53bdaa79a6faf7dfe4ca645804befc51b8
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date:   Tue Mar 5 18:26:02 2019 +0800

    Move primops into ghc-prim


>---------------------------------------------------------------

e6c0ef53bdaa79a6faf7dfe4ca645804befc51b8
 compiler/ghc.mk                   | 79 ---------------------------------------
 libraries/ghc-prim/ghc-prim.cabal | 17 +++++++++
 2 files changed, 17 insertions(+), 79 deletions(-)

diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index 6cfa43a..2c3c3ea 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -234,85 +234,6 @@ compiler/stage2/$(PLATFORM_H) : mk/config.mk mk/project.mk | $$(dir $$@)/.
 compiler/stage3/$(PLATFORM_H) : compiler/stage2/$(PLATFORM_H)
 	"$(CP)" $< $@
 
-# ----------------------------------------------------------------------------
-#		Generate supporting stuff for prelude/PrimOp.hs
-#		from prelude/primops.txt
-
-PRIMOP_BITS_NAMES = primop-data-decl.hs-incl        \
-                    primop-tag.hs-incl              \
-                    primop-list.hs-incl             \
-                    primop-has-side-effects.hs-incl \
-                    primop-out-of-line.hs-incl      \
-                    primop-commutable.hs-incl       \
-                    primop-code-size.hs-incl        \
-                    primop-can-fail.hs-incl         \
-                    primop-strictness.hs-incl       \
-                    primop-fixity.hs-incl           \
-                    primop-primop-info.hs-incl      \
-                    primop-vector-uniques.hs-incl   \
-                    primop-vector-tys.hs-incl       \
-                    primop-vector-tys-exports.hs-incl \
-                    primop-vector-tycons.hs-incl
-
-PRIMOP_BITS_STAGE1 = $(addprefix compiler/stage1/build/,$(PRIMOP_BITS_NAMES))
-PRIMOP_BITS_STAGE2 = $(addprefix compiler/stage2/build/,$(PRIMOP_BITS_NAMES))
-PRIMOP_BITS_STAGE3 = $(addprefix compiler/stage3/build/,$(PRIMOP_BITS_NAMES))
-
-compiler_CPP_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
-compiler_CPP_OPTS += ${GhcCppOpts}
-
-# We add these paths to the Haskell compiler's #include search path list since
-# we must avoid #including files by paths relative to the source file as Hadrian
-# moves the build artifacts out of the source tree. See #8040.
-compiler_HC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
-
-define preprocessCompilerFiles
-# $0 = stage
-compiler/stage$1/build/primops.txt: compiler/prelude/primops.txt.pp compiler/stage$1/$$(PLATFORM_H)
-	$$(HS_CPP) -P $$(compiler_CPP_OPTS) -Icompiler/stage$1 -x c $$< | grep -v '^#pragma GCC' > $$@
-
-compiler/stage$1/build/primop-data-decl.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --data-decl          < $$< > $$@
-compiler/stage$1/build/primop-tag.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --primop-tag         < $$< > $$@
-compiler/stage$1/build/primop-list.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --primop-list        < $$< > $$@
-compiler/stage$1/build/primop-has-side-effects.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --has-side-effects   < $$< > $$@
-compiler/stage$1/build/primop-out-of-line.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --out-of-line        < $$< > $$@
-compiler/stage$1/build/primop-commutable.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --commutable         < $$< > $$@
-compiler/stage$1/build/primop-code-size.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --code-size          < $$< > $$@
-compiler/stage$1/build/primop-can-fail.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --can-fail           < $$< > $$@
-compiler/stage$1/build/primop-strictness.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --strictness         < $$< > $$@
-compiler/stage$1/build/primop-fixity.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --fixity             < $$< > $$@
-compiler/stage$1/build/primop-primop-info.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --primop-primop-info < $$< > $$@
-compiler/stage$1/build/primop-vector-uniques.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --primop-vector-uniques     < $$< > $$@
-compiler/stage$1/build/primop-vector-tys.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --primop-vector-tys         < $$< > $$@
-compiler/stage$1/build/primop-vector-tys-exports.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --primop-vector-tys-exports < $$< > $$@
-compiler/stage$1/build/primop-vector-tycons.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --primop-vector-tycons      < $$< > $$@
-
-# Usages aren't used any more; but the generator
-# can still generate them if we want them back
-compiler/stage$1/build/primop-usage.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
-	"$$(genprimopcode_INPLACE)" --usage              < $$< > $$@
-
-endef
-
-$(eval $(call preprocessCompilerFiles,1))
-$(eval $(call preprocessCompilerFiles,2))
-$(eval $(call preprocessCompilerFiles,3))
-
 # -----------------------------------------------------------------------------
 # Configuration
 
diff --git a/libraries/ghc-prim/ghc-prim.cabal b/libraries/ghc-prim/ghc-prim.cabal
index a95f1ec..3bc849b 100644
--- a/libraries/ghc-prim/ghc-prim.cabal
+++ b/libraries/ghc-prim/ghc-prim.cabal
@@ -81,3 +81,20 @@ Library
     -- We need to set the unit ID to ghc-prim (without a version number)
     -- as it's magic.
     ghc-options: -this-unit-id ghc-prim
+
+    install-includes:
+        primop-data-decl.hs-incl
+        primop-tag.hs-incl
+        primop-list.hs-incl
+        primop-has-side-effects.hs-incl
+        primop-out-of-line.hs-incl
+        primop-commutable.hs-incl
+        primop-code-size.hs-incl
+        primop-can-fail.hs-incl
+        primop-strictness.hs-incl
+        primop-fixity.hs-incl
+        primop-primop-info.hs-incl
+        primop-vector-uniques.hs-incl
+        primop-vector-tys.hs-incl
+        primop-vector-tys-exports.hs-incl
+        primop-vector-tycons.hs-incl
\ No newline at end of file



More information about the ghc-commits mailing list