1. 14 Dec, 2000 1 commit
  2. 11 Dec, 2000 1 commit
  3. 08 Dec, 2000 1 commit
  4. 06 Dec, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-12-06 13:03:28 by simonmar] · d3645411
      simonmar authored
      Re-engineer the transition from Core to STG syntax.  Main changes in
      this commit:
      
        - a new pass, CoreSat, handles saturation of constructors and PrimOps,
          and puts the syntax into STG-like normal form (applications to atoms
          only, etc), modulo type applications and Notes.
      
        - CoreToStg is now done at the same time as StgVarInfo.  Most of the
          contents of StgVarInfo.lhs have been copied into CoreToStg.lhs and
          some simplifications made.
      
      less major changes:
      
        - globalisation of names for the purposes of object splitting is
          now done by the C code generator (which is the Right Place in
          principle, but it was a bit fiddly).
      
        - CoreTidy now does cloning of local binders and collection of arity
          info.  The IdInfo from CoreTidy is now *almost* the final IdInfo we
          put in the interface file, except for CafInfo.  I'm going to move
          the CafInfo collection into CoreTidy in due course too.
      
        - and some other minor tidyups while I was in cluster-bomb commit mode.
      d3645411
  5. 21 Nov, 2000 2 commits
    • simonmar's avatar
      [project @ 2000-11-21 16:42:58 by simonmar] · bd8f046e
      simonmar authored
      Bugfixes, bugfixes:
      
        - allow compiling expressions in the context of any module we have
          an interface for, including "Prelude".
        - don't forget to pull in things like unpackCString# in the renamer,
          we might need to use them for desugaring Strings, for example.  I'm
          sure there are other things we'll need to pull in too.
        - :quit now works from the interpreter (!)
      bd8f046e
    • simonmar's avatar
      [project @ 2000-11-21 14:31:58 by simonmar] · e663f7b8
      simonmar authored
      Mostly verbosity changes.
      
      GONE AWAY:  -dshow-passes, -ddump-all, -ddump-most.
      
      NEW:
          -v<n>, where <n> is
      
          0	|   print errors & warnings only
          1   |   minimal verbosity: print "compiling M ... done." for each module.
          2   |   equivalent to -dshow-passes
          3   |   equivalent to existing "ghc -v"
          4   |   "ghc -v -ddump-most"
          5   |   "ghc -v -ddump-all"
      
      4 & 5 are the same at the moment.  -dshow-passes also prints out the
      passes in the driver, and some in the compilation manager.
      e663f7b8
  6. 19 Nov, 2000 1 commit
  7. 14 Nov, 2000 1 commit
  8. 13 Nov, 2000 1 commit
  9. 07 Nov, 2000 2 commits
  10. 31 Oct, 2000 2 commits
  11. 27 Oct, 2000 1 commit
  12. 26 Oct, 2000 2 commits
  13. 25 Oct, 2000 1 commit
  14. 24 Oct, 2000 3 commits
  15. 18 Oct, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-10-18 09:40:17 by simonmar] · a3113e20
      simonmar authored
      - Dynamicise another couple of options (-fgenerics & -freport-compile)
        The rest look awkward to move into DynFlags.
      
      - Move opt_UseVanillaRegs & friends to CgRetConv, since they aren't
        real options.
      a3113e20
  16. 17 Oct, 2000 1 commit
  17. 12 Oct, 2000 2 commits
    • simonmar's avatar
      [project @ 2000-10-12 14:41:15 by simonmar] · 69b29b57
      simonmar authored
      Remove wired-in names.  Partially propogated.
      69b29b57
    • simonmar's avatar
      [project @ 2000-10-12 13:11:45 by simonmar] · 30d55993
      simonmar authored
      Move FAST_INT and FAST_BOOL into their own module FastTypes, replacing
      the macro definitions in HsVersions.h with real definitions.  Change
      most of the names in the process.
      
      Now we don't get bogus imports of GlaExts all over the place, and
      -fwarn-unused-imports is less noisy.
      30d55993
  18. 11 Oct, 2000 2 commits
  19. 10 Oct, 2000 3 commits
    • simonmar's avatar
      [project @ 2000-10-10 16:31:26 by simonmar] · b3ee0636
      simonmar authored
      driver<->hsc deforestation continues; classifyOpts isn't needed any more
      b3ee0636
    • simonmar's avatar
      [project @ 2000-10-10 15:42:32 by simonmar] · 4d9a3241
      simonmar authored
      Define HscLang, the output format of hsc.
      
      Remove opt_OutputLanguage, opt_OutputFile, and a few other flags which
      we're going to do through DynFlags or directly as arguments to hscLang now.
      4d9a3241
    • simonmar's avatar
      [project @ 2000-10-10 13:20:38 by simonmar] · 35fb1e38
      simonmar authored
      Main is now HscMain: this will transform eventually into the
      compiler's entry point.
      
      CmdLineOpts now separates flags into static flags and dynamic flags;
      dynamic flags will be passed around explicitly and can therefore
      change from compilation to compilation.  All the dump flags and a few
      language flags (like -fglasgow-exts) are currently DynFlags.
      
      NOTE: nothing will now compile, for a long while until we get all this
      connected up.  This commit is so that we start pulling in the same
      direction.
      35fb1e38
  20. 05 Oct, 2000 1 commit
  21. 03 Oct, 2000 1 commit
    • simonpj's avatar
      [project @ 2000-10-03 08:43:00 by simonpj] · 710e2074
      simonpj authored
      --------------------------------------
      	Adding generics		SLPJ Oct 2000
      	--------------------------------------
      
      This big commit adds Hinze/PJ-style generic class definitions, based
      on work by Andrei Serjantov.  For example:
      
        class Bin a where
          toBin   :: a -> [Int]
          fromBin :: [Int] -> (a, [Int])
      
          toBin {| Unit |}    Unit	  = []
          toBin {| a :+: b |} (Inl x)   = 0 : toBin x
          toBin {| a :+: b |} (Inr y)   = 1 : toBin y
          toBin {| a :*: b |} (x :*: y) = toBin x ++ toBin y
      
      
          fromBin {| Unit |}    bs      = (Unit, bs)
          fromBin {| a :+: b |} (0:bs)  = (Inl x, bs')    where (x,bs') = fromBin bs
          fromBin {| a :+: b |} (1:bs)  = (Inr y, bs')    where (y,bs') = fromBin bs
          fromBin {| a :*: b |} bs  	  = (x :*: y, bs'') where (x,bs' ) = fromBin bs
      							  (y,bs'') = fromBin bs'
      
      Now we can say simply
      
        instance Bin a => Bin [a]
      
      and the compiler will derive the appropriate code automatically.
      
      		(About 9k lines of diffs.  Ha!)
      
      
      Generic related things
      ~~~~~~~~~~~~~~~~~~~~~~
      
      * basicTypes/BasicTypes: The EP type (embedding-projection pairs)
      
      * types/TyCon:
      	An extra field in an algebraic tycon (genInfo)
      
      * types/Class, and hsSyn/HsBinds:
      	Each class op (or ClassOpSig) carries information about whether
      	it  	a) has no default method
      		b) has a polymorphic default method
      		c) has a generic default method
      	There's a new data type for this: Class.DefMeth
      
      * types/Generics:
      	A new module containing good chunk of the generic-related code
      	It has a .hi-boot file (alas).
      
      * typecheck/TcInstDcls, typecheck/TcClassDcl:
      	Most of the rest of the generics-related code
      
      * hsSyn/HsTypes:
      	New infix type form to allow types of the form
      		data a :+: b = Inl a | Inr b
      
      * parser/Parser.y, Lex.lhs, rename/ParseIface.y:
      	Deal with the new syntax
      
      * prelude/TysPrim, TysWiredIn:
      	Need to generate generic stuff for the wired-in TyCons
      
      * rename/RnSource RnBinds:
      	A rather gruesome hack to deal with scoping of type variables
      	from a generic patterns.  Details commented in the ClassDecl
      	case of RnSource.rnDecl.
      
      	Of course, there are many minor renamer consequences of the
      	other changes above.
      
      * lib/std/PrelBase.lhs
      	Data type declarations for Unit, :+:, :*:
      
      
      Slightly unrelated housekeeping
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      * hsSyn/HsDecls:
      	ClassDecls now carry the Names for their implied declarations
      	(superclass selectors, tycon, etc) in a list, rather than
      	laid out one by one.  This simplifies code between the parser
      	and the type checker.
      
      * prelude/PrelNames, TysWiredIn:
      	All the RdrNames are now together in PrelNames.
      
      * utils/ListSetOps:
      	Add finite mappings based on equality and association lists (Assoc a b)
      	Move stuff from List.lhs that is related
      710e2074
  22. 14 Sep, 2000 1 commit
    • simonpj's avatar
      [project @ 2000-09-14 13:46:39 by simonpj] · cae34044
      simonpj authored
      ---------------------------------------
      	Simon's tuning changes: early Sept 2000
      	---------------------------------------
      
      Library changes
      ~~~~~~~~~~~~~~~
      * Eta expand PrelShow.showLitChar.  It's impossible to compile this well,
        and it makes a big difference to some programs (e.g. gen_regexps)
      
      * Make PrelList.concat into a good producer (in the foldr/build sense)
      
      
      Flag changes
      ~~~~~~~~~~~~
      * Add -ddump-hi-diffs to print out changes in interface files.  Useful
        when watching what the compiler is doing
      
      * Add -funfolding-update-in-place to enable the experimental optimisation
        that makes the inliner a bit keener to inline if it's in the RHS of
        a thunk that might be updated in place.  Sometimes this is a bad idea
        (one example is in spectral/sphere; see notes in nofib/Simon-nofib-notes)
      
      
      Tuning things
      ~~~~~~~~~~~~~
      * Fix a bug in SetLevels.lvlMFE.  (change ctxt_lvl to dest_level)
        I don't think this has any performance effect, but it saves making
        a redundant let-binding that is later eliminated.
      
      * Desugar.dsProgram and DsForeign
        Glom together all the bindings into a single Rec.  Previously the
        bindings generated by 'foreign' declarations were not glommed together, but
        this led to an infelicity (i.e. poorer code than necessary) in the modules
        that actually declare Float and Double (explained a bit more in Desugar.dsProgram)
      
      * OccurAnal.shortMeOut and IdInfo.shortableIdInfo
        Don't do the occurrence analyser's shorting out stuff for things which
        have rules.  Comments near IdInfo.shortableIdInfo.
        This is deeply boring, and mainly to do with making rules work well.
        Maybe rules should have phases attached too....
      
      * CprAnalyse.addIdCprInfo
        Be a bit more willing to add CPR information to thunks;
        in particular, if the strictness analyser has just discovered that this
        is a strict let, then the let-to-case transform will happen, and CPR is fine.
        This made a big difference to PrelBase.modInt, which had something like
      	modInt = \ x -> let r = ... -> I# v in
      			...body strict in r...
        r's RHS isn't a value yet; but modInt returns r in various branches, so
        if r doesn't have the CPR property then neither does modInt
      
      * MkId.mkDataConWrapId
        Arrange that vanilla constructors, like (:) and I#, get unfoldings that are
        just a simple variable $w:, $wI#.  This ensures they'll be inlined even into
        rules etc, which makes matching a bit more reliable.  The downside is that in
        situations like (map (:) xs), we'll end up with (map (\y ys. $w: y ys) xs.
        Which is tiresome but it doesn't happen much.
      
      * SaAbsInt.findStrictness
        Deal with the case where a thing with no arguments is bottom.  This is Good.
        E.g.   module M where { foo = error "help" }
        Suppose we have in another module
      	case M.foo of ...
        Then we'd like to do the case-of-error transform, without inlining foo.
      
      
      Tidying up things
      ~~~~~~~~~~~~~~~~~
      * Reorganised Simplify.completeBinding (again).
      
      * Removed the is_bot field in CoreUnfolding (is_cheap is true if is_bot is!)
        This is just a tidy up
      
      * HsDecls and others
        Remove the NewCon constructor from ConDecl.  It just added code, and nothing else.
        And it led to a bug in MkIface, which though that a newtype decl was always changing!
      
      * IdInfo and many others
        Remove all vestiges of UpdateInfo (hasn't been used for years)
      cae34044
  23. 07 Sep, 2000 1 commit
    • simonpj's avatar
      [project @ 2000-09-07 16:31:45 by simonpj] · e9f0fa88
      simonpj authored
      * The simplifier used to glom together all the top-level bindings into
        a single Rec every time it was invoked.  The reason for this is explained
        in SimplCore.lhs, but for at least one simple program it meant that the
        simplifier never got around to unravelling the recursive group into
        non-recursive pieces.  So I've put the glomming under explicit flag
        control with a -fglom-binds simplifier pass.   A side benefit is
        that because it happens less often, the (expensive) SCC algorithm
        runs less often.
      e9f0fa88
  24. 23 Jul, 2000 1 commit
    • panne's avatar
      [project @ 2000-07-23 10:53:11 by panne] · c8a6996a
      panne authored
      Strictfp-like behaviour is the default now, which can be switched off
      via -fexcess-precision. (Has anybody a better name for this option?)
      c8a6996a
  25. 16 Jul, 2000 1 commit
  26. 29 Jun, 2000 1 commit
  27. 25 May, 2000 1 commit
    • simonpj's avatar
      [project @ 2000-05-25 12:41:14 by simonpj] · 495ef8bd
      simonpj authored
      ~~~~~~~~~~~~
      		Apr/May 2000
      		~~~~~~~~~~~~
      
      This is a pretty big commit!  It adds stuff I've been working on
      over the last month or so.  DO NOT MERGE IT WITH 4.07!
      
      Interface file formats have changed a little; you'll need
      to make clean before remaking.
      
      						Simon PJ
      
      Recompilation checking
      ~~~~~~~~~~~~~~~~~~~~~~
      Substantial improvement in recompilation checking.  The version management
      is now entirely internal to GHC.  ghc-iface.lprl is dead!
      
      The trick is to generate the new interface file in two steps:
        - first convert Types etc to HsTypes etc, and thereby
      	build a new ParsedIface
        - then compare against the parsed (but not renamed) version of the old
      	interface file
      Doing this meant adding code to convert *to* HsSyn things, and to
      compare HsSyn things for equality.  That is the main tedious bit.
      
      Another improvement is that we now track version info for
      fixities and rules, which was missing before.
      
      
      Interface file reading
      ~~~~~~~~~~~~~~~~~~~~~~
      Make interface files reading more robust.
        * If the old interface file is unreadable, don't fail. [bug fix]
      
        * If the old interface file mentions interfaces
          that are unreadable, don't fail. [bug fix]
      
        * When we can't find the interface file,
          print the directories we are looking in.  [feature]
      
      
      Type signatures
      ~~~~~~~~~~~~~~~
        * New flag -ddump-types to print type signatures
      
      
      Type pruning
      ~~~~~~~~~~~~
      When importing
      	data T = T1 A | T2 B | T3 C
      it seems excessive to import the types A, B, C as well, unless
      the constructors T1, T2 etc are used.  A,B,C might be more types,
      and importing them may mean reading more interfaces, and so on.
       So the idea is that the renamer will just import the decl
      	data T
      unless one of the constructors is used.  This turns out to be quite
      easy to implement.  The downside is that we must make sure the
      constructors are always available if they are really needed, so
      I regard this as an experimental feature.
      
      
      Elimininate ThinAir names
      ~~~~~~~~~~~~~~~~~~~~~~~~~
      Eliminate ThinAir.lhs and all its works.  It was always a hack, and now
      the desugarer carries around an environment I think we can nuke ThinAir
      altogether.
      
      As part of this, I had to move all the Prelude RdrName defns from PrelInfo
      to PrelMods --- so I renamed PrelMods as PrelNames.
      
      I also had to move the builtinRules so that they are injected by the renamer
      (rather than appearing out of the blue in SimplCore).  This is if anything simpler.
      
      Miscellaneous
      ~~~~~~~~~~~~~
      * Tidy up the data types involved in Rules
      
      * Eliminate RnEnv.better_provenance; use Name.hasBetterProv instead
      
      * Add Unique.hasKey :: Uniquable a => a -> Unique -> Bool
        It's useful in a lot of places
      
      * Fix a bug in interface file parsing for __U[!]
      495ef8bd
  28. 23 May, 2000 1 commit
    • simonpj's avatar
      [project @ 2000-05-23 11:35:36 by simonpj] · bb91427f
      simonpj authored
      *** MERGE WITH 4.07 (once I've checked it works) ***
      
      * Fix result type signatures.  Note that a consequential change is that
        an ordinary binding with a variable on the left
      	f = e
        is now treated as a FunMonoBind, not a PatMonoBind.  This makes
        a few things a bit simpler (eg rnMethodBinds)
      
      * Fix warnings for unused imports.  This meant moving where provenances
        are improved in RnNames.  Move mkExportAvails from RnEnv to RnNames.
      
      * Print module names right (small change in Module.lhs and Rename.lhs)
      
      * Remove a few unused bindings
        
      * Add a little hack to let us print info about join points that turn
        out not to be let-no-escaped.  The idea is to call them "$j" and report
        any such variables that are not let-no-escaped.
      
      * Some small things aiming towards -ddump-types (harmless but incomplete)
      bb91427f
  29. 21 Apr, 2000 1 commit
  30. 13 Apr, 2000 1 commit
    • simonpj's avatar
      [project @ 2000-04-13 11:56:35 by simonpj] · 9579283c
      simonpj authored
      Add support for 'packages'.
      
      * A package is a group of modules.
      
      * A package has a name (e.g. std)
      
      * A package is built into a single library (Unix; e.g. libHSstd.a)
                             or a single DLL     (Windows; e.g. HSstd.dll)
      
      * The '-package-name foo' flag tells GHC that the module being compiled
        is destined for package foo.
      
      * The '-package foo' flag tells GHC to make available modules
        from package 'foo'.  It replaces '-syslib foo' which is now deprecated.
      
      * Cross-package references cost an extra indirection in Windows,
        but not Unix
      
      * GHC does not maintain detailed cross-package dependency information.
        It does remember which modules in other packages the current module
        depends on, but not which things within those imported things.
      
      
      All of this tidies up the Prelude enormously.  The Prelude and
      Standard Libraries are built into a singl package called 'std'.  (This
      is a change; the library is now called libHSstd.a instead of libHS.a)
      9579283c