1. 23 Nov, 2001 1 commit
  2. 18 Oct, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-10-18 16:29:12 by simonpj] · 685e04e4
      simonpj authored
      ----------------------------------------------
      	The CoreTidy/CorePrep/CoreToStg saga continues
      	[actually, this commit mostly completes the job]
      	----------------------------------------------
      
      			DO NOT MERGE!
      
      * CorePrep injects implicit bindings, not the type checker,
        nor CgConTbls.   (This way, all the code generators see
        them, so no need to fiddle with the byte code generator.)
      
        As a result, all bindings in the module are for LocalIds,
        at least until CoreTidy.   This is a Big Win.
      
        Hence remove nasty isImplicitId test in update_bndr in
        SimplCore and DmdAnal
      
      * hasNoBinding is no longer true of a dataConId (worker).
        There's an implicit curried binding for it.
      
      * Remove yukky test in exprIsTrivial that did not regard
        a hasNoBinding Id as trivial; similarly in SimplUtils.tryEtaReduce
      
      * In CoreTidy, get the names to avoid from the type env.
        That way it includes implicit bindings too.
      
      * CoreTidy set the Arity of a top-level Id permanently;
        it's up to the rest of the compiler to respect it.
        Notably, CorePrep uses etaExpand to make the manifest arity
        match the claimed arity.
      
      * As a result, nuke CgArity, so that CgInfo now contains only
        CafInfo.  The CafInfo is knot-tied as before.
      
      
      Other things
      
      * In Simplify.simplLazyBind, be a bit keener to float bindings
        out if it's a top-level binding.
      685e04e4
  3. 23 Aug, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-08-23 09:54:45 by simonpj] · 98bf5734
      simonpj authored
      --------------------------------------------------
      	Be a bit more liberal when slurping instance decls
      	--------------------------------------------------
      
      Functional dependencies have (as usual) made things more complicated
      
      Suppose an interface file contains
      	interface A where
      	  class C a b | a->b where op :: a->b
      	  instance C Foo Baz where ...
      
      Now we are compiling
      	module B where
      	  import A
      	  t = op (v::Foo)
      
      Should we slurp the instance decl, even though Baz is nowhere mentioned
      in module B?  YES!  Because of the fundep, the (C Foo ?) part is enough to
      select this instance decl, and the Baz part follows.
      
      Rather than take fundeps into account "properly", we just slurp
      if C is visible and *any one* of the Names in the types
      This is a slightly brutal approximation, but most instance decls
      are regular H98 ones and it's perfect for them.
      
      Changes:
      
        HscTypes:
      	generalise the types of GatedDecl a bit
      
        RnHiFiles.loadInstDecl, RnHiFiles.loadRule, RnIfaces.selectGated:
      	the meat of the solution
      
        RdrName, OccName etc:
      	some consequential wibbles
      98bf5734
  4. 15 Jun, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-06-15 08:29:57 by simonpj] · 972d6442
      simonpj authored
      Some tidying up
      
      * Remove CmStaticInfo
         - GhciMode moves to HscTypes
         - The package stuff moves to new module main/Packages.lhs
      
      [put any package-related stuff in the new module]
      
      * Add Outputable.docToSDoc
      972d6442
  5. 31 May, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-05-31 11:32:25 by simonmar] · e0a941b9
      simonmar authored
      - add -hidir flag to control the destination for .hi files when doing
        multiple compilations (matches -odir).
      
      - change the ml_hi_file component of ModuleLocation from Maybe FilePath to
        FilePath.  We never made use of its Maybeness.
      
      - clear out some unused code from the Hsc phase of run_phase and clean up
        a bit.  Fix a bug with the -ohi option at the same time (I don't think
        it works in 5.xx.x before this patch).
      e0a941b9
  6. 18 May, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-05-18 08:46:18 by simonpj] · b4775e5e
      simonpj authored
      -----------------------------
      	Get unbox-strict-fields right
      	-----------------------------
      
      The problem was that when a library was compiled *without* -funbox-strict-fields,
      and the main program was compiled *with* that flag, we were wrongly treating
      the fields of imported data types as unboxed.
      
      To fix this I added an extra constructor to StrictnessMark to express whether
      the "!" annotation came from an interface file (don't fiddle) or a source
      file (decide whether to unbox).
      
      On the way I tided things up:
      
      * StrictnessMark moves to Demand.lhs, and doesn't have the extra DataCon
        fields that kept it in DataCon before.
      
      * HsDecls.BangType has one constructor, not three, with a StrictnessMark field.
      
      * DataCon keeps track of its strictness signature (dcRepStrictness), but not
        its "user strict marks" (which were never used)
      
      * All the functions, like getUniquesDs, that used to take an Int saying how
        many uniques to allocate, now return an infinite list. This saves arguments
        and hassle.  But it involved touching quite a few files.
      
      * rebuildConArgs takes a list of Uniques to use as its unique supply.  This
        means I could combine DsUtils.rebuildConArgs with MkId.rebuildConArgs
        (hooray; the main point of the previous change)
      
      
      I also tidied up one or two error messages
      b4775e5e
  7. 23 Mar, 2001 1 commit
  8. 14 Mar, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-03-14 15:26:00 by simonpj] · 506278ab
      simonpj authored
      -------------------------------------
      	Import more rules, and fix usage info
      	-------------------------------------
      
      1. A rule wasn't being slurped in that should have been.
      Reason: wordToWord32# was in the 'TypeEnv', because it's a primop,
      so the renamer thought it was already slurped in, which is true.
      But it forgot to use the TypeEnv as a source of gates when deciding
      which rules to pull in.  Result: a useful rule for the primop wasn't
      making it in.  Thanks to Marcin for isolating this one.
      
      2. RnIfaces.recordTypeEnvSlurp (was recordVSlurp) was blindly adding
      the name to the iVSlurp set, but the iVSlurp set is supposed to contain
      only "big" names (tycons, classes, and Ids that aren't data cons,
      class ops etc).  We need to get the big name from the thing.
      Mildly tiresomely, this means we have to keep the Class inside
      the TyCon derived from that class.   Hence updates to TyCon and Class.
      506278ab
  9. 13 Mar, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-03-13 12:50:29 by simonmar] · 10cbc75d
      simonmar authored
      Some rearrangements that Simon & I have been working on recently:
      
          - CoreSat is now CorePrep, and is a general "prepare-for-code-
            generation" pass.  It does cloning, saturation of constructors &
            primops, A-normal form, and a couple of other minor fiddlings.
      
          - CoreTidy no longer does cloning, and minor fiddlings.  It doesn't
            need the unique supply any more, so that's removed.
      
          - CoreToStg now collects CafInfo and the list of CafRefs for each
            binding.  The SRT pass is much simpler now.
      
          - IdInfo now has a CgInfo field for "code generator info".  It currently
            contains arity (the actual code gen arity which affects the calling
            convention as opposed to the ArityInfo which is a measure of how
            many arguments the Id can be applied to before it does any work), and
            CafInfo.
      
            Previously we overloaded the ArityInfo field to contain both
            codegen arity and simplifier arity.  Things are cleaner now.
      
          - CgInfo is collected by CoreToStg, and passed back into CoreTidy in
            a loop.  The compiler will complain rather than going into a black
            hole if the CgInfo is pulled on too early.
      
          - Worker info in an interface file now comes with arity info attached.
            Previously the main arity info was overloaded for this purpose, but
            it lead to a few hacks in the compiler, this tidies things up somewhat.
      
      Bottom line: we removed several fragilities, and tidied up a number of
      things.  Code size should be smaller, but we'll see...
      10cbc75d
  10. 08 Mar, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-03-08 12:07:38 by simonpj] · 51a571c0
      simonpj authored
      --------------------
      	A major hygiene pass
      	--------------------
      
      1. The main change here is to
      
      	Move what was the "IdFlavour" out of IdInfo,
      	and into the varDetails field of a Var
      
         It was a mess before, because the flavour was a permanent attribute
         of an Id, whereas the rest of the IdInfo was ephemeral.  It's
         all much tidier now.
      
         Main places to look:
      
      	   Var.lhs	Defn of VarDetails
      	   IdInfo.lhs	Defn of GlobalIdDetails
      
         The main remaining infelicity is that SpecPragmaIds are right down
         in Var.lhs, which seems unduly built-in for such an ephemeral thing.
         But that is no worse than before.
      
      
      2. Tidy up the HscMain story a little.  Move mkModDetails from MkIface
         into CoreTidy (where it belongs more nicely)
      
         This was partly forced by (1) above, because I didn't want to make
         DictFun Ids into a separate kind of Id (which is how it was before).
         Not having them separate means we have to keep a list of them right
         through, rather than pull them out of the bindings at the end.
      
      3. Add NameEnv as a separate module (to join NameSet).
      
      4. Remove unnecessary {-# SOURCE #-} imports from FieldLabel.
      51a571c0
  11. 01 Mar, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-03-01 14:26:00 by simonmar] · 18b24e64
      simonmar authored
      GHCi fixes:
      
        - expressions are now compiled in a pseudo-module "$Interactive",
          which avoids some problems with storage of demand-loaded declarations.
      
        - compilation manager now detects when it needs to read the interace
          for a module, even if it is already compiled.  GHCi never demand-loads
          interfaces now.
      
        - (from Simon PJ) fix a problem with the recompilation checker, which
          meant that modules were sometimes not recompiled when they should
          have been.
      
        - ByteCodeGen/Link: move linker related stuff into ByteCodeLink.
      18b24e64
  12. 26 Feb, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-02-26 15:06:57 by simonmar] · 1c62b517
      simonmar authored
      Implement do-style bindings on the GHCi command line.
      
      The syntax for a command-line is exactly that of a do statement, with
      the following meanings:
      
        - `pat <- expr'
          performs expr, and binds each of the variables in pat.
      
        - `let pat = expr; ...'
          binds each of the variables in pat, doesn't do any evaluation
      
        - `expr'
          behaves as `it <- expr' if expr is IO-typed, or `let it = expr'
          followed by `print it' otherwise.
      1c62b517
  13. 23 Feb, 2001 1 commit
  14. 20 Feb, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-02-20 09:41:48 by simonpj] · 52eed22d
      simonpj authored
      Deprecations [HscTypes, MkIface, Rename, RnEnv, RnIfaces]
      ~~~~~~~~~~~~
      * Arrange that a change in deprecations is treated as a 
        hi-file difference.
      
      * Warn about deprecations at the usage site.  This entailed
        changing HscTypes.GlobalRdrEnv to include deprecations.
        While I was at it, I changed the range of GlobalRdrEnv 
        to a data type, GlobalRdrElt, instead a of a pair.
      52eed22d
  15. 20 Dec, 2000 1 commit
  16. 08 Dec, 2000 1 commit
  17. 07 Dec, 2000 1 commit
  18. 24 Nov, 2000 1 commit
  19. 21 Nov, 2000 1 commit
  20. 20 Nov, 2000 1 commit
    • simonpj's avatar
      [project @ 2000-11-20 14:48:52 by simonpj] · c271b647
      simonpj authored
      When renaming, typechecking an expression from the user
      interface, we may suck in declarations from interface
      files (e.g. the Prelude).  This commit takes account of that.
      
      To do so, I did some significant restructuring in TcModule,
      with consequential changes and tidy ups elsewhere in the type
      checker.  I think there should be fewer lines in total than before.
      c271b647
  21. 14 Nov, 2000 2 commits
  22. 10 Nov, 2000 1 commit
    • simonpj's avatar
      [project @ 2000-11-10 15:12:50 by simonpj] · f23ba2b2
      simonpj authored
      1.	Outputable.PprStyle now carries a bit more information
      	In particular, the printing style tells whether to print
      	a name in unqualified form.  This used to be embedded in
      	a Name, but since Names now outlive a single compilation unit,
      	that's no longer appropriate.
      
      	So now the print-unqualified predicate is passed in the printing
      	style, not embedded in the Name.
      
         2.	I tidied up HscMain a little.  Many of the showPass messages
      	have migraged into the repective pass drivers
      f23ba2b2
  23. 07 Nov, 2000 1 commit
  24. 06 Nov, 2000 1 commit
  25. 03 Nov, 2000 1 commit
  26. 01 Nov, 2000 1 commit
    • simonpj's avatar
      [project @ 2000-11-01 17:15:28 by simonpj] · 2ffefc1b
      simonpj authored
      More renamer commits
      
      Versioning now works properly I think.
      
      The main irritation is that interface files now have fuly-qualified names for
      *everything*, even things defined in that module.  This is a deficiency in
      the pretty printing for interface files.  Probable solution: add something
      to the SDoc styles.  But not today.
      2ffefc1b
  27. 31 Oct, 2000 2 commits
  28. 30 Oct, 2000 4 commits
  29. 27 Oct, 2000 3 commits
  30. 26 Oct, 2000 2 commits
  31. 25 Oct, 2000 2 commits