1. 29 Jan, 2020 5 commits
  2. 28 Jan, 2020 3 commits
  3. 23 Jan, 2020 2 commits
    • Ryan Scott's avatar
      Use splitLHs{ForAll,Sigma}TyInvis throughout the codebase · ea1581cb
      Ryan Scott authored
      Richard points out in #17688 that we use `splitLHsForAllTy` and
      `splitLHsSigmaTy` in places that we ought to be using the
      corresponding `-Invis` variants instead, identifying two bugs
      that are caused by this oversight:
      
      * Certain TH-quoted type signatures, such as those that appear in
        quoted `SPECIALISE` pragmas, silently turn visible `forall`s into
        invisible `forall`s.
      * When quoted, the type `forall a -> (a ~ a) => a` will turn into
        `forall a -> a` due to a bug in `DsMeta.repForall` that drops
        contexts that follow visible `forall`s.
      
      These are both ultimately caused by the fact that `splitLHsForAllTy`
      and `splitLHsSigmaTy` split apart visible `forall`s in addition to
      invisible ones. This patch cleans things up:
      
      * We now use `splitLHsForAllTyInvis` and `splitLHsSigmaTyInvis`
        throughout the codebase. Relatedly, the `splitLHsForAllTy` and
        `splitLHsSigmaTy` have been removed, as they are easy to misuse.
      * `DsMeta.repForall` now only handles invisible `forall`s to reduce
        the chance for confusion with visible `forall`s, which need to be
        handled differently. I also renamed it from `repForall` to
        `repForallT` to emphasize that its distinguishing characteristic
        is the fact that it desugars down to `L.H.TH.Syntax.ForallT`.
      
      Fixes #17688.
      
      (cherry picked from commit 18c0d037)
      ea1581cb
    • Ben Gamari's avatar
      Bump binary submodule · 3b63d029
      Ben Gamari authored
      3b63d029
  4. 18 Jan, 2020 2 commits
    • John Ericson's avatar
      Get rid of OpDest · c8338aa2
      John Ericson authored
      `OpDest` was basically a defunctionalization. Just turn the code that
      cased on it into those functions, and call them directly.
      
      (cherry picked from commit ee5d63f4)
      c8338aa2
    • John Ericson's avatar
      Handle TagToEnum in the same big case as the other primops · 0721dfa5
      John Ericson authored
      Before, it was a panic because it was handled above. But there must have
      been an error in my reasoning (another caller?) because #17442 reported
      the panic was hit.
      
      But, rather than figuring out what happened, I can just make it
      impossible by construction. By adding just a bit more bureaucracy in the
      return types, I can handle TagToEnum in the same case as all the others,
      so the big case is is now total, and the panic is removed.
      
      Fixes #17442
      
      (cherry picked from commit 22c0bdc3)
      0721dfa5
  5. 16 Jan, 2020 1 commit
  6. 15 Jan, 2020 1 commit
  7. 13 Jan, 2020 1 commit
  8. 12 Jan, 2020 5 commits
  9. 08 Jan, 2020 3 commits
    • Ben Gamari's avatar
      testsuite: Fix Windows platform test · ca69875a
      Ben Gamari authored
      Previously we used platform.system() and while this worked fine (e.g.
      returned `Windows`, as expected) locally under both msys and MingW64
      Python distributions, it inexplicably returned `MINGW64_NT-10.0`
      under MingW64 Python on CI. It seems os.name is more reliable so we now
      use that instead..
      ca69875a
    • Ben Gamari's avatar
      Dummy commit · 196eec1a
      Ben Gamari authored
      To allow CI to pass despite the submodule linter.
      196eec1a
    • Ben Gamari's avatar
      Bump bytestring submodule to 0.10.10.0 · e3f34c31
      Ben Gamari authored
      e3f34c31
  10. 07 Jan, 2020 17 commits
    • Ben Gamari's avatar
      Placeholder · af67425c
      Ben Gamari authored
      To force CI to go through despite previous failure of submodule checker.
      af67425c
    • Ben Gamari's avatar
      configure: Only check GCC version if CC is GCC · a609dbe4
      Ben Gamari authored
      Also refactor FP_GCC_EXTRA_FLAGS in a few ways:
      
       * We no longer support compilers which lack support for -fno-builtin
         and -fwrapv so remove the condition on GccVersion
       * These flags are only necessary when using the via-C backend
         so make them conditional on Unregisterised.
      
      Fixes #15742.
      
      (cherry picked from commit adb04fa0a9f1824600b026487951db4d325f242e)
      a609dbe4
    • Alexey Kuleshevich's avatar
      hpc: Fix encoding issues. Add test for and fix #17073 · 9ee3e581
      Alexey Kuleshevich authored
      * Make sure files are being read/written in UTF-8. Set encoding while writing
        HTML output. Also set encoding while writing and reading .tix files although
        we don't yet have a ticket complaining that this poses problems.
      * Set encoding in html header to utf8
      * Upgrade to new version of 'hpc' library and reuse `readFileUtf8`
        and `writeFileUtf8` functions
      * Update git submodule for `hpc`
      * Bump up `hpc` executable version
      Co-authored-by: Ben Gamari's avatarBen Gamari <ben@smart-cactus.org>
      (cherry picked from commit afb23168fd28087ad0af339b559f90e3b70f2460)
      9ee3e581
    • Ryan Scott's avatar
      Prevent -optc arguments from being duplicated in reverse order (#17471) · 4156b877
      Ryan Scott authored
      This reverts a part of commit
      7bc5d6c6 that causes all arguments
      to `-optc` (and `-optcxx`) to be passed twice to the C/C++ compiler,
      once in reverse order and then again in the correct order. While
      passing duplicate arguments is usually harmless it can cause breakage
      in this pattern, which is employed by Hackage libraries in the wild:
      
      ```
      ghc Foo.hs foo.c -optc-D -optcFOO
      ```
      
      As `FOO -D -D FOO` will cause compilers to error.
      
      Fixes #17471.
      
      (cherry picked from commit 9a896a555242b7fe55be7215744ed38fd2ee6dfd)
      4156b877
    • Ben Gamari's avatar
      configure: Fix HAVE_C11_ATOMICS macro · 22d64112
      Ben Gamari authored
      Previously we were using AC_DEFINE instead of
      AC_DEFINE_UNQUOTED, resulted in the variable not being
      interpolated.
      
      Fixes #17505.
      
      (cherry picked from commit 2c66f364a761b7d0cfe766953aeb5d1f5921950d)
      22d64112
    • Sebastian Graf's avatar
      Make warnings for TH splices opt-in · a6ae0122
      Sebastian Graf authored
      In #17270 we have the pattern-match checker emit incorrect warnings. The
      reason for that behavior is ultimately an inconsistency in whether we
      treat TH splices as written by the user (`FromSource :: Origin`) or as
      generated code (`Generated`). This was first reported in #14838.
      
      The current solution is to TH splices as `Generated` by default and only
      treat them as `FromSource` when the user requests so
      (-fenable-th-splice-warnings). There are multiple reasons for opt-in
      rather than opt-out:
      
        * It's not clear that the user that compiles a splice is the author of the code
          that produces the warning. Think of the situation where she just splices in
          code from a third-party library that produces incomplete pattern matches.
          In this scenario, the user isn't even able to fix that warning.
        * Gathering information for producing the warnings (pattern-match check
          warnings in particular) is costly. There's no point in doing so if the user
          is not interested in those warnings.
      
      Fixes #17270, but not #14838, because the proper solution needs a GHC
      proposal extending the TH AST syntax.
      
      (cherry picked from commit c2ffcd476161a572ed0672b929ea59b8b97a231a)
      a6ae0122
    • Ryan Scott's avatar
      Fix @since annotations for isResourceVanishedError and friends (#17488) · cbff5303
      Ryan Scott authored
      (cherry picked from commit 5773fd87ea59bdd3ad4c5ab9eb84936f84c6080b)
      cbff5303
    • Abigail's avatar
      Make CorePrep.tryEtaReducePrep and CoreUtils.tryEtaReduce line up · 474a119c
      Abigail authored
      Simon PJ says he prefers this fix to #17429 over banning eta-reduction
      for jumps entirely. Sure enough, this also works.
      
      Test case: simplCore/should_compile/T17429.hs
      
      (cherry picked from commit 4a1e7e47)
      474a119c
    • Abigail's avatar
      Take care to not eta-reduce jumps in CorePrep · 61fe6c68
      Abigail authored
      CorePrep already had a check to prevent it from eta-reducing Ids that
      respond true to hasNoBinding (foreign calls, constructors for unboxed
      sums and products, and Ids with compulsory unfoldings). It did not,
      however, consider join points as ids that 'must be saturated'.
      
      Checking whether the Id responds True to 'isJoinId' should prevent
      CorePrep from turning saturated jumps like the following (from #17429)
      into undersaturated ones:
      
            (\ eta_XP ->
               join { mapped_s1vo _ = lvl_s1vs } in jump mapped_s1vo eta_XP)
      
      (cherry picked from commit de6bbdf2)
      61fe6c68
    • Stefan Schulze Frielinghaus's avatar
      Fix endian handling of LLVM backend · f3560a3a
      Stefan Schulze Frielinghaus authored
      Get rid of CPP macro WORDS_BIGENDIAN which is not defined anymore, and
      replace it by DynFlag. This fixes partially #17337.
      
      (cherry picked from commit 6c59cc71)
      f3560a3a
    • Ryan Scott's avatar
      Ignore unary constraint tuples during typechecking (#17511) · 4cfdeafd
      Ryan Scott authored
      We deliberately avoid defining a magical `Unit%` class, for reasons
      that I have expounded upon in the newly added
      `Note [Ignore unary constraint tuples]` in `TcHsType`. However, a
      sneaky user could try to insert `Unit%` into their program by way of
      Template Haskell, leading to the interface-file error observed
      in #17511. To avoid this, any time we encounter a unary constraint
      tuple during typechecking, we drop the surrounding constraint tuple
      application. This is safe to do since `Unit% a` and `a` would be
      semantically equivalent (unlike other forms of unary tuples).
      
      Fixes #17511.
      
      (cherry picked from commit 507328915b3ca7f947de0a23c8f10e744bdfa47b)
      4cfdeafd
    • Ben Gamari's avatar
      testsuite: Don't override LD_LIBRARY_PATH, only prepend · db5d2ed1
      Ben Gamari authored
      NixOS development environments often require that LD_LIBRARY_PATH
      be set in order to find system libraries. T1407 was overriding
      LD_LIBRARY_PATH, dropping these directories. Now it merely prepends,
      its directory.
      
      (cherry picked from commit cf4306f1c1ca565b0bbf68eebef44aa4594e6a0f)
      db5d2ed1
    • Alan Zimmerman's avatar
      API Annotations: Unicode '->' on HsForallTy · c194ba74
      Alan Zimmerman authored
      The code fragment
      
        type family Proxy2' ∷ ∀ k → k → Type where
          Proxy2' = Proxy'
      
      Generates AnnRarrow instead of AnnRarrowU for the first →.
      
      Fixes #17519
      
      (cherry picked from commit f5866f9aa7fcdf81f8d385d33a842be6e7f2f210)
      c194ba74
    • Ben Gamari's avatar
      rts/NonMovingSweep: Fix locking of new mutable list allocation · d37352ea
      Ben Gamari authored
      Previously we used allocBlockOnNode_sync in nonmovingSweepMutLists
      despite the fact that we aren't in the GC and therefore the allocation
      spinlock isn't in use. This meant that sweep would end up spinning until
      the next minor GC, when the SM lock was moved away from the SM_MUTEX to
      the spinlock. This isn't a correctness issue but it sure isn't good for
      performance.
      
      Found thanks for Ward.
      
      Fixes #17539.
      
      (cherry picked from commit af247ff861702869843e0d7d9a6b3523135734bb)
      d37352ea
    • Ben Gamari's avatar
      rts: Add a long form flag to enable the non-moving GC · c5d2bab5
      Ben Gamari authored
      The old flag, `-xn`, was quite cryptic. Here we add `--nonmoving-gc` in
      addition.
      
      (cherry picked from commit bcad4ea0ecb792d966e6b131e94dff33287d0e84)
      c5d2bab5
    • Ryan Scott's avatar
      lookupBindGroupOcc: recommend names in the same namespace (#17593) · 633e6942
      Ryan Scott authored
      Previously, `lookupBindGroupOcc`'s error message would recommend all
      similar names in scope, regardless of whether they were type
      constructors, data constructors, or functions, leading to the
      confusion witnessed in #17593. This is easily fixed by only
      recommending names in the same namespace, using the
      `nameSpacesRelated` function.
      
      Fixes #17593.
      
      (cherry picked from commit c1975facd490acb6d14abad4f5d58d0830dfc7c4)
      633e6942
    • Stefan Schulze Frielinghaus's avatar
      Fix endian handling w.r.t. CPP macro WORDS_BIGENDIAN · c3d8dadc
      Stefan Schulze Frielinghaus authored
      Include header file `ghcautoconf.h` where the CPP macro
      `WORDS_BIGENDIAN` is defined. This finally fixes #17337 (in conjunction
      with commit 6c59cc71).
      
      (cherry picked from commit 3c12355e)
      (cherry picked from commit 11f8eef5)
      c3d8dadc