1. 28 Aug, 2020 3 commits
  2. 27 Aug, 2020 2 commits
  3. 26 Aug, 2020 6 commits
    • Krzysztof Gogolewski's avatar
      primops: Remove Monadic and Dyadic categories · 770100e0
      Krzysztof Gogolewski authored
      There were four categories of primops: Monadic, Dyadic, Compare, GenPrimOp.
      The compiler does not treat Monadic and Dyadic in any special way,
      we can just replace them with GenPrimOp.
      Compare is still used in isComparisonPrimOp.
    • Peter Trommler's avatar
      PPC and X86: Portable printing of IEEE floats · fcb10b6c
      Peter Trommler authored
      GNU as and the AIX assembler support floating point literals.
      SPARC seems to have support too but I cannot test on SPARC.
      Curiously, `doubleToBytes` is also used in the LLVM backend.
      To avoid endianness issues when cross-compiling float and double literals
      are printed as C-style floating point values. The assembler then takes
      care of memory layout and endianness.
      This was brought up in #18431 by @hsyl20.
    • Sylvain Henry's avatar
      Bignum: fix BigNat subtraction (#18604) · dc476a50
      Sylvain Henry authored
      There was a confusion between the boolean expected by
      withNewWordArrayTrimedMaybe and the boolean returned by subtracting
    • Sylvain Henry's avatar
      Refactor UnitId pretty-printing · 0b17fa18
      Sylvain Henry authored
      When we pretty-print a UnitId for the user, we try to map it back to its
      origin package name, version and component to print
      "package-version:component" instead of some hash.
      The UnitId type doesn't carry these information, so we have to look into
      a UnitState to find them. This is why the Outputable instance of
      UnitId used `sdocWithDynFlags` in order to access the `unitState` field
      of DynFlags.
      This is wrong for several reasons:
      1. The DynFlags are accessed when the message is printed, not when it is
         generated. So we could imagine that the unitState may have changed
         in-between. Especially if we want to allow unit unloading.
      2. We want GHC to support several independent sessions at once, hence
         several UnitState. The current approach supposes there is a unique
         UnitState as a UnitId doesn't indicate which UnitState to use.
      See the Note [Pretty-printing UnitId] in GHC.Unit for the new approach
      implemented by this patch.
      One step closer to remove `sdocDynFlags` field from `SDocContext`
      Fix #18124.
      Also fix some Backpack code to use SDoc instead of String.
    • Takenobu Tani's avatar
      users-guide: Color the logo on the front page of the PDF · b7d98cb2
      Takenobu Tani authored
      This patch updates the logo with a recent color scheme.
      This affects only the PDF version of the user's guide.
      See also:
      * https://mail.haskell.org/pipermail/ghc-devs/2020-August/019139.html
      * https://gitlab.haskell.org/ghc/ghc/-/wikis/logo
    • Takenobu Tani's avatar
      linters: Make CPP linter skip image files · 2d635a50
      Takenobu Tani authored
      This patch adds an exclusion rule for `docs/users_guide/images`,
      to avoid lint errors of PDF files.
  4. 25 Aug, 2020 4 commits
  5. 24 Aug, 2020 4 commits
  6. 23 Aug, 2020 2 commits
  7. 22 Aug, 2020 3 commits
  8. 21 Aug, 2020 6 commits
  9. 19 Aug, 2020 4 commits
    • Simon Peyton Jones's avatar
      Add right-to-left rule for pattern bindings · eb9bdaef
      Simon Peyton Jones authored
      Fix #18323 by adding a few lines of code to handle non-recursive
      pattern bindings.  see GHC.Tc.Gen.Bind
      Note [Special case for non-recursive pattern bindings]
      Alas, this confused the pattern-match overlap checker; see #18323.
      Note that this patch only affects pattern bindings like that
      for (x,y) in this program
        combine :: (forall a . [a] -> a) -> [forall a. a -> a]
                -> ((forall a . [a] -> a), [forall a. a -> a])
        breaks = let (x,y) = combine head ids
                 in x y True
      We need ImpredicativeTypes for those [forall a. a->a] types to be
      valid. And with ImpredicativeTypes the old, unprincipled "allow
      unification variables to unify with a polytype" story actually
      works quite well. So this test compiles fine (if delicatedly) with
      old GHCs; but not with QuickLook unless we add this patch
    • Alex D's avatar
      Implement -Wredundant-bang-patterns (#17340) · 731c8d3b
      Alex D authored
      Add new flag '-Wredundant-bang-patterns' that enables checks for "dead" bangs.
      Dead bangs are the ones that under no circumstances can force a thunk that
      wasn't already forced. Dead bangs are a form of redundant bangs. The new check
      is performed in Pattern-Match Coverage Checker along with other checks (namely,
      redundant and inaccessible RHSs). Given
          f :: Bool -> Int
          f True = 1
          f !x   = 2
      we can detect dead bang patterns by checking whether @x ~ ⊥@ is satisfiable
      where the PmBang appears in 'checkGrdTree'. If not, then clearly the bang is
      dead. Such a dead bang is then indicated in the annotated pattern-match tree by
      a 'RedundantSrcBang' wrapping. In 'redundantAndInaccessibles', we collect
      all dead bangs to warn about.
      Note that we don't want to warn for a dead bang that appears on a redundant
      clause. That is because in that case, we recommend to delete the clause wholly,
      including its leading pattern match.
      Dead bang patterns are redundant. But there are bang patterns which are
      redundant that aren't dead, for example
          f !() = 0
      the bang still forces the match variable, before we attempt to match on (). But
      it is redundant with the forcing done by the () match. We currently don't
      detect redundant bangs that aren't dead.
    • Sylvain Henry's avatar
      DynFlags: refactor GHC.CmmToAsm (#17957, #10143) · 0c5ed5c7
      Sylvain Henry authored
      This patch removes the use of `sdocWithDynFlags` from GHC.CmmToAsm.*.Ppr
      To do that I've had to make some refactoring:
      * X86' and PPC's `Instr` are no longer `Outputable` as they require a
        `Platform` argument
      * `Instruction` class now exposes `pprInstr :: Platform -> instr -> SDoc`
      * as a consequence, I've refactored some modules to avoid .hs-boot files
      * added (derived) functor instances for some datatypes parametric in the
        instruction type. It's useful for pretty-printing as we just have to
        map `pprInstr` before pretty-printing the container datatype.
    • Ben Gamari's avatar
      testsuite: Only run llvm ways if llc is available · aa4b744d
      Ben Gamari authored
      As noted in #18560, we previously would always run the LLVM ways since
      `configure` would set `SettingsLlcCommand` to something non-null when
      it otherwise couldn't find the `llc` executable. Now we rather probe for
      the existence of the `llc` executable in the testsuite driver.
      Fixes #18560.
  10. 18 Aug, 2020 6 commits