[project @ 1998-01-12 14:44:37 by simonm]
authorsimonm <unknown>
Mon, 12 Jan 1998 14:45:18 +0000 (14:45 +0000)
committersimonm <unknown>
Mon, 12 Jan 1998 14:45:18 +0000 (14:45 +0000)
remove more version cruft.

ghc/compiler/Makefile
ghc/compiler/basicTypes/Unique.lhs
ghc/compiler/deSugar/Desugar.lhs
ghc/compiler/main/CmdLineOpts.lhs
ghc/compiler/prelude/PrelVals.lhs
ghc/compiler/simplCore/ConFold.lhs
ghc/compiler/utils/BitSet.lhs
ghc/compiler/utils/Pretty.lhs
ghc/compiler/utils/PrimPacked.lhs
ghc/compiler/utils/StringBuffer.lhs

index 777b138..a603512 100644 (file)
@@ -1,4 +1,5 @@
 # -----------------------------------------------------------------------------
+# $Id: Makefile,v 1.33 1998/01/12 14:44:37 simonm Exp $
 
 TOP = ..
 include $(TOP)/mk/boilerplate.mk
@@ -62,10 +63,6 @@ HS_SRCS = $(SRCS_UGNHS) \
           $(foreach dir,$(DIRS),$(wildcard $(dir)/*.lhs)) \
          rename/ParseIface.hs
 
-ifneq "$(Ghc2_0)" "YES"
-HS_SRCS += main/LoopHack.hc 
-endif
-
 # NB: it's no good to include *.hs in the top-line wildcard, because the .hs files
 #     in parser/ may not have been created at that point.
 
@@ -77,12 +74,8 @@ HCS      = $(patsubst %.lhs, %.hc, $(patsubst %.hs, %.hc, $(HS_SRCS)))
 # Haskell, source stubs just re-exporting info from the various .hi-boot files.
 # (Reason: we don't want to fiddle with the imports in the sources). We give them
 # the suffix .hs, since they're special and don't fall under the umbrella of $(HS_SRCS)
-# always (only when $(Ghc2_0) is equal to YES)
-ifeq "$(Ghc2_0)" "YES"
+
 MKDEPENDHS_SRCS = $(HS_SRCS)
-else
-LOOPS   = $(patsubst %.lhi, %.hi, $(wildcard */*.lhi))
-endif
  
 HS_OBJS  = \
   $(patsubst %.hc, %.o, $(HCS)) \
@@ -133,21 +126,11 @@ SRC_HC_OPTS += \
   -I. -IcodeGen -InativeGen -Iparser \
   -i$(subst $(space),:,$(DIRS))
 
-ifeq "$(Ghc2_0)" "NO"
-SRC_HC_OPTS += -fhaskell-1.3
-endif
-
 # -syslib ghc just needed for use of PackedString.hPutPS
 
 SRC_CC_OPTS += -Iparser -I. -I$(TOP)/includes -O
 
-ifeq "$(Ghc2_0)" "NO"
-SRC_HC_OPTS += -fomit-derived-read -fomit-reexported-instances
-else
-SRC_HC_OPTS += -recomp
-endif
-
-SRC_HC_OPTS += $(GhcHcOpts)
+SRC_HC_OPTS += -recomp $(GhcHcOpts)
 
 #      Special flags for particular modules
 #      The standard suffix rule for compiling a Haskell file
@@ -187,17 +170,11 @@ reader/Lex_HC_OPTS                = -K2m -H16m -fvia-C
 # Heap was 6m with 2.10
 reader/ReadPrefix_HC_OPTS      = -fvia-C '-\#include"hspincl.h"' -H10m
 
-rename/ParseIface_HC_OPTS      += -Onot -H30m
-ifeq "$(Ghc2_0)" "YES"
-rename/ParseIface_HC_OPTS       += -fno-warn-incomplete-patterns
-endif
+rename/ParseIface_HC_OPTS      += -Onot -H30m -fno-warn-incomplete-patterns
 
 ifeq "$(TARGETPLATFORM)" "hppa1.1-hp-hpux9"
 rename/RnMonad_HC_OPTS                 = -fvia-C -O2 -O2-for-C
 else
