This project is mirrored from https://gitlab.haskell.org/ghc/ghc.git. Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
Last successful update .
  1. 20 Feb, 2017 1 commit
    • Simon Peyton Jones's avatar
      Change -dppr-ticks to -dsuppress-ticks · 2d5be63d
      Simon Peyton Jones authored
      I spent about two hours today hunting fruitlessly for a simplifier
      bug (when fixing Trac #13255), only to find that it was caused by
      -ddump-X silently suppressing all ticks in Core.
      
      I think this has happened to me once before.
      
      So I've changed to make tick-printing on by default (like coercions,
      etc), with a flag -dsuppress-ticks (like -dsuppress-coercions) to
      suppress them.
      
      Blargh.
      
      -dppr-ticks is still there, but deprecated.
      2d5be63d
  2. 08 Feb, 2017 1 commit
  3. 04 Feb, 2017 1 commit
  4. 03 Feb, 2017 1 commit
    • Sylvain Henry's avatar
      Ditch static flags · bbd3c399
      Sylvain Henry authored
      This patch converts the 4 lasting static flags (read from the command
      line and unsafely stored in immutable global variables) into dynamic
      flags. Most use cases have been converted into reading them from a DynFlags.
      
      In cases for which we don't have easy access to a DynFlags, we read from
      'unsafeGlobalDynFlags' that is set at the beginning of each 'runGhc'.
      It's not perfect (not thread-safe) but it is still better as we can
      set/unset these 4 flags before each run when using GHC API.
      
      Updates haddock submodule.
      
      Rebased and finished by: bgamari
      
      Test Plan: validate
      
      Reviewers: goldfire, erikd, hvr, austin, simonmar, bgamari
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2839
      
      GHC Trac Issues: #8440
      bbd3c399
  5. 31 Jan, 2017 1 commit
    • Daniel Haraj's avatar
      Use top-level instances to solve superclasses where possible · 748b7974
      Daniel Haraj authored
      This patch introduces a new flag `-fsolve-constant-dicts` which makes the
      constraint solver solve super class constraints with available dictionaries if
      possible. The flag is enabled by `-O1`.
      
      The motivation of this patch is that the compiler can produce more efficient
      code if the constraint solver used top-level instance declarations to solve
      constraints that are currently solved givens and their superclasses. In
      particular, as it currently stands, the compiler imposes a performance penalty
      on the common use-case where superclasses are bundled together for user
      convenience. The performance penalty applies to constraint synonyms as
      well. This example illustrates the issue:
      
      ```
      {-# LANGUAGE ConstraintKinds, MultiParamTypeClasses, FlexibleContexts #-}
      module B where
      
      class M a b where m :: a -> b
      
      type C a b = (Num a, M a b)
      
      f :: C Int b => b -> Int -> Int
      f _ x = x + 1
      ```
      
      Output without the patch, notice that we get the instance for `Num Int` by
      using the class selector `p1`.
      
      ```
      f :: forall b_arz. C Int b_arz => b_arz -> Int -> Int
      f =
        \ (@ b_a1EB) ($d(%,%)_a1EC :: C Int b_a1EB) _ (eta1_B1 :: Int) ->
          + @ Int
            (GHC.Classes.$p1(%,%) @ (Num Int) @ (M Int b_a1EB) $d(%,%)_a1EC)
            eta1_B1
            B.f1
      ```
      
      Output with the patch, nicely optimised code!
      
      ```
      f :: forall b. C Int b => b -> Int -> Int
      f =
        \ (@ b) _ _ (x_azg :: Int) ->
          case x_azg of { GHC.Types.I# x1_a1DP ->
          GHC.Types.I# (GHC.Prim.+# x1_a1DP 1#)
          }
      ```
      
      Reviewers: simonpj, bgamari, austin
      
      Reviewed By: simonpj
      
      Subscribers: mpickering, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2714
      
      GHC Trac Issues: #12791, #5835
      748b7974
  6. 30 Jan, 2017 1 commit
    • Matthew Pickering's avatar
      Add a flag to emit error messages as JSON · 91691117
      Matthew Pickering authored
      This patch adds the flag `-ddump-json` which dumps all the compiler
      output as a JSON array. This allows tooling to more easily parse GHC's
      output to display to users.
      
      The flag is currently experimental and will hopefully be refined for the
      next release.  In particular I have avoided any changes which involve
      significant refactoring and provided what is easy given the current
      infrastructure.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: DanielG, gracjan, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3010
      
      GHC Trac Issues: #13190
      91691117
  7. 25 Jan, 2017 1 commit
  8. 20 Jan, 2017 1 commit
    • Yuras's avatar
      Warn on missing home modules · 15b9a85e
      Yuras authored
      Introduce a warning, -Wmissing-home-modules, to warn about home modules,
      not listed in command line.
      
      It is usefull for cabal when user fails to list a module in
      `exposed-modules` and `other-modules`.
      
      Test Plan: make TEST=MissingMod
      
      Reviewers: mpickering, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: simonpj, mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2977
      
      GHC Trac Issues: #13129
      15b9a85e
  9. 19 Jan, 2017 1 commit
    • Richard Eisenberg's avatar
      Update levity polymorphism · e7985ed2
      Richard Eisenberg authored
      This commit implements the proposal in
      https://github.com/ghc-proposals/ghc-proposals/pull/29 and
      https://github.com/ghc-proposals/ghc-proposals/pull/35.
      
      Here are some of the pieces of that proposal:
      
      * Some of RuntimeRep's constructors have been shortened.
      
      * TupleRep and SumRep are now parameterized over a list of RuntimeReps.
      * This
      means that two types with the same kind surely have the same
      representation.
      Previously, all unboxed tuples had the same kind, and thus the fact
      above was
      false.
      
      * RepType.typePrimRep and friends now return a *list* of PrimReps. These
      functions can now work successfully on unboxed tuples. This change is
      necessary because we allow abstraction over unboxed tuple types and so
      cannot
      always handle unboxed tuples specially as we did before.
      
      * We sometimes have to create an Id from a PrimRep. I thus split PtrRep
      * into
      LiftedRep and UnliftedRep, so that the created Ids have the right
      strictness.
      
      * The RepType.RepType type was removed, as it didn't seem to help with
      * much.
      
      * The RepType.repType function is also removed, in favor of typePrimRep.
      
      * I have waffled a good deal on whether or not to keep VoidRep in
      TyCon.PrimRep. In the end, I decided to keep it there. PrimRep is *not*
      represented in RuntimeRep, and typePrimRep will never return a list
      including
      VoidRep. But it's handy to have in, e.g., ByteCodeGen and friends. I can
      imagine another design choice where we have a PrimRepV type that is
      PrimRep
      with an extra constructor. That seemed to be a heavier design, though,
      and I'm
      not sure what the benefit would be.
      
      * The last, unused vestiges of # (unliftedTypeKind) have been removed.
      
      * There were several pretty-printing bugs that this change exposed;
      * these are fixed.
      
      * We previously checked for levity polymorphism in the types of binders.
      * But we
      also must exclude levity polymorphism in function arguments. This is
      hard to check
      for, requiring a good deal of care in the desugarer. See Note [Levity
      polymorphism
      checking] in DsMonad.
      
      * In order to efficiently check for levity polymorphism in functions, it
      * was necessary
      to add a new bit of IdInfo. See Note [Levity info] in IdInfo.
      
      * It is now safe for unlifted types to be unsaturated in Core. Core Lint
      * is updated
      accordingly.
      
      * We can only know strictness after zonking, so several checks around
      * strictness
      in the type-checker (checkStrictBinds, the check for unlifted variables
      under a ~
      pattern) have been moved to the desugarer.
      
      * Along the way, I improved the treatment of unlifted vs. banged
      * bindings. See
      Note [Strict binds checks] in DsBinds and #13075.
      
      * Now that we print type-checked source, we must be careful to print
      * ConLikes correctly.
      This is facilitated by a new HsConLikeOut constructor to HsExpr.
      Particularly troublesome
      are unlifted pattern synonyms that get an extra void# argument.
      
      * Includes a submodule update for haddock, getting rid of #.
      
      * New testcases:
        typecheck/should_fail/StrictBinds
        typecheck/should_fail/T12973
        typecheck/should_run/StrictPats
        typecheck/should_run/T12809
        typecheck/should_fail/T13105
        patsyn/should_fail/UnliftedPSBind
        typecheck/should_fail/LevPolyBounded
        typecheck/should_compile/T12987
        typecheck/should_compile/T11736
      
      * Fixed tickets:
        #12809
        #12973
        #11736
        #13075
        #12987
      
      * This also adds a test case for #13105. This test case is
      * "compile_fail" and
      succeeds, because I want the testsuite to monitor the error message.
      When #13105 is fixed, the test case will compile cleanly.
      e7985ed2
  10. 15 Jan, 2017 1 commit
  11. 13 Jan, 2017 1 commit
  12. 10 Jan, 2017 1 commit
    • Rufflewind's avatar
      Fix terminal corruption bug and clean up SDoc interface. · 22845adc
      Rufflewind authored
      - Fix #13076 by wrapping `printDoc_` so that the terminal color is
        reset even if an exception occurs.
      
      - Add `printSDoc`, `printSDocLn`, and `bufLeftRenderSDoc` to keep `SDoc`
        values abstract (they are wrappers of `printDoc_`, `printDoc`, and
        `bufLeftRender` respectively).
      
      - Remove unused function: `printForAsm`
      
      Test Plan: manual
      
      Reviewers: RyanGlScott, austin, dfeuer, bgamari
      
      Reviewed By: dfeuer, bgamari
      
      Subscribers: dfeuer, mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2932
      
      GHC Trac Issues: #13076
      22845adc
  13. 05 Jan, 2017 1 commit
    • Joachim Breitner's avatar
      Add a CSE pass to Stg (#9291) · 19d5c731
      Joachim Breitner authored
      This CSE pass only targets data constructor applications. This is
      probably the best we can do, as function calls and primitive operations
      might have side-effects.
      
      Introduces the flag -fstg-cse, enabled by default with -O for now. It
      might also be a good candiate for -O2.
      
      Differential Revision: https://phabricator.haskell.org/D2871
      19d5c731
  14. 23 Dec, 2016 1 commit
    • Rufflewind's avatar
      Add caret diagnostics · 158530a5
      Rufflewind authored
      This is controlled by -f[no-]diagnostics-show-caret.
      
      Example of what it looks like:
      ```
          |
       42 |     x = 1 + ()
          |         ^^^^^^
      ```
      This is appended to each diagnostic message.
      
      Test Plan:
      testsuite/tests/warnings/should_fail/CaretDiagnostics1
      testsuite/tests/warnings/should_fail/CaretDiagnostics2
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: joehillen, mpickering, Phyx, simonpj, alanz, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2718
      
      GHC Trac Issues: #8809
      158530a5
  15. 20 Dec, 2016 1 commit
  16. 19 Dec, 2016 1 commit
  17. 18 Dec, 2016 1 commit
  18. 17 Dec, 2016 1 commit
    • Rufflewind's avatar
      Windows: Improve terminal detection mechanism · 3dbd2b09
      Rufflewind authored
      The previous detection mechanism allowed environment variables (ANSICON,
      ConEmuANSI, TERM) to supersede the fact that the stderr is not a
      terminal, which is probably what led to color codes appearing in the
      stderr of the tests (see: 847d2293).
      
      This commit changes the detection mechanism to detect Cygwin/MSYS2
      terminals in a more reliable manner, avoiding the use of environment
      variables entirely.
      
      Test Plan: validate
      
      Reviewers: Phyx, austin, erikd, bgamari
      
      Reviewed By: Phyx, bgamari
      
      Subscribers: RyanGlScott, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2809
      3dbd2b09
  19. 16 Dec, 2016 1 commit
  20. 15 Dec, 2016 1 commit
  21. 11 Dec, 2016 1 commit
    • Moritz Angermann's avatar
      Make globals use sharedCAF · c3c70244
      Moritz Angermann authored
      Summary:
      The use of globals is quite painful when multiple rts are loaded, e.g.
      when plugins are loaded, which bring in a second rts. The sharedCAF
      appraoch was employed for the FastStringTable; I've taken the libery
      to extend this to the other globals I could find.
      
      This is a reboot of D2575, that should hopefully not exhibit the same
      windows build issues.
      
      Reviewers: Phyx, simonmar, goldfire, bgamari, austin, hvr, erikd
      
      Reviewed By: Phyx, simonmar, bgamari
      
      Subscribers: mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2773
      c3c70244
  22. 09 Dec, 2016 3 commits
    • Sylvain Henry's avatar
      Export `warningGroups' and `warningHierarchies' · 1c296c0c
      Sylvain Henry authored
      Reviewers: austin, mpickering, bgamari
      
      Reviewed By: mpickering, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2806
      1c296c0c
    • Rufflewind's avatar
      Disable colors unless printing to stderr · cee72d5c
      Rufflewind authored
      Only print colors when mkLocMessageAnn is called directly from
      defaultLogAction.  This prevents ANSI error codes from cluttering up the
      dump files.
      
      Test Plan: validate
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2792
      
      GHC Trac Issues: #12927
      cee72d5c
    • Sylvain Henry's avatar
      Scrutinee Constant Folding · d3b546b1
      Sylvain Henry authored
      This patch introduces new rules to perform constant folding through
      case-expressions.
      
      E.g.,
      ```
      case t -# 10# of _ {  ===> case t of _ {
               5#      -> e1              15#     -> e1
               8#      -> e2              18#     -> e2
               DEFAULT -> e               DEFAULT -> e
      ```
      
      The initial motivation is that it allows "Merge Nested Cases"
      optimization to kick in and to further simplify the code
      (see Trac #12877).
      
      Currently we recognize the following operations for Word# and Int#: Add,
      Sub, Xor, Not and Negate (for Int# only).
      
      Test Plan: validate
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2762
      
      GHC Trac Issues: #12877
      d3b546b1
  23. 01 Dec, 2016 1 commit
  24. 30 Nov, 2016 3 commits
  25. 29 Nov, 2016 4 commits
    • Moritz Angermann's avatar
      Make globals use sharedCAF · 6f7ed1e5
      Moritz Angermann authored
      The use of globals is quite painful when multiple rts are loaded, e.g.
      when plugins are loaded, which bring in a second rts. The sharedCAF
      appraoch was employed for the FastStringTable; I've taken the libery
      to extend this to the other globals I could find.
      
      Reviewers: rwbarton, simonmar, austin, hvr, erikd, bgamari
      
      Reviewed By: simonmar, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2575
      6f7ed1e5
    • Sylvain Henry's avatar
      Replace -fshow-source-paths with -fhide-source-paths · 3ec85630
      Sylvain Henry authored
      This patch reverts the change introduced with
      587dcccf and restores the previous
      default output of GHC (i.e., show source path and object path for each
      compiled module).
      
      The -fhide-source-paths flag can be used to hide these paths and reduce
      the line
      noise.
      
      Reviewers: gracjan, nomeata, austin, bgamari, simonmar, hvr
      
      Reviewed By: hvr
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2728
      
      GHC Trac Issues: #12851
      3ec85630
    • Rufflewind's avatar
      Detect color support · 52222f9b
      Rufflewind authored
      Test Plan: validate
      
      Reviewers: erikd, Phyx, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2717
      
      GHC Trac Issues: #8809
      52222f9b
    • Rufflewind's avatar
      Make diagnostics slightly more colorful · f1fc8cbf
      Rufflewind authored
      This is a preliminary commit to add colors to diagnostics (warning and
      error messages).  The aesthetic changes are:
      
        - 'warning', 'error', and 'fatal' are all colored magenta, red, and
          red respectively.
        - The warning annotation [-Wsomething] shares the same color.
        - Warnings and errors are also bolded (this is consistent with what
          other compilers do).
      
      A new flag has been added to control the behavior:
      
          -fdiagnostics-color=(always|auto|never)
      
      This flag is 'auto' by default.  However, auto-detection is not
      implemented yet, so it effectively it defaults to off.
      
      Test Plan: validate
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2716
      
      GHC Trac Issues: #8809
      f1fc8cbf
  26. 21 Nov, 2016 1 commit
    • Maciej Bielecki's avatar
      Implement fine-grained `-Werror=...` facility · 514acfe4
      Maciej Bielecki authored
      This patch add new options `-Werror=...`, `-Wwarn=...` and
      `-Wno-error=...` (synonym for `-Wwarn=...`).
      
      Semantics:
      
        - `-Werror` marks all warnings as fatal, including those that don't
          have a warning flag, and CPP warnings.
        - `-Werror=...` enables a warning and marks it as fatal
        - `-Wwarn=...` marks a warning as non-fatal, but doesn't disable it
      
      Test Plan: validate
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: mpickering, svenpanne, RyanGlScott, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2706
      
      GHC Trac Issues: #11219
      514acfe4
  27. 12 Nov, 2016 1 commit
  28. 11 Nov, 2016 1 commit
    • Ben Gamari's avatar
      Pass -no-pie to GCC · d421a7e2
      Ben Gamari authored
      Certain distributions (e.g. Debian and Ubuntu) have enabled PIE be
      default in their GCC packaging. This breaks our abuse of GCC as a linker
      which requires that we pass -Wl,-r, which is incompatible with
      PIE (since the former implies that we are generating a relocatable
      object file and the latter an executable).
      
      This is a second attempt at D2691. This attempt constrasts with D2691 in that
      it preserves the "does gcc support -no-pie" flag in settings, allowing this to
      be reconfigured by `configure` during installation of a binary distribution.
      Thanks for @rwbarton for drawing attention to this issue.
      
      Test Plan: Validate
      
      Reviewers: austin, hvr, erikd
      
      Reviewed By: erikd
      
      Subscribers: thomie, rwbarton, erikd
      
      Differential Revision: https://phabricator.haskell.org/D2693
      
      GHC Trac Issues: #12759
      d421a7e2
  29. 06 Nov, 2016 1 commit
  30. 26 Oct, 2016 1 commit
    • Matthew Pickering's avatar
      Remove -dtrace-level · 48876ae0
      Matthew Pickering authored
      The flag was:
      
      1. Not documented.
      2. Only used as a boolean flag.
      3. Has overlapping functionality with -dno-debug-output
      4. My poll of #ghc concluded that people didn't know it existed.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2627
      
      GHC Trac Issues: #12691
      48876ae0
  31. 22 Oct, 2016 1 commit
    • Erik de Castro Lopo's avatar
      Add -Wcpp-undef warning flag · 3cb32d8b
      Erik de Castro Lopo authored
      When enabled, this new warning flag passes `-Wundef` to the C
      pre-processor which causes the pre-processor to warn on uses of
      the `#if` directive on undefined identifiers.
      
      It is not currently enabled in any of the standard warning groups.
      
      Test Plan: Make sure the two tests pass on all major platforms.
      
      Reviewers: hvr, carter, Phyx, bgamari, austin
      
      Reviewed By: Phyx
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2626
      
      GHC Trac Issues: #12752
      3cb32d8b
  32. 08 Oct, 2016 2 commits
    • Edward Z. Yang's avatar
      61b143af
    • Edward Z. Yang's avatar
      Make InstalledUnitId be ONLY a FastString. · 5bd8e8d3
      Edward Z. Yang authored
      
      
      It turns out that we don't really need to be able to
      extract a ComponentId from UnitId, except in one case.
      So compress UnitId into a single FastString.
      
      The one case where we do need the ComponentId is when
      we are compiling an instantiated version of a package;
      we need the ComponentId to look up the indefinite
      version of this package from the database.  So now we
      just pass it in as an argument -this-component-id.
      
      Also: ghc-pkg now no longer will unregister a package if
      you register one with the same package name, if the
      instantiations don't match.
      
      Cabal submodule update which tracks the same data type
      change.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      5bd8e8d3