Skip to content
Snippets Groups Projects
  1. Mar 11, 2020
    • Ryan Scott's avatar
      Re-quantify when generalising over rewrite rule types · 0bc23338
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      Previously, `tcRules` would check for naughty quantification
      candidates (see `Note [Naughty quantification candidates]` in
      `TcMType`) when generalising over the type of a rewrite rule. This
      caused sensible-looking rewrite rules (like those in #17710) to be
      rejected. A more permissing (and easier-to-implement) approach is to
      do what is described in `Note [Generalising in tcTyFamInstEqnGuts]`
      in `TcTyClsDecls`: just re-quantify all the type variable binders,
      regardless of the order in which the user specified them. After all,
      the notion of type variable specificity has no real meaning in
      rewrite rules, since one cannot "visibly apply" a rewrite rule.
      I have written up this wisdom in
      `Note [Re-quantify type variables in rules]` in `TcRules`.
      
      As a result of this patch, compiling the `ExplicitForAllRules1` test
      case now generates one fewer warning than it used to. As far as I can
      tell, this is benign, since the thing that the disappearing warning
      talked about was also mentioned in an entirely separate warning.
      
      Fixes #17710.
      0bc23338
    • Greg Steuck's avatar
      Fixed a minor typo in codegen.rst · 1daa2029
      Greg Steuck authored and Marge Bot's avatar Marge Bot committed
      1daa2029
    • Sylvain Henry's avatar
      Split GHC.Iface.Utils module · 20800b9a
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      * GHC.Iface.Recomp: recompilation avoidance stuff
      * GHC.Iface.Make: mkIface*
      
      Moved `writeIfaceFile` into GHC.Iface.Load alongside `readIface` and
      renamed it `writeIface` for consistency.
      20800b9a
    • Ben Gamari's avatar
      rts: Prefer darwin-specific getCurrentThreadCPUTime · bb586f89
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      macOS Catalina now supports a non-POSIX-compliant version of clock_gettime
      which cannot use the clock_gettime codepath.
      
      Fixes #17906.
      bb586f89
  2. Mar 10, 2020
  3. Mar 09, 2020
  4. Mar 05, 2020
  5. Mar 04, 2020
  6. Mar 02, 2020
    • Sylvain Henry's avatar
      Use configure script to detect that we should use in-tree GMP on Windows · 2a2f51d7
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      2a2f51d7
    • Roland Senn's avatar
      Set `ImpredicativeTypes` during :print command. (#14828) · 7c0c76fb
      Roland Senn authored and Marge Bot's avatar Marge Bot committed
      If ImpredicativeTypes is not enabled, then `:print <term>` will fail if the
      type of <term> has nested `forall`s or `=>`s.
      This is because the GHCi debugger's internals will attempt to unify a
      metavariable with the type of <term> and then display the result, but if the
      type has nested `forall`s or `=>`s, then unification will fail.
      As a result, `:print` will bail out and the unhelpful result will be
      `<term> = (_t1::t1)` (where `t1` is a metavariable).
      
      Beware: <term> can have nested `forall`s even if its definition doesn't use
      RankNTypes! Here is an example from #14828:
      
        class Functor f where
          fmap :: (a -> b) -> f a -> f b
      
      Somewhat surprisingly, `:print fmap` considers the type of fmap to have
      nested foralls. This is because the GHCi debugger sees the type
      `fmap :: forall f. Functor f => forall a b. (a -> b) -> f a -> f b`.
      We could envision deeply instantiating this type to get the type
      `forall f a b. Functor f => (a -> b) -> f a -> f b`,
      but this trick wouldn't work for higher-rank types.
      
      Instead, we adopt a simpler fix: enable `ImpredicativeTypes` when using
      `:print` and friends in the GHCi debugger. This is allows metavariables
      to unify with types that have nested (or higher-rank) `forall`s/`=>`s,
      which makes `:print fmap` display as
      `fmap = (_t1::forall a b. Functor f => (a -> b) -> f a -> f b)`, as expected.
      
      Although ImpredicativeTypes is a somewhat unpredictable from a type inference
      perspective, there is no danger in using it in the GHCi debugger, since all
      of the terms that the GHCi debugger deals with have already been typechecked.
      7c0c76fb
    • Ilias Tsitsimpis's avatar
      Do not define hs_atomic{read,write}64() on non-64bit · dbea7e9d
      Ilias Tsitsimpis authored and Marge Bot's avatar Marge Bot committed
      Do not define hs_atomicread64() and hs_atomicwrite64() on machines where
      WORD_SIZE_IN_BITS is less than 64, just like we do with the rest of the atomic
      functions which work on 64-bit values.
      
      Without this, compilation fails on MIPSel and PowerPC with the following error:
      
      /usr/bin/ld: /<<PKGBUILDDIR>>/libraries/ghc-prim/dist-install/build/libHSghc-prim-0.5.3_p.a(atomic.p_o): in function `hs_atomicread64':
      atomic.c:(.text.hs_atomicread64+0x8): undefined reference to `__sync_add_and_fetch_8'
      /usr/bin/ld: /<<PKGBUILDDIR>>/libraries/ghc-prim/dist-install/build/libHSghc-prim-0.5.3_p.a(atomic.p_o): in function `hs_atomicwrite64':
      atomic.c:(.text.hs_atomicwrite64+0x38): undefined reference to `__sync_bool_compare_and_swap_8'
      
      Fixes #17886.
      dbea7e9d
    • Krzysztof Gogolewski's avatar
      Remove dead code · 3cf7303b
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      * The names in PrelName and THNames are no longer used
        since TH merged types and kinds, Typeable is kind-polymorphic,
        .net support was removed
      * unqualQuasiQuote no longer used since 6f8ff0bb
      3cf7303b
  7. Feb 29, 2020
    • Roland Senn's avatar
      Show breakpoint locations of breakpoints which were ignored during :force (#2950) · 3979485b
      Roland Senn authored
      GHCi is split up into 2 major parts: The user-interface (UI)
      and the byte-code interpreter. With `-fexternal-interpreter`
      they even run in different processes. Communication between
      the UI and the Interpreter (called `iserv`) is done using
      messages over a pipe. This is called `Remote GHCI` and
      explained in the Note [Remote GHCi] in `compiler/ghci/GHCi.hs`.
      
      To process a `:force` command the UI sends a `Seq` message
      to the `iserv` process. Then `iserv` does the effective
      evaluation of the value. When during this process a breakpoint
      is hit, the `iserv` process has no additional information to
      enhance the `Ignoring breakpoint` output with the breakpoint
      location.
      
      To be able to print additional breakpoint information,
      there are 2 possible implementation choices:
      1. Store the needed information in the `iserv` process.
      2. Print the `Ignoring breakpoint` from the UI process.
      
      For option 1 we need to store the breakpoint info redundantely
      in 2 places and this is bad. Therfore option 2 was implemented
      in this MR:
      - The user enters a `force` command
      - The UI sends  a `Seq` message to the `iserv` process.
      - If processing of the `Seq` message hits a breakpoint,
        the `iserv` process returns control to the UI process.
      - The UI looks up the source location of the breakpoint,
        and prints the enhanced `Ignoring breakpoint` output.
      - The UI sends a `ResumeSeq` message to the `iserv` process,
        to continue forcing.
      3979485b
    • Ömer Sinan Ağacan's avatar
      Simplify IfaceIdInfo type · 04d30137
      Ömer Sinan Ağacan authored and Marge Bot's avatar Marge Bot committed
      IfaceIdInfo type is confusing: there's practically no difference between
      `NoInfo` and `HasInfo []`. The comments say NoInfo is used when
      -fomit-interface-pragmas is enabled, but we don't need to distinguish
      `NoInfo` from `HasInfo []` in when reading the interface so the
      distinction is not important.
      
      This patch simplifies the type by removing NoInfo. When we have no info
      we use an empty list.
      
      With this change we no longer read the info list lazily when reading an
      IfaceInfoItem, but when reading an IfaceId the ifIdInfo field is
      read lazily, so I doubt this is going to be a problem.
      04d30137
    • Sylvain Henry's avatar
      Fix Hadrian's ``--configure`` (fix #17883) · 34c7d230
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      34c7d230
    • Jean-Baptiste Mazon's avatar
      rts: enforce POSIX numeric locale for heap profiles · 252e5117
      Jean-Baptiste Mazon authored and Marge Bot's avatar Marge Bot committed
      252e5117
    • adam's avatar
      docs: correct link to th haddocks from users guide · 0f55df7f
      adam authored and Marge Bot's avatar Marge Bot committed
      0f55df7f
    • adam's avatar
      docs: correct relative links to haddocks from users guide (fixes #17866) · b86a6395
      adam authored and Marge Bot's avatar Marge Bot committed
      b86a6395
    • Sylvain Henry's avatar
      Refactor runtime interpreter code · 18757cab
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      In #14335 we want to be able to use both the internal interpreter (for
      the plugins) and the external interpreter (for TH and GHCi) at the same
      time.
      
      This patch performs some preliminary refactoring: the `hsc_interp` field
      of HscEnv replaces `hsc_iserv` and is now used to indicate which
      interpreter (internal, external) to use to execute TH and GHCi.
      
      Opt_ExternalInterpreter flag and iserv options in DynFlags are now
      queried only when we set the session DynFlags. It should help making GHC
      multi-target in the future by selecting an interpreter according to the
      selected target.
      18757cab
    • Ömer Sinan Ağacan's avatar
      Document and refactor a few things around bitmap scavenging · b5fb58fd
      Ömer Sinan Ağacan authored and Marge Bot's avatar Marge Bot committed
      - Added a few comments in StgPAP
      - Added a few comments and assertions in scavenge_small_bitmap and
        walk_large_bitmap
      - Did tiny refactor in GHC.Data.Bitmap: added some comments, deleted
        dead code, used PlatformWordSize type.
      b5fb58fd
    • xldenis's avatar
      Rename ghci.sh and build.sh to ghci and build respectively · a999ee96
      xldenis authored and Marge Bot's avatar Marge Bot committed
      Convert hadrian buildscripts to unsuffixed, dashed form
      
      final cleanups
      a999ee96
    • Ben Gamari's avatar
      plugins: Ensure that loadInterface plugins can see annotations · 99d2de86
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      loadInterface replaces the `mi_decls`, `mi_insts`, `mi_fam_insts`,
      `mi_rules`, `mi_anns` fields of ModIface with `undefined` before
      inserting the interface into the EPS. However, we still want to give
      loadInterface plugins access to these fields. Consequently, we want to
      pass the unmodified `ModIface` the plugin.
      99d2de86
    • Vladislav Zavialov's avatar
      Monotonic locations (#17632) · 327b29e1
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      When GHC is parsing a file generated by a tool, e.g. by the C preprocessor, the
      tool may insert #line pragmas to adjust the locations reported to the user.
      
      As the result, the locations recorded in RealSrcLoc are not monotonic. Elements
      that appear later in the StringBuffer are not guaranteed to have a higher
      line/column number.
      
      In fact, there are no guarantees whatsoever, as #line pragmas can arbitrarily
      modify locations. This lack of guarantees makes ideas such as #17544
      infeasible.
      
      This patch adds an additional bit of information to every SrcLoc:
      
      	newtype BufPos = BufPos { bufPos :: Int }
      
      A BufPos represents the location in the StringBuffer, unaffected by any
      pragmas.
      
      Updates haddock submodule.
      
      Metric Increase:
          haddock.Cabal
          haddock.base
          haddock.compiler
          MultiLayerModules
          Naperian
          parsing001
          T12150
      327b29e1
    • Ilias Tsitsimpis's avatar
      llvm-targets: Add arm-unknown-linux-gnueabi · 37f12603
      Ilias Tsitsimpis authored and Marge Bot's avatar Marge Bot committed
      Add arm-unknown-linux-gnueabi, which is used by Debian's ARM EABI port
      (armel), as an LLVM target.
      37f12603
Loading