1. 23 Sep, 2003 1 commit
    • simonmar's avatar
      [project @ 2003-09-23 14:32:57 by simonmar] · abbc5a0b
      simonmar authored
      - Convert many of the optimisation options into dynamic options (that is,
        they can be mentioned in {-# OPTIONS #-} pragmas).
      
      - Add a new way to specify constructor-field unboxing on a selective
        basis.  To tell the compiler to unbox a constructor field, do this:
      
            data T = T !!Int
      
        and GHC will store that field unboxed if possible.  If it isn't possible
        (say, because the field has a sum type) then the annotation is ignored.
      
        The -funbox-strict-fields flag is now a dynamic flag, and has the same
        effect as replacing all the '!' annotations with '!!'.
      abbc5a0b
  2. 16 Sep, 2003 1 commit
    • simonmar's avatar
      [project @ 2003-09-16 13:03:37 by simonmar] · 2129fa6f
      simonmar authored
      Legacy Removal
      ~~~~~~~~~~~~~~
      
      The following features have been consigned to the bit bucket:
      
        _ccall_
        _casm_
        ``....''  (lit-lits)
        the CCallable class
        the CReturnable class
      2129fa6f
  3. 20 Feb, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-02-20 18:33:50 by simonpj] · 56b5a8b8
      simonpj authored
      -------------------------------------
            Add Core Notes and the {-# CORE #-} pragma
      	-------------------------------------
      
      This is an idea of Hal Daume's. The key point is that Notes in Core
      are augmented thus:
      
        data Note
          = SCC CostCentre
          | ...
          | CoreNote String     -- NEW
      
      These notes can be injected via a Haskell-source pragma:
      
         f x = ({-# CORE "foo" #-} show) ({-# CORE "bar" #-} x)
      
      This wraps a (Note (CoreNote "foo")) around the 'show' variable,
      and a similar note around the argument to 'show'.
      
      These notes are basically ignored by GHC, but are emitted into
      External Core, where they may convey useful information.
      
      Exactly how code involving these notes is munged by the simplifier
      isn't very well defined.  We'll see how it pans out.  Meanwhile
      the impact on the rest of the compiler is minimal.
      56b5a8b8
  4. 06 Jan, 2003 1 commit
    • simonmar's avatar
      [project @ 2003-01-06 14:40:04 by simonmar] · e26bfe83
      simonmar authored
      Disable the version check on the .hi file for --show-iface.  This
      means that it can be used on .hi files for other "ways" (eg. profiled)
      without having to resort to using the undocumented -buildtag option.
      e26bfe83
  5. 25 Oct, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-10-25 15:23:03 by simonpj] · 4ef18ea2
      simonpj authored
      ------------------------
      	More dependency fiddling
      	------------------------
      
      	WARNING: Interface file format has changed (again)
      		 You need to 'make clean' in all library code
      
      * Orphan modules are now kept separately
        Home-package dependencies now contain only home-package dependencies!
        See HscTypes.Dependencies
      
      * Linker now uses the dependencies to do dynamic linking
      
      Result: Template Haskell should work even without --make (not yet tested)
      4ef18ea2
  6. 24 Oct, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-10-24 14:17:46 by simonpj] · e0445ffa
      simonpj authored
      ------------------------------------------
      	1. New try and module and package dependencies
      	2. OrigNameCache always contains final info
      	------------------------------------------
      
      These things nearly complete sorting out the incremental
      linking problem that started us off!
      
      1. This commit separates two kinds of information:
      
        (a) HscTypes.Dependencies:
      	What (i)  home-package modules, and
      	     (ii) other packages
            this module depends on, transitively.
      
            That is, to link the module, it should be enough
            to link the dependent modules and packages (plus
            any C stubs etc).
      
            Along with this info we record whether the dependent module
            is (a) a boot interface or (b) an orphan module.  So in
            fact (i) can contain non-home-package modules, namely the
            orphan ones in other packages (sigh).
      
        (b) HscTypes.Usage:
            What version of imported things were used to
            actually compile the module.  This info is used for
            recompilation control only.
      
      
      
      2. The Finder now returns a correct Module (incl package indicator)
      first time, so we can install the absolutely final Name in the
      OrigNameCache when we first come across an occurrence of that name,
      even if it's only an occurrence in an unfolding in some other interface
      file.  This is much tidier.
      
      As a result Module.lhs is much cleaner
      	No DunnoYet
      	No mkVanillaModule
      ALl very joyful stuff.
      e0445ffa
  7. 13 Sep, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-09-13 15:02:25 by simonpj] · 9af77fa4
      simonpj authored
      --------------------------------------
      	Make Template Haskell into the HEAD
      	--------------------------------------
      
      This massive commit transfers to the HEAD all the stuff that
      Simon and Tim have been doing on Template Haskell.  The
      meta-haskell-branch is no more!
      
      WARNING: make sure that you
      
        * Update your links if you are using link trees.
          Some modules have been added, some have gone away.
      
        * Do 'make clean' in all library trees.
          The interface file format has changed, and you can
          get strange panics (sadly) if GHC tries to read old interface files:
          e.g.  ghc-5.05: panic! (the `impossible' happened, GHC version 5.05):
      	  Binary.get(TyClDecl): ForeignType
      
        * You need to recompile the rts too; Linker.c has changed
      
      
      However the libraries are almost unaltered; just a tiny change in
      Base, and to the exports in Prelude.
      
      
      NOTE: so far as TH itself is concerned, expression splices work
      fine, but declaration splices are not complete.
      
      
      		---------------
      		The main change
      		---------------
      
      The main structural change: renaming and typechecking have to be
      interleaved, because we can't rename stuff after a declaration splice
      until after we've typechecked the stuff before (and the splice
      itself).
      
      * Combine the renamer and typecheker monads into one
      	(TcRnMonad, TcRnTypes)
        These two replace TcMonad and RnMonad
      
      * Give them a single 'driver' (TcRnDriver).  This driver
        replaces TcModule.lhs and Rename.lhs
      
      * The haskell-src library package has a module
      	Language/Haskell/THSyntax
        which defines the Haskell data type seen by the TH programmer.
      
      * New modules:
      	hsSyn/Convert.hs 	converts THSyntax -> HsSyn
      	deSugar/DsMeta.hs 	converts HsSyn -> THSyntax
      
      * New module typecheck/TcSplice type-checks Template Haskell splices.
      
      		-------------
      		Linking stuff
      		-------------
      
      * ByteCodeLink has been split into
      	ByteCodeLink	(which links)
      	ByteCodeAsm	(which assembles)
      
      * New module ghci/ObjLink is the object-code linker.
      
      * compMan/CmLink is removed entirely (was out of place)
        Ditto CmTypes (which was tiny)
      
      * Linker.c initialises the linker when it is first used (no need to call
        initLinker any more).  Template Haskell makes it harder to know when
        and whether to initialise the linker.
      
      
      	-------------------------------------
      	Gathering the LIE in the type checker
      	-------------------------------------
      
      * Instead of explicitly gathering constraints in the LIE
      	tcExpr :: RenamedExpr -> TcM (TypecheckedExpr, LIE)
        we now dump the constraints into a mutable varabiable carried
        by the monad, so we get
      	tcExpr :: RenamedExpr -> TcM TypecheckedExpr
      
        Much less clutter in the code, and more efficient too.
        (Originally suggested by Mark Shields.)
      
      
      		-----------------
      		Remove "SysNames"
      		-----------------
      
      Because the renamer and the type checker were entirely separate,
      we had to carry some rather tiresome implicit binders (or "SysNames")
      along inside some of the HsDecl data structures.  They were both
      tiresome and fragile.
      
      Now that the typechecker and renamer are more intimately coupled,
      we can eliminate SysNames (well, mostly... default methods still
      carry something similar).
      
      		-------------
      		Clean up HsPat
      		-------------
      
      One big clean up is this: instead of having two HsPat types (InPat and
      OutPat), they are now combined into one.  This is more consistent with
      the way that HsExpr etc is handled; there are some 'Out' constructors
      for the type checker output.
      
      So:
      	HsPat.InPat	--> HsPat.Pat
      	HsPat.OutPat	--> HsPat.Pat
      	No 'pat' type parameter in HsExpr, HsBinds, etc
      
      	Constructor patterns are nicer now: they use
      		HsPat.HsConDetails
      	for the three cases of constructor patterns:
      		prefix, infix, and record-bindings
      
      	The *same* data type HsConDetails is used in the type
      	declaration of the data type (HsDecls.TyData)
      
      Lots of associated clean-up operations here and there.  Less code.
      Everything is wonderful.
      9af77fa4
  8. 29 Aug, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-08-29 15:44:11 by simonmar] · ce9687a5
      simonmar authored
      Housekeeping:
      
        - The main goal is to remove dependencies on hslibs for a
          bootstrapped compiler, leaving only a requirement that the
          packages base, haskell98 and readline are built in stage 1 in
          order to bootstrap.  We're almost there: Posix is still required
          for signal handling, but all other dependencies on hslibs are now
          gone.
      
          Uses of Addr and ByteArray/MutableByteArray array are all gone
          from the compiler.  PrimPacked defines the Ptr type for GHC 4.08
          (which didn't have it), and it defines simple BA and MBA types to
          replace uses of ByteArray and MutableByteArray respectively.
      
        - Clean up import lists.  HsVersions.h now defines macros for some
          modules which have moved between GHC versions.  eg. one now
          imports 'GLAEXTS' to get at unboxed types and primops in the
          compiler.
      
          Many import lists have been sorted as per the recommendations in
          the new style guidelines in the commentary.
      
      I've built the compiler with GHC 4.08.2, 5.00.2, 5.02.3, 5.04 and
      itself, and everything still works here.  Doubtless I've got something
      wrong, though.
      ce9687a5
  9. 27 May, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-05-27 15:28:07 by simonpj] · ef2b170c
      simonpj authored
      Allow infix type constructors
      
      This commit adds infix type constructors (but not yet class constructors).
      The documentation describes what should be the case.  Lots of tiresome
      changes, but nothing exciting.
      
      Allows infix type constructors everwhere a type can occur, and in a data
      or type synonym decl.  E.g.
      
      	data a :*: b = ....
      
      
      You can give fixity decls for type constructors, but the fixity decl
      applies both to the tycon and the corresponding data con.
      ef2b170c
  10. 07 May, 2002 2 commits
  11. 06 May, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-05-06 08:31:29 by simonmar] · de23b5da
      simonmar authored
      Slurp the usages information lazilly from the interface file.  In most
      cases we don't need it at all: we only use it when we're loading a
      module's interface file to check whether the module needs recompiling.
      de23b5da
  12. 01 May, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-05-01 09:10:32 by simonpj] · 1b853dc9
      simonpj authored
      When reading an interface file, don't discard CPR info even
      if -fcpr-off is selected.  The info describes what the .o file
      contains, so we can't ignore that!
      1b853dc9
  13. 22 Apr, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-04-22 16:06:35 by simonpj] · dbfe93e6
      simonpj authored
      CPR control
      
      1.  Remove -fno-cpr, add -fcpr-off which is a simple static flag
          for switching the new CPR analysis off altogether.
          (The "-fno" machinery is rather complicated.)
      
      2.  Rejig SimplCore a little so that the "old strictness analyser"
          runs both the old strictness analyser and the old CPR analyser,
          which makes it more like the new strictness/CPR analyser.
      
          (How much longer we keep the old strictness/CPR analyser in the
          compiler at all I don't know.  It's just for comparision purposes
          when we write the paper.)
      dbfe93e6
  14. 05 Mar, 2002 2 commits
    • simonmar's avatar
      [project @ 2002-03-05 14:18:53 by simonmar] · caac75c6
      simonmar authored
      Generate the contents of the GHC.Prim interface file automatically
      from the list of available PrimOps and various other wired-in things.
      
      Two main benefits from this:
      
        - There's one fewer places to edit when adding a new primop.
      
        - It's one less reason to need the interface file parser, and
          now we no longer need the (short-lived) --compile-iface option
          so I've removed it.
      caac75c6
    • simonmar's avatar
      [project @ 2002-03-05 09:05:23 by simonmar] · 06f35bd5
      simonmar authored
      [ forgot to add this file the first time around... ]
      
      Binary Interface Files - stage 1
      --------------------------------
      
      This commit changes the default interface file format from text to
      binary, in order to improve compilation performace.
      
      To view an interface file, use 'ghc --show-iface Foo.hi'.
      
      utils/Binary.hs is the basic Binary I/O library, based on the nhc98
      binary I/O library but much stripped-down and working in terms of
      bytes rather than bits, and with some special features for GHC: it
      remembers which Module is being emitted to avoid dumping too many
      qualified names, and it keeps track of a "dictionary" of FastStrings
      so that we don't dump the same FastString more than once into the
      binary file.  I'll make a generic version of this for the libraries at
      some point.
      
      main/BinIface.hs contains most of the Binary instances.  Some
      instances are in the same module as the data type (RdrName, Name,
      OccName in particular).  Most instances were generated using a
      modified version of DrIFT, which I'll commit later.  However, editing
      them by hand isn't hard (certainly easier than modifying
      ParseIface.y).
      
      The first thing in a binary interface is the interface version, so
      nice error messages will be generated if the binary format changes and
      you still have old interfaces lying around.  The version also now
      includes the "way" as an extra sanity check.
      
      Other changes
      -------------
      
      I don't like the way FastStrings contain both hashed strings (with
      O(1) comparison) and literal C strings (with O(n) comparison).  So as
      a first step to separating these I made serveral "literal" type
      strings into hashed strings.  SLIT() still generates a literal, and
      now FSLIT() generates a hashed string.  With DEBUG on, you'll get a
      warning if you try to compare any SLIT()s with anything, and the
      compiler will fall over if you try to dump any literal C strings into
      an interface file (usually indicating a use of SLIT() which should be
      FSLIT()).
      
      mkSysLocal no longer re-encodes its FastString argument each time it
      is called.
      
      I also fixed the -pgm options so that the argument can now optionally
      be separted from the option.
      
      Bugfix: PrelNames declared Names for several comparison primops, eg.
      eqCharName, eqIntName etc. but these had different uniques from the
      real primop names.  I've moved these to PrimOps and defined them using
      mkPrimOpIdName instead, and deleted some for which we don't have real
      primops (Manuel: please check that things still work for you after
      this change).
      06f35bd5