1. 15 Oct, 2021 1 commit
    • sheaf's avatar
      Introduce Concrete# for representation polymorphism checks · 4bdb1d2d
      sheaf authored
      PHASE 1: we never rewrite Concrete# evidence.
      
      This patch migrates all the representation polymorphism checks to
      the typechecker, using a new constraint form
      
        Concrete# :: forall k. k -> TupleRep '[]
      
      Whenever a type `ty` must be representation-polymorphic
      (e.g. it is the type of an argument to a function), we emit a new
      `Concrete# ty` Wanted constraint. If this constraint goes
      unsolved, we report a representation-polymorphism error to the user.
      The 'FRROrigin' datatype keeps track of the context of the
      representation-polymorphism check, for more informative error messages.
      
      This paves the way for further improvements, such as
      allowing type families in RuntimeReps and improving the soundness
      of typed Template Haskell. This is left as future work (PHASE 2).
      
      fixes #17907 #20277 #20330 #20423 #20426
      
      updates haddock submodule
      
      -------------------------
      Metric Decrease:
          T5642
      -------------------------
      4bdb1d2d
  2. 14 Oct, 2021 6 commits
    • Matthew Pickering's avatar
      Some extra strictness in annotation fields · 481e6b54
      Matthew Pickering authored
      Locations can be quite long-lived so it's important that things which
      live in locations, such as annotations are forced promptly. Otherwise
      they end up retaining the entire PState, as evidenced by this retainer
      trace:
      
      ```
      PState 0x4277ce6cd8 0x4277ce6d00 0x7f61f12d37d8 0x7f61f12d37d8 0x7f61f135ef78 0x4277ce6d48 0x4277ce6d58 0x4277ce6d70 0x4277ce6d58 0x4277ce6d88 0x4277ce6da0 0x7f61f29782f0 0x7f61cd16b440 0x7f61cd16b440 0x7f61d00f8d18 0x7f61f296d290 0x7f61cd16b440 0x7f61d00f8d18 0x7f61cd16b4a8 0x7f61f135ef78 0x4277ce6db8 0x4277ce6dd0 0x7f61f134f358 0 3 <PState:GHC.Parser.Lexer:_build-ipe/stage1/compiler/build/GHC/Parser/Lexer.hs:3779:46>
      _thunk(  ) 0x4277ce6280 0x4277ce68a0 <([LEpaComment], [LEpaComment]):GHC.Parser.Lexer:>
      _thunk(  ) 0x4277ce6568 <EpAnnComments:GHC.Parser.Lexer:compiler/GHC/Parser/Lexer.x:2306:19-40>
      _thunk(  ) 0x4277ce62b0 0x4277ce62c0 0x4277ce6280 0x7f61f287fc58 <EpAnn AnnList:GHC.Parser:_build-ipe/stage1/compiler/build/GHC/Parser.hs:12664:13-32>
      SrcSpanAnn 0x4277ce6060 0x4277ce6048 <SrcSpanAnn':GHC.Parser:_build-ipe/stage1/compiler/build/GHC/Parser.hs:12664:3-35>
      L 0x4277ce4e70 0x428f8c9158 <GenLocated:GHC.Data.BooleanFormula:compiler/GHC/Data/BooleanFormula.hs:40:23-29>
      0x428f8c8318 : 0x428f8c8300 <[]:GHC.Base:libraries/base/GHC/Base.hs:1316:16-29>
      Or 0x428f8c7890 <BooleanFormula:GHC.Data.BooleanFormula:compiler/GHC/Data/BooleanFormula.hs:40:23-29>
      IfConcreteClass 0x7f61cd16b440 0x7f61cd16b440 0x428f8c7018 0x428f8c7030 <IfaceClassBody:GHC.Iface.Make:compiler/GHC/Iface/Make.hs:(640,12)-(645,13)>
      ```
      
      Making these few places strict is sufficient for now but there are
      perhaps more places which will need strictifying in future.
      
      -------------------------
      Metric Increase:
          parsing001
      -------------------------
      481e6b54
    • Alan Zimmerman's avatar
      EPA: Preserve semicolon order in annotations · 8b7f5424
      Alan Zimmerman authored
      Ensure the AddSemiAnn items appear in increasing order, so that if
      they are converted to delta format they are still in the correct
      order.
      
      Prior to this the exact printer sorted by Span, which is meaningless
      for EpaDelta locations.
      8b7f5424
    • Joachim Breitner's avatar
      fuzzyLookup: More deterministic order · f450e948
      Joachim Breitner authored
      else the output may depend on the input order, which seems it may depend
      on the concrete Uniques, which is causing headaches when including test
      cases about that.
      f450e948
    • Ziyang Liu's avatar
      Suggest -dynamic-too in failNonStd when applicable · 557d26fa
      Ziyang Liu authored
      I encountered an error that says
      
      ```
      Cannot load -dynamic objects when GHC is built the normal way
      To fix this, either:
        (1) Use -fexternal-interpreter, or
        (2) Build the program twice: once the normal way, and then
            with -dynamic using -osuf to set a different object file suffix.
      ```
      
      Or it could say
      
      ```
      (2) Use -dynamic-too
      ```
      557d26fa
    • Joachim Breitner's avatar
      Move BreakInfo into own module · 7f2ce0d6
      Joachim Breitner authored
      while working on GHCi stuff, e.g. `GHC.Runtime.Eval.Types`, I observed a
      fair amount of modules being recompiled that I didn’t expect to depend
      on this, from byte code interpreters to linkers. Turns out that the
      rather simple `BreakInfo` type is all these modules need from the
      `GHC.Runtime.Eval.*` hierarchy, so by moving that into its own file we
      make the dependency tree wider and shallower, which is probably worth
      it.
      7f2ce0d6
    • Matthew Pickering's avatar
      Make sure paths are quoted in install Makefile · df016e4e
      Matthew Pickering authored
      Previously it would fail with this error:
      
      ```
      if [ -L wrappers/ghc ]; then echo "ghc is a symlink"; fi
      ghc is a symlink
      cp: target 'dir/bin/ghc' is not a directory
      make: *** [Makefile:197: install_wrappers] Error 1
      ```
      
      which is because the install path contains a space.
      
      Fixes #20506
      df016e4e
  3. 13 Oct, 2021 12 commits
  4. 12 Oct, 2021 21 commits