1. 25 Dec, 2007 1 commit
    • chevalier@alum.wellesley.edu's avatar
      Extend API for compiling to and from Core · 98c68a1c
      chevalier@alum.wellesley.edu authored
      Added API support for compiling Haskell to simplified Core, and for
      compiling Core to machine code. The latter, especially, should be
      considered experimental and has only been given cursory testing. Also
      fixed warnings in DriverPipeline. Merry Christmas.
      98c68a1c
  2. 30 Nov, 2007 1 commit
  3. 14 Nov, 2007 1 commit
  4. 07 Nov, 2007 1 commit
    • Simon Marlow's avatar
      #1617: Add :browse! and various other additions to GHCi · 806ab633
      Simon Marlow authored
         
        - :browse!
          a variant of :browse that lists children separately,
          not in context, and gives import qualifiers in comments
      
      SimonM: I also added sorting by source location for interpreted
      modules in :browse, and alphabetic sorting by name otherwise.  For
      :browse *M, the locally-defined names come before the external ones.
      
        - :{ ..lines.. :} (multiline commands)
          allow existing commands to be spread over multiple lines
          to improve readability, both interactively and in .ghci
          (includes a refactoring that unifies the previous three
          command loops into one, runCommands, fed from cmdqueue,
          file, or readline)
      
        - :set
            now shows GHCi-specific flag settings (printing/
            debugger), as well as non-language dynamic flag 
            settings
          :show languages
            show active language flags
          :show packages
            show active package flags as well as implicitly 
            loaded packages
      806ab633
  5. 06 Nov, 2007 2 commits
    • Simon Marlow's avatar
      fix stage 1 compilation · e019188e
      Simon Marlow authored
      e019188e
    • Simon Marlow's avatar
      GHC API: add checkAndLoadModule · 7379e82a
      Simon Marlow authored
      Does what the name suggests: it performs the function of both
      checkModule and load on that module, avoiding the need to process each
      module twice when checking a batch of modules.  This will make Haddock
      and ghctags much faster.
      
      Along with this is the beginnings of a refactoring of the HscMain
      interface.  HscMain now exports functions for separately running the
      parser, typechecher, and generating ModIface and ModDetails.
      Eventually the plan is to complete this interface and use it to
      replace the existing one.
      7379e82a
  6. 25 Jun, 2007 1 commit
  7. 27 Oct, 2007 1 commit
    • chevalier@alum.wellesley.edu's avatar
      Make compileToCore return the module name and type environment along with bindings · 8102af4e
      chevalier@alum.wellesley.edu authored
        compileToCore returned just a list of CoreBind, which isn't enough,
      since to do anything with the resulting Core code, you probably also
      want the type declarations. I left compileToCore as it is, but added a
      function compileToCoreModule that returns a complete Core module (with
      module name, type environment, and bindings). I'm not sure that
      returning the type environment is the best way to represent the type
      declarations for the given module, but I don't want to reinvent the
      External Core wheel for this.
      8102af4e
  8. 03 Oct, 2007 1 commit
  9. 11 Sep, 2007 1 commit
    • simonpj@microsoft.com's avatar
      Define and use PprTyThing.pprTypeForUser · 046feb1e
      simonpj@microsoft.com authored
      When printing types for the user, the interactive UI often wants to
      leave foralls implicit.  But then (as Claus points out) we need to be
      careful about name capture. For example with this source program
      
      	class C a b where
      	  op :: forall a. a -> b
      
      we were erroneously displaying the class in GHCi (with suppressed
      foralls) thus:
      
      	class C a b where
      	  op :: a -> b
      
      which is utterly wrong. 
      
      This patch fixes the problem, removes GHC.dropForAlls (which is dangerous),
      and instead supplies PprTyThing.pprTypeForUser, which does the right thing.
      
      046feb1e
  10. 10 Sep, 2007 1 commit
  11. 11 Sep, 2007 1 commit
  12. 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
  13. 08 Sep, 2007 1 commit
  14. 06 Sep, 2007 1 commit
    • Simon Marlow's avatar
      FIX #1465, error messages could sometimes say things like "A.T doesn't match A.T" · 42181975
      Simon Marlow authored
      This turned out to be a black hole, however we believe we now have a
      plan that does the right thing and shouldn't need to change again.
      Error messages will only ever refer to a name in an unambiguous way,
      falling back to <package>:<module>.<name> if no unambiguous shorter
      variant can be found.  See HscTypes.mkPrintUnqualified for the
      details.
      
      Earlier hacks to work around this problem have been removed (TcSimplify).
      42181975
  15. 05 Sep, 2007 3 commits
    • nr@eecs.harvard.edu's avatar
      change of representation for GenCmm, GenCmmTop, CmmProc · 16dc208a
      nr@eecs.harvard.edu authored
      The type parameter to a C-- procedure now represents a control-flow
      graph, not a single instruction.  The newtype ListGraph preserves the 
      current representation while enabling other representations and a
      sensible way of prettyprinting.  Except for a few changes in the
      prettyprinter the new compiler binary should be bit-for-bit identical
      to the old.
      16dc208a
    • Simon Marlow's avatar
      fix warnings · 81f944da
      Simon Marlow authored
      81f944da
    • Simon Marlow's avatar
      FIX #1650: ".boot modules interact badly with the ghci debugger" · e2782137
      Simon Marlow authored
      In fact hs-boot files had nothing to do with it: the problem was that
      GHCi would forget the breakpoint information for a module that had
      been reloaded but not recompiled.  It's amazing that we never noticed
      this before.
      
      The ModBreaks were in the ModDetails, which was the wrong place.  When
      we avoid recompiling a module, ModDetails is regenerated from ModIface
      by typecheckIface, and at that point it has no idea what the ModBreaks
      should be, so typecheckIface made it empty.  The right place for the
      ModBreaks to go is with the Linkable, which is retained when
      compilation is avoided.  So now I've placed the ModBreaks in with the
      CompiledByteCode, which also makes it clear that only byte-code
      modules have breakpoints.
      
      This fixes break022/break023
      e2782137
  16. 04 Sep, 2007 1 commit
  17. 03 Sep, 2007 1 commit
  18. 01 Sep, 2007 1 commit
  19. 27 Aug, 2007 1 commit
  20. 26 Aug, 2007 1 commit
  21. 24 Aug, 2007 1 commit
    • mnislaih's avatar
      A partial attempt to improve :stepover · 99794f66
      mnislaih authored
        
        With this patch, :stepover can effectively appear to step over recursive calls and 
        calls to locally bound functions (in a where clause).
        
        However, when we run out of ticks in the current expression, 
        the illusion vanishes and laziness brings us to the body of the last function 
        we "stepped over". 
        This is not desired at all, it is potentially very confusing.
        As a countermeasure, when this happens :stepover emits a warning
      
           "Warning: no more breakpoints in this function body, switching to :step"  
      99794f66
  22. 22 Aug, 2007 1 commit
    • mnislaih's avatar
      A partial attempt to improve :stepover · 24ee7541
      mnislaih authored
        
        With this patch, :stepover can effectively appear to step over recursive calls and 
        calls to locally bound functions (in a where clause).
        
        However, when we run out of ticks in the current expression, 
        the illusion vanishes and laziness brings us to the body of the last function 
        we "stepped over". 
        This is not desired at all, it is potentially very confusing.
        As a countermeasure, when this happens :stepover emits a warning
      
           "Warning: no more breakpoints in this function body, switching to :step"  
      24ee7541
  23. 20 Aug, 2007 1 commit
  24. 18 Aug, 2007 2 commits
  25. 15 Aug, 2007 1 commit
  26. 09 Aug, 2007 1 commit
    • mnislaih's avatar
      A new :stepover command for the debugger · fcd7ba21
      mnislaih authored
        
        Step from statement to statement without leaving the block. 
        Tries to do the sensible thing when used on expressions.
            
            The idea is to:
            1 - Step to the next breakpoint and examine the srcloc
            2 - If it is contained in the same statement block as we were, 
                then stop and give control to the user, 
              else continue to the next breakpoint
            3 - Repeat from 1. If we reach the end of the statement block,
                i.e. no more ticks in this expression after the current one, 
                then step normally.
        
        Replace statement block with 'declaration block' (of an expression) in the
        pseudo algo. above.
        Let's see how well this idea works in practice...
      fcd7ba21
  27. 29 Jun, 2007 1 commit
    • chevalier@alum.wellesley.edu's avatar
      Further compileToCore improvements · 78f4da28
      chevalier@alum.wellesley.edu authored
      Per suggestions from Simon M:
      
      * Changed GHC.checkModule so that it doesn't call depanal.
      * Changed GHC.checkModule to optionally return Core bindings
      as a component of the CheckedModule that it returns (and 
      resulting changes to HscMain.hscFileCheck).
      * As a result, simplified GHC.compileToCore and changed it
      to load the given file so that the caller doesn't have to.
      78f4da28
  28. 27 Jun, 2007 1 commit
  29. 25 Jun, 2007 1 commit
    • chevalier@alum.wellesley.edu's avatar
      Add a compileToCore function to the GHC API · d7230e53
      chevalier@alum.wellesley.edu authored
      Added a compileToCore function to the GHC API that takes a
        session, module, and filename, and returns a list of Core
        bindings if successful. This is just a first try and could
        probably be improved (for example, there's probably a way to
        get the filename from the module so that it doesn't have to 
        be passed in, I just don't see it offhand.)
      d7230e53
  30. 05 Jun, 2007 2 commits
  31. 30 May, 2007 1 commit
  32. 11 May, 2007 1 commit
  33. 10 May, 2007 1 commit
  34. 07 May, 2007 1 commit
  35. 03 May, 2007 1 commit
    • Simon Marlow's avatar
      Add history/trace functionality to the GHCi debugger · e1b89960
      Simon Marlow authored
      The debugger can now log each step of the evaluation without actually
      stopping, keeping a history of the recent steps (currently 50).  When
      a (real) breakpoint is hit, you can examine previous steps in the
      history (and their free variables) using the :history, :back and
      :forward commands.
      e1b89960