1. 08 Apr, 2019 3 commits
    • Yuriy Syrovetskiy's avatar
      Add `-optcxx` option (#16477) · 97502be8
      Yuriy Syrovetskiy authored
    • Phuong Trinh's avatar
      Fix #16500: look for interface files in -hidir flag in OneShot mode · 2b3f4718
      Phuong Trinh authored
      We are currently ignoring options set in the hiDir field of hsc_dflags
      when looking for interface files while compiling in OneShot mode. This
      is inconsistent with the behaviour of other directory redirecting fields
      (such as objectDir or hieDir). It is also inconsistent with the
      behaviour of compilation in CompManager mode (a.k.a `ghc --make`) which
      looks for interface files in the directory set in hidir flag. This
      changes Finder.hs so that we use the value of hiDir while looking for
      interface in OneShot mode.
    • Michal Terepeta's avatar
      Generate straightline code for inline array allocation · 63b7d5fb
      Michal Terepeta authored
      GHC has an optimization for allocating arrays when the size is
      statically known -- it'll generate the code allocating and initializing
      the array inline (instead of a call to a procedure from
      However, the generated code uses a loop to do the initialization. Since
      we already check that the requested size is small (we check against
      `maxInlineAllocSize`), we can generate faster straightline code instead.
      This brings about 15% improvement for `newSmallArray#` in my testing and
      slightly simplifies the code in GHC.
      Signed-off-by: Michal Terepeta's avatarMichal Terepeta <michal.terepeta@gmail.com>
  2. 07 Apr, 2019 1 commit
    • Eric Crockett's avatar
      Fix #16282. · 3a38ea44
      Eric Crockett authored
      Previously, -W(all-)missed-specs was created with 'NoReason',
      so no information about the flag was printed along with the warning.
      Now, -Wall-missed-specs is listed as the Reason if it was set,
      otherwise -Wmissed-specs is listed as the reason.
  3. 04 Apr, 2019 6 commits
    • Ryan Scott's avatar
      Tweak error messages for narrowly-kinded assoc default decls · 33b0a291
      Ryan Scott authored
      This program, from #13971, currently has a rather confusing error
      class C a where
        type T a :: k
        type T a = Int
          • Kind mis-match on LHS of default declaration for ‘T’
          • In the default type instance declaration for ‘T’
            In the class declaration for ‘C’
      It's not at all obvious why GHC is complaining about the LHS until
      you realize that the default, when printed with
      `-fprint-explicit-kinds`, is actually `type T @{k} @* a = Int`.
      That is to say, the kind of `a` is being instantiated to `Type`,
      whereas it ought to be a kind variable. The primary thrust of this
      patch is to weak the error message to make this connection
      more obvious:
          • Illegal argument ‘*’ in:
              ‘type T @{k} @* a = Int’
              The arguments to ‘T’ must all be type variables
          • In the default type instance declaration for ‘T’
            In the class declaration for ‘C’
      Along the way, I performed some code cleanup suggested by @rae in
      ghc/ghc#13971 (comment 191287). Before,
      we were creating a substitution from the default declaration's type
      variables to the type family tycon's type variables by way of
      `tcMatchTys`. But this is overkill, since we already know (from the
      aforementioned validity checking) that all the arguments in a default
      declaration must be type variables anyway. Therefore, creating the
      substitution is as simple as using `zipTvSubst`. I took the
      opportunity to perform this refactoring while I was in town.
      Fixes #13971.
    • Andreas Klebinger's avatar
      Restore Xmm registers properly in StgCRun.c · cbb88865
      Andreas Klebinger authored
      This fixes #16514: Xmm6-15 was restored based off rax instead of rsp.
      The code was introduced in the fix for #14619.
    • Ben Gamari's avatar
      testsuite: Add testcase for #16111 · 6c0dd085
      Ben Gamari authored
    • Ryan Scott's avatar
      Use funPrec, not topPrec, to parenthesize GADT argument types · 51fd3571
      Ryan Scott authored
      A simple oversight. Fixes #16527.
    • Ryan Scott's avatar
      Fix #16518 with some more kind-splitting smarts · 25c02ea1
      Ryan Scott authored
      This patch corrects two simple oversights that led to #16518:
      1. `HsUtils.typeToLHsType` was taking visibility into account in the
         `TyConApp` case, but not the `AppTy` case. I've factored out the
         visibility-related logic into its own `go_app` function and now
         invoke `go_app` from both the `TyConApp` and `AppTy` cases.
      2. `Type.fun_kind_arg_flags` did not properly split kinds with
         nested `forall`s, such as
         `(forall k. k -> Type) -> (forall k. k -> Type)`. This was simply
         because `fun_kind_arg_flags`'s `FunTy` case always bailed out and
         assumed all subsequent arguments were `Required`, which clearly
         isn't the case for nested `forall`s. I tweaked the `FunTy` case
         to recur on the result kind.
    • Yuriy Syrovetskiy's avatar
  4. 03 Apr, 2019 12 commits
    • Ben Gamari's avatar
      gitlab: Fix label names in issue templates · 895394c2
      Ben Gamari authored
    • Ben Gamari's avatar
      gitlab-ci: Build hyperlinked sources for releases · 6f13e7b1
      Ben Gamari authored
      Fixes #16445.
    • Sebastian Graf's avatar
      Fix Uncovered set of literal patterns · 4626cf21
      Sebastian Graf authored
      Issues #16289 and #15713 are proof that the pattern match checker did
      an unsound job of estimating the value set abstraction corresponding to
      the uncovered set.
      The reason is that the fix from #11303 introducing `NLit` was
      incomplete: The `LitCon` case desugared to `Var` rather than `LitVar`,
      which would have done the necessary case splitting analogous to the
      `ConVar` case.
      This patch rectifies that by introducing the fresh unification variable
      in `LitCon` in value abstraction position rather than pattern postition,
      recording a constraint equating it to the constructor expression rather
      than the literal. Fixes #16289 and #15713.
    • Ben Gamari's avatar
      configure: Always use AC_LINK_ELSEIF when testing against assembler · 7b090b53
      Ben Gamari authored
      This fixes #16440, where the build system incorrectly concluded that the
      `.subsections_via_symbols` assembler directive was supported on a Linux
      system. This was caused by the fact that gcc was invoked with `-flto`;
      when so-configured gcc does not call the assembler but rather simply
      serialises its AST for compilation during the final link.
      This is described in Note [autoconf assembler checks and -flto].
    • Chris Martin's avatar
      Inline the definition of 'ap' in the Monad laws · bf6dbe3d
      Chris Martin authored
      The law as it is currently written is meaningless, because nowhere have
      we defined the implementation of 'ap'. The reader of the Control.Monad
      documentation is provided with only a type signature,
      > ap :: Monad m => m (a -> b) -> m a -> m b
      an informal description,
      > In many situations, the liftM operations can be replaced by uses of
      > ap, which promotes function application.
      and a relationship between 'ap' and the 'liftM' functions
      > return f `ap` x1 `ap` ... `ap` xn
      > is equivalent to
      > liftMn f x1 x2 ... xn
      Without knowing how 'ap' is defined, a law involving 'ap' cannot
      provide any guidance for how to write a lawful Monad instance, nor can
      we conclude anything from the law.
      I suspect that a reader equipped with the understanding that 'ap' was
      defined prior to the invention of the Applicative class could deduce
      that 'ap' must be defined in terms of (>>=), but nowhere as far as I can
      tell have we written this down explicitly for readers without the
      benefit of historical context.
      If the law is meant to express a relationship among (<*>), (>>=), and
      'return', it seems that it is better off making this statement directly,
      sidestepping 'ap' altogether.
    • Chris Martin's avatar
      Correct two misspellings of "separately" · 722fdddf
      Chris Martin authored
    • Ben Gamari's avatar
    • Ben Gamari's avatar
    • Frank Steffahn's avatar
    • Andrew Martin's avatar
    • Nathan Collins's avatar
      users-guide: Fix typo · 2ec749b5
      Nathan Collins authored
    • Andreas Klebinger's avatar
      Fix faulty substitutions in StgCse (#11532). · 5a75ccd0
      Andreas Klebinger authored
      `substBndr` should rename bindings which shadow existing ids.
      However while it was renaming the bindings it was not adding proper substitutions
      for renamed bindings.
      Instead of adding a substitution of the form `old -> new` for renamed
      bindings it mistakenly added `old -> old` if no replacement had taken
      place while adding none if `old` had been renamed.
      As a byproduct this should improve performance, as we no longer add
      useless substitutions for unshadowed bindings.
  5. 02 Apr, 2019 7 commits
  6. 01 Apr, 2019 11 commits