1. 20 Jun, 2007 4 commits
    • simonpj@microsoft.com's avatar
    • simonpj@microsoft.com's avatar
      Use -X for language extensions · 5e05865d
      simonpj@microsoft.com authored
      We've often talked about having a separate flag for language extensions,
      and now we have one. You can say
      
      	-XImplicitParams
      	-X=ImplicitParams
      	-Ximplicit-params
      
      as you like.  These replace the "-f" flags with similar names (though
      the -f prefix will serve as a synonym for -X for a while).  
      
      There's an optional "=", and the flag is normalised by removing hyphens
      and lower-casing, so all the above variants mean the same thing.
      
      The nomenclature is intended to match the LANGUAGE pramgas, which are
      defined by Cabal.  So you can also say
      
      	{-# LANGUAGE ImplicitParams #-}
      
      But Cabal doesn't have as many language options as GHC does, so the -X
      things are a superset of the LANGUAGE things.
      
      The optional "=" applies to all flags that take an argument, so you can,
      for example, say
      	
      	-pgmL=/etc/foo
      
      I hope that's ok.  (It's an unforced change; just fitted in.)
      
      I hope we'll add more -X flags, to replace the portmanteau -fglasgow-exts 
      which does everything!  
      
      I have updated the manual, but doubtless missed something.
      
      
      5e05865d
    • andy@galois.com's avatar
      d85714eb
    • andy@galois.com's avatar
      Turning off case liberation when using the hpc option, for now · d363c1fc
      andy@galois.com authored
      Consider the following code
      
           f = g (case v of
                    V a b -> a : t f)
      
      where g is expensive. Liberate case will turn this into
      
           f = g (case v of
                   V a b -> a : t (letrec f = g (case v of
                                                 V a b -> a : f t)
                                    in f)
                 )
      
      Yikes! We evaluate g twice. This leads to a O(2^n) explosion
      if g calls back to the same code recursively.
      
      This happen sometimes in HPC, because every tick is a liberate-able case,
      but is a general problem to case liberation (I think). 
      d363c1fc
  2. 12 Jun, 2007 1 commit
    • Ian Lynagh's avatar
      Tweak banner printing · cedd4187
      Ian Lynagh authored
      * -{short,long}-ghci-banner are now dynamic options, so you can put
        ":set -short-ghci-banner" in .ghci
      * The -v2 banner information now always tells you what compiler booted GHC,
        and what stage the compiler is. Thus we no longer assume that stage > 1
        iff GHCI is defined.
      cedd4187
  3. 15 May, 2007 1 commit
    • Simon Marlow's avatar
      GHCi debugger: new flag -fbreak-on-exception · 17f848e1
      Simon Marlow authored
      When -fbreak-on-exception is set, an exception will cause GHCi to
      suspend the current computation and return to the prompt, where the
      history of the current evaluation can be inspected (if we are in
      :trace).  This isn't on by default, because the behaviour could be
      confusing: for example, ^C will cause a breakpoint.  It can be very
      useful for finding the cause of a "head []" or a "fromJust Nothing",
      though.
      17f848e1
  4. 14 May, 2007 1 commit
  5. 11 May, 2007 1 commit
  6. 07 May, 2007 1 commit
  7. 04 May, 2007 1 commit
    • simonpj@microsoft.com's avatar
      Make -frewrite-rules into a dynamic flag; off for -O0 · 5943ce90
      simonpj@microsoft.com authored
      Argubly rewrite rules should not fire with -O0, and it turns
      out that when compiling GHC.Base with -O0 we get a crash if
      the rewrite rules do fire (see Note [Scoping for Builtin rules]
      in PrelRules).
      
      So unless someone yells, rewrite rules are off with -O0.
      
      The new (now dynamic) flag is 
          -frewrite rules (with -fno-rewrite-rules to disable)
      
      The old (static) flag -frules-off is gone.
      5943ce90
  8. 29 Apr, 2007 1 commit
  9. 25 Apr, 2007 1 commit
  10. 17 Apr, 2007 1 commit
    • Simon Marlow's avatar
      Re-working of the breakpoint support · cdce6477
      Simon Marlow authored
      This is the result of Bernie Pope's internship work at MSR Cambridge,
      with some subsequent improvements by me.  The main plan was to
      
       (a) Reduce the overhead for breakpoints, so we could enable 
           the feature by default without incurrent a significant penalty
       (b) Scatter more breakpoint sites throughout the code
      
      Currently we can set a breakpoint on almost any subexpression, and the
      overhead is around 1.5x slower than normal GHCi.  I hope to be able to
      get this down further and/or allow breakpoints to be turned off.
      
      This patch also fixes up :print following the recent changes to
      constructor info tables.  (most of the :print tests now pass)
      
      We now support single-stepping, which just enables all breakpoints.
      
        :step <expr>     executes <expr> with single-stepping turned on
        :step            single-steps from the current breakpoint
      
      The mechanism is quite different to the previous implementation.  We
      share code with the HPC (haskell program coverage) implementation now.
      The coverage pass annotates source code with "tick" locations which
      are tracked by the coverage tool.  In GHCi, each "tick" becomes a
      potential breakpoint location.
      
      Previously breakpoints were compiled into code that magically invoked
      a nested instance of GHCi.  Now, a breakpoint causes the current
      thread to block and control is returned to GHCi.
      
      See the wiki page for more details and the current ToDo list:
      
        http://hackage.haskell.org/trac/ghc/wiki/NewGhciDebugger
      cdce6477
  11. 11 Apr, 2007 1 commit
    • Simon Marlow's avatar
      Rationalise GhcMode, HscTarget and GhcLink · 3c22606b
      Simon Marlow authored
      This patch cleans up the GHC API, and adds some functionality: we can
      now compile to object code inside GHCi.
      
      Previously we had:
      
        data GhcMode
          = BatchCompile
          | Interactive
          | OneShot
          | JustTypecheck
          | MkDepend
        
        data HscTarget
          = HscC
          | HscAsm
          | HscJava
          | HscInterpreted
          | HscNothing
      
      There was redundancy here; if GhcMode is Interactive, then only
      HscInterpreted makes sense, and JustTypecheck required HscNothing.
      Now we have:
      
        data GhcMode
          = CompManager       -- ^ --make, GHCi, etc.
          | OneShot           -- ^ ghc -c Foo.hs
          | MkDepend          -- ^ ghc -M, see Finder for why we need this
      
      and HscTarget remains as before.
      
      Previously GhcLink looked like this:
      
        data GhcLink = NoLink | StaticLink
      
      Now we have:
      
        data GhcLink = NoLink | LinkBinary | LinkInMemory
      
      The idea being that you can have an HscTarget of HscAsm (for example)
      and still link in memory.
      
      There are two new flags:
      
        -fobject-code selects object code as the target (selects
                      either -fasm or -fvia-C, whichever is the default)
                      This can be usd with ':set' in GHCi, or on the command line.
      
        -fbyte-code   sets byte-code as the target.  Only works in GHCi.
                      One day maybe this could save the byte code in a file
                      when used outside GHCi.
      
        (names chosen for consistency with -fno-code).
      
      Changes to the GHC API: newSession no longer takes the GhcMode
      argument.  The GhcMode defaults to CompManager, which is usually what
      you want.  To do JustTypecheck now, just set hscTarget to HscNothing.
      3c22606b
  12. 22 Mar, 2007 1 commit
    • simonpj@microsoft.com's avatar
      Add -ddump-mod-cycles to -M behaviour · a896a832
      simonpj@microsoft.com authored
      This patch adds a flag -ddump-mod-cycles to the "ghc -M" dependency analyser.
      
      The effect of
      	ghc -M -ddump-mod-cycles
      is to dump a list of cycles foud in the module graph.  The display is
      trimmed so that only dependencies within the cycle are shown; and the
      list of modules in a cycle is itself sorted into dependency order, so that
      it is easy to track the chain of dependencies.
      
      Open question: should the flag be "-ddump-mod-cycles" or "-optdep-dump-mod-cycles"?  For this reason I have not yet added to the documentation.
      a896a832
  13. 09 Feb, 2007 1 commit
    • simonpj@microsoft.com's avatar
      Major improvement to SpecConstr · cac2aca1
      simonpj@microsoft.com authored
      This patch improves the SpecConstr pass, by 
        a) making it work with join points
        b) making it generate specialisations transitively
      
      As part of it, SpecConstr now carries a substitution with it, which
      runs over the whole program as it goes.  This turned out to be 
      a big win; simplified the implementation quite a bit.
      
      I have *disabled* the specialisation on lambdas; it's pretty fragile,
      and sometimes generates more and more specialisations. Something to
      come back to, perhaps.
      
      I rejigged the flag-handling a bit.  Now the specification of passes
      in DynFlags is a bit nicer; see
      	- optLevelFlags top-level data structure
      	- runWhen function
      	- CoreDoPasses constructor
      
      There are now command-line flags
      	-fspec-constr
      	-fliberate-case
      	-fspec-threshold=N
      which do the obvious thing.  -O2 switches on both spec-constr and liberate-case.
      You can use -fno-liberate-case, -fno-spec-constr after -O2 to switch them off again.
      
      The spec-threshold applies to both these transformations; default value 200 for now.
      
      
      
      
      cac2aca1
  14. 07 Feb, 2007 2 commits
  15. 21 Dec, 2006 1 commit
    • lennart@augustsson.net's avatar
      Add support for overloaded string literals. · 90dc9026
      lennart@augustsson.net authored
      The class is named IsString with the single method fromString.
      Overloaded strings work the same way as overloaded numeric literals.
      In expressions a string literals gets a fromString applied to it.
      In a pattern there will be an equality comparison with the fromString:ed literal.
      
      Use -foverloaded-strings to enable this extension.
       
      90dc9026
  16. 12 Jan, 2007 1 commit
  17. 11 Jan, 2007 2 commits
  18. 09 Jan, 2007 1 commit
  19. 16 Dec, 2006 1 commit
  20. 11 Dec, 2006 2 commits
  21. 10 Dec, 2006 2 commits
  22. 09 Dec, 2006 1 commit
  23. 01 Dec, 2006 1 commit
    • wolfgang.thaller@gmx.net's avatar
      Decouple -O from -fvia-C · 8971f720
      wolfgang.thaller@gmx.net authored
      Nowadays, there are situations where -fvia-C is definitely unwanted, such
      as when -fPIC is used on some platforms, so we do not want implicit -fvia-C
      any more.
      8971f720
  24. 29 Nov, 2006 1 commit
    • andy@galois.com's avatar
      TickBox representation change · 8100cd43
      andy@galois.com authored
      This changes the internal representation of TickBoxes,
      from
              Note (TickBox "module" n)  <expr>
      into
      
              case tick<module,n> of
                _ -> <expr>
      
      tick has type :: #State #World, when the module and tick numbe
      are stored inside IdInfo.
      
      Binary tick boxes change from
      
               Note (BinaryTickBox "module" t f) <expr>
      
      into
      
                btick<module,t,f> <expr>
      
      btick has type :: Bool -> Bool, with the module and tick number
      stored inside IdInfo.
      8100cd43
  25. 20 Nov, 2006 1 commit
  26. 24 Oct, 2006 1 commit
    • andy@galois.com's avatar
      Haskell Program Coverage · d5934bbb
      andy@galois.com authored
      This large checkin is the new ghc version of Haskell
      Program Coverage, an expression-level coverage tool for Haskell.
      
      Parts:
      
       - Hpc.[ch] - small runtime support for Hpc; reading/writing *.tix files.
       - Coverage.lhs - Annotates the HsSyn with coverage tickboxes.
        - New Note's in Core,
            - TickBox      -- ticked on entry to sub-expression
            - BinaryTickBox  -- ticked on exit to sub-expression, depending
      	       	     -- on the boolean result.
      
        - New Stg level TickBox (no BinaryTickBoxes, though) 
      
      You can run the coverage tool with -fhpc at compile time. 
      Main must be compiled with -fhpc. 
      				      
      d5934bbb
  27. 11 Oct, 2006 1 commit
  28. 05 Oct, 2006 1 commit
  29. 04 Oct, 2006 1 commit
  30. 27 Sep, 2006 2 commits
  31. 20 Sep, 2006 1 commit
    • chak@cse.unsw.edu.au.'s avatar
      Option -findexed-types · 284d83ee
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 19:42:48 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Option -findexed-types
        Fri Sep  8 21:35:37 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Option -findexed-types
          - Introduced the switch -findexed-types to activate the indexed type family 
            framework.
          - The switch enables the special 'family' and allows kind signatures (which are
            currently compulsory for associated families).
      284d83ee
  32. 19 Sep, 2006 1 commit
    • Simon Marlow's avatar
      Packages cleanup, and allow new packages to be loaded with :set again · ee565d46
      Simon Marlow authored
      This cleans up the package subsystem a little.  There are some
      changes to the GHC API as a result.
      
        - GHC.init and GHC.initFromArgs are no longer necessary.
      
        - GHC.newSession takes the root of the GHC tree as an argument
          (previously passed to GHC.init).
      
        - You *must* do GHC.setSessionDynFlags after GHC.newSession,
          this is what loads the package database.
      
        - Several global vars removed from SysTools
      
        - The :set command in GHCi can now cause new packages to be loaded,
          or can hide/ignore existing packages.
      ee565d46