1. 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)
    • Ben Gamari's avatar
      Bump binary submodule · 3b63d029
      Ben Gamari authored
  2. 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)
    • 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)
  3. 16 Jan, 2020 1 commit
  4. 15 Jan, 2020 1 commit
  5. 13 Jan, 2020 1 commit
  6. 12 Jan, 2020 5 commits
  7. 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..
    • Ben Gamari's avatar
      Dummy commit · 196eec1a
      Ben Gamari authored
      To allow CI to pass despite the submodule linter.
    • Ben Gamari's avatar
      Bump bytestring submodule to · e3f34c31
      Ben Gamari authored
  8. 07 Jan, 2020 25 commits
    • Ben Gamari's avatar
      Placeholder · af67425c
      Ben Gamari authored
      To force CI to go through despite previous failure of submodule checker.
    • 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 adb04fa0)
    • 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 afb23168)
    • 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 9a896a55)
    • 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
      Fixes #17505.
      (cherry picked from commit 2c66f364)
    • 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 c2ffcd47)
    • Ryan Scott's avatar
      Fix @since annotations for isResourceVanishedError and friends (#17488) · cbff5303
      Ryan Scott authored
      (cherry picked from commit 5773fd87)
    • 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)
    • 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)
    • 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)
    • 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 50732891)
    • 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 cf4306f1)
    • 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 f5866f9a)
    • 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
      Found thanks for Ward.
      Fixes #17539.
      (cherry picked from commit af247ff8)
    • 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
      (cherry picked from commit bcad4ea0)
    • 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 c1975fac)
    • 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)
    • Gabor Greif's avatar
      while at it rename XCode to the official Xcode · a9bd5420
      Gabor Greif authored
      (cherry picked from commit 1c302c62)
    • Gabor Greif's avatar
      suppress popup dialog about missing Xcode at configure · 5f6b2636
      Gabor Greif authored
      tested with `bash` and `zsh`.
      (cherry picked from commit 78ce1b41)
    • Gabor Greif's avatar
      use shell variable CcLlvmBackend for test · 3ddb196d
      Gabor Greif authored
      Previously we used `AC_DEFINE`d variable `CC_LLVM_BACKEND` which has an empty shell expansion.
      (cherry picked from commit 7cfb9baf)
    • Ben Gamari's avatar
      driver: Include debug level in the recompilation check hash · 029b1b78
      Ben Gamari authored
      Fixes #17586.
      (cherry picked from commit 40f14165)
    • Ben Gamari's avatar
      rts: Ensure that nonmoving gc isn't used with profiling · 4186c713
      Ben Gamari authored
      (cherry picked from commit 5f91c661)
    • Ben Gamari's avatar
      llvmGen: Ensure that entry labels don't have predecessors · ae3573a7
      Ben Gamari authored
      The LLVM IR forbids the entry label of a procedure from having any
      predecessors. In the case of a simple looping function the LLVM code
      generator broke this invariant, as noted in #17589. Fix this by
      moving the function prologue to its own basic block, as suggested by
      @kavon in #11649.
      Fixes #11649 and #17589.
      (cherry picked from commit a9d97026)
    • Ben Gamari's avatar
      llvmGen: Drop old fix for #11649 · baf3e687
      Ben Gamari authored
      This was a hack which is no longer necessary now since we introduce a
      dedicated entry block for each procedure.
      (cherry picked from commit 72af6e9e)
    • Ben Gamari's avatar
      configure: Find Python3 for testsuite · 9e3dc52e
      Ben Gamari authored
      In addition, we prefer the Mingw64 Python distribution on Windows due
      to #17483.
      (cherry picked from commit bd716d58)