-ifeq "$(Ghc2_0)" "NO"
-rename/RnMonad_HC_OPTS                 = -fvia-C
-endif
 endif
 rename/RnEnv_HC_OPTS           = -fvia-C
 rename/RnSource_HC_OPTS                = -H12m
@@ -218,9 +195,6 @@ typecheck/TcHsSyn_HC_OPTS   = -H15m
 typecheck/TcExpr_HC_OPTS       = -H15m
 
 typecheck/TcEnv_HC_OPTS                = -H10m
-ifeq "$(Ghc2_0)" "NO"
-typecheck/TcMonad_HC_OPTS      = -fvia-C       
-endif
 utils/Argv_HC_OPTS             = -fvia-C -monly-3-regs
 utils/SST_HC_OPTS              = -fvia-C
 utils/PrimPacked_HC_OPTS       = -fvia-C -monly-3-regs
@@ -229,12 +203,6 @@ utils/StringBuffer_HC_OPTS = -fvia-C
 utils/Digraph_HC_OPTS          = -fglasgow-exts -fvia-C
 utils/Outputable_HC_OPTS       = -monly-3-regs
 
-# optimiser misbehaving in 0.29, occurrence analyser fails to terminate when
-# compiling lib/required/Time.lhs
-ifeq "$(Ghc2_0)" "NO"
-simplCore/OccurAnal_HC_OPTS    = -Onot
-endif
-
 # Strictness analyser misbehaving in 2.10, fails to terminate on
 # UpdAnal.lhs due to weird recursive datatype.  Bug was exposed by a
 # separate bugfix to the fixpoint finder.
@@ -265,10 +233,6 @@ parser/hschooks.o : parser/hschooks.c
 # Interface-file parser uses Happy
 SRC_HAPPY_OPTS += +RTS -K2m -H10m -RTS
 
-ifeq ($(Ghc2_0),NO)
-SRC_HAPPY_OPTS+= -1.2
-endif
-
 rename/ParseIface.hs : rename/ParseIface.y
        @$(RM) rename/ParseIface.hs rename/ParseIface.hinfo
        $(HAPPY) $(HAPPY_OPTS) -g rename/ParseIface.y
@@ -284,30 +248,6 @@ hsp: parser/printtree.o parser/main.o libhsp.a
        $(CC) -o $@ $(CC_OPTS) $^
 
 CLEAN_FILES += hsp
-#-----------------------------------------------------------------------------
-#              Interface files
-
-# LoopHack.lhc is an SLPJ addition to fix a profiling problem.  See comments
-# inside it. (compilation is handled by the suffix rules).
-
-#
-# Building the loop breakers from .lhi (0.2x) or .hi-boot (2.xx) files
-#
-ifeq "$(Ghc2_0)" "NO"
-hi-boot :: $(LOOPS)
-
-%.hi : %.lhi
-       $(RM) $@
-       $(UNLIT) $<  $@ || ( $(RM) $@ && exit 1 )
-       @chmod 444 $@
-
-boot :: hi-boot
-else
-# hi-boot not needed when using 2.04+ as HC, defining it here
-# to be consistent across setting of Ghc2_0
-hi-boot :
-       @echo "Done."
-endif
 
 #-----------------------------------------------------------------------------
 #              Linking
@@ -326,15 +266,6 @@ INSTALL_LIBEXECS += hsc hsp
 #-----------------------------------------------------------------------------
 #              depend
 
-# If we're using a 1.2 compiler to compile the compiler, need the old mkdepend stuff
-#
-# ToDo: define sep MKDEPENDHS_1.2 variable so that it can be readily overridden
-# in a build.mk file.
-#
-ifeq ($(Ghc2_0),NO)
-MKDEPENDHS      = $(MKDEPENDHS_1_2)
-endif
-
 #
 # Before doing `make depend', need to build all derived Haskell source files
 #
