1. 29 Oct, 2019 19 commits
  2. 28 Oct, 2019 5 commits
    • Simon Peyton Jones's avatar
      Better arity for join points · ad1fe274
      Simon Peyton Jones authored
      A join point was getting too large an arity, leading to #17294.
      I've tightened up the invariant: see
        CoreSyn, Note [Invariants on join points], invariant 2b
    • Sebastian Graf's avatar
      Use FlexibleInstances for `Outputable (* p)` instead of match-all instances... · e951f219
      Sebastian Graf authored
      Use FlexibleInstances for `Outputable (* p)` instead of match-all instances with equality constraints
      In #17304, Richard and Simon dicovered that using `-XFlexibleInstances`
      for `Outputable` instances of AST data types means users can provide orphan
      `Outputable` instances for passes other than `GhcPass`.
      Type inference doesn't currently to suffer, and Richard gave an example
      in #17304 that shows how rare a case would be where the slightly worse
      type inference would matter.
      So I went ahead with the refactoring, attempting to fix #17304.
    • Alan Zimmerman's avatar
      Attach API Annotations for {-# SOURCE #-} import pragma · e0e04856
      Alan Zimmerman authored
      Attach the API annotations for the start and end locations of the
      {-# SOURCE #-} pragma in an ImportDecl.
      Closes #17388
    • Ryan Scott's avatar
      Refactor TcDeriv to validity-check less in anyclass/via deriving (#13154) · cd9b9459
      Ryan Scott authored
      Due to the way `DerivEnv` is currently structured, there is an
      invariant that every derived instance must consist of a class applied
      to a non-empty list of argument types, where the last argument *must*
      be an application of a type constructor to some arguments. This works
      for many cases, but there are also some design patterns in standalone
      `anyclass`/`via` deriving that are made impossible due to enforcing
      this invariant, as documented in #13154.
      This fixes #13154 by refactoring `TcDeriv` and friends to perform
      fewer validity checks when using the `anyclass` or `via` strategies.
      The highlights are as followed:
      * Five fields of `DerivEnv` have been factored out into a new
        `DerivInstTys` data type. These fields only make sense for
        instances that satisfy the invariant mentioned above, so
        `DerivInstTys` is now only used in `stock` and `newtype` deriving,
        but not in other deriving strategies.
      * There is now a `Note [DerivEnv and DerivSpecMechanism]` describing
        the bullet point above in more detail, as well as explaining the
        exact requirements that each deriving strategy imposes.
      * I've refactored `mkEqnHelp`'s call graph to be slightly less
        complicated. Instead of the previous `mkDataTypeEqn`/`mkNewTypeEqn`
        dichotomy, there is now a single entrypoint `mk_eqn`.
      * Various bits of code were tweaked so as not to use fields that are
        specific to `DerivInstTys` so that they may be used by all deriving
        strategies, since not all deriving strategies use `DerivInstTys`.
    • Josef Svenningsson's avatar
      Fix #15344: use fail when desugaring applicative-do · 6635a3f6
      Josef Svenningsson authored
      Applicative-do has a bug where it fails to use the monadic fail method
      when desugaring patternmatches which can fail. See #15344.
      This patch fixes that problem. It required more rewiring than I had expected.
      Applicative-do happens mostly in the renamer; that's where decisions about
      scheduling are made. This schedule is then carried through the typechecker and
      into the desugarer which performs the actual translation. Fixing this bug
      required sending information about the fail method from the renamer, through
      the type checker and into the desugarer. Previously, the desugarer didn't
      have enough information to actually desugar pattern matches correctly.
      As a side effect, we also fix #16628, where GHC wouldn't catch missing
      MonadFail instances with -XApplicativeDo.
  3. 27 Oct, 2019 7 commits
  4. 26 Oct, 2019 8 commits
    • Ömer Sinan Ağacan's avatar
      Remove redundant -fno-cse options · 4054f0e5
      Ömer Sinan Ağacan authored
      These were probably added with some GLOBAL_VARs, but those GLOBAL_VARs
      are now gone.
    • Ben Gamari's avatar
      rts: Fix ARM linker includes · 417f59d4
      Ben Gamari authored
       * Prefer #pragma once over guard macros
       * Drop redundant #includes
       * Fix order to ensure that necessary macros are defined when we
         condition on them
    • Ben Gamari's avatar
      Enable PDF documentation · 60575596
      Ben Gamari authored
    • Ben Gamari's avatar
      testsuite: Skip regalloc_unit_tests unless have_ncg · 8ac49411
      Ben Gamari authored
      This is a unit test for the native code generator's register allocator;
      naturally. the NCG is required.
    • Ben Gamari's avatar
      gitlab-ci: Produce ARMv7 binary distributions · 609c7ee6
      Ben Gamari authored
    • Adam Sandberg Eriksson's avatar
      hadrian: point link to ghc gitlab · 4820af10
      Adam Sandberg Eriksson authored
      [skip ci]
    • Roland Senn's avatar
      Fix #14690 - :steplocal panics after break-on-error · 1be9c35c
      Roland Senn authored
      `:steplocal` enables only breakpoints in the current top-level binding.
      When a normal breakpoint is hit, then the module name and the break id from the `BRK_FUN` byte code
      allow us to access the corresponding entry in a ModBreak table. From this entry we then get the SrcSpan
      (see compiler/main/InteractiveEval.hs:bindLocalsAtBreakpoint).
      With this source-span we can then determine the current top-level binding, needed for the steplocal command.
      However, if we break at an exception or at an error, we don't have an BRK_FUN byte-code, so we don't have any source information.
      The function `bindLocalsAtBreakpoint` creates an `UnhelpfulSpan`, which doesn't allow us to determine the current top-level binding.
      To avoid a `panic`, we have to check for `UnhelpfulSpan` in the function `ghc/GHCi/UI.hs:stepLocalCmd`.
      Hence a :steplocal command after a break-on-exception or a break-on-error is not possible.
    • Andrew Martin's avatar
      Implement shrinkSmallMutableArray# and resizeSmallMutableArray#. · 8916e64e
      Andrew Martin authored
      This is a part of GHC Proposal #25: "Offer more array resizing primitives".
      Resources related to the proposal:
        - Discussion: https://github.com/ghc-proposals/ghc-proposals/pull/121
        - Proposal: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0025-resize-boxed.rst
      Only shrinkSmallMutableArray# is implemented as a primop since a
      library-space implementation of resizeSmallMutableArray# (in GHC.Exts)
      is no less efficient than a primop would be. This may be replaced by
      a primop in the future if someone devises a strategy for growing
      arrays in-place. The library-space implementation always copies the
      array when growing it.
      This commit also tweaks the documentation of the deprecated
      sizeofMutableByteArray#, removing the mention of concurrency. That
      primop is unsound even in single-threaded applications. Additionally,
      the non-negativity assertion on the existing shrinkMutableByteArray#
      primop has been removed since this predicate is trivially always true.
  5. 25 Oct, 2019 1 commit