Commit e76fa699 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Merge the remainder of HaskellConstants into Constants

parent 998a6337
......@@ -474,16 +474,12 @@ $(compiler_stage1_depfile_haskell) : $(COMPILER_INCLUDES_DEPS)
$(compiler_stage2_depfile_haskell) : $(COMPILER_INCLUDES_DEPS)
$(compiler_stage3_depfile_haskell) : $(COMPILER_INCLUDES_DEPS)
# Every Constants.o object file depends on includes/GHCConstants.h:
$(eval $(call compiler-hs-dependency,Constants,$(includes_GHCCONSTANTS) includes/HaskellConstants.hs))
# Every PrimOp.o object file depends on $(PRIMOP_BITS):
$(eval $(call compiler-hs-dependency,PrimOp,$(PRIMOP_BITS)))
# GHC itself doesn't know about the above dependencies, so we have to
# switch off the recompilation checker for those modules:
# switch off the recompilation checker for that module:
compiler/prelude/PrimOp_HC_OPTS += -fforce-recomp
compiler/main/Constants_HC_OPTS += -fforce-recomp
# LibFFI.hs #includes ffi.h
compiler/stage2/build/LibFFI.hs : $(libffi_HEADERS)
......
......@@ -4,21 +4,26 @@
\section[Constants]{Info about this compilation}
\begin{code}
{-# OPTIONS -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
module Constants (module Constants) where
import Config
#include "ghc_boot_platform.h"
#include "../includes/HaskellConstants.hs"
hiVersion :: Integer
hiVersion = read (cProjectVersionInt ++ cProjectPatchLevel) :: Integer
-- All pretty arbitrary:
mAX_TUPLE_SIZE :: Int
mAX_TUPLE_SIZE = 62 -- Should really match the number
-- of decls in Data.Tuple
mAX_CONTEXT_REDUCTION_DEPTH :: Int
mAX_CONTEXT_REDUCTION_DEPTH = 200
-- Increase to 200; see Trac #5395
wORD64_SIZE :: Int
wORD64_SIZE = 8
tARGET_MAX_CHAR :: Int
tARGET_MAX_CHAR = 0x10ffff
\end{code}
import Data.Int
-- This magical #include brings in all the everybody-knows-these magic
-- constants unfortunately, we need to be *explicit* about which one
-- we want; if we just hope a -I... will get the right one, we could
-- be in trouble.
{-
Pull in the autoconf defines (HAVE_FOO), but don't include
ghcconfig.h, because that will include ghcplatform.h which has the
wrong platform settings for the compiler (it has the platform
settings for the target plat instead).
-}
#include "../includes/ghcautoconf.h"
#include "stg/HaskellMachRegs.h"
#include "rts/Constants.h"
#include "MachDeps.h"
#include "../includes/dist-derivedconstants/header/DerivedConstants.h"
-- import Util
-- All pretty arbitrary:
mAX_TUPLE_SIZE :: Int
mAX_TUPLE_SIZE = 62 -- Should really match the number
-- of decls in Data.Tuple
mAX_CONTEXT_REDUCTION_DEPTH :: Int
mAX_CONTEXT_REDUCTION_DEPTH = 200
-- Increase to 200; see Trac #5395
wORD64_SIZE :: Int
wORD64_SIZE = 8
tARGET_MAX_CHAR :: Int
tARGET_MAX_CHAR = 0x10ffff
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