1. 18 Jun, 2011 3 commits
  2. 14 Jun, 2011 2 commits
  3. 09 Jun, 2011 1 commit
    • Ian Lynagh's avatar
      Refactor SrcLoc and SrcSpan · b2bd63f9
      Ian Lynagh authored
      The "Unhelpful" cases are now in a separate type. This allows us to
      improve various things, e.g.:
      * Most of the panic's in SrcLoc are now gone
      * The Lexer now works with RealSrcSpans rather than SrcSpans, i.e. it
        knows that it has real locations and thus can assume that the line
        number etc really exists
      * Some of the more suspicious cases are no longer necessary, e.g.
        we no longer need this case in advanceSrcLoc:
            advanceSrcLoc loc _ = loc -- Better than nothing
      
      More improvements can probably be made, e.g. tick locations can
      probably use RealSrcSpans too.
      b2bd63f9
  4. 31 May, 2011 1 commit
  5. 28 Apr, 2011 1 commit
  6. 26 Apr, 2011 1 commit
  7. 12 Apr, 2011 1 commit
    • Simon Marlow's avatar
      Change the way module initialisation is done (#3252, #4417) · a52ff761
      Simon Marlow authored
      Previously the code generator generated small code fragments labelled
      with __stginit_M for each module M, and these performed whatever
      initialisation was necessary for that module and recursively invoked
      the initialisation functions for imported modules.  This appraoch had
      drawbacks:
      
       - FFI users had to call hs_add_root() to ensure the correct
         initialisation routines were called.  This is a non-standard,
         and ugly, API.
      
       - unless we were using -split-objs, the __stginit dependencies would
         entail linking the whole transitive closure of modules imported,
         whether they were actually used or not.  In an extreme case (#4387,
         #4417), a module from GHC might be imported for use in Template
         Haskell or an annotation, and that would force the whole of GHC to
         be needlessly linked into the final executable.
      
      So now instead we do our initialisation with C functions marked with
      __attribute__((constructor)), which are automatically invoked at
      program startup time (or DSO load-time).  The C initialisers are
      emitted into the stub.c file.  This means that every time we compile
      with -prof or -hpc, we now get a stub file, but thanks to #3687 that
      is now invisible to the user.
      
      There are some refactorings in the RTS (particularly for HPC) to
      handle the fact that initialisers now get run earlier than they did
      before.
      
      The __stginit symbols are still generated, and the hs_add_root()
      function still exists (but does nothing), for backwards compatibility.
      a52ff761
  8. 05 Apr, 2011 1 commit
    • Simon Marlow's avatar
      Merge _stub.o files into the main .o file (Fixes #3687 and #706) · 7b0ff179
      Simon Marlow authored
      Now GHC still generates the _stub.c files, but the object file is
      automatically merged into the main .o file for a module.  This means
      that build systems (including GHC's own) no longer need to worry about
      looking for _stub.o files and including them when linking.
      
      I had to do lots of refactoring in DriverPipeline to make this work;
      now there's a monad to carry around all the information, and
      everything is a lot tidier.
      
      The _stub.c is now created as a temporary file and removed after
      compilation (unless the -keep-tmp-files flag is on).
      7b0ff179
  9. 03 Apr, 2011 2 commits
  10. 22 Mar, 2011 1 commit
    • Edward Z. Yang's avatar
      Split out "Raw Cmm" dump to its own flag -ddump-raw-cmm · 419821c7
      Edward Z. Yang authored
      Previously, -ddump-cmmz was used to dump out the "Raw Cmm" right
      before it gets passed to the backends, as well as all of the
      intermediate phases in the new code generator.  Unfortunately,
      there are a lot of intermediate phases, which means -ddump-cmmz
      takes a very long time with -fnew-codegen for large programs,
      even if you're only interested in the final result.
      
      Here we split up -ddump-cmmz into -ddump-cmmz (now exclusively for
      the new code generator) and -ddump-raw-cmm (for both code generation
      paths.) The old flag was not documented in the manual, so hopefully
      not too many people will be surprised by this change.
      419821c7
  11. 26 Feb, 2011 1 commit
    • vivian's avatar
      :script file scripts in GHCi #1363 · eccb2d89
      vivian authored
      This patch adds the script command in GHCi
      
      A file is read and executed as a series of GHCi commands.
      
      Execution terminates on the first error.  The filename and
      line number are included in the error.
      eccb2d89
  12. 20 Feb, 2011 1 commit
    • chak@cse.unsw.edu.au.'s avatar
      Added a VECTORISE pragma · f2aaae97
      chak@cse.unsw.edu.au. authored
      - Added a pragma {-# VECTORISE var = exp #-} that prevents
        the vectoriser from vectorising the definition of 'var'.
        Instead it uses the binding '$v_var = exp' to vectorise
        'var'.  The vectoriser checks that the Core type of 'exp'
        matches the vectorised Core type of 'var'.  (It would be
        quite complicated to perform that check in the type checker
        as the vectorisation of a type needs the state of the VM
        monad.)
      - Added parts of a related VECTORISE SCALAR pragma
      - Documented -ddump-vect
      - Added -ddump-vt-trace
      - Some clean up
      f2aaae97
  13. 24 Jan, 2011 1 commit
    • Simon Marlow's avatar
      Merge in new code generator branch. · 889c084e
      Simon Marlow authored
      This changes the new code generator to make use of the Hoopl package
      for dataflow analysis.  Hoopl is a new boot package, and is maintained
      in a separate upstream git repository (as usual, GHC has its own
      lagging darcs mirror in http://darcs.haskell.org/packages/hoopl).
      
      During this merge I squashed recent history into one patch.  I tried
      to rebase, but the history had some internal conflicts of its own
      which made rebase extremely confusing, so I gave up. The history I
      squashed was:
      
        - Update new codegen to work with latest Hoopl
        - Add some notes on new code gen to cmm-notes
        - Enable Hoopl lag package.
        - Add SPJ note to cmm-notes
        - Improve GC calls on new code generator.
      
      Work in this branch was done by:
         - Milan Straka <fox@ucw.cz>
         - John Dias <dias@cs.tufts.edu>
         - David Terei <davidterei@gmail.com>
      
      Edward Z. Yang <ezyang@mit.edu> merged in further changes from GHC HEAD
      and fixed a few bugs.
      889c084e
  14. 17 Jan, 2011 1 commit
  15. 29 Oct, 2010 1 commit
  16. 27 Oct, 2010 1 commit
    • Simon Marlow's avatar
      Refactoring and tidyup of HscMain and related things (also fix #1666) · 94bf0d36
      Simon Marlow authored
      While trying to fix #1666 (-Werror aborts too early) I decided to some
      tidyup in GHC/DriverPipeline/HscMain.
      
       - The GhcMonad overloading is gone from DriverPipeline and HscMain
         now.  GhcMonad is now defined in a module of its own, and only
         used in the top-level GHC layer.  DriverPipeline and HscMain
         use the plain IO monad and take HscEnv as an argument.
      
       - WarnLogMonad is gone.  printExceptionAndWarnings is now called
         printException (the old name is deprecated).  Session no longer
         contains warnings.
      
       - HscMain has its own little monad that collects warnings, and also
         plumbs HscEnv around.  The idea here is that warnings are collected
         while we're in HscMain, but on exit from HscMain (any function) we
         check for warnings and either print them (via log_action, so IDEs
         can still override the printing), or turn them into an error if
         -Werror is on.
      
       - GhcApiCallbacks is gone, along with GHC.loadWithLogger.  Thomas
         Schilling told me he wasn't using these, and I don't see a good
         reason to have them.
      
       - there's a new pure API to the parser (suggestion from Neil Mitchell):
            parser :: String
                   -> DynFlags
                   -> FilePath
                   -> Either ErrorMessages (WarningMessages, 
                                            Located (HsModule RdrName))
      94bf0d36
  17. 19 Oct, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Clean up the debugger code · a40f2735
      simonpj@microsoft.com authored
      In particular there is much less fiddly skolemisation now
      Things are not *quite* right (break001 and 006 still fail), 
      but they are *much* better than before.
      a40f2735
  18. 13 Oct, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Remove GHC.extendGlobalRdrScope, GHC.extendGlobalTypeScope · 762c2432
      simonpj@microsoft.com authored
      These functions were added by
      
         Tue Apr 18 03:36:06 BST 2006  Lemmih <lemmih@gmail.com>
         * Make the initial rdr and type scope available in the ghc-api
      
      The are extremely dubious, because they extend the Rdr and Type
      env for every compilation.  The right thing to do is to use
      the InteractiveContext for temporary extensions.
      
      So far as we know, no one uses them.  And if they are being used
      it's probably a mistake.  So we're backing them out.
      762c2432
  19. 25 Aug, 2010 1 commit
  20. 16 Aug, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Refactor the command-line argument parsing (again) · 0cb74388
      simonpj@microsoft.com authored
      This change allows the client of CmdLineParser a bit more flexibility,
      by giving him an arbitrary computation (not just a deprecation
      message) for each flag.  
      
      There are several clients, so there are lots of boilerplate changes.
      
      Immediate motivation: if RTS is not profiled, we want to make 
      Template Haskell illegal.  That wasn't with the old setup.
      0cb74388
  21. 06 Jul, 2010 1 commit
  22. 25 Jun, 2010 1 commit
  23. 27 Apr, 2010 1 commit
    • Simon Marlow's avatar
      --make is now the default (#3515), and -fno-code works with --make (#3783) · 7828bf3e
      Simon Marlow authored
      If the command line contains any Haskell source files, then we behave
      as if --make had been given.
      
      The meaning of the -c flag has changed (back): -c now selects one-shot
      compilation, but stops before linking.  However, to retain backwards
      compatibility, -c is still allowed with --make, and means the same as
      --make -no-link.  The -no-link flag has been un-deprecated.
      
      -fno-code is now allowed with --make (#3783); the fact that it was
      disabled before was largely accidental, it seems.  We also had some
      regressions in this area: it seems that -fno-code was causing a .hc
      file to be emitted in certain cases.  I've tidied up the code, there
      was no need for -fno-code to be a "mode" flag, as far as I can tell.
      
      -fno-code does not emit interface files, nor does it do recompilation
      checking, as suggested in #3783.  This would make Haddock emit
      interface files, for example, and I'm fairly sure we don't want to do
      that.  Compiling with -fno-code is pretty quick anyway, perhaps we can
      get away without recompilation checking.
      7828bf3e
  24. 20 Mar, 2010 1 commit
  25. 12 Jan, 2010 1 commit
    • Simon Marlow's avatar
      Do some recompilation avoidance in GHC.loadModule · ce426964
      Simon Marlow authored
      GHC.loadModule compiles a module after it has been parsed and
      typechecked explicity. If we are compiling to object code and there is
      a valid object file already on disk, then we can skip the compilation
      step. This is useful in Haddock, when processing a package that uses
      Template Haskell and hence needs actual compilation, and the package
      has already been compiled.
      
      As usual, the recomp avoidance can be disabled with -fforce-recomp.
      ce426964
  26. 04 Jan, 2010 1 commit
  27. 27 Nov, 2009 1 commit
  28. 18 Sep, 2009 1 commit
  29. 11 Sep, 2009 1 commit
  30. 26 Aug, 2009 1 commit
  31. 18 Aug, 2009 1 commit
    • Thomas Schilling's avatar
      Remove the lock around NameCache for readBinIface. · cadba810
      Thomas Schilling authored
      Turns out using atomic update instead of a full-blown lock was easier
      than I thought.  It should also be safe in the case where we
      concurrently read the same interface file.  Whichever thread loses the
      race will simply find that all of the names are already defined and
      will have no effect on the name cache.
      cadba810
  32. 17 Aug, 2009 1 commit
    • Thomas Schilling's avatar
      Make access to NameCache atomic. Sometimes needs a lock. · 9f68c348
      Thomas Schilling authored
      'readBinIface' updates the name cache in a way that is hard to use
      with atomicModifyIORef, so this patch introduces a lock for this case.
      All other updates use atomicModifyIORef.
      
      Having a single lock is quite pessimistic, so it remains to be seen
      whether this will become a problem.  In principle we only need to make
      sure that we do not load the same file concurrently (or that it's
      idempotent).  In practice we also need to ensure that concurrent reads
      do not cancel each other out (since the new NameCache may be based on
      an outdated version).
      9f68c348
  33. 06 Jul, 2009 2 commits
  34. 01 Jul, 2009 1 commit
  35. 03 Mar, 2009 1 commit
    • dias@eecs.harvard.edu's avatar
      A few bug fixes; some improvements spurred by paper writing · 31a9d048
      dias@eecs.harvard.edu authored
      Among others:
      - Fixed Stg->C-- translation of let-no-escapes -- it's important to use the
        right continuation...
      - Fixed infinite recursion in X86 backend (shortcutJump mishandled infinite loops)
      - Fixed yet another wrong calling convention -- primops take args only in vanilla regs,
        but they may return results on the stack!
      - Removed StackInfo from LGraph and Block -- now in LastCall and CmmZ
      - Updated avail-variable and liveness code
      31a9d048