1. 28 Oct, 2008 2 commits
  2. 30 Oct, 2008 1 commit
    • simonpj@microsoft.com's avatar
      Add (a) CoreM monad, (b) new Annotations feature · 9bcd95ba
      simonpj@microsoft.com authored
      This patch, written by Max Bolingbroke,  does two things
      
      1.  It adds a new CoreM monad (defined in simplCore/CoreMonad),
          which is used as the top-level monad for all the Core-to-Core
          transformations (starting at SimplCore).  It supports
             * I/O (for debug printing)
             * Unique supply
             * Statistics gathering
             * Access to the HscEnv, RuleBase, Annotations, Module
          The patch therefore refactors the top "skin" of every Core-to-Core
          pass, but does not change their functionality.
      
      2.  It adds a completely new facility to GHC: Core "annotations".
          The idea is that you can say
             {#- ANN foo (Just "Hello") #-}
          which adds the annotation (Just "Hello") to the top level function
          foo.  These annotations can be looked up in any Core-to-Core pass,
          and are persisted into interface files.  (Hence a Core-to-Core pass
          can also query the annotations of imported things.)  Furthermore,
          a Core-to-Core pass can add new annotations (eg strictness info)
          of its own, which can be queried by importing modules.
      
      The design of the annotation system is somewhat in flux.  It's
      designed to work with the (upcoming) dynamic plug-ins mechanism,
      but is meanwhile independently useful.
      
      Do not merge to 6.10!  
      9bcd95ba
  3. 14 Oct, 2008 1 commit
  4. 20 Oct, 2008 1 commit
  5. 10 Oct, 2008 1 commit
  6. 08 Oct, 2008 1 commit
  7. 03 Oct, 2008 1 commit
    • Ian Lynagh's avatar
      Use an extensible-exceptions package when bootstrapping · 1f3a7730
      Ian Lynagh authored
      Ifdefs for whether we had extensible exceptions or not were spreading
      through GHC's source, and things would only have got worse for the next
      2-3 years, so instead we now use an implementation of extensible
      exceptions built on top of the old exception type.
      1f3a7730
  8. 02 Oct, 2008 1 commit
    • Thomas Schilling's avatar
      Let parseModule take a ModSummary like checkAndLoadModule did. · 766b34f8
      Thomas Schilling authored
      To get the ModSummary for a ModuleName getModSummary can be used.
      It's not called find* or lookup* because it assumes that the module is
      in the module graph and throws an exception if it cannot be found.
      Overall, I'm not quite sure about the usefulness of this function
      since the user has no control about which filetype to grab (hs or
      hs-boot).
      766b34f8
  9. 21 Sep, 2008 1 commit
  10. 23 Sep, 2008 1 commit
  11. 18 Sep, 2008 2 commits
    • pepe's avatar
      Fix a couple of issues with :print · decbb181
      pepe authored
            
            - Ticket #1995: Unsoundness with newtypes
            - Ticket #2475: "Can't unify" error when stopped at an exception
            
            In addition this patch adds the following:
            
            - Unfailingness: RTTI cannot panic anymore. 
              In case of failure, it recovers gracefully by returning the "I know nothing" type
            - A -ddump-rtti flag
      decbb181
    • Jedai's avatar
      RichTokenStream support · 36104d7a
      Jedai authored
      This patch adds support for raw token streams, that contain more
      information than normal token streams (they contains comments at
      least). The "lexTokenStream" function brings this support to the
      Lexer module. In addition to that, functions have been added to
      the GHC module to make easier to recover of the token stream of 
      a module ("getTokenStream").
      
      Building on that, I added what could be called "rich token
      stream": token stream to which have been added the source string
      corresponding to each token, the function addSourceToToken takes
      a StringBuffer and a starting SrcLoc and a token stream and build
      this rich token stream. getRichTokenStream is a convenience
      function to get a module rich token stream. "showRichTokenStream"
      use the SrcLoc information in such a token stream to get a string
      similar to the original source (except unsignificant
      whitespaces). Thus "putStrLn . showRichTokenStream =<<
      getRichTokenStream s mod" should print a valid module source, the
      interesting part being to modify the token stream between the get
      and the show of course.
      36104d7a
  12. 17 Sep, 2008 1 commit
    • Thomas Schilling's avatar
      Change 'loadWithCompiler' callback argument to just print warnings. · 6091f224
      Thomas Schilling authored
      Rename function accordingly.
      
      The callback wasn't very flexible to begin with.  There's pretty much
      no way around to calling 'compile' inside that callback since
      'upsweep' depends on certain side effects of compile.  It therefore
      makes more sense to restrict the callback to its intended use only,
      namely to log warnings and errors.
      6091f224
  13. 14 Sep, 2008 1 commit
    • Thomas Schilling's avatar
      Use 'GhcMonad' in GHC and split up checkModule into phases. · 1c7d0ac0
      Thomas Schilling authored
      I'm not sure I covered all the ways of throwing errors in the code.
      Some functions throw ProgramErrors, some error messages.  It's still
      quite a mess, but we're getting closer.  The missing cases are mostly
      errors that cannot be fixed by the API client either or are a result
      of wrong usage, so are in any case fatal.
      
      One function, 'getModuleInfo', still returns a 'Maybe', but the
      documentation suggests it should always succeed.  So I may change that
      soon.
      
      The spit-up of of 'checkModule' has pros and cons.  The various forms
      of 'checkModule*' now become:
      
       checkAndLoadModule ms False ~~>
          loadModule =<< typecheckModule =<< parseModule (ms_mod_name ms)
      
       checkAndLoadModule ms True ~~>
         loadModule =<< desugarModule =<< typecheckModule =<< parseModule (ms_mod_name ms)
      
       checkModule mn False ~~>
         typecheckModule =<< parseModule mn
      
       checkModule mn True ~~>
         desugarModule =<< typecheckModule =<< parseModule mn
      
      The old APIs cannot easily be provided, since the result type would be
      different depending on the second argument.  However, a more
      convenient API can be modelled on top of these four functions
      ({parse,typecheck,desugar,load}Module).
      1c7d0ac0
  14. 27 Aug, 2008 1 commit
    • Simon Marlow's avatar
      re-fix of #1205, fix #2542 · 3d73e45b
      Simon Marlow authored
      New form of :load in GHCi:
      
      > :load *A
      
      forces A to be loaded as byte-code.  See the manual for details.  The
      previous behaviour for specifying filenames vs. module names on the
      command line and in :load has been restored.
      
      The Target datatype has a new Bool field, which is True if the target
      is allowed to be loaded from compiled code, or False otherwise, so
      this functionality is available via the GHC API.  guessTarget
      understands the *-prefix form for specifying targets.
      3d73e45b
  15. 26 Aug, 2008 2 commits
  16. 05 Aug, 2008 1 commit
    • Simon Marlow's avatar
      Add -XPackageImports, new syntax for package-qualified imports · 1867a7bb
      Simon Marlow authored
      Now you can say
        
        import "network" Network.Socket
      
      and get Network.Socket from package "network", even if there are
      multiple Network.Socket modules in scope from different packages
      and/or the current package.
      
      This is not really intended for general use, it's mainly so that we
      can build backwards-compatible versions of packages, where we need to
      be able to do
      
      module GHC.Base (module New.GHC.Base) where
      import "base" GHC.Base as New.GHC.Base
      1867a7bb
  17. 07 Aug, 2008 1 commit
  18. 31 Jul, 2008 2 commits
  19. 30 Jul, 2008 1 commit
  20. 28 Jul, 2008 1 commit
    • Simon Marlow's avatar
      Complete the changes for #1205 · ca26fe60
      Simon Marlow authored
      Now ":load M" always searches for a module called "M", rather than
      using a file called "M.hs" if that exists.  To get the file semantics
      (i.e. not loading "M.o"), use ":load M.hs".
      ca26fe60
  21. 20 Jul, 2008 2 commits
  22. 14 Jul, 2008 1 commit
  23. 11 Jul, 2008 3 commits
  24. 09 Jul, 2008 1 commit
    • Simon Marlow's avatar
      #1205: ':load foo.hs' in GHCi always compiles to bytecode · 3897d02a
      Simon Marlow authored
      So now
      
        :load foo.hs       loads bytecode for foo.hs, even if foo.o exists
        :load foo          is just shorthand for :load foo.hs
        :load M            loads a module M, as object code if possible
                           (no change here)
      
        :set -fobject-code
        :load foo.hs       loads foo.hs as object code; an existing foo.o
                           can be used.
        
      This turned out to be very straightforward: when building the
      ModSummary for a file (summariseFile) we just ignore the object file
      unless -fobject-code is on.
      3897d02a
  25. 14 Jun, 2008 4 commits
  26. 29 May, 2008 1 commit
    • dias@eecs.harvard.edu's avatar
      Cmm back end upgrades · 25628e27
      dias@eecs.harvard.edu authored
      Several changes in this patch, partially bug fixes, partially new code:
      o bug fixes in ZipDataflow
         - added some checks to verify that facts converge
         - removed some erroneous checks of convergence on entry nodes
         - added some missing applications of transfer functions
      o changed dataflow clients to use ZipDataflow, making ZipDataflow0 obsolete
      o eliminated DFA monad (no need for separate analysis and rewriting monads with ZipDataflow)
      o started stack layout changes
         - no longer generating CopyIn and CopyOut nodes (not yet fully expunged though)
         - still not using proper calling conventions
      o simple new optimizations:
         - common block elimination
            -- have not yet tried to move the Adams opt out of CmmProcPointZ
         - block concatenation
      o piped optimization fuel up to the HscEnv
         - can be limited by a command-line flag
         - not tested, and probably not yet properly used by clients
      o added unique supply to FuelMonad, also lifted unique supply to DFMonad
      25628e27
  27. 12 Apr, 2008 1 commit
  28. 06 Apr, 2008 1 commit
  29. 29 Mar, 2008 1 commit
  30. 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