NB: This commit renames some files. In each of your build directories,
you will need to:
rm -f ghc/compiler/prelude/primops.txt
rm -f ghc/compiler/prelude/primops.i
rm -f ghc/lib/std/PrelGHC.hi-boot
lndir ../fptools # or wherever your CVS working directory is
The change:
Run PrelGHC.hi-boot through the preprocesor, as we already do primops.txt.
This commit introduces a new prefix, ".pp", which means "run through
preprocesor". In a previous commit, I changed ghc/compiler/Makefile
to preprocess primops.txt into primops.i. That is gone now. We now
preprocess primops.txt.pp (a file in the CVS repository) into primops.txt
(a platform-dependent file, created at build time). We also preprocess
PrelGHC.hi-boot.pp (a file in the CVS repository) into PrelGHC.hi-boot
(a platform-dependent file, created at build time).
The reason for using the preprocessor is because fewer primops are defined
if SUPPORT_LONG_LONGS is undefined. SUPPORT_LONG_LONGS is undefined on
64-bit architectures such as the Alpha.
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.180 2001/08/02 05:15:33 qrczak Exp $
+# $Id: Makefile,v 1.181 2001/08/04 06:19:54 ken Exp $
TOP = ..
include $(TOP)/mk/boilerplate.mk
TOP = ..
include $(TOP)/mk/boilerplate.mk
# Generate supporting stuff for prelude/PrimOp.lhs
# from prelude/primops.txt
# Generate supporting stuff for prelude/PrimOp.lhs
# from prelude/primops.txt
-# Run prelude/primops.txt through the preprocessor, to weed out
-# primitives that don't (need to) exist on 64-bit architectures.
-prelude/primops.i: prelude/primops.txt
- $(CPP) -I$(GHC_INCLUDE_DIR) -x c $< 2>/dev/null | $(SED) -e '/^#/d' > $@
+CLEAN_FILES += prelude/primops.txt
GENPOC=$(TOP)/utils/genprimopcode/genprimopcode
GENPOC=$(TOP)/utils/genprimopcode/genprimopcode
depend :: $(PRIMOP_BITS)
endif
depend :: $(PRIMOP_BITS)
endif
-primop-data-decl.hs-incl: prelude/primops.i
+primop-data-decl.hs-incl: prelude/primops.txt
$(GENPOC) --data-decl < $< > $@
$(GENPOC) --data-decl < $< > $@
-primop-tag.hs-incl: prelude/primops.i
+primop-tag.hs-incl: prelude/primops.txt
$(GENPOC) --primop-tag < $< > $@
$(GENPOC) --primop-tag < $< > $@
-primop-list.hs-incl: prelude/primops.i
+primop-list.hs-incl: prelude/primops.txt
$(GENPOC) --primop-list < $< > $@
$(GENPOC) --primop-list < $< > $@
-primop-has-side-effects.hs-incl: prelude/primops.i
+primop-has-side-effects.hs-incl: prelude/primops.txt
$(GENPOC) --has-side-effects < $< > $@
$(GENPOC) --has-side-effects < $< > $@
-primop-out-of-line.hs-incl: prelude/primops.i
+primop-out-of-line.hs-incl: prelude/primops.txt
$(GENPOC) --out-of-line < $< > $@
$(GENPOC) --out-of-line < $< > $@
-primop-commutable.hs-incl: prelude/primops.i
+primop-commutable.hs-incl: prelude/primops.txt
$(GENPOC) --commutable < $< > $@
$(GENPOC) --commutable < $< > $@
-primop-needs-wrapper.hs-incl: prelude/primops.i
+primop-needs-wrapper.hs-incl: prelude/primops.txt
$(GENPOC) --needs-wrapper < $< > $@
$(GENPOC) --needs-wrapper < $< > $@
-primop-can-fail.hs-incl: prelude/primops.i
+primop-can-fail.hs-incl: prelude/primops.txt
$(GENPOC) --can-fail < $< > $@
$(GENPOC) --can-fail < $< > $@
-primop-strictness.hs-incl: prelude/primops.i
+primop-strictness.hs-incl: prelude/primops.txt
$(GENPOC) --strictness < $< > $@
$(GENPOC) --strictness < $< > $@
-primop-usage.hs-incl: prelude/primops.i
+primop-usage.hs-incl: prelude/primops.txt
$(GENPOC) --usage < $< > $@
$(GENPOC) --usage < $< > $@
-primop-primop-info.hs-incl: prelude/primops.i
+primop-primop-info.hs-incl: prelude/primops.txt
$(GENPOC) --primop-primop-info < $< > $@
$(GENPOC) --primop-primop-info < $< > $@
-----------------------------------------------------------------------
-----------------------------------------------------------------------
--- $Id: primops.txt,v 1.23 2001/07/26 03:08:38 ken Exp $
+-- $Id: primops.txt.pp,v 1.1 2001/08/04 06:19:54 ken Exp $
--
-- Primitive Operations
--
--
-- Primitive Operations
--
-- To add a new primop, you currently need to update the following files:
--
-- To add a new primop, you currently need to update the following files:
--
--- - this file (ghc/compiler/prelude/primops.txt), which includes
+-- - this file (ghc/compiler/prelude/primops.txt.pp), which includes
-- the type of the primop, and various other properties (its
-- strictness attributes, whether it is defined as a macro
-- or as out-of-line code, etc.)
--
-- the type of the primop, and various other properties (its
-- strictness attributes, whether it is defined as a macro
-- or as out-of-line code, etc.)
--
--- - ghc/lib/std/PrelGHC.hi-boot, to declare the primop
+-- - ghc/lib/std/PrelGHC.hi-boot.pp, to declare the primop
--
-- - if the primop is inline (i.e. a macro), then:
-- ghc/includes/PrimOps.h
--
-- - if the primop is inline (i.e. a macro), then:
-- ghc/includes/PrimOps.h
#-----------------------------------------------------------------------------
# Rules
#-----------------------------------------------------------------------------
# Rules
-PrelPrimopWrappers.hs: ../../compiler/prelude/primops.i
+PrelPrimopWrappers.hs: ../../compiler/prelude/primops.txt
rm -f $@
../../utils/genprimopcode/genprimopcode --make-haskell-wrappers < $< > $@
rm -f $@
../../utils/genprimopcode/genprimopcode --make-haskell-wrappers < $< > $@
all :: PrelMain.dll_o
endif
all :: PrelMain.dll_o
endif
-CLEAN_FILES += PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
+CLEAN_FILES += PrelGHC.hi-boot PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
-- primitive operations and types that GHC knows about.
---------------------------------------------------------------------------
-- primitive operations and types that GHC knows about.
---------------------------------------------------------------------------
+#include "config.h"
+#include "Derived.h"
+
__interface "std" PrelGHC 1 0 where
__export PrelGHC
__interface "std" PrelGHC 1 0 where
__export PrelGHC
integer2Wordzh
int2Integerzh
word2Integerzh
integer2Wordzh
int2Integerzh
word2Integerzh
+#ifdef SUPPORT_LONG_LONGS
integerToInt64zh
integerToWord64zh
int64ToIntegerzh
word64ToIntegerzh
integerToInt64zh
integerToWord64zh
int64ToIntegerzh
word64ToIntegerzh
andIntegerzh
orIntegerzh
xorIntegerzh
andIntegerzh
orIntegerzh
xorIntegerzh
indexInt8Arrayzh
indexInt16Arrayzh
indexInt32Arrayzh
indexInt8Arrayzh
indexInt16Arrayzh
indexInt32Arrayzh
+#ifdef SUPPORT_LONG_LONGS
indexWord8Arrayzh
indexWord16Arrayzh
indexWord32Arrayzh
indexWord8Arrayzh
indexWord16Arrayzh
indexWord32Arrayzh
+#ifdef SUPPORT_LONG_LONGS
readArrayzh
readCharArrayzh
readArrayzh
readCharArrayzh
readInt8Arrayzh
readInt16Arrayzh
readInt32Arrayzh
readInt8Arrayzh
readInt16Arrayzh
readInt32Arrayzh
+#ifdef SUPPORT_LONG_LONGS
readWord8Arrayzh
readWord16Arrayzh
readWord32Arrayzh
readWord8Arrayzh
readWord16Arrayzh
readWord32Arrayzh
+#ifdef SUPPORT_LONG_LONGS
writeArrayzh
writeCharArrayzh
writeArrayzh
writeCharArrayzh
writeInt8Arrayzh
writeInt16Arrayzh
writeInt32Arrayzh
writeInt8Arrayzh
writeInt16Arrayzh
writeInt32Arrayzh
+#ifdef SUPPORT_LONG_LONGS
writeWord8Arrayzh
writeWord16Arrayzh
writeWord32Arrayzh
writeWord8Arrayzh
writeWord16Arrayzh
writeWord32Arrayzh
+#ifdef SUPPORT_LONG_LONGS
indexCharOffAddrzh
indexWideCharOffAddrzh
indexCharOffAddrzh
indexWideCharOffAddrzh
indexInt8OffAddrzh
indexInt16OffAddrzh
indexInt32OffAddrzh
indexInt8OffAddrzh
indexInt16OffAddrzh
indexInt32OffAddrzh
+#ifdef SUPPORT_LONG_LONGS
indexWord8OffAddrzh
indexWord16OffAddrzh
indexWord32OffAddrzh
indexWord8OffAddrzh
indexWord16OffAddrzh
indexWord32OffAddrzh
+#ifdef SUPPORT_LONG_LONGS
readCharOffAddrzh
readWideCharOffAddrzh
readCharOffAddrzh
readWideCharOffAddrzh
readInt8OffAddrzh
readInt16OffAddrzh
readInt32OffAddrzh
readInt8OffAddrzh
readInt16OffAddrzh
readInt32OffAddrzh
+#ifdef SUPPORT_LONG_LONGS
readWord8OffAddrzh
readWord16OffAddrzh
readWord32OffAddrzh
readWord8OffAddrzh
readWord16OffAddrzh
readWord32OffAddrzh
+#ifdef SUPPORT_LONG_LONGS
writeCharOffAddrzh
writeWideCharOffAddrzh
writeCharOffAddrzh
writeWideCharOffAddrzh
writeInt8OffAddrzh
writeInt16OffAddrzh
writeInt32OffAddrzh
writeInt8OffAddrzh
writeInt16OffAddrzh
writeInt32OffAddrzh
+#ifdef SUPPORT_LONG_LONGS
writeWord8OffAddrzh
writeWord16OffAddrzh
writeWord32OffAddrzh
writeWord8OffAddrzh
writeWord16OffAddrzh
writeWord32OffAddrzh
+#ifdef SUPPORT_LONG_LONGS
eqForeignObjzh
indexCharOffForeignObjzh
eqForeignObjzh
indexCharOffForeignObjzh
indexInt8OffForeignObjzh
indexInt16OffForeignObjzh
indexInt32OffForeignObjzh
indexInt8OffForeignObjzh
indexInt16OffForeignObjzh
indexInt32OffForeignObjzh
+#ifdef SUPPORT_LONG_LONGS
indexInt64OffForeignObjzh
indexInt64OffForeignObjzh
indexWord8OffForeignObjzh
indexWord16OffForeignObjzh
indexWord32OffForeignObjzh
indexWord8OffForeignObjzh
indexWord16OffForeignObjzh
indexWord32OffForeignObjzh
+#ifdef SUPPORT_LONG_LONGS
indexWord64OffForeignObjzh
indexWord64OffForeignObjzh
unsafeFreezzeArrayzh -- Note zz in the middle
unsafeFreezzeByteArrayzh -- Ditto
unsafeFreezzeArrayzh -- Note zz in the middle
unsafeFreezzeByteArrayzh -- Ditto
--- Export PrelErr.error, so that others don't have to import PrelErr
+-- Export PrelErr.error, so that others do not have to import PrelErr
1 assert :: __forall a => PrelBase.Bool -> a -> a ;
1 assert :: __forall a => PrelBase.Bool -> a -> a ;
--- These guys don't really exist:
+-- These guys do not really exist:
--
1 zdfCCallableCharzh :: {CCallable Charzh} ;
1 zdfCCallableDoublezh :: {CCallable Doublezh} ;
--
1 zdfCCallableCharzh :: {CCallable Charzh} ;
1 zdfCCallableDoublezh :: {CCallable Doublezh} ;
main = getArgs >>= \args ->
if length args /= 1 || head args `notElem` known_args
main = getArgs >>= \args ->
if length args /= 1 || head args `notElem` known_args
- then error ("usage: genprimopcode command < primops.i > ...\n"
+ then error ("usage: genprimopcode command < primops.txt > ...\n"
++ " where command is one of\n"
++ unlines (map (" "++) known_args)
)
++ " where command is one of\n"
++ unlines (map (" "++) known_args)
)
-- Abstract syntax -----------------------------------------------
------------------------------------------------------------------
-- Abstract syntax -----------------------------------------------
------------------------------------------------------------------
--- info for all primops; the totality of the info in primops.txt
+-- info for all primops; the totality of the info in primops.txt(.pp)
data Info
= Info [Option] [PrimOpSpec] -- defaults, primops
deriving Show
data Info
= Info [Option] [PrimOpSpec] -- defaults, primops
deriving Show
%.$(way_)o : %.$(way_)rc
@$(RM) $@
windres $< $@
%.$(way_)o : %.$(way_)rc
@$(RM) $@
windres $< $@
+
+#-----------------------------------------------------------------------------
+# Preprocessor suffix rule
+
+% : %.pp
+ rm -f $@
+ $(CPP) -I$(GHC_INCLUDE_DIR) -x c $< | $(SED) -e '/^#/d' > $@