@@ -342,11 +273,8 @@ depend :: $(LOOPS) $(SRCS_UGNHS) rename/ParseIface.hs
 
 
 ifeq "$(GhcWithHscBuiltViaC)" "YES"
-ifeq "$(Ghc2_0)" "NO"
-SRC_MKDEPENDHS_OPTS += -o hc
-else
 SRC_MKDEPENDHS_OPTS += -optdep-o -optdephc
-endif
+
 # When booting from .hc, (hackily) remove the suffix rule for 
 # .l?hs -> .o, so that the .hc -> .o is used instead.
 %.$(way_)o : %.lhs
index 4021d24..e6abf14 100644 (file)
@@ -385,25 +385,11 @@ A character-stingy way to read/write numbers (notably Uniques).
 The ``62-its'' are \tr{[0-9a-zA-Z]}.  We don't handle negative Ints.
 Code stolen from Lennart.
 \begin{code}
-#if __GLASGOW_HASKELL__ == 201
-# define BYTE_ARRAY GHCbase.ByteArray
-# define RUN_ST            GHCbase.runST
-# define AND_THEN   >>=
-# define AND_THEN_  >>
-# define RETURN            return
-#elif __GLASGOW_HASKELL__ >= 202
 # define BYTE_ARRAY GlaExts.ByteArray
 # define RUN_ST            ST.runST
 # define AND_THEN   >>=
 # define AND_THEN_  >>
 # define RETURN            return
-#else
-# define BYTE_ARRAY _ByteArray
-# define RUN_ST            _runST
-# define AND_THEN   `thenStrictlyST`
-# define AND_THEN_  `seqStrictlyST`
-# define RETURN            returnStrictlyST
-#endif
 
 iToBase62 :: Int -> SDoc
 
index 87d90b2..8bee5d6 100644 (file)
@@ -4,11 +4,7 @@
 \section[Desugar]{@deSugar@: the main function}
 
 \begin{code}
-module Desugar ( deSugar, pprDsWarnings
-#if __GLASGOW_HASKELL__ < 200
-               , DsMatchContext
-#endif
-              ) where
+module Desugar ( deSugar, pprDsWarnings ) where
 
 #include "HsVersions.h"
 
index 09de84a..6a8e9b4 100644 (file)
@@ -514,21 +514,10 @@ lAST_SIMPL_SWITCH_TAG = IBOX(tagOf_SimplSwitch SimplCaseScrutinee)
 %************************************************************************
 
 \begin{code}
-#if __GLASGOW_HASKELL__ == 201
-# define ARRAY     Array
-# define LIFT      GHCbase.Lift
-# define SET_TO            =:
-(=:) a b = (a,b)
-#elif __GLASGOW_HASKELL__ >= 202
 # define ARRAY     Array
 # define LIFT      Lift
 # define SET_TO            =:
 (=:) a b = (a,b)
-#else
-# define ARRAY     _Array
-# define LIFT      _Lift
-# define SET_TO            :=
-#endif
 
 isAmongSimpl :: [SimplifierSwitch] -> SimplifierSwitch -> SwitchResult
 
index 5520a0b..99e4c2b 100644 (file)
@@ -26,11 +26,7 @@ import Literal               ( mkMachInt )
 import Name            ( mkWiredInIdName, Module )
 import PragmaInfo
 import PrimOp          ( PrimOp(..) )
-#if __GLASGOW_HASKELL__ >= 202
 import Type            
-#else
-import Type            ( mkTyVarTy )
-#endif
 import TyVar           ( openAlphaTyVar, alphaTyVar, betaTyVar, gammaTyVar, TyVar )
 import Unique          -- lots of *Keys
 import Util            ( panic )
index aa2a490..2f06ecb 100644 (file)
@@ -192,22 +192,7 @@ completePrim env op args
 
        ---------   Floats --------------
     oneFloatLit FloatNegOp  f  = return_float (-f)
-#if __GLASGOW_HASKELL__ <= 22
-    oneFloatLit FloatExpOp  f  = return_float (exp f)
-    oneFloatLit FloatLogOp  f  = return_float (log f)
-    oneFloatLit FloatSqrtOp f  = return_float (sqrt f)
-    oneFloatLit FloatSinOp  f  = return_float (sin f)
-    oneFloatLit FloatCosOp  f  = return_float (cos f)
-    oneFloatLit FloatTanOp  f  = return_float (tan f)
-    oneFloatLit FloatAsinOp f  = return_float (asin f)
-    oneFloatLit FloatAcosOp f  = return_float (acos f)
-    oneFloatLit FloatAtanOp f  = return_float (atan f)
-    oneFloatLit FloatSinhOp f  = return_float (sinh f)
-    oneFloatLit FloatCoshOp f  = return_float (cosh f)
-    oneFloatLit FloatTanhOp f  = return_float (tanh f)
-#else
-    -- hard to do all that in Rationals ?? (WDP 94/10) ToDo
-#endif
+    -- hard to do float ops in Rationals ?? (WDP 94/10) ToDo
     oneFloatLit _          _   = give_up
 
     twoFloatLits FloatGtOp    f1 f2          = return_bool (f1 >  f2)
index bc4ea14..6c7e536 100644 (file)
@@ -23,9 +23,7 @@ module BitSet (
     ) where
 
 #ifdef __GLASGOW_HASKELL__
-#if __GLASGOW_HASKELL__ >= 202
 import GlaExts
-#endif
 -- nothing to import
 #elif defined(__YALE_HASKELL__)
 {-hide import from mkdependHS-}
index 41cdb1a..9da7804 100644 (file)
@@ -165,19 +165,10 @@ allow you to use either GHC or Hugs.  To get GHC, just set the CPP variable
 #define DIV    `quotInt#`
 
 
-#if __GLASGOW_HASKELL__ >= 202
-                       -- Haskell 1.3 stuff
 #define SHOW   Show
 #define MAXINT maxBound
 
 #else
-                       -- Haskell 1.2 stuff
-#define SHOW   Text
-#define MAXINT maxInt
-#endif
-
-
-#else
 
 -- Standard Haskell
 
index 1021645..e7abdb3 100644 (file)
@@ -127,15 +127,8 @@ copySubStrFO (ForeignObj fo) (I# start#) len@(I# length#) =
        fill_in arr_in# (idx +# 1#) }
 
 {- ToDo: add FO primitives.. -}
-#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ <=205
-indexCharOffFO# :: ForeignObj# -> Int# -> Char#
-indexCharOffFO# fo# i# = 
-  case unsafePerformIO (_casm_ ``%r=(char)*((char *)%0 + (int)%1); '' (ForeignObj fo#) (I# i#)) of
-    C# c -> c
-#else
 indexCharOffFO# :: ForeignObj# -> Int# -> Char#
 indexCharOffFO# fo i = indexCharOffForeignObj# fo i
-#endif
 
 -- step on (char *) pointer by x units.
 addrOffset# :: Addr# -> Int# -> Addr# 
index 3119a13..6fac235 100644 (file)
@@ -331,11 +331,7 @@ lexemeToString (StringBuffer fo _ start_pos# current#) =
  if start_pos# ==# current# then
     ""
  else
-#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ <= 205
-    byteArrayToString (copySubStr (A# fo) (I# start_pos#) (I# (current# -# start_pos#)))
-#else
     unpackCStringBA (copySubStr (A# fo) (I# start_pos#) (I# (current# -# start_pos#)))
-#endif
     
 lexemeToByteArray :: StringBuffer -> _ByteArray Int
 lexemeToByteArray (StringBuffer fo _ start_pos# current#) =