1. 15 Dec, 2021 22 commits
    • Cheng Shao's avatar
      Add a note to base changelog · 6cea7311
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      6cea7311
    • Cheng Shao's avatar
      base: fix autoconf detection of C pointer types · 89c1ffd6
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      We used to attempt compiling `foo_t val; *val;` to determine if `foo_t`
      is a pointer type in C. This doesn't work if `foo_t` points to an
      incomplete type, and autoconf will detect `foo_t` as a floating point
      type in that case. Now we use `memset(val, 0, 0)` instead, and it works
      for incomplete types as well.
      89c1ffd6
    • Cheng Shao's avatar
      base: use `CUIntPtr` instead of `Ptr ()` as the autoconf detected Haskell type for C pointers · d13b9f20
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      When autoconf detects a C pointer type, we used to specify `Ptr ()` as
      the Haskell type. This doesn't work in some cases, e.g. in `wasi-libc`,
      `clockid_t` is a pointer type, but we expected `CClockId` to be an
      integral type, and `Ptr ()` lacks various integral type instances.
      d13b9f20
    • abarbu's avatar
      Plugin load order should follow the commandline order (fixes #17884) · f5a0b408
      abarbu authored and Marge Bot's avatar Marge Bot committed
      In the past the order was reversed because flags are consed onto a list.
      No particular behavior was documented.
      
      We now reverse the flags and document the behavior.
      f5a0b408
    • Joachim Breitner's avatar
      Test case from #19313 · 45bd6308
      Joachim Breitner authored and Marge Bot's avatar Marge Bot committed
      45bd6308
    • Greg Steuck's avatar
      Add OpenBSD to llvm-targets · 34abbd81
      Greg Steuck authored and Marge Bot's avatar Marge Bot committed
      This improves some tests that previously failed with:
      
      ghc: panic! (the 'impossible' happened)
        GHC version 9.3.20211211:
              Failed to lookup LLVM data layout
        Target: x86_64-unknown-openbsd
      
      Added the new generated lines to `llvm-targets` on an openbsd
      7.0-current with clang 11.1.0.
      34abbd81
    • doyougnu's avatar
      CmmToLlvm: rename LCGConfig -> LlvmCgConfig · 70f0aafe
      doyougnu authored and Marge Bot's avatar Marge Bot committed
      CmmToLlvm: renamce lcgPlatform -> llvmCgPlatform
      
      CmmToLlvm: rename lcgContext -> llvmCgContext
      
      CmmToLlvm: rename lcgFillUndefWithGarbage
      
      CmmToLlvm: rename lcgSplitSections
      
      CmmToLlvm: lcgBmiVersion -> llvmCgBmiVersion
      
      CmmToLlvm: lcgLlvmVersion -> llvmCgLlvmVersion
      
      CmmToLlvm: lcgDoWarn -> llvmCgDoWarn
      
      CmmToLlvm: lcgLlvmConfig -> llvmCgLlvmConfig
      
      CmmToLlvm: llvmCgPlatformMisc --> llvmCgLlvmTarget
      70f0aafe
    • doyougnu's avatar
      CmmToLlvm.Config: strictify LlvmConfig field · bc663f87
      doyougnu authored and Marge Bot's avatar Marge Bot committed
      bc663f87
    • doyougnu's avatar
      LLVM.CodeGen: use fast-string literals · 80016022
      doyougnu authored and Marge Bot's avatar Marge Bot committed
      That is remove factorization of common strings and string building
      code for the LLVM code gen ops. Replace these with string literals
      to obey the FastString rewrite rule in GHC.Data.FastString and compute
      the string length at compile time
      80016022
    • doyougnu's avatar
      SysTools.Tasks Llvm.Types: remove redundant import · 6b0fb9a0
      doyougnu authored and Marge Bot's avatar Marge Bot committed
      Llvm.Types: remove redundant import
      
      SysTools.Tasks: remove redundant import
      
      - namely CmmToLlvm.Base
      6b0fb9a0
    • doyougnu's avatar
      CmmToLlvm: Remove DynFlags, add LlvmCgConfig · ecaec722
      doyougnu authored and Marge Bot's avatar Marge Bot committed
      CodeOutput: LCGConfig, add handshake initLCGConfig
      
      Add two modules:
      GHC.CmmToLlvm.Config                -- to hold the Llvm code gen config
      GHC.Driver.Config.CmmToLlvm         -- for initialization, other utils
      
      CmmToLlvm: remove HasDynFlags, add LlvmConfig
      
      CmmToLlvm: add lcgContext to LCGConfig
      
      CmmToLlvm.Base: DynFlags --> LCGConfig
      
      Llvm: absorb LlvmOpts into LCGConfig
      
      CmmToLlvm.Ppr: swap DynFlags --> LCGConfig
      
      CmmToLlvm.CodeGen: swap DynFlags --> LCGConfig
      
      CmmToLlvm.CodeGen: swap DynFlags --> LCGConfig
      
      CmmToLlvm.Data: swap LlvmOpts --> LCGConfig
      
      CmmToLlvm: swap DynFlags --> LCGConfig
      
      CmmToLlvm: move LlvmVersion to CmmToLlvm.Config
      
      Additionally:
      - refactor Config and initConfig to hold LlvmVersion
      - push IO needed to get LlvmVersion to boundary between Cmm and LLvm
      code generation
      - remove redundant imports, this is much cleaner!
      
      CmmToLlvm.Config: store platformMisc_llvmTarget
      
      instead of all of platformMisc
      ecaec722
    • Ben Gamari's avatar
      libiserv: Rename Lib module to IServ · 0198bb11
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      As proposed in #20546.
      0198bb11
    • Ben Gamari's avatar
      ghc-bin: Add --merge-objs mode · 5686f47b
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This adds a new mode, `--merge-objs`, which can be used to produce
      merged GHCi library objects.
      
      As future work we will rip out the object-merging logic in Hadrian and
      Cabal and instead use this mode.
      
      Closes #20712.
      5686f47b
    • Ben Gamari's avatar
      compiler: Use withFile instead of bracket · 71ecb55b
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      A minor refactoring noticed by hlint.
      71ecb55b
    • Ben Gamari's avatar
      compiler: Drop `Maybe ModLocation` from T_MergeForeign · 4f654071
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This field was entirely unused.
      4f654071
    • Ben Gamari's avatar
      users-guide: Fix documentation for -shared flag · 82c39f4d
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This flag was previously called `--mk-dll`. It was renamed to `-shared`
      in b562cbe3 but the documentation wasn't
      updated to match.
      82c39f4d
    • MichaWiedenmann1's avatar
      Fixes typo in documentation of the Semigroup instance of Equivalence · 55cb2aa7
      MichaWiedenmann1 authored and Marge Bot's avatar Marge Bot committed
      55cb2aa7
    • Cheng Shao's avatar
      base: fix clockid_t usage when it's a pointer type in C · 7c2609d8
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      Closes #20607.
      7c2609d8
    • Joachim Breitner's avatar
      Ghci environment: Do not remove shadowed ids · a5d8d47f
      Joachim Breitner authored and Marge Bot's avatar Marge Bot committed
      Names defined earier but shadowed need to be kept around, e.g. for type
      signatures:
      ```
      ghci> data T = T
      ghci> let t = T
      ghci> data T = T
      ghci> :t t
      t :: Ghci1.T
      ```
      and indeed they can be used:
      ```
      ghci> let t2 = Ghci1.T :: Ghci1.T
      ghci> :t t2
      t2 :: Ghci1.T
      ```
      
      However, previously this did not happen for ids (non-types), although they
      are still around under the qualified name internally:
      ```
      ghci> let t = "other t"
      ghci> t'
      
      <interactive>:8:1: error:
          • Variable not in scope: t'
          • Perhaps you meant one of these:
              ‘Ghci2.t’ (imported from Ghci2), ‘t’ (line 7), ‘t2’ (line 5)
      ghci> Ghci2.t
      
      <interactive>:9:1: error:
          • GHC internal error: ‘Ghci2.t’ is not in scope during type checking, but it passed the renamer
            tcl_env of environment: []
          • In the expression: Ghci2.t
            In an equation for ‘it’: it = Ghci2.t
      ```
      
      This fixes the problem by simply removing the code that tries to remove
      shadowed ids from the environment. Now you can refer to shadowed ids using
      `Ghci2.t`, just like you can do for data and type constructors. This
      simplifies the code, makes terms and types more similar, and also
      fixes #20455.
      
      Now all names ever defined in GHCi are in `ic_tythings`, which is printed by
      `:show bindings`. But for that commands, it seems to be more ergonomic
      to only list those bindings that are not shadowed. Or, even if it is not
      more ergonomic, it’s the current behavour. So let's restore that by filtering
      in `icInScopeTTs`.
      
      Of course a single `TyThing` can be associated with many names. We keep
      it it in the bindings if _any_ of its names are still visible
      unqualifiedly. It's a judgement call.
      
      This commit also turns a rather old comment into a test files.
      The comment is is rather stale and things are better explained
      elsewhere. Fixes #925.
      
      Two test cases are regressing:
      
                         T14052(ghci) ghc/alloc  2749444288.0 12192109912.0 +343.4% BAD
                     T14052Type(ghci) ghc/alloc  7365784616.0 10767078344.0  +46.2% BAD
      
      This is not unexpected; the `ic_tythings list grows` a lot more if we
      don’t remove shadowed Ids. I tried to alleviate it a bit with earlier
      MRs, but couldn’t make up for it completely.
      
      Metric Increase:
          T14052
          T14052Type
      a5d8d47f
    • alirezaghey's avatar
      fix ambiguity in `const` documentation · 1c8d609a
      alirezaghey authored and Marge Bot's avatar Marge Bot committed
      fixes #20412
      1c8d609a
    • Tamar Christina's avatar
      rts: update xxhash used by the linker's hashmap · 8a2de3c2
      Tamar Christina authored and Marge Bot's avatar Marge Bot committed
      8a2de3c2
    • Vaibhav Sagar's avatar
      Data.Functor.Classes: fix Ord1 instance for Down · 9ff54ea8
      Vaibhav Sagar authored and Marge Bot's avatar Marge Bot committed
      9ff54ea8
  2. 14 Dec, 2021 1 commit
  3. 12 Dec, 2021 6 commits
    • Greg Steuck's avatar
      Respect W^X in Linker.c:preloadObjectFile on OpenBSD · 401ddd53
      Greg Steuck authored and Marge Bot's avatar Marge Bot committed
      This fixes -fexternal-interpreter for ghci. Fixes #20814.
      401ddd53
    • Oleg Grenrus's avatar
      Use HasCallStack and error in GHC.List and .NonEmpty · 31bf380f
      Oleg Grenrus authored and Marge Bot's avatar Marge Bot committed
      In addition to providing stack traces, the scary HasCallStack will
      hopefully make people think whether they want to use these functions,
      i.e. act as a documentation hint that something weird might happen.
      
      A single metric increased, which doesn't visibly
      use any method with `HasCallStack`.
      
      -------------------------
      Metric Decrease:
          T9630
      Metric Decrease:
          T19695
          T9630
      -------------------------
      31bf380f
    • Andrey Mokhov's avatar
      Drop --configure from Hadrian docs · 93783e6a
      Andrey Mokhov authored and Marge Bot's avatar Marge Bot committed
      93783e6a
    • Ben Gamari's avatar
      gitlab-ci: Bump fedora jobs to use Fedora 33 · f04d1a49
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Annoyingly, this will require downstream changes in head.hackage, which
      depends upon the artifact produced by this job.
      
      Prompted by !6462.
      f04d1a49
    • Matthew Pickering's avatar
      iserv: Remove network dependent parts of libiserv · 6b2947d2
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      As noted in #20794 the parts of libiserv and iserv-proxy depend on
      network, therefore are never built nor tested during CI.
      
      Due to this iserv-proxy had bitrotted due to the bound on bytestring
      being out of date.
      
      Given we don't test this code it seems undesirable to distribute it.
      Therefore, it's removed and an external maintainer can be responsible
      for testing it (via head.hackage if desired).
      
      Fixes #20794
      6b2947d2
    • Douglas Wilson's avatar
      rts: correct stats when running with +RTS -qn1 · 40a44f68
      Douglas Wilson authored and Marge Bot's avatar Marge Bot committed
      Despite the documented care having been taken, several bugs are fixed here.
      
      When run with -qn1, when a SYNC_GC_PAR is requested we will have
      
      n_gc_threads == n_capabilities && n_gc_idle_threads == (n_gc_threads - 1)
      
      In this case we now:
      * Don't increment par_collections
      * Don't increment par_balanced_copied
      * Don't emit debug traces for idle threads
      * Take the fast path in scavenge_until_all_done, wakeup_gc_threads, and
          shutdown_gc_threads.
      
      Some ASSERTs have also been tightened.
      
      Fixes #19685
      40a44f68
  4. 11 Dec, 2021 3 commits
  5. 10 Dec, 2021 8 commits