1. 01 Oct, 2016 2 commits
    • tmcgilchrist's avatar
      Recognise US spelling for specialisation flags. · 151edd89
      tmcgilchrist authored and Ben Gamari's avatar Ben Gamari committed
      The user guide says that we allow the user to use `specialise` or
      `specialize` interchangeably but this wasn't the case for the relevant
      flags. This patch adds aliases for the flags which control
      specialisation.
      
      Reviewers: erikd, austin, mpickering, bgamari
      
      Reviewed By: mpickering, bgamari
      
      Subscribers: mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2542
      
      GHC Trac Issues: #12575
      151edd89
    • Ryan Scott's avatar
      Implement deriving strategies · 9e862765
      Ryan Scott authored and Ben Gamari's avatar Ben Gamari committed
      Allows users to explicitly request which approach to `deriving` to use
      via keywords, e.g.,
      
      ```
      newtype Foo = Foo Bar
        deriving Eq
        deriving stock    Ord
        deriving newtype Show
      ```
      
      Fixes #10598. Updates haddock submodule.
      
      Test Plan: ./validate
      
      Reviewers: hvr, kosmikus, goldfire, alanz, bgamari, simonpj, austin,
      erikd, simonmar
      
      Reviewed By: alanz, bgamari, simonpj
      
      Subscribers: thomie, mpickering, oerjan
      
      Differential Revision: https://phabricator.haskell.org/D2280
      
      GHC Trac Issues: #10598
      9e862765
  2. 16 Sep, 2016 1 commit
    • Ben Gamari's avatar
      Remove directories from include paths · ea310f99
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Previously this was a relative path which worked in the GHC tree, but
      failed elsewhere. This caused trouble for out-of-tree users as well as
      Hadrian, which wants to move build artifacts out of the working
      directory. Fixes #8040.
      
      Test Plan: Validate
      
      Reviewers: thomie, austin, snowleopard, hvr
      
      Reviewed By: snowleopard, hvr
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2530
      
      GHC Trac Issues: #8040
      ea310f99
  3. 10 Sep, 2016 1 commit
    • Ryan Scott's avatar
      Remove -flocal-ghci-history from default flags · 7b4bb405
      Ryan Scott authored
      Summary:
      D2461 seemed to (inadvertently, I think) add the
      `-flocal-ghci-history` flag to the list of `defaultFlags` that are enabled
      automatically. As a result, every invocation of `ghci` caused a local GHCi
      history to be saved to the current directory, which probably shouldn't be the
      default.
      
      Test Plan:
      Run `ghci`, observe the lack of a `.ghci_history` file in your
      working directory
      
      Reviewers: austin, thomie, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: ak3n
      
      Differential Revision: https://phabricator.haskell.org/D2520
      
      GHC Trac Issues: #9089
      7b4bb405
  4. 31 Aug, 2016 3 commits
  5. 30 Aug, 2016 1 commit
    • Duncan Coutts's avatar
      Fix handling of package-db entries in .ghc.environment files, etc. · ef784c55
      Duncan Coutts authored and Ben Gamari's avatar Ben Gamari committed
      Previously interpreting the content of the .ghc.env files was done
      after the step that loaded the available package dbs. This meant that
      setting the package db flags was ineffective. This patch moves
      interpreting the env files before loading of the package dbs.
      
      Also, the package-db entries refer to files. Allow spaces in these file
      names. Also treat as comments lines beginning with "--".
      
      These are pretty minor fixes in a feature that up 'til now has been
      essentially unused (witness no bug report about it), so there's very
      low risk here. If we can get this into 8.0.2 then cabal can start
      generating the .ghc.environment files, otherwise it cannot as it needs
      the working package-db entries, to be able to refer to local package
      dbs in the build tree (or cabal nix store).
      
      Test Plan:
      Manually create example .ghc.env files
      run ghci; :show packages
      Done this. It works.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2476
      ef784c55
  6. 05 Aug, 2016 1 commit
  7. 21 Jul, 2016 1 commit
    • Ömer Sinan Ağacan's avatar
      Implement unboxed sum primitive type · 714bebff
      Ömer Sinan Ağacan authored
      Summary:
      This patch implements primitive unboxed sum types, as described in
      https://ghc.haskell.org/trac/ghc/wiki/UnpackedSumTypes.
      
      Main changes are:
      
      - Add new syntax for unboxed sums types, terms and patterns. Hidden
        behind `-XUnboxedSums`.
      
      - Add unlifted unboxed sum type constructors and data constructors,
        extend type and pattern checkers and desugarer.
      
      - Add new RuntimeRep for unboxed sums.
      
      - Extend unarise pass to translate unboxed sums to unboxed tuples right
        before code generation.
      
      - Add `StgRubbishArg` to `StgArg`, and a new type `CmmArg` for better
        code generation when sum values are involved.
      
      - Add user manual section for unboxed sums.
      
      Some other changes:
      
      - Generalize `UbxTupleRep` to `MultiRep` and `UbxTupAlt` to
        `MultiValAlt` to be able to use those with both sums and tuples.
      
      - Don't use `tyConPrimRep` in `isVoidTy`: `tyConPrimRep` is really
        wrong, given an `Any` `TyCon`, there's no way to tell what its kind
        is, but `kindPrimRep` and in turn `tyConPrimRep` returns `PtrRep`.
      
      - Fix some bugs on the way: #12375.
      
      Not included in this patch:
      
      - Update Haddock for new the new unboxed sum syntax.
      
      - `TemplateHaskell` support is left as future work.
      
      For reviewers:
      
      - Front-end code is mostly trivial and adapted from unboxed tuple code
        for type checking, pattern checking, renaming, desugaring etc.
      
      - Main translation routines are in `RepType` and `UnariseStg`.
        Documentation in `UnariseStg` should be enough for understanding
        what's going on.
      
      Credits:
      
      - Johan Tibell wrote the initial front-end and interface file
        extensions.
      
      - Simon Peyton Jones reviewed this patch many times, wrote some code,
        and helped with debugging.
      
      Reviewers: bgamari, alanz, goldfire, RyanGlScott, simonpj, austin,
                 simonmar, hvr, erikd
      
      Reviewed By: simonpj
      
      Subscribers: Iceland_jack, ggreif, ezyang, RyanGlScott, goldfire,
                   thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D2259
      714bebff
  8. 16 Jul, 2016 2 commits
    • tvv's avatar
      CodeGen: Way to dump cmm only once (#11717) · 1ba79fa4
      tvv authored and Ben Gamari's avatar Ben Gamari committed
      The `-ddump-cmm` put all stages of Cmm processing into one output.
      This patch changes its behavior and adds two more options to make
      Cmm dumping flexible.
      
      - `-ddump-cmm-from-stg` dumps only initial version of  Cmm right after
         STG->Cmm codegen
      - `-ddump-cmm` dumps the final result of the Cmm pipeline processing
      - `-ddump-cmm-verbose` dumps intermediate output of each Cmm pipeline
         step
      - `-ddump-cmm-proc` and `-ddump-cmm-caf` seems were lost. Now enabled
      
      Test Plan: ./validate
      
      Reviewers: thomie, simonmar, austin, bgamari
      
      Reviewed By: thomie, simonmar
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2393
      
      GHC Trac Issues: #11717
      1ba79fa4
    • Ben Gamari's avatar
      Log heap profiler samples to event log · a9bc5476
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Test Plan: Try it
      
      Reviewers: hvr, simonmar, austin, erikd
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1722
      
      GHC Trac Issues: #11094
      a9bc5476
  9. 13 Jun, 2016 1 commit
    • niteria's avatar
      Use UniqFM for SigOf · 586d5581
      niteria authored
      Summary:
      The Ord instance for ModuleName is currently implemented in
      terms of Uniques causing potential determinism problems.
      I plan to change it to use the actual FastStrings and in
      preparation for that I'm switching to UniqFM where it's
      possible (you need *one* Unique per key, and you can't get
      the keys back), so that the performance doesn't suffer.
      
      Test Plan: ./validate
      
      Reviewers: simonmar, austin, ezyang, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2320
      
      GHC Trac Issues: #4012
      586d5581
  10. 10 Jun, 2016 1 commit
  11. 24 May, 2016 1 commit
    • seraphime's avatar
      Fix: #12084 deprecate old profiling flags · 1956cbf1
      seraphime authored and Thomas Miedema's avatar Thomas Miedema committed
      Change help message so it doesn't specify -auto-all.
      Make old profiling flags deprecated as they are no longer
      documented.
      Update Makefile and documentation accordingly.
      Update release notes for ghc 8.2
      
      Test Plan:
      ./verify; `ghc --help` shouldn't specify the -auto-all
      flag. Furthermore `ghc -fprof -auto-all` should emit a warning
      
      Reviewed By: thomie, austin
      
      Differential Revision: https://phabricator.haskell.org/D2257
      
      GHC Trac Issues: #12084
      
      Update submodule nofib
      1956cbf1
  12. 16 May, 2016 1 commit
    • Ben Gamari's avatar
      Move Extension type to ghc-boot-th · eed820b6
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      This creates a new package, `ghc-boot-th`, to contain the `Extension`
      type, which now lives in `GHC.LanguageExtension.Type`. This ensures that
      the transitive dependency set of the `template-haskell` package remains
      minimal.
      
      The `GHC.LanguageExtensions.Type` module is also re-exported by
      `ghc-boot`, which provides an orphan `binary` instance as well.
      
      Test Plan: Validate
      
      Reviewers: goldfire, thomie, hvr, austin
      
      Reviewed By: thomie
      
      Subscribers: RyanGlScott, thomie, erikd, ezyang
      
      Differential Revision: https://phabricator.haskell.org/D2224
      eed820b6
  13. 02 May, 2016 1 commit
  14. 22 Apr, 2016 1 commit
    • Simon Peyton Jones's avatar
      Warn about simplifiable class constraints · 9421b0c7
      Simon Peyton Jones authored
      Provoked by Trac #11948, this patch adds a new warning to GHC
      
        -Wsimplifiable-class-constraints
      
      It warns if you write a class constraint in a type signature that
      can be simplified by an existing instance declaration.  Almost always
      this means you should simplify it right now; type inference is very
      fragile without it, as #11948 shows.
      
      I've put the warning as on-by-default, but I suppose that if there are
      howls of protest we can move it out (as happened for -Wredundant-constraints.
      
      It actually found an example of an over-complicated context in CmmNode.
      
      Quite a few tests use these weird contexts to trigger something else,
      so I had to suppress the warning in those.
      
      The 'haskeline' library has a few occurrences of the warning (which
      I think should be fixed), so I switched it off for that library in
      warnings.mk.
      
      The warning itself is done in TcValidity.check_class_pred.
      
      HOWEVER, when type inference fails we get a type error; and the error
      suppresses the (informative) warning.  So as things stand, the warning
      only happens when it doesn't cause a problem.  Not sure what to do
      about this, but this patch takes us forward, I think.
      9421b0c7
  15. 17 Apr, 2016 1 commit
  16. 10 Apr, 2016 1 commit
    • Herbert Valerio Riedel's avatar
      Reduce default for -fmax-pmcheck-iterations from 1e7 to 2e6 · d2e05c6b
      Herbert Valerio Riedel authored and Ben Gamari's avatar Ben Gamari committed
      The commit 28f951ed introduced the
      `-fmax-pmcheck-iterations` flag and set the default limit to 1e7
      iterations.
      
      However, this value is still high enough that it can result GHC to
      exhibit memory spikes beyond 1 GiB of RAM usage (heap profile showed
      several `(:)`s, as well as `THUNK_2_0`, and `PmCon` during the memory
      spikes)
      
      A value of 2e6 seems to be a safer upper bound which still manages to
      let the checker not run into the limit in most cases.
      
      Test Plan: Validate, try building a few Hackage packages
      
      Reviewers: austin, gkaracha, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2095
      d2e05c6b
  17. 30 Mar, 2016 1 commit
  18. 25 Mar, 2016 1 commit
    • Ben Gamari's avatar
      DynFlags: Initialize unsafeGlobalDynFlags enough to be useful · 4e98b4ff
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Previously unsafeGlobalDynFlags would bottom if used prior to
      initialization. This meant that any attempt to use the pretty-printer
      early in the initialization process of the compiler would fail. This is
      quite inconvenient.
      
      Here we initialize unsafeGlobalDynFlags with defaultDynFlags, bottoming
      only if settings is accessed.
      
      See #11755.
      
      Test Plan: Validate
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: thomie, gridaphobe
      
      Differential Revision: https://phabricator.haskell.org/D2036
      
      GHC Trac Issues: #11755
      4e98b4ff
  19. 24 Mar, 2016 3 commits
    • kaiha's avatar
      Add option `no-keep-hi-files` and `no-keep-o-files` (fixes #4114) · 24149528
      kaiha authored and Ben Gamari's avatar Ben Gamari committed
      Summary: Remove `.hi` and `.o` files if the flags `no-keep-hi-files` and
      `no-keep-o-files` are given.
      
      Test Plan: ./validate
      
      Reviewers: austin, thomie, bgamari
      
      Reviewed By: thomie, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2021
      
      GHC Trac Issues: #4114
      24149528
    • Ben Gamari's avatar
      Default RuntimeRep variables unless -fprint-explicit-runtime-reps · 371608f1
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      Addresses #11549 by defaulting `RuntimeRep` variables to `PtrRepLifted`
      and adding a new compiler flag `-fprint-explicit-runtime-reps` to
      disable this behavior.
      
      This is just a guess at the right way to go about this. If it's
      wrong-beyond-any-hope just say so.
      
      Test Plan: Working on a testcase
      
      Reviewers: goldfire, austin
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1961
      
      GHC Trac Issues: #11549
      371608f1
    • Ben Gamari's avatar
      DsExpr: Rip out static/dynamic check in list desugaring · 0db05941
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Previously we would try to break explicit lists into a dynamic prefix
      and static tail and desugar the former into a `build` expression.
      Unfortunately, this heuristic resulted in surprising behavior
      (see #11710) and wasn't pulling its weight. Here we drop it (along with
      the `-fsimple-list-literals` flag), leaving only the list length
      heuristic to determine whether `build` or cons list desugaring should be
      used.
      
      Test Plan: Validate
      
      Reviewers: simonpj, austin
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2023
      
      GHC Trac Issues: #11710
      0db05941
  20. 21 Mar, 2016 1 commit
  21. 11 Mar, 2016 2 commits
    • Simon Marlow's avatar
      Add -foptimal-applicative-do · 2f45cf3f
      Simon Marlow authored
      Summary:
      The algorithm for ApplicativeDo rearrangement is based on a heuristic
      that runs in O(n^2).  This patch adds the optimal algorithm, which is
      O(n^3), selected by a flag (-foptimal-applicative-do).  It finds better
      solutions in a small number of cases (about 2% of the cases where
      ApplicativeDo makes a difference), but it can be very slow for large do
      expressions.  I'm mainly adding it for experimental reasons.
      
      ToDo: user guide docs
      
      Test Plan: validate
      
      Reviewers: simonpj, bgamari, austin, niteria, erikd
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1969
      2f45cf3f
    • Ben Gamari's avatar
      Handle unset HOME environment variable more gracefully · 2908ae8d
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Test Plan:
        * Validate
        * try `env -i ghc`
        * try `env -i runghc HelloWorld.hs`
      
      Reviewers: austin
      
      Subscribers: thomie, ezyang
      
      Differential Revision: https://phabricator.haskell.org/D1971
      
      GHC Trac Issues: #11678
      2908ae8d
  22. 29 Feb, 2016 1 commit
  23. 27 Feb, 2016 1 commit
    • Herbert Valerio Riedel's avatar
      Default to -fno-show-warning-groups (re #10752) · 46f3775c
      Herbert Valerio Riedel authored
      As `-fno-show-warning-groups` shows associated warning groups regardless
      of whether the respective warning group flag as been passed on the CLI,
      the warning-group information may be confusing to users.
      
      At this point, `-fshow-warning-groups` is useful mostly to GHC
      developers and possibly GHC users who want to see which warning groups
      an emitted warning is part of. (Btw, this is particularly interesting in
      combination with `-Weverything` which enables *every* warning flag known
      to GHC.)
      
      Consequently, starting with this commit, one has to opt-in via
      `-fshow-warning-groups` for GHC to show warning groups.
      
      In order to reduce the testsuite delta in this commit, the
      `-fshow-warning-groups` flag has been added to TEST_HC_OPTS.
      46f3775c
  24. 25 Feb, 2016 2 commits
    • barrucadu's avatar
      Print which warning-flag controls an emitted warning · bb5afd3c
      barrucadu authored and Herbert Valerio Riedel's avatar Herbert Valerio Riedel committed
      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
    • manav's avatar
      Make warning names more consistent · 66584914
      manav authored and Ben Gamari's avatar Ben Gamari committed
      - Replace "Sigs" with "Signatures" in WarningFlag data constructors.
      - Replace "PatSyn" with "PatternSynonym" in WarningFlag data
        constructors.
      - Deprecate "missing-local-sigs" in favor of "missing-local-signatures".
      - Deprecate "missing-exported-sigs" in favor of
        "missing-exported-signatures".
      - Deprecate "missing-pat-syn-signatures" in favor of
        "missing-pattern-synonym-signatures".
      - Replace "ddump-strsigs" with "ddump-str-signatures"
      
      These complete the tasks that were explicitly mentioned in #11583
      
      Test Plan:
      Executed `ghc --show-options` and verified that the flags were changed
      as expected.
      
      Reviewers: svenpanne, austin, bgamari
      
      Reviewed By: austin, bgamari
      
      Subscribers: mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1939
      
      GHC Trac Issues: #11583
      66584914
  25. 23 Feb, 2016 2 commits
  26. 16 Feb, 2016 1 commit
  27. 15 Feb, 2016 1 commit
  28. 11 Feb, 2016 2 commits
  29. 09 Feb, 2016 2 commits