summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Update Note references -- comments onlyRichard Eisenberg2019-11-021-2/+2
| | | | Follow-on from !2041.
* Separate `LPat` from `Pat` on the type-levelSebastian Graf2019-11-0212-77/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add +RTS --disable-delayed-os-memory-return. Fixes #17411.Niklas Hambüchen2019-11-015-13/+74
| | | | | | Sets `MiscFlags.disableDelayedOsMemoryReturn`. See the added `Note [MADV_FREE and MADV_DONTNEED]` for details.
* doc: Fix backticksNiklas Hambüchen2019-11-011-1/+1
|
* Make CSE delay inlining lessSimon Peyton Jones2019-11-018-12/+72
| | | | | | | | | CSE delays inlining a little bit, to avoid losing vital specialisations; see Note [Delay inlining after CSE] in CSE. But it was being over-enthusiastic. This patch makes the delay only apply to Ids with specialisation rules, which avoids unnecessary delay (#17409).
* testsuite: Add test for #17423Ben Gamari2019-11-012-0/+38
|
* hadrian: Make runtest invocation consistency with MakeBen Gamari2019-11-011-8/+9
| | | | | Use True/False instead of 0/1. This shouldn't be a functional change but we should be consistent.
* template-haskell: require at least 1 GADT constructor name (#17379)Adam Sandberg Eriksson2019-11-016-0/+32
|
* Describe optimisation of demand analysis of noinlineBen Gamari2019-11-011-0/+8
| | | | As described in #16588.
* testsuite: Make ExplicitForAllRules1 more robustBen Gamari2019-11-012-11/+15
| | | | Previously the test relied on `id` not inlining. Fix this.
* base: Ensure that failIO isn't SOURCE importedBen Gamari2019-11-014-9/+18
| | | | | | | | | failIO has useful information in its demand signature (specifically that it bottoms) which is hidden if it is SOURCE imported, as noted in #16588. Rejigger things such that we don't SOURCE import it. Metric Increase: T13701
* Fix a bad error in tcMatchTySimon Peyton Jones2019-11-011-4/+28
| | | | | | | | | | | This patch fixes #17395, a very subtle and hard-to-trigger bug in tcMatchTy. It's all explained in Note [Matching in the presence of casts (2)] I have not added a regression test because it is very hard to trigger it, until we have the upcoming mkAppTyM patch, after which lacking this patch means you can't even compile the libraries.
* Add another test for #17267Simon Peyton Jones2019-11-013-0/+41
| | | | This one came in a comment from James Payor
* Makes Lint less chatty:Simon Peyton Jones2019-11-011-11/+13
| | | | | | | | | | | | | | | | | I found in #17415 that Lint was printing out truly gigantic warnings, unmanageably huge, with repeated copies of the same thing. This patch makes Lint less chatty, especially for warnings: * For **warnings**, I don't print details of the location, unless you add `-dppr-debug`. * For **errors**, I still print all the info. They are fatal and stop exection, whereas warnings appear repeatedly. * I've made much less use of `AnExpr` in `LintLocInfo`; the expression can be gigantic.
* rts: Make m32 allocator per-ObjectCodeBen Gamari2019-11-017-53/+83
| | | | | | | | | | | | | | | | | MacOS Catalina is finally going to force our hand in forbidden writable exeutable mappings. Unfortunately, this is quite incompatible with the current global m32 allocator, which mixes symbols from various objects in a single page. The problem here is that some of these symbols may not yet be resolved (e.g. had relocations performed) as this happens lazily (and therefore we can't yet make the section read-only and therefore executable). The easiest way around this is to simply create one m32 allocator per ObjectCode. This may slightly increase fragmentation for short-running programs but I suspect will actually improve fragmentation for programs doing lots of loading/unloading since we can always free all of the pages allocated to an object when it is unloaded (although this ability will only be implemented in a later patch).
* mmap: Factor out protection flagsBen Gamari2019-11-011-4/+3
|
* Fix running of ratio test casetaylorfausak2019-11-011-1/+1
|
* Add tests for rounding ratiostaylorfausak2019-11-012-0/+42
|
* Fix rounding around 0taylorfausak2019-11-011-6/+9
|
* Implement `round` for `Ratio` that doesn't explode with `Natural`staylorfausak2019-11-011-0/+7
|
* base: Various haddock fixesBen Gamari2019-10-312-5/+5
| | | | Just a few things I found while looking at #17383.
* testsuite: Add test for #17414Ben Gamari2019-10-312-0/+20
|
* base: Clamp IO operation size to 2GB on DarwinBen Gamari2019-10-311-4/+17
| | | | | As reported in #17414, Darwin throws EINVAL in response to large writes.
* Remove redundant 0s in ghc-heap pointer stringsÖmer Sinan Ağacan2019-10-311-3/+1
| | | | | | | | | Before: 0x0000004200c86888 After: 0x42000224f8 This is more concise and consistent with the RTS's printer (which uses %p formatter, and at least on Linux gcc prints the short form) and gdb's pointer formatter.
* gitlab-ci: Fix the ARMv7 tripleBen Gamari2019-10-301-1/+1
| | | | | | | | | | Previously we were configuring the ARMv7 builds with a host/target triple of arm-linux-gnueabihf, which caused us to target ARMv6 and consequently rely on the old CP15 memory barrier implementation. This barrier has to be emulated on ARMv8 machines which is glacially slow. Hopefully this should fix the ARMv7 builds which currently consistently time out.
* Whitespace forward compatibility for proposal #229Vladislav Zavialov2019-10-3016-47/+27
| | | | | | | | GHC Proposal #229 changes the lexical rules of Haskell, which may require slight whitespace adjustments in certain cases. This patch changes formatting in a few places in GHC and its testsuite in a way that enables it to compile under the proposed rules.
* rts: More aarch64 header fixesBen Gamari2019-10-305-7/+10
|
* Interpreter: initialize arity fields of AP_NOUPDsÖmer Sinan Ağacan2019-10-291-4/+4
| | | | | | AP_NOUPD entry code doesn't use the arity field, but not initializing this field confuses printers/debuggers, and also makes testing harder as the field's value changes randomly.
* gitlab-ci: Fix binary distribution testingBen Gamari2019-10-291-20/+20
|
* Don't include settings file in binary distributionBen Gamari2019-10-291-1/+1
| | | | | | | | The configuration in the installation environment (as determined by `autoconf`) may differ from the build environment and therefore we need to be sure to rebuild the settings file. Fixes #17374.
* gitlab-ci: Use pxz to compress binary distributionsBen Gamari2019-10-292-1/+2
|
* distrib: Fix binary distribution installationBen Gamari2019-10-293-4/+6
| | | | | This had silently regressed due to 81860281 and the variable renaming performed in b55ee979, as noted in #17374.
* Revert "Replace freebsd-gnueabihf with freebsd"Ben Gamari2019-10-293-4/+8
| | | | | This reverts commit aa31ceaf7568802590f73a740ffbc8b800096342 as suggested in #17392.
* Don't substitute GccVersion variableBen Gamari2019-10-292-4/+2
| | | | | Not only is it now unused but we generally can't assume that we are compiling with GCC, so it really shouldn't be used.
* base: Split up file locking implementationBen Gamari2019-10-298-284/+352
| | | | This makes the CPP significantly easier to follow.
* base: Fix open-file lockingBen Gamari2019-10-292-19/+40
| | | | | | | | | The OFD locking path introduced in 3b784d440d4b01b4c549df7c9a3ed2058edfc780 due to #13945 appears to have never actually worked but we never noticed due to an oversight in the autoconf check. Fix it. Thanks to Oleg Grenrus for noticing this.
* hadrian: Drop -Werror=unused-but-set-variable from GHC flagsBen Gamari2019-10-291-3/+1
| | | | | | | | | | | Previously `hadrian` would pass `-optc-Werror=unused-but-set-variable` to all GHC invocations. This was a difference from the make build system and cause the unregisterised build to fail as the C that GHC produces contains many unused functions. Drop it from the GHC flags. Note, however, that the flag is still present in `Settings.Builders.Common.cWarnings` and therefore will still be applied during compilation of C sources.
* hadrian: Shuffle around RTS build flagsBen Gamari2019-10-291-10/+19
| | | | | Some of these flags wanted to be passed to .cmm builds as well as C builds.
* hadrian: Define NOSMP when building rts unregisterisedBen Gamari2019-10-296-15/+54
| | | | | | | | It seems that NOSMP was previously only defined when compiling the compiler, not the RTS. Fix this. In addition do some spring-cleaning and make the logic match that of the Make build system.
* hadrian: Define USE_LIBFFI_FOR_ADJUSTORS when necessaryBen Gamari2019-10-291-0/+2
|
* gitlab-ci: Factor out Linux Hadrian validation logicBen Gamari2019-10-291-3/+6
|
* gitlab-ci: Use Hadrian for unregisterised jobBen Gamari2019-10-291-7/+7
|
* MkIface: Remove redundant parameter and outdated comments from addFingerprintsÖmer Sinan Ağacan2019-10-291-8/+8
|
* HscMain: Move a comment closer to the relevant siteÖmer Sinan Ağacan2019-10-291-4/+4
|
* Remove unused DynFlags arg of lookupIfaceByModuleÖmer Sinan Ağacan2019-10-296-17/+12
|
* Return ModIface in compilation pipeline, remove IORef hack for generating ↵Ömer Sinan Ağacan2019-10-294-97/+114
| | | | | | | | | | | | | | | | | | | | | ModIfaces The compilation phases now optionally return ModIface (for phases that generate an interface, currently only HscOut when (re)compiling a file). The value is then used by compileOne' to return the generated interface with HomeModInfo (which is then used by the batch mode compiler when building rest of the tree). hscIncrementalMode also returns a DynFlags with plugin info, to be used in the rest of the pipeline. Unfortunately this introduces a (perhaps less bad) hack in place of the previous IORef: we now record the DynFlags used to generate the partial infterface in HscRecomp and use the same DynFlags when generating the full interface. I spent almost three days trying to understand what's changing in DynFlags that causes a backpack test to fail, but I couldn't figure it out. There's a FIXME added next to the field so hopefully someone who understands this better than I do will fix it leter.
* Refactor HscRecomp constructors:Ömer Sinan Ağacan2019-10-293-47/+45
| | | | | | | | | | | Make it evident in the constructors that the final interface is only available when HscStatus is not HscRecomp. (When HscStatus == HscRecomp we need to finish the compilation to get the final interface) `Maybe ModIface` return value of hscIncrementalCompile and the partial `expectIface` function are removed.
* testsuite: Fix quoting of $(TEST_HC) in T12674Ben Gamari2019-10-291-2/+2
| | | | I have no idea how this went unnoticed until now.
* linters: Add linter to catch unquoted use of $(TEST_HC)Ben Gamari2019-10-291-4/+16
| | | | This is a common bug that creeps into Makefiles (e.g. see T12674).
* linters: Add mode to lint given set of filesBen Gamari2019-10-292-5/+16
| | | | This makes testing much easier.