summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* hadrian: Don't rely on realpath in bindist Makefilewip/T19963Ben Gamari2021-12-013-4/+58
| | | | | | | | As noted in #19963, `realpath` is not specified by POSIX and therefore cannot be assumed to be available. Here we provide a POSIX shell implementation of `realpath`, due to Julian Ospald and others. Closes #19963.
* Use Monoid in hptSomeThingsBelowUsSylvain Henry2021-11-291-18/+15
| | | | | | | | | | It seems to have a moderate but good impact on perf tests in CI. In particular: MultiLayerModules(normal) ghc/alloc 3125771138.7 3065532240.0 -1.9% So it's likely that huge projects will benefit from this.
* TTG: replace Void/NoExtCon with DataConCantHappenKrzysztof Gogolewski2021-11-2914-147/+134
| | | | | | | | There were two ways to indicate that a TTG constructor is unused in a phase: `NoExtCon` and `Void`. This unifies the code, and uses the name 'DataConCantHappen', following the discussion at MR 7041. Updates haddock submodule
* linker: Introduce linker_verbose debug outputBen Gamari2021-11-296-115/+132
| | | | | | | | This splits the -Dl RTS debug output into two distinct flags: * `+RTS -Dl` shows errors and debug output which scales with at most O(# objects) * `+RTS -DL` shows debug output which scales with O(# symbols)t
* Make ambient MinGW support a proper settingsJohn Ericson2021-11-2714-40/+55
| | | | | | | Get rid of `USE_INPLACE_MINGW_TOOLCHAIN` and use a settings file entry instead. The CPP setting was originally introduced in f065b6b012.
* Fix top-level configure script so --disable-foo worksJohn Ericson2021-11-271-12/+10
|
* Factor our `FP_CAPITALIZE_YES_NO`John Ericson2021-11-275-17/+18
| | | | | This deduplicates converting from yes/no to YES/NO in the configure scripts while also making it safer.
* Allow keywords which can be used as variables to be used with ↵Matthew Pickering2021-11-263-1/+11
| | | | | | | | | | | | | OverloadedDotSyntax There are quite a few keywords which are allowed to be used as variables. Such as "as", "dependency" etc. These weren't accepted by OverloadedDotSyntax. The fix is pretty simple, use the varid production rather than raw VARID. Fixes #20723
* Reflect type change in the haddock commentKai Prott2021-11-261-1/+1
|
* Adapt plugin test caseKai Prott2021-11-261-1/+1
|
* Fix plugin type to GHC.Plugins.PluginKai Prott2021-11-261-1/+1
|
* Simplify printQualificationKai Prott2021-11-261-7/+2
|
* Remove duplicate importKai Prott2021-11-261-1/+0
|
* Improve error message for mis-typed plugins #20671Kai Prott2021-11-263-16/+26
| | | | Previously, when a plugin could not be loaded because it was incorrectly typed, the error message only printed the expected but not the actual type. This commit augments the error message such that both types are printed and the corresponding module is printed as well.
* Rename Data.Array.ByteArray -> Data.Array.ByteBodigrim2021-11-263-8/+8
|
* Rename Data.ByteArray to Data.Array.ByteArray + add TrustworthyBodigrim2021-11-263-8/+9
|
* Kill a use of %n format specifierGreg Steuck2021-11-253-15/+21
| | | | | | | | | | | | | | This format has been used as a security exploit vector for decades now. Some operating systems (OpenBSD, Android, MSVC). It is targeted for removal in C2X standard: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2834.htm This requires extending the debug message function to return the number of bytes written (like printf(3)), to permit %n format specifier in one in one invocation of statsPrintf() in report_summary(). Implemented by Matthias Kilian (kili<AT>outback.escape.de)
* Permit multiple values in config_args for validateGreg Steuck2021-11-251-1/+1
| | | | | The whitespace expansion should be permitted to pass multiple arguments to configure.
* Link against libatomic for 64-bit atomic operationsIlias Tsitsimpis2021-11-251-6/+37
| | | | | | | Some platforms (e.g., armel) require linking against libatomic for 64-bit atomic operations. Fixes #20549
* hadrian: Add `collect_stats` flavour transformerSebastian Graf2021-11-252-0/+20
| | | | | This is useful for later consumption with https://gitlab.haskell.org/bgamari/ghc-utils/-/blob/master/ghc_timings.py
* compiler: Mark GHC.Prelude as Haddock no-homeBen Gamari2021-11-251-0/+1
| | | | This significantly improves Haddock documentation generated by nix.
* Allow boring class declarations in hs-boot filessheaf2021-11-2514-4/+126
| | | | | | | | | | | | | | | | | | | | | | | There are two different ways of declaring a class in an hs-boot file: - a full declaration, where everything is written as it is in the .hs file, - an abstract declaration, where class methods and superclasses are left out. However, a declaration with no methods and a trivial superclass, such as: class () => C a was erroneously considered to be an abstract declaration, because the superclass is trivial. This is remedied by a one line fix in GHC.Tc.TyCl.tcClassDecl1. This patch also further clarifies the documentation around class declarations in hs-boot files. Fixes #20661, #20588.
* Add `llvmOptLevel` to `DynFlags` (#20500)Gergo ERDI2021-11-252-5/+7
|
* Add specific optimization flag for Cmm control flow analysis (#20500)Gergo ERDI2021-11-254-2/+15
|
* Add specific optimization flag for fast PAP calls (#6084, #20500)Gergo ERDI2021-11-254-1/+5
|
* Use `simplify` in non-optimizing build pipeline (#20500)Gergo ERDI2021-11-251-4/+2
|
* GHCi Debugger - Improve RTTIRoland Senn2021-11-253-10/+13
| | | | | | | When processing the heap, use also `APClosures` to create additional type constraints. This adds more equations and therefore improves the unification process to infer the correct type of values at breakpoints. (Fix the `incr` part of #19559)
* drop instance Semigroup InstalledModuleEnvPepe Iborra2021-11-251-1/+4
| | | | Instead, introduce plusInstalledModuleEnv
* Drop instance Semigroup ModuleEnvPepe Iborra2021-11-251-1/+0
| | | | There is more than one possible Semigroup and it is not needed since plusModuleEnv can be used directly
* Monoid instance for InstalledModuleEnvPepe Iborra2021-11-251-0/+3
|
* gitlab-ci: Add release jobs for Darwin targetsBen Gamari2021-11-251-13/+30
| | | | | | | | | As noted in #20707, the validate jobs which we previously used lacked profiling support. Also clean up some variable definitions. Fixes #20707.
* testsuite: debounce title updatesZubin Duggal2021-11-251-5/+20
|
* Disable warnings for unused goto labelsGreg Steuck2021-11-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Clang on OpenBSD aborts compilation with this diagnostics: ``` % "inplace/bin/ghc-stage1" -optc-Wno-error=unused-label -optc-Wall -optc-Werror -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Wno-aggregate-return -optc-fno-strict-aliasing -optc-fno-common -optc-Irts/dist-install/build/./autogen -optc-Irts/include/../dist-install/build/include -optc-Irts/include/. -optc-Irts/. -optc-DCOMPILING_RTS -optc-DFS_NAMESPACE=rts -optc-Wno-unknown-pragmas -optc-O2 -optc-fomit-frame-pointer -optc-g -optc-DRtsWay=\"rts_v\" -static -O0 -H64m -Wall -fllvm-fill-undef-with-garbage -Werror -this-unit-id rts -dcmm-lint -package-env - -i -irts -irts/dist-install/build -Irts/dist-install/build -irts/dist-install/build/./autogen -Irts/dist-install/build/./autogen -Irts/include/../dist-install/build/include -Irts/include/. -Irts/. -optP-DCOMPILING_RTS -optP-DFS_NAMESPACE=rts -O2 -Wcpp-undef -Wnoncanonical-monad-instances -c rts/linker/Elf.c -o rts/dist-install/build/linker/Elf.o rts/linker/Elf.c:2169:1: error: error: unused label 'dl_iterate_phdr_fail' [-Werror,-Wunused-label] | 2169 | dl_iterate_phdr_fail: | ^ dl_iterate_phdr_fail: ^~~~~~~~~~~~~~~~~~~~~ rts/linker/Elf.c:2172:1: error: error: unused label 'dlinfo_fail' [-Werror,-Wunused-label] | 2172 | dlinfo_fail: | ^ dlinfo_fail: ^~~~~~~~~~~~ 2 errors generated. ```
* Don't use implicit lifting when deriving LiftMatthew Pickering2021-11-254-10/+34
| | | | | | | | | | | | | | | | It isn't much more complicated to be more precise when deriving Lift so we now generate ``` data Foo = Foo Int Bool instance Lift Foo where lift (Foo a b) = [| Foo $(lift a) $(lift b) |] liftTyped (Foo a b) = [|| Foo $$(lift a) $$(lift b) |] ``` This fixes #20688 which complained about using implicit lifting in the derived code.
* Add Data.Bits changes to base 4.16 changelogsheaf2021-11-251-0/+16
| | | | | | | | | | Several additions since 4.15 had not been recorded in the changelog: - newtypes And, Ior, Xor and Iff, - oneBits - symbolic synonyms `.^.`, `.>>.`, `!>>.`, `.<<.` and `!<<.`. Fixes #20608.
* Apply 1 suggestion(s) to 1 file(s)John Ericson2021-11-251-1/+1
|
* Reorder `sed` arguments to work with BSD sedGreg Steuck2021-11-251-2/+3
| | | | | | The order was swapped in 490e8c750ea23ce8e2b7309e0d514b7d27f231bb causing the build on OpenBSD to fail with: `sed: 1: "mk/config.h": invalid command code m`
* Misc cleanupKrzysztof Gogolewski2021-11-2517-95/+35
| | | | | | | | | | | | | | | | | | | | | * Remove `getTag_RDR` (unused), `tidyKind` and `tidyOpenKind` (already available as `tidyType` and `tidyOpenType`) * Remove Note [Explicit Case Statement for Specificity]. Since 0a709dd9876e40 we require GHC 8.10 for bootstrapping. * Change the warning to `cmpAltCon` to a panic. This shouldn't happen. If it ever does, the code was wrong anyway: it shouldn't always return `LT`, but rather `LT` in one case and `GT` in the other case. * Rename `verifyLinearConstructors` to `verifyLinearFields` * Fix `Note [Local record selectors]` which was not referenced * Remove vestiges of `type +v` * Minor fixes to StaticPointers documentation, part of #15603
* Enable UnboxedTuples in `genInst`, Fixes #20524CarrieMY2021-11-259-11/+32
|
* Compare types of recursive let-bindings in alpha-equivalenceChristiaan Baaij2021-11-256-146/+254
| | | | | | | | | | | | | This commit fixes #20641 by checking the types of recursive let-bindings when performing alpha-equality. The `Eq (DeBruijn CoreExpr)` instance now also compares `BreakPoint`s similarly to `GHC.Core.Utils.eqTickish`, taking bound variables into account. In addition, the `Eq (DeBruijn Type)` instance now correctly compares the kinds of the types when one of them contains a Cast: the instance is modeled after `nonDetCmpTypeX`.
* Ensure new Ct/evidence invariantChristiaan Baaij2021-11-254-31/+80
| | | | | | | | | | The `ctev_pred` field of a `CtEvidence` is a just a cache for the type of the evidence. More precisely: * For Givens, `ctev_pred` = `varType ctev_evar` * For Wanteds, `ctev_pred` = `evDestType ctev_dest` This new invariant is needed because evidence can become part of a type, via `Castty ty kco`.
* Use getExecutablePath in getBaseDir on OpenBSDGreg Steuck2021-11-251-2/+2
| | | | | | | | While OpenBSD doesn't have a general mechanism for determining the path of the executing program image, it is reasonable to rely on argv[0] which happens as a fallback in getExecutablePath. With this change on top of T18173 we can get a bit close to fixing #18173.
* Revert "Convert lookupIdSubst panic back to a warning (#20200)"Matthew Pickering2021-11-251-6/+4
| | | | This reverts commit df1d808f26544cbb77d85773d672137c65fd3cc7.
* Make T14075 more robustMatthew Pickering2021-11-251-0/+2
|
* Correct retypechecking in --make modeMatthew Pickering2021-11-2514-128/+359
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note [Hydrating Modules] ~~~~~~~~~~~~~~~~~~~~~~~~ What is hydrating a module? * There are two versions of a module, the ModIface is the on-disk version and the ModDetails is a fleshed-out in-memory version. * We can **hydrate** a ModIface in order to obtain a ModDetails. Hydration happens in three different places * When an interface file is initially loaded from disk, it has to be hydrated. * When a module is finished compiling, we hydrate the ModIface in order to generate the version of ModDetails which exists in memory (see Note) * When dealing with boot files and module loops (see Note [Rehydrating Modules]) Note [Rehydrating Modules] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ If a module has a boot file then it is critical to rehydrate the modules on the path between the two. Suppose we have ("R" for "recursive"): ``` R.hs-boot: module R where data T g :: T -> T A.hs: module A( f, T, g ) where import {-# SOURCE #-} R data S = MkS T f :: T -> S = ...g... R.hs: module R where data T = T1 | T2 S g = ...f... ``` After compiling A.hs we'll have a TypeEnv in which the Id for `f` has a type type uses the AbstractTyCon T; and a TyCon for `S` that also mentions that same AbstractTyCon. (Abstract because it came from R.hs-boot; we know nothing about it.) When compiling R.hs, we build a TyCon for `T`. But that TyCon mentions `S`, and it currently has an AbstractTyCon for `T` inside it. But we want to build a fully cyclic structure, in which `S` refers to `T` and `T` refers to `S`. Solution: **rehydration**. *Before compiling `R.hs`*, rehydrate all the ModIfaces below it that depend on R.hs-boot. To rehydrate a ModIface, call `typecheckIface` to convert it to a ModDetails. It's just a de-serialisation step, no type inference, just lookups. Now `S` will be bound to a thunk that, when forced, will "see" the final binding for `T`; see [Tying the knot](https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/tying-the-knot). But note that this must be done *before* compiling R.hs. When compiling R.hs, the knot-tying stuff above will ensure that `f`'s unfolding mentions the `LocalId` for `g`. But when we finish R, we carefully ensure that all those `LocalIds` are turned into completed `GlobalIds`, replete with unfoldings etc. Alas, that will not apply to the occurrences of `g` in `f`'s unfolding. And if we leave matters like that, they will stay that way, and *all* subsequent modules that import A will see a crippled unfolding for `f`. Solution: rehydrate both R and A's ModIface together, right after completing R.hs. We only need rehydrate modules that are * Below R.hs * Above R.hs-boot There might be many unrelated modules (in the home package) that don't need to be rehydrated. This dark corner is the subject of #14092. Suppose we add to our example ``` X.hs module X where import A data XT = MkX T fx = ...g... ``` If in `--make` we compile R.hs-boot, then A.hs, then X.hs, we'll get a `ModDetails` for `X` that has an AbstractTyCon for `T` in the the argument type of `MkX`. So: * Either we should delay compiling X until after R has beeen compiled. * Or we should rehydrate X after compiling R -- because it transitively depends on R.hs-boot. Ticket #20200 has exposed some issues to do with the knot-tying logic in GHC.Make, in `--make` mode. this particular issue starts [here](https://gitlab.haskell.org/ghc/ghc/-/issues/20200#note_385758). The wiki page [Tying the knot](https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/tying-the-knot) is helpful. Also closely related are * #14092 * #14103 Fixes tickets #20200 #20561
* Combine STG free variable traversals (#17978)nineonine2021-11-2313-319/+288
| | | | | | | | | | | | | | | | | | | | | Previously we would traverse the STG AST twice looking for free variables. * Once in `annTopBindingsDeps` which considers top level and imported ids free. Its output is used to put bindings in dependency order. The pass happens in STG pipeline. * Once in `annTopBindingsFreeVars` which only considers non-top level ids free. Its output is used by the code generator to compute offsets into closures. This happens in Cmm (CodeGen) pipeline. Now these two traversal operations are merged into one - `FVs.depSortWithAnnotStgPgm`. The pass happens right at the end of STG pipeline. Some type signatures had to be updated due to slight shifts of StgPass boundaries (for example, top-level CodeGen handler now directly works with CodeGen flavoured Stg AST instead of Vanilla). Due to changed order of bindings, a few debugger type reconstruction bugs have resurfaced again (see tests break018, break021) - work item #18004 tracks this investigation. authors: simonpj, nineonine
* gitlab-ci: Bump DOCKER_REVBen Gamari2021-11-231-1/+1
|
* Add a warning for GADT match + NoMonoLocalBinds (#20485)Krzysztof Gogolewski2021-11-2312-14/+109
| | | | | | | | | Previously, it was an error to pattern match on a GADT without GADTs or TypeFamilies. This is now allowed. Instead, we check the flag MonoLocalBinds; if it is not enabled, we issue a warning, controlled by -Wgadt-mono-local-binds. Also fixes #20485: pattern synonyms are now checked too.
* Don't include types in test outputAndreas Klebinger2021-11-234-45/+32
|
* CmmSink: Be more aggressive in removing no-op assignments.Andreas Klebinger2021-11-239-6/+897
| | | | | | | | | | No-op assignments like R1 = R1 are not only wasteful. They can also inhibit other optimizations like inlining assignments that read from R1. We now check for assignments being a no-op before and after we simplify the RHS in Cmm sink which should eliminate most of these no-ops.