1. 21 Sep, 2017 1 commit
  2. 06 Sep, 2017 1 commit
    • Moritz Angermann's avatar
      Clean up opt and llc · 22733532
      Moritz Angermann authored
      The LLVM backend shells out to LLVMs `opt` and `llc` tools. This clean
      up introduces a shared data structure to carry the arguments we pass to
      each tool so that corresponding flags are next to each other. It drops
      the hard coded data layouts in favor of using `-mtriple` and have LLVM
      infer them. Furthermore we add `clang` as a proper tool, so we don't
      rely on assuming that `clang` is called `clang` on the `PATH` when using
      `clang` as the assembler.  Finally this diff also changes the type of
      `optLevel` from `Int` to `Word`, as we do not have negative optimization
      levels.
      
      Reviewers: erikd, hvr, austin, rwbarton, bgamari, kavon
      
      Reviewed By: kavon
      
      Subscribers: michalt, Ericson2314, ryantrinkle, dfeuer, carter, simonpj,
      kavon, simonmar, thomie, erikd, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3352
      22733532
  3. 18 Jul, 2017 1 commit
    • niteria's avatar
      Make module membership on ModuleGraph faster · b8fec695
      niteria authored
      When loading/reloading with a large number of modules
      (>5000) the cost of linear lookups becomes significant.
      
      The changes here made `:reload` go from 6s to 1s on my
      test case.
      
      The bottlenecks were `needsLinker` in `DriverPipeline` and
      `getModLoop` in `GhcMake`.
      
      Test Plan: ./validate
      
      Reviewers: simonmar, austin, bgamari
      
      Subscribers: thomie, rwbarton
      
      Differential Revision: https://phabricator.haskell.org/D3703
      b8fec695
  4. 11 Jul, 2017 1 commit
  5. 27 Jun, 2017 2 commits
  6. 21 Jun, 2017 1 commit
  7. 08 Jun, 2017 1 commit
    • Douglas Wilson's avatar
      Refactor temp files cleanup · 3ee3822c
      Douglas Wilson authored
      Remove filesToNotIntermediateClean from DynFlags, create a data type
      FilesToClean, and change filesToClean in DynFlags to be a FilesToClean.
      
      Modify SysTools.newTempName and the Temporary constructor of
      PipelineMonad.PipelineOutput to take a TempFileLifetime, which specifies
      whether a temp file should live until the end of GhcMonad.withSession,
      or until the next time cleanIntermediateTempFiles is called.
      
      These changes allow the cleaning of intermediate files in GhcMake to be
      much more efficient.
      
      HscTypes.hptObjs is removed as it is no longer used.
      
      A new performance test T13701 is added, which passes both with and
      without -keep-tmp-files.  The test fails by 25% without the patch, and
      passes when -keep-tmp-files is added.
      
      Note that there are still at two hotspots caused by
      algorithms quadratic in the number of modules, however neither of them
      allocate. They are:
      
      * DriverPipeline.compileOne'.needsLinker
      * GhcMake.getModLoop
      
      DriverPipeline.compileOne'.needsLinker is changed slightly to improve
      the situation.
      
      I don't like adding these Types to DynFlags, but they need to be seen by
      Dynflags, SysTools and PipelineMonad. The alternative seems to be to
      create a new module.
      
      Reviewers: austin, hvr, bgamari, dfeuer, niteria, simonmar, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #13701
      
      Differential Revision: https://phabricator.haskell.org/D3620
      3ee3822c
  8. 05 Jun, 2017 1 commit
    • Alan Zimmerman's avatar
      Udate hsSyn AST to use Trees that Grow · 8e6ec0fa
      Alan Zimmerman authored
      Summary:
      See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow
      
      This commit prepares the ground for a full extensible AST, by replacing the type
      parameter for the hsSyn data types with a set of indices into type families,
      
          data GhcPs -- ^ Index for GHC parser output
          data GhcRn -- ^ Index for GHC renamer output
          data GhcTc -- ^ Index for GHC typechecker output
      
      These are now used instead of `RdrName`, `Name` and `Id`/`TcId`/`Var`
      
      Where the original name type is required in a polymorphic context, this is
      accessible via the IdP type family, defined as
      
          type family IdP p
          type instance IdP GhcPs = RdrName
          type instance IdP GhcRn = Name
          type instance IdP GhcTc = Id
      
      These types are declared in the new 'hsSyn/HsExtension.hs' module.
      
      To gain a better understanding of the extension mechanism, it has been applied
      to `HsLit` only, also replacing the `SourceText` fields in them with extension
      types.
      
      To preserve extension generality, a type class is introduced to capture the
      `SourceText` interface, which must be honoured by all of the extension points
      which originally had a `SourceText`.  The class is defined as
      
          class HasSourceText a where
            -- Provide setters to mimic existing constructors
            noSourceText  :: a
            sourceText    :: String -> a
      
            setSourceText :: SourceText -> a
            getSourceText :: a -> SourceText
      
      And the constraint is captured in `SourceTextX`, which is a constraint type
      listing all the extension points that make use of the class.
      
      Updating Haddock submodule to match.
      
      Test Plan: ./validate
      
      Reviewers: simonpj, shayan-najd, goldfire, austin, bgamari
      
      Subscribers: rwbarton, thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D3609
      8e6ec0fa
  9. 12 May, 2017 1 commit
  10. 29 Apr, 2017 2 commits
  11. 25 Apr, 2017 1 commit
    • Simon Marlow's avatar
      Don't setProgramDynFlags on every :load · 914842e5
      Simon Marlow authored
      Summary:
      setProgramDynFlags invalidates the whole module graph, forcing
      everything to be re-summarised (including preprocessing) on every
      :reload.
      
      Looks like this was a bad regression in 8.0, but we didn't notice
      because there was no test for it.  Now there is!
      
      Test Plan:
      * validate
      * new unit test
      
      Reviewers: bgamari, triple, austin, niteria, erikd, jme
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3398
      914842e5
  12. 18 Apr, 2017 1 commit
  13. 05 Apr, 2017 1 commit
  14. 04 Apr, 2017 1 commit
  15. 02 Apr, 2017 1 commit
  16. 01 Apr, 2017 1 commit
    • Simon Marlow's avatar
      Optimise common cases of GHC.setProgramDynFlags · 3b5f786c
      Simon Marlow authored
      * If the package flags haven't changed, don't do initPackages (which
        might take multiple seconds in extreme cases)
      
      * Provide a way to change the log_action without invalidating the
        summary cache.
      
      Test Plan: validate
      
      Reviewers: niteria, bgamari, austin, erikd, ezyang
      
      Reviewed By: bgamari
      
      Subscribers: mpickering, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3392
      3b5f786c
  17. 28 Mar, 2017 1 commit
  18. 24 Mar, 2017 1 commit
    • Rufflewind's avatar
      Allow colors to be customized · adf27d61
      Rufflewind authored
      Allow customization of diagnostic colors through the GHC_COLORS
      environment variable.  Some color-related code have been refactored to
      PprColour to reduce the circular dependence between DynFlags,
      Outputable, ErrUtils.  Some color functions that were part of Outputable
      but were never used have been deleted.
      
      Test Plan: validate
      
      Reviewers: austin, hvr, bgamari, dfeuer
      
      Reviewed By: bgamari, dfeuer
      
      Subscribers: dfeuer, rwbarton, thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3364
      adf27d61
  19. 02 Mar, 2017 1 commit
  20. 10 Feb, 2017 1 commit
  21. 09 Feb, 2017 1 commit
  22. 20 Jan, 2017 1 commit
    • Phil de Joux's avatar
      Show explicit quantifiers in conflicting definitions error · 33140f41
      Phil de Joux authored
      This fixes #12441, where definitions in a Haskell module and its boot
      file which differed only in their quantifiers produced a confusing error
      message. Here we teach GHC to always show quantifiers for these errors.
      
      Reviewers: goldfire, simonmar, erikd, austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: snowleopard, simonpj, mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2734
      
      GHC Trac Issues: #12441
      33140f41
  23. 16 Nov, 2016 2 commits
    • Simon Marlow's avatar
      Generalise the implicit prelude import · d3542fad
      Simon Marlow authored
      Now it's possible to have two lists of imports:
      * extra_imports are imports that are always added to the context
      * prelude_imports are imports that are added if we don't have
        any open modules in scope.
      
      No UI changes or new commands are added for now.  This was functionality
      that we needed in our customized GHCi at Facebook, so I wanted to get it
      upstream to reduce the differences between our version and the upstream
      version.
      d3542fad
    • Simon Marlow's avatar
      Avoid calling newDynFlags when there are no changes · 7acee066
      Simon Marlow authored
      This is a small optimisation for :set and :unset
      7acee066
  24. 03 Nov, 2016 1 commit
  25. 02 Nov, 2016 1 commit
    • Sylvain HENRY's avatar
      Uninstall signal handlers · 8a5960ad
      Sylvain HENRY authored
      GHC installs signal handlers in runGhc/runGhcT to handle ^C but it
      never uninstalls them.
      It can be an issue, especially when using GHC as a library.
      
      Test Plan: validate
      
      Reviewers: bgamari, erikd, austin, simonmar
      
      Reviewed By: bgamari, simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2633
      
      GHC Trac Issues: #4162
      8a5960ad
  26. 08 Oct, 2016 1 commit
  27. 31 Aug, 2016 1 commit
  28. 23 Jun, 2016 1 commit
  29. 01 May, 2016 1 commit
    • niksaz's avatar
      Greater customization of GHCi prompt · 533037cc
      niksaz authored
      This patch is trying to redesign the :set prompt option to take not a
      String but a Haskell function, like [String] -> Int -> IO String, where
      [String] is the list of the names of the currently loaded modules and
      Int is the line number. Currently you may set prompt function with
      **:set promt-function [String] -> Int -> IO String** option and old
      version is also available - :set prompt String.
      
      So, it looks like I've almost completed this patch:
      
      1) Now we have a lot of escape sequences - 13 to be exact. Most of them
         are similar to bash prompt escape sequences. Thus they are quite handy.
      
      2) We may use the special escape sequence to call shell functions, for
         example "%call(ls -l -a)".
      
      3) We may use :set prompt-function to set PFunction to handle prompt.
         It is just [String] -> Int -> IO String.
      
      Reviewers: erikd, austin, mpickering, bgamari
      
      Reviewed By: mpickering, bgamari
      
      Subscribers: mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2084
      
      GHC Trac Issues: #5850
      533037cc
  30. 12 Mar, 2016 1 commit
  31. 05 Mar, 2016 1 commit
  32. 25 Feb, 2016 1 commit
    • barrucadu's avatar
      Print which warning-flag controls an emitted warning · bb5afd3c
      barrucadu authored
      Both gcc and clang tell which warning flag a reported warning can be
      controlled with, this patch makes ghc do the same. More generally, this
      allows for annotated compiler output, where an optional annotation is
      displayed in brackets after the severity.
      
      This also adds a new flag `-f(no-)show-warning-groups` to control
      whether to show which warning-group (such as `-Wall` or `-Wcompat`)
      a warning belongs to. This flag is on by default.
      
      This implements #10752
      
      Reviewed By: quchen, bgamari, hvr
      
      Differential Revision: https://phabricator.haskell.org/D1943
      bb5afd3c
  33. 11 Feb, 2016 1 commit
  34. 27 Jan, 2016 1 commit
  35. 22 Jan, 2016 1 commit
  36. 18 Jan, 2016 1 commit
  37. 17 Jan, 2016 1 commit