1. 28 May, 2008 1 commit
    • Simon Marlow's avatar
      Use MD5 checksums for recompilation checking (fixes #1372, #1959) · 526c3af1
      Simon Marlow authored
      This is a much more robust way to do recompilation checking.  The idea
      is to create a fingerprint of the ABI of an interface, and track
      dependencies by recording the fingerprints of ABIs that a module
      depends on.  If any of those ABIs have changed, then we need to
      recompile.
      
      In bug #1372 we weren't recording dependencies on package modules,
      this patch fixes that by recording fingerprints of package modules
      that we depend on.  Within a package there is still fine-grained
      recompilation avoidance as before.
      
      We currently use MD5 for fingerprints, being a good compromise between
      efficiency and security.  We're not worried about attackers, but we
      are worried about accidental collisions.
      
      All the MD5 sums do make interface files a bit bigger, but compile
      times on the whole are about the same as before.  Recompilation
      avoidance should be a bit more accurate than in 6.8.2 due to fixing
      #1959, especially when using -O.
      526c3af1
  2. 04 May, 2008 1 commit
  3. 12 Apr, 2008 1 commit
  4. 29 Mar, 2008 2 commits
  5. 17 Mar, 2008 3 commits
  6. 07 Feb, 2008 1 commit
    • Ian Lynagh's avatar
      Convert more UniqFM's back to LazyUniqFM's · d51f42f6
      Ian Lynagh authored
      These fix these failures:
         break008(ghci)
         break009(ghci)
         break026(ghci)
         ghci.prog009(ghci)
         ghci025(ghci)
         print007(ghci)
         prog001(ghci)
         prog002(ghci)
         prog003(ghci)
      at least some of which have this symptom:
          Exception: expectJust prune
      d51f42f6
  7. 05 Feb, 2008 1 commit
  8. 17 Jan, 2008 1 commit
  9. 10 Oct, 2007 1 commit
    • Dan Licata's avatar
      View patterns, record wildcards, and record puns · 6a05ec5e
      Dan Licata authored
      This patch implements three new features:
      * view patterns (syntax: expression -> pat in a pattern)
      * working versions of record wildcards and record puns
      See the manual for detailed descriptions.
      
      Other minor observable changes:
      * There is a check prohibiting local fixity declarations
        when the variable being fixed is not defined in the same let
      * The warn-unused-binds option now reports warnings for do and mdo stmts
      
      Implementation notes: 
      
      * The pattern renamer is now in its own module, RnPat, and the
      implementation is now in a CPS style so that the correct context is
      delivered to pattern expressions.
      
      * These features required a fairly major upheaval to the renamer.
      Whereas the old version used to collect up all the bindings from a let
      (or top-level, or recursive do statement, ...) and put them into scope
      before renaming anything, the new version does the collection as it
      renames.  This allows us to do the right thing with record wildcard
      patterns (which need to be expanded to see what names should be
      collected), and it allows us to implement the desired semantics for view
      patterns in lets.  This change had a bunch of domino effects brought on
      by fiddling with the top-level renaming.
      
      * Prior to this patch, there was a tricky bug in mkRecordSelId in HEAD,
      which did not maintain the invariant necessary for loadDecl.  See note
      [Tricky iface loop] for details.
      6a05ec5e
  10. 08 Oct, 2007 1 commit
  11. 10 Sep, 2007 1 commit
    • Simon Marlow's avatar
      FIX #903: mkWWcpr: not a product · 3b1438a9
      Simon Marlow authored
      This fixes the long-standing bug that prevents some code with
      mutally-recursive modules from being compiled with --make and -O,
      including GHC itself.  See the comments for details.
      
      There are some additional cleanups that were forced/enabled by this
      patch: I removed importedSrcLoc/importedSrcSpan: it wasn't adding any
      useful information, since a Name already contains its defining Module.
      In fact when re-typechecking an interface file we were wrongly
      replacing the interesting SrcSpans in the Names with boring
      importedSrcSpans, which meant that location information could degrade
      after reloading modules.  Also, recreating all these Names was a waste
      of space/time.
      3b1438a9
  12. 04 Sep, 2007 1 commit
  13. 03 Sep, 2007 1 commit
  14. 01 Sep, 2007 1 commit
  15. 17 Jul, 2007 1 commit
    • andy@galois.com's avatar
      Adding pushing of hpc translation status through hi files. · c1681a73
      andy@galois.com authored
      Now, if a single module *anywhere* on the module tree is built with
      -fhpc, the binary will enable reading/writing of <bin>.tix.
      
      Previously, you needed to compile Main to allow coverage to operate.
      
      This changes the file format for .hi files; you will need to recompile every library.
      c1681a73
  16. 16 Jul, 2007 1 commit
  17. 06 Jun, 2007 1 commit
    • simonpj@microsoft.com's avatar
      Remove unnecessary free-variables from renamer · 3c4a732b
      simonpj@microsoft.com authored
      The renamer used to be responsible for making sure that all interfaces
      with instance decls (other than orphans) were loaded.  But TH makes that
      impossible, so the typechecker does it, via checkWiredInTyCon.
      
      This patch simply removes redundant additions to the free-variable set
      in the renamer, which were there, I believe, solely to ensure that the 
      instances came in.  Removing them should change nothing, but it's a 
      useful clean up.
      3c4a732b
  18. 22 May, 2007 1 commit
  19. 11 May, 2007 1 commit
  20. 10 May, 2007 1 commit
  21. 08 May, 2007 1 commit
    • chak@cse.unsw.edu.au.'s avatar
      Improved VectInfo · 098f818b
      chak@cse.unsw.edu.au. authored
      - We need to keep pairs of (f, f_CC) in VectInfo as it is difficult
        to obtain Names from OccNames (of imported modules) in Core passes.
      - There is a choice of keeping Names or Vars in VectInfo.  We go with Vars
        for now; mainly to avoid converting between Names and Vars repeatedly for
        the same VectInfo in other than one-shot mode.
      
        Again goes to the HEAD straight away to avoid conflicts down the road.
      098f818b
  22. 04 May, 2007 1 commit
  23. 14 Apr, 2007 1 commit
  24. 27 Mar, 2007 1 commit
    • Simon Marlow's avatar
      partial fix for #1119 · 1e8ae3f0
      Simon Marlow authored
      Unless we're in one-shot mode, emit an error if we attempt to
      demand-load interfaces for home modules.  This can only happen in one
      way (that I'm aware of): typing a qualified name at the GHCi prompt
      that refers to a module that isn't loaded.  Previously you got a
      cryptic message about not finding an interface file, now you get:
      
      Prelude> Foo.a
      
      <interactive>:1:0:
          attempting to use module `Foo' (Foo.hs) which is not loaded
      
      Of course you can still refer to package modules like this without
      loading them explicitly, only home modules are affected, and the
      behaviour is exactly the same as if you try to ':browse Foo' and
      Foo isn't loaded.
      1e8ae3f0
  25. 16 Mar, 2007 1 commit
  26. 11 Jan, 2007 1 commit
  27. 10 Nov, 2006 1 commit
  28. 19 Oct, 2006 1 commit
  29. 18 Oct, 2006 1 commit
  30. 13 Oct, 2006 1 commit
    • chak@cse.unsw.edu.au.'s avatar
      Keep track of family instance modules · 311b1cdf
      chak@cse.unsw.edu.au. authored
      - Now each modules carries
        (1) a flag saying whether it contains family instance declarations and
        (2) a list of all modules further down in the import tree that contain
            family instance declarations.
        (The information is split into these two parts for the exact same reasons why
        the info about orphan modules is split, too.)
      - This is the first step to *optimised* overlap checking of family instances
        coming from imported modules.
      
      *** WARNING: This patch changes the interface file format! ***
      ***          Recompile libraries and stage2 from scratch!  ***
      311b1cdf
  31. 11 Oct, 2006 2 commits
    • Simon Marlow's avatar
      Module header tidyup, phase 1 · 49c98d14
      Simon Marlow authored
      This patch is a start on removing import lists and generally tidying
      up the top of each module.  In addition to removing import lists:
      
         - Change DATA.IOREF -> Data.IORef etc.
         - Change List -> Data.List etc.
         - Remove $Id$
         - Update copyrights
         - Re-order imports to put non-GHC imports last
         - Remove some unused and duplicate imports
      49c98d14
    • Simon Marlow's avatar
      Interface file optimisation and removal of nameParent · b00b5bc0
      Simon Marlow authored
      This large commit combines several interrelated changes:
      
        - IfaceSyn now contains actual Names rather than the special
          IfaceExtName type.  The binary interface file contains
          a symbol table of Names, where each entry is a (package,
          ModuleName, OccName) triple.  Names in the IfaceSyn point
          to entries in the symbol table.
      
          This reduces the size of interface files, which should
          hopefully improve performance (not measured yet).
      
          The toIfaceXXX functions now do not need to pass around
          a function from Name -> IfaceExtName, which makes that
          code simpler.
      
        - Names now do not point directly to their parents, and the
          nameParent operation has gone away.  It turned out to be hard to
          keep this information consistent in practice, and the parent info
          was only valid in some Names.  Instead we made the following
          changes:
      
          * ImportAvails contains a new field 
                imp_parent :: NameEnv AvailInfo
            which gives the family info for any Name in scope, and
            is used by the renamer when renaming export lists, amongst
            other things.  This info is thrown away after renaming.
      
          * The mi_ver_fn field of ModIface now maps to
            (OccName,Version) instead of just Version, where the
            OccName is the parent name.  This mapping is used when
            constructing the usage info for dependent modules.
            There may be entries in mi_ver_fn for things that are not in
            scope, whereas imp_parent only deals with in-scope things.
      
          * The md_exports field of ModDetails now contains
            [AvailInfo] rather than NameSet.  This gives us
            family info for the exported names of a module.
      
      Also:
      
         - ifaceDeclSubBinders moved to IfaceSyn (seems like the
           right place for it).
      
         - heavily refactored renaming of import/export lists.
      
         - Unfortunately external core is now broken, as it relied on
           IfaceSyn.  It requires some attention.
      b00b5bc0
  32. 10 Oct, 2006 1 commit
    • chak@cse.unsw.edu.au.'s avatar
      Rough matches for family instances · 2a8cdc3a
      chak@cse.unsw.edu.au. authored
      - Class and type family instances just got a lot more similar.
      - FamInst, like Instance, now has a rough match signature.  The idea is the
        same: if the rough match doesn't match, there is no need to pull in the while
        tycon describing the instance (from a lazily read iface).
      - IfaceFamInst changes in a similar way and the list of all IFaceFamInsts is
        now written into the binary iface (as for class instances), as deriving it
        from the tycon (as before) would render the whole rough matching useless.
      - As a result of this, the plumbing of class instances and type instances 
        through the various environments, ModIface, ModGuts, and ModDetails is now
        almost the same.  (The remaining difference are mostly because the dfun of a
        class instance is an Id, but type instance refer to a TyCon, not an Id.)
      
      *** WARNING: The interface file format changed! ***
      ***	     Rebuild from scratch.		***
      2a8cdc3a
  33. 06 Oct, 2006 1 commit
    • simonpj@microsoft.com's avatar
      Fix up the typechecking of interface files during --make · 84f4c1df
      simonpj@microsoft.com authored
      This patch fixes Trac #909.  The problem was that when compiling 
      the base package, the handling of wired-in things wasn't right;
      in TcIface.tcWiredInTyCon it repeatedly loaded GHC.Base.hi into the
      PIT, even though that was the very module it was compiling.
      
      The main fix is by introducing TcIface.ifCheckWiredInThing.
      
      But I did some minor refactoring as well.
      84f4c1df
  34. 23 Sep, 2006 1 commit
  35. 22 Sep, 2006 1 commit
  36. 20 Sep, 2006 1 commit
    • chak@cse.unsw.edu.au.'s avatar
      Import/export of data constructors in family instances · a835e9fa
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 19:50:42 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Import/export of data constructors in family instances
        Tue Sep 12 13:54:37 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Import/export of data constructors in family instances
          - Data constructors of a data/newtype family F can be exported and imported
            by writing F(..) or F(ConName).
          - This appears the most natural from a user's persepctive - although, it has a
            slightly different flavour than similar import/exports items for closed data 
            types.  The data constructors denoted by F(..) vary in dependence on the 
            visible data instances.
          - This has been non-trivial to achieve as RnNames derives its knowledge of what
            sub-binders an F(..) item exports/imports from the relation specified by 
            Name.nameParent - ie, the constructors of a data/newtype instance need to 
            have the family name (not the internal name of the representation tycon) as 
            their parent.
          
          *** WARNING: This patched changes the iface format! ***
          ***          Please re-compile from scratch!	    ***
      a835e9fa