summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Refactor hole constraints.wip/hole-refactorRichard Eisenberg2020-05-0423-480/+498
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, holes (both expression holes / out of scope variables and partial-type-signature wildcards) were emitted as *constraints* via the CHoleCan constructor. While this worked fine for error reporting, there was a fair amount of faff in keeping these constraints in line. In particular, and unlike other constraints, we could never change a CHoleCan to become CNonCanonical. In addition: * the "predicate" of a CHoleCan constraint was really the type of the hole, which is not a predicate at all * type-level holes (partial type signature wildcards) carried evidence, which was never used * tcNormalise (used in the pattern-match checker) had to create a hole constraint just to extract it again; it was quite messy The new approach is to record holes directly in WantedConstraints. It flows much more nicely now. Along the way, I did some cleaning up of commentary in GHC.Tc.Errors.Hole, which I had a hard time understanding. This was instigated by a future patch that will refactor the way predicates are handled. The fact that CHoleCan's "predicate" wasn't really a predicate is incompatible with that future patch. No test case, because this is meant to be purely internal. It turns out that this change improves the performance of the pattern-match checker, likely because fewer constraints are sloshing about in tcNormalise. I have not investigated deeply, but an improvement is not a surprise here: ------------------------- Metric Decrease: PmSeriesG -------------------------
* Make boxed 1-tuples have known keysRyan Scott2020-04-287-8/+65
| | | | | | | | | | | | Unlike other tuples, which use special syntax and are "known" by way of a special `isBuiltInOcc_maybe` code path, boxed 1-tuples do not use special syntax. Therefore, in order to make sure that the internals of GHC are aware of the `data Unit a = Unit a` definition in `GHC.Tuple`, we give `Unit` known keys. For the full details, see `Note [One-tuples] (Wrinkle: Make boxed one-tuple names have known keys)` in `GHC.Builtin.Types`. Fixes #18097.
* Define a Quote IO instanceRyan Scott2020-04-284-4/+20
| | | | Fixes #18103.
* hadrian: always capture both stdout and stderr when running a builder failsAlp Mestanogullari2020-04-271-21/+28
| | | | | | | | | | | | | The idea being that when a builder('s command) fails, we quite likely want to have all the information available to figure out why. Depending on the builder _and_ the particular problem, the useful bits of information can be printed on stdout or stderr. We accomplish this by defining a simple wrapper for Shake's `cmd` function, that just _always_ captures both streams in case the command returns a non-zero exit code, and by using this wrapper everywhere in `hadrian/src/Builder.hs`. Fixes #18089.
* TH: fix Show/Eq/Ord instances for Bytes (#16457)Sylvain Henry2020-04-275-1/+95
| | | | We shouldn't compare pointer values but the actual bytes.
* Tweak includes in non-moving GC headersÖmer Sinan Ağacan2020-04-263-4/+1
| | | | | | | We don't use hash tables in non-moving GC so remove the includes. This breaks Compact.c as existing includes no longer include Hash.h, so include Hash.h explicitly in Compact.c.
* Fix misleading Ptr phantom type in SerializedCompact (#15653)Sylvain Henry2020-04-261-2/+2
|
* Modules: Utils and Data (#13009)Sylvain Henry2020-04-26565-2370/+2390
| | | | | | | Update Haddock submodule Metric Increase: haddock.compiler
* Switch order on `GhcMake.IsBoot`John Ericson2020-04-242-3/+3
| | | | | | | | | | | | In !1798 we were requested to replace many `Bool`s with this data type. But those bools had `False` meaning `NotBoot`, so the `Ord` instance would be flipped if we use this data-type as-is. Since the planned formally-`Bool` occurrences vastly outnumber the current occurrences, we figured it would be better to conform the `Ord` instance to how the `Bool` is used now, fixing any issues, rather than fix them currently with the bigger refactor later in !1798. That way, !1798 can be a "pure" refactor with no behavioral changes.
* GHC.Prim docs: note and testmniip2020-04-236-6/+22
|
* Include docs for non-primop entries in primops.txt as wellmniip2020-04-233-12/+22
|
* Add :doc to GHC.Primmniip2020-04-237-18/+60
|
* Trees That Grow refactor for `ConPat` and `CoPat`John Ericson2020-04-2329-331/+584
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `ConPat{In,Out}` -> `ConPat` - `CoPat` -> `XPat (CoPat ..)` Note that `GHC.HS.*` still uses `HsWrap`, but only when `p ~ GhcTc`. After this change, moving the type family instances out of `GHC.HS.*` is sufficient to break the cycle. Add XCollectPat class to decide how binders are collected from XXPat based on the pass. Previously we did this with IsPass, but that doesn't work for Haddock's DocNameI, and the constraint doesn't express what actual distinction is being made. Perhaps a class for collecting binders more generally is in order, but we haven't attempted this yet. Pure refactor of code around ConPat - InPat/OutPat synonyms removed - rename several identifiers - redundant constraints removed - move extension field in ConPat to be first - make ConPat use record syntax more consistently Fix T6145 (ConPatIn became ConPat) Add comments from SPJ. Add comment about haddock's use of CollectPass. Updates haddock submodule.
* testsuite: Don't attempt to read .std{err,out} files if they don't existBen Gamari2020-04-231-2/+10
| | | | | | | | Simon reports that he was previously seeing framework failures due to an attempt to read the non-existing T13456.stderr. While I don't know exactly what this is due to, it does seem like a non-existing .std{out,err} file should be equivalent to an empty file. Teach the testsuite driver to treat it as such.
* hadrian/ghci: Allow arguments to be passed to GHCiBen Gamari2020-04-233-4/+4
| | | | | | | Previously the arguments passed to hadrian/ghci were passed both to `hadrian` and GHCi. This is rather odd given that there are essentially not arguments in the intersection of the two. Let's just pass them to GHCi; this allows `hadrian/ghci -Werror`.
* Create di_scoped_tvs for associated data family instances properlyRyan Scott2020-04-233-7/+99
| | | | | | | See `Note [Associated data family instances and di_scoped_tvs]` in `GHC.Tc.TyCl.Instance`, which explains all of the moving parts. Fixes #18055.
* RTS: workaround a Linux kernel bug in timerfdSylvain Henry2020-04-221-4/+12
| | | | | | | | | | | | | | Reading a timerfd may return 0: https://lkml.org/lkml/2019/8/16/335. This is currently undocumented behavior and documentation "won't happen anytime soon" (https://lkml.org/lkml/2020/2/13/295). With this patch, we just ignore the result instead of crashing. It may fix #18033 but we can't be sure because we don't have enough information. See also this discussion about the kernel bug: https://github.com/Azure/sonic-swss-common/pull/302/files/1f070e7920c2e5d63316c0105bf4481e73d72dc9
* Remove leftover comment in tcRnModule', redundant bindÖmer Sinan Ağacan2020-04-221-30/+25
| | | | | The code for the comment was moved in dc8c03b2a5c but the comment was forgotten.
* Update commentary and slightly refactor GHC.Tc.Deriv.InferRyan Scott2020-04-221-10/+17
| | | | | | | | | There was some out-of-date commentary in `GHC.Tc.Deriv.Infer` that has been modernized. Along the way, I removed the `bad` constraints in `simplifyDeriv`, which did not serve any useful purpose (besides being printed in debugging output). Fixes #18073.
* Fix build warning; add more informative information to the linker; fix ↵Moritz Angermann2020-04-222-5/+15
| | | | linker for empty sections
* llvmGen: Remove -fast-llvm flagBen Gamari2020-04-223-20/+1
| | | | | | | | | | | | | | | | | | | | | | Issue #18076 drew my attention to the undocumented `-fast-llvm` flag for the LLVM code generator introduced in 22733532171330136d87533d523f565f2a4f102f. Speaking to Moritz about this, the motivation for this flag was to avoid potential incompatibilities between LLVM and the assembler/linker toolchain by making LLVM responsible for machine-code generation. Unfortunately, this cannot possibly work: the LLVM backend's mangler performs a number of transforms on the assembler generated by LLVM that are necessary for correctness. These are currently: * mangling Haskell functions' symbol types to be `object` instead of `function` on ELF platforms (necessary for tables-next-to-code) * mangling AVX instructions to ensure that we don't assume alignment (which LLVM otherwise does) * mangling Darwin's subsections-via-symbols directives Given that these are all necessary I don't believe that we can support `-fast-llvm`. Let's rather remove it.
* Add "ddump-cmm-opt" as alias for "ddump-opt-cmm".Andreas Klebinger2020-04-222-2/+10
|
* rts: Ensure that sigaction structs are initializedBen Gamari2020-04-221-2/+3
| | | | | | I noticed these may have uninitialized fields when looking into #18037. The reporter says that zeroing them doesn't fix the MSAN failures they observe but zeroing them is the right thing to do regardless.
* Do eager instantation in termsSimon Peyton Jones2020-04-2271-849/+943
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements eager instantiation, a small but critical change to the type inference engine, #17173. The main change is this: When inferring types, always return an instantiated type (for now, deeply instantiated; in future shallowly instantiated) There is more discussion in https://www.tweag.io/posts/2020-04-02-lazy-eager-instantiation.html There is quite a bit of refactoring in this patch: * The ir_inst field of GHC.Tc.Utils.TcType.InferResultk has entirely gone. So tcInferInst and tcInferNoInst have collapsed into tcInfer. * Type inference of applications, via tcInferApp and tcInferAppHead, are substantially refactored, preparing the way for Quick Look impredicativity. * New pure function GHC.Tc.Gen.Expr.collectHsArgs and applyHsArgs are beatifully dual. We can see the zipper! * GHC.Tc.Gen.Expr.tcArgs is now much nicer; no longer needs to return a wrapper * In HsExpr, HsTypeApp now contains the the actual type argument, and is used in desugaring, rather than putting it in a mysterious wrapper. * I struggled a bit with good error reporting in Unify.matchActualFunTysPart. It's a little bit simpler than before, but still not great. Some smaller things * Rename tcPolyExpr --> tcCheckExpr tcMonoExpr --> tcLExpr * tcPatSig moves from GHC.Tc.Gen.HsType to GHC.Tc.Gen.Pat Metric Decrease: T9961 Reduction of 1.6% in comiler allocation on T9961, I think.
* PPC NCG: Add DWARF constants and debug labelsPeter Trommler2020-04-2210-41/+65
| | | | Fixes #11261
* Fix tab-completion for :break (#17989)Roland Senn2020-04-228-10/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In tab-completion for the `:break` command, only those identifiers should be shown, that are accepted in the `:break` command. Hence these identifiers must be - defined in an interpreted module - top-level - currently in scope - listed in a `ModBreaks` value as a possible breakpoint. The identifiers my be qualified or unqualified. To get all possible top-level breakpoints for tab-completeion with the correct qualification do: 1. Build the list called `pifsBreaks` of all pairs of (Identifier, module-filename) from the `ModBreaks` values. Here all identifiers are unqualified. 2. Build the list called `pifInscope` of all pairs of (Identifiers, module-filename) with identifiers from the `GlobalRdrEnv`. Take only those identifiers that are in scope and have the correct prefix. Here the identifiers may be qualified. 3. From the `pifInscope` list seclect all pairs that can be found in the `pifsBreaks` list, by comparing only the unqualified part of the identifier. The remaining identifiers can be used for tab-completion. This ensures, that we show only identifiers, that can be used in a `:break` command.
* Mark DataCon wrappers CONLIKEAlexis King2020-04-2212-19/+162
| | | | | | | | | | | | | | | | | | | | | | | | | Now that DataCon wrappers don’t inline until phase 0 (see commit b78cc64e923716ac0512c299f42d4d0012306c05), it’s important that case-of-known-constructor and RULE matching be able to see saturated applications of DataCon wrappers in unfoldings. Making them conlike is a natural way to do it, since they are, in fact, precisely the sort of thing the CONLIKE pragma exists to solve. Fixes #18012. This also bumps the version of the parsec submodule to incorporate a patch that avoids a metric increase on the haddock perf tests. The increase was not really a flaw in this patch, as parsec was implicitly relying on inlining heuristics. The patch to parsec just adds some INLINABLE pragmas, and we get a nice performance bump out of it (well beyond the performance we lost from this patch). Metric Decrease: T12234 WWRec haddock.Cabal haddock.base haddock.compiler
* `MatchResult'` -> `MatchResult`John Ericson2020-04-229-63/+61
| | | | Inline `MatchResult` alias accordingly.
* Generalize type of `matchCanFail`John Ericson2020-04-221-1/+1
|
* Inline `adjustMatchResult`John Ericson2020-04-225-15/+14
| | | | It is just `fmap`
* Remove panic in dsHandleMonadicFailureJohn Ericson2020-04-222-37/+42
| | | | | Rework dsHandleMonadicFailure to be correct by construction instead of using an unreachable panic.
* Refactor the `MatchResult` type in the desugarerJonathan DK Gibbons2020-04-223-87/+110
| | | | This way, it does a better job of proving whether or not the fail operator is used.
* stg-spec: Modify file paths according to new module hierarchyTakenobu Tani2020-04-222-11/+11
| | | | | | | | | | | | | | | | | This patch updates file paths according to new module hierarchy [1]: * GHC/Stg/Syntax.hs <= stgSyn/StgSyn.hs * GHC/Types/Literal.hs <= basicTypes/Literal.hs * GHC/Types/CostCentre.hs <= profiling/CostCentre.hs This patch also updates old file path [2]: * utils/genapply/Main.hs <= utils/genapply/GenApply.hs [1]: https://gitlab.haskell.org/ghc/ghc/-/wikis/Make-GHC-codebase-more-modular [2]: commit 0cc4aad36f [skip ci]
* CmmToAsm DynFlags refactoring (#17957)Sylvain Henry2020-04-2114-276/+298
| | | | | | | | | | | | | * Remove `DynFlags` parameter from `isDynLinkName`: `isDynLinkName` used to test the global `ExternalDynamicRefs` flag. Now we test it outside of `isDynLinkName` * Add new fields into `NCGConfig`: current unit id, sse/bmi versions, externalDynamicRefs, etc. * Replace many uses of `DynFlags` by `NCGConfig` * Moved `BMI/SSE` datatypes into `GHC.Platform`
* Avoid `sdocWithDynFlags` in `pprCLbl` (#17957)Sylvain Henry2020-04-211-125/+100
| | | | | | * add a `DynFlags` parameter to `pprCLbl` * put `maybe_underscore` and `pprAsmCLbl` in a `where` clause to avoid `DynFlags` parameters
* Avoid using sdocWithDynFlags (#17957)Sylvain Henry2020-04-213-14/+13
| | | | | Remove one use of `sdocWithDynFlags` from `GHC.CmmToLlvm.llvmCodeGen'` and from `GHC.Driver.CodeOutput.profilingInitCode`
* Avoid DynFlags in Ppr code (#17957)Sylvain Henry2020-04-217-42/+49
| | | | | | | | | | * replace `DynFlags` parameters with `SDocContext` parameters for a few Ppr related functions: `bufLeftRenderSDoc`, `printSDoc`, `printSDocLn`, `showSDocOneLine`. * remove the use of `pprCols :: DynFlags -> Int` in Outputable. We already have the information via `sdocLineLength :: SDocContext -> Int`
* GHC.Runtime: avoid DynFlags (#17957)Sylvain Henry2020-04-213-11/+18
| | | | | * add `getPlatform :: TcM Platform` helper * remove unused `DynFlags` parameter from `emptyPLS`
* Use ParserFlags in GHC.Runtime.Eval (#17957)Sylvain Henry2020-04-213-22/+25
| | | | | | Instead of passing `DynFlags` to functions such as `isStmt` and `hasImport` in `GHC.Runtime.Eval` we pass `ParserFlags`. It's a much simpler structure that can be created purely with `mkParserFlags'`.
* docs: drop note about not supporting shared libraries on unix systemsAdam Sandberg Ericsson2020-04-211-2/+0
| | | | [skip ci]
* Mark T12010 fragile on 32-bitÖmer Sinan Ağacan2020-04-201-5/+5
|
* Fix a buglet in redundant-constraint warningsSimon Peyton Jones2020-04-205-3/+46
| | | | | | | | Ticket #18036 pointed out that we were reporting a redundant constraint when it really really wasn't. Turned out to be a buglet in the SkolemInfo for the relevant implication constraint. Easily fixed!
* Derive Ord instance for ExtensionShayne Fletcher2020-04-201-0/+4
| | | | | | Metric Increase: T12150 T12234
* Add missing addInScope call for letrec binders in OccurAnalAlexis King2020-04-191-3/+5
| | | | | | | | This fixes #18044, where a shadowed variable was incorrectly substituted by the binder swap on the RHS of a floated-in letrec. This can only happen when the uniques line up *just* right, so writing a regression test would be very difficult, but at least the fix is small and straightforward.
* Modules (#13009)Sylvain Henry2020-04-18250-1058/+1038
| | | | | | | | | | | | | | * SysTools * Parser * GHC.Builtin * GHC.Iface.Recomp * Settings Update Haddock submodule Metric Decrease: Naperian parsing001
* GHC.Core.Opt renamingSylvain Henry2020-04-1882-302/+302
| | | | | | | | | | | * GHC.Core.Op => GHC.Core.Opt * GHC.Core.Opt.Simplify.Driver => GHC.Core.Opt.Driver * GHC.Core.Opt.Tidy => GHC.Core.Tidy * GHC.Core.Opt.WorkWrap.Lib => GHC.Core.Opt.WorkWrap.Utils As discussed in: * https://mail.haskell.org/pipermail/ghc-devs/2020-April/018758.html * https://gitlab.haskell.org/ghc/ghc/issues/13009#note_264650
* Improve prepForeignCall error reportingÖmer Sinan Ağacan2020-04-181-9/+21
| | | | | | | Show parameters and description of the error code when ffi_prep_cif fails. This may be helpful for debugging #17018.
* Bump hsc2hs submoduleBen Gamari2020-04-181-0/+0
|
* gitlab-ci: Use rules syntax for conditional jobsBen Gamari2020-04-181-74/+41
|
* gitlab-ci: Enable FreeBSD job for so-labelled MRsBen Gamari2020-04-181-2/+5
|