Skip to content
Snippets Groups Projects
  1. Nov 17, 2019
  2. Nov 14, 2019
  3. Nov 13, 2019
    • Ben Gamari's avatar
      Ensure that coreView/tcView are able to inline · 2d4f9ad8
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Previously an import cycle between Type and TyCoRep meant that several
      functions in TyCoRep ended up SOURCE import coreView. This is quite
      unfortunate as coreView is intended to be fused into a larger pattern
      match and not incur an extra call.
      
      Fix this with a bit of restructuring:
      
       * Move the functions in `TyCoRep` which depend upon things in `Type`
         into `Type`
       * Fold contents of `Kind` into `Type` and turn `Kind` into a simple
         wrapper re-exporting kind-ish things from `Type`
       * Clean up the redundant imports that popped up as a result
      
      Closes #17441.
      
      Metric Decrease:
          T4334
      2d4f9ad8
  4. Nov 08, 2019
  5. Nov 06, 2019
    • Takenobu Tani's avatar
      configure: Add checking python3-sphinx · 97f9674b
      Takenobu Tani authored and Marge Bot's avatar Marge Bot committed
      This checks the configuration about python3-sphinx.
      We need python3-sphinx instead of python2-sphinx to build documentation.
      
      The approach is as follows:
      * Check python3 version with custom `conf.py` invoked from
        sphinx-build` executable
      * Place custom `conf.py` into new `utils/check-sphinx` directory
      
      If sphinx is for python2 not python3, it's treated as config ERROR
      instead of WARN.
      
      See also #17346 and #17356.
      97f9674b
  6. Nov 03, 2019
    • Sebastian Graf's avatar
      Separate `LPat` from `Pat` on the type-level · 182b1199
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      Since the Trees That Grow effort started, we had `type LPat = Pat`.
      This is so that `SrcLoc`s would only be annotated in GHC's AST, which is
      the reason why all GHC passes use the extension constructor `XPat` to
      attach source locations. See #15495 for the design discussion behind
      that.
      
      But now suddenly there are `XPat`s everywhere!
      There are several functions which dont't cope with `XPat`s by either
      crashing (`hsPatType`) or simply returning incorrect results
      (`collectEvVarsPat`).
      
      This issue was raised in #17330. I also came up with a rather clean and
      type-safe solution to the problem: We define
      
      ```haskell
      type family XRec p (f :: * -> *) = r | r -> p f
      type instance XRec (GhcPass p) f = Located (f (GhcPass p))
      type instance XRec TH          f =          f p
      type LPat p = XRec p Pat
      ```
      
      This is a rather modular embedding of the old "ping-pong" style, while
      we only pay for the `Located` wrapper within GHC. No ping-ponging in
      a potential Template Haskell AST, for example. Yet, we miss no case
      where we should've handled a `SrcLoc`: `hsPatType` and
      `collectEvVarsPat` are not callable at an `LPat`.
      
      Also, this gets rid of one indirection in `Located` variants:
      Previously, we'd have to go through `XPat` and `Located` to get from
      `LPat` to the wrapped `Pat`. Now it's just `Located` again.
      
      Thus we fix #17330.
      182b1199
  7. Oct 29, 2019
  8. Oct 28, 2019
    • Sebastian Graf's avatar
      Use FlexibleInstances for `Outputable (* p)` instead of match-all instances... · e951f219
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      Use FlexibleInstances for `Outputable (* p)` instead of match-all instances with equality constraints
      
      In #17304, Richard and Simon dicovered that using `-XFlexibleInstances`
      for `Outputable` instances of AST data types means users can provide orphan
      `Outputable` instances for passes other than `GhcPass`.
      
      Type inference doesn't currently to suffer, and Richard gave an example
      in #17304 that shows how rare a case would be where the slightly worse
      type inference would matter.
      
      So I went ahead with the refactoring, attempting to fix #17304.
      e951f219
  9. Oct 23, 2019
    • Andreas Klebinger's avatar
      Make dynflag argument for withTiming pure. · 6beea836
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      19 times out of 20 we already have dynflags in scope.
      
      We could just always use `return dflags`. But this is in fact not free.
      When looking at some STG code I noticed that we always allocate a
      closure for this expression in the heap. Clearly a waste in these cases.
      
      For the other cases we can either just modify the callsite to
      get dynflags or use the _D variants of withTiming I added which
      will use getDynFlags under the hood.
      6beea836
  10. Oct 22, 2019
    • Stefan Schulze Frielinghaus's avatar
      Implement s390x LLVM backend. · fd8b666a
      Stefan Schulze Frielinghaus authored and Marge Bot's avatar Marge Bot committed
      This patch adds support for the s390x architecture for the LLVM code
      generator. The patch includes a register mapping of STG registers onto
      s390x machine registers which enables a registerised build.
      fd8b666a
    • matthewbauer's avatar
      Replace freebsd-gnueabihf with freebsd · aa31ceaf
      matthewbauer authored and Marge Bot's avatar Marge Bot committed
      FreeBSD does not support GNU libc, so it makes no sense to use this
      triple. Most likely previous builds were just using the FreeBSD libc
      instead of gnueabihf. To fix this, we should just use
      armv6-unknown-freebsd and armv7-unknown-freebsd triples. Note that
      both of these are actually "soft-float", not "hard-float". FreeBSD has
      never officially released hard-float arm32:
      
      https://wiki.freebsd.org/ARMTier1
      aa31ceaf
  11. Oct 20, 2019
  12. Oct 18, 2019
  13. Oct 16, 2019
  14. Oct 09, 2019
  15. Oct 08, 2019
  16. Oct 07, 2019
  17. Oct 05, 2019
    • matthewbauer's avatar
      Add musl systems to llvm-targets · 8039b625
      matthewbauer authored and Marge Bot's avatar Marge Bot committed
      This was done in Nixpkgs, but never upstreamed. Musl is pretty much
      the same as gnu, but with a different libc. I’ve used the same values
      for everything.
      8039b625
    • John Ericson's avatar
      Factor out a smaller part of Platform for host fallback · dd8f76b2
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      dd8f76b2
    • John Ericson's avatar
      Per stage headers, ghc_boot_platform.h -> stage 0 ghcplatform.h · 05419e55
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      The generated headers are now generated per stage, which means we can
      skip hacks like `ghc_boot_platform.h` and just have that be the stage 0
      header as proper. In general, stages are to be embraced: freely generate
      everything in each stage but then just build what you depend on, and
      everything is symmetrical and efficient. Trying to avoid stages because
      bootstrapping is a mind bender just creates tons of bespoke
      mini-mind-benders that add up to something far crazier.
      
      Hadrian was pretty close to this "stage-major" approach already, and so
      was fairly easy to fix. Make needed more work, however: it did know
      about stages so at least there was a scaffold, but few packages except
      for the compiler cared, and the compiler used its own counting system.
      That said, make and Hadrian now work more similarly, which is good for
      the transition to Hadrian. The merits of embracing stage aside, the
      change may be worthy for easing that transition alone.
      05419e55
  18. Sep 25, 2019
    • Ryan Scott's avatar
      Remove unneeded CPP now that GHC 8.6 is the minimum · 795986aa
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      The minimum required GHC version for bootstrapping is 8.6, so we can
      get rid of some unneeded `#if `__GLASGOW_HASKELL__` CPP guards, as
      well as one `MIN_VERSION_ghc_prim(0,5,3)` guard (since GHC 8.6 bundles
      `ghc-prim-0.5.3`).
      795986aa
  19. Sep 20, 2019
  20. Sep 17, 2019
  21. Sep 13, 2019
  22. Sep 12, 2019
  23. Sep 09, 2019
    • Sylvain Henry's avatar
      Module hierarchy: StgToCmm (#13009) · 447864a9
      Sylvain Henry authored
      Add StgToCmm module hierarchy. Platform modules that are used in several
      other places (NCG, LLVM codegen, Cmm transformations) are put into
      GHC.Platform.
      447864a9
  24. Sep 07, 2019
    • Ömer Sinan Ağacan's avatar
      Minor refactoring in deriveConstants · 821bece9
      Ömer Sinan Ağacan authored and Marge Bot's avatar Marge Bot committed
      Mainly we now generate this
      
          data PlatformConstants = PlatformConstants {
                pc_CONTROL_GROUP_CONST_291 :: Int,
                pc_STD_HDR_SIZE :: Int,
                pc_PROF_HDR_SIZE :: Int,
                pc_BLOCK_SIZE :: Int,
            }
      
      instead of
      
          data PlatformConstants = PlatformConstants {
              pc_platformConstants :: ()
              , pc_CONTROL_GROUP_CONST_291 :: Int
              , pc_STD_HDR_SIZE :: Int
              , pc_PROF_HDR_SIZE :: Int
              , pc_BLOCK_SIZE :: Int
              ...
            }
      
      The first field has no use and according to (removed) comments it was to
      make code generator's work easier.. if anything this version is simpler
      because it has less repetition (the commas in strings are gone).
      821bece9
  25. Aug 07, 2019
  26. Jul 21, 2019
  27. Jul 14, 2019
    • John Ericson's avatar
      Expunge #ifdef and #ifndef from the codebase · d7c6c471
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      These are unexploded minds as far as the linter is concerned. I don't
      want to hit in my MRs by mistake!
      
      I did this with `sed`, and then rolled back some changes in the docs,
      config.guess, and the linter itself.
      d7c6c471
  28. Jul 10, 2019
    • John Ericson's avatar
      Deduplicate "unique subdir" code between GHC and Cabal · 24782b89
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      The code, including the generated module with the version, is now in
      ghc-boot. Config.hs reexports stuff as needed, ghc-pkg doesn't need any
      tricks at all.
      24782b89
    • John Ericson's avatar
      Remove most uses of TARGET platform macros · 0472f0f6
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      These prevent multi-target builds. They were gotten rid of in 3 ways:
      
      1. In the compiler itself, replacing `#if` with runtime `if`. In these
      cases, we care about the target platform still, but the target platform
      is dynamic so we must delay the elimination to run time.
      
      2. In the compiler itself, replacing `TARGET` with `HOST`. There was
      just one bit of this, in some code splitting strings representing lists
      of paths. These paths are used by GHC itself, and not by the compiled
      binary. (They are compiler lookup paths, rather than RPATHS or something
      that does matter to the compiled binary, and thus would legitamentally
      be target-sensative.) As such, the path-splitting method only depends on
      where GHC runs and not where code it produces runs. This should have
      been `HOST` all along.
      
      3. Changing the RTS. The RTS doesn't care about the target platform,
      full stop.
      
      4. `includes/stg/HaskellMachRegs.h` This file is also included in the
      genapply executable. This is tricky because the RTS's host platform
      really is that utility's target platform. so that utility really really
      isn't multi-target either. But at least it isn't an installed part of
      GHC, but just a one-off tool when building the RTS. Lying with the
      `HOST` to a one-off program (genapply) that isn't installed doesn't seem so bad.
      It's certainly better than the other way around of lying to the RTS
      though not to genapply. The RTS is more important, and it is installed,
      *and* this header is installed as part of the RTS.
      0472f0f6
  29. Jul 09, 2019
    • Ryan Scott's avatar
      Use an empty data type in TTG extension constructors (#15247) · 6a03d77b
      Ryan Scott authored
      To avoid having to `panic` any time a TTG extension constructor is
      consumed, this MR introduces an uninhabited 'NoExtCon' type and uses
      that in every extension constructor's type family instance where it
      is appropriate. This also introduces a 'noExtCon' function which
      eliminates a 'NoExtCon', much like 'Data.Void.absurd' eliminates
      a 'Void'.
      
      I also renamed the existing `NoExt` type to `NoExtField` to better
      distinguish it from `NoExtCon`. Unsurprisingly, there is a lot of
      code churn resulting from this.
      
      Bumps the Haddock submodule. Fixes #15247.
      6a03d77b
  30. Jun 26, 2019
    • Oleg Grenrus's avatar
      Add -Winferred-safe-imports warning · a863c44f
      Oleg Grenrus authored and Ben Gamari's avatar Ben Gamari committed
      This commit partly reverts e69619e9
      commit by reintroducing Sf_SafeInferred SafeHaskellMode.
      
      We preserve whether module was declared or inferred Safe.  When
      declared-Safe module imports inferred-Safe, we warn.  This inferred
      status is volatile, often enough it's a happy coincidence, something
      which cannot be relied upon. However, explicitly Safe or Trustworthy
      packages won't accidentally become Unsafe.
      
      Updates haddock submodule.
      a863c44f
    • Ben Gamari's avatar
      Bump containers submodule to v0.6.2.1 · 4c2127c4
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      4c2127c4
  31. Jun 24, 2019
  32. Jun 20, 2019
  33. Jun 16, 2019
Loading