summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Faster checkFamInstConsistencywip/T13719Bartosz Nitka2017-05-233-88/+135
| | | | | | | | | | | | | | | | | | | | | | | Summary: This implements the idea from https://ghc.haskell.org/trac/ghc/ticket/13092#comment:14. It's explained in Note [Checking family instance optimization] in more detail. This improves the test case T13719 tenfold and cuts down the compile time on `:load` in `ghci` on our internal code base by half. Test Plan: ./validate Reviewers: simonpj, simonmar, rwbarton, austin, bgamari Subscribers: thomie GHC Trac Issues: #13719 Differential Revision: https://phabricator.haskell.org/D3603
* Extend ModuleSet with useful functionsBartosz Nitka2017-05-221-1/+19
|
* Testcase for type family consistency checksBartosz Nitka2017-05-2211-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on my quick search, we don't have a test that verifies that we check the type family instances of currently compiled module against direct or indirect dependencies. This adds two tests: for a direct dependency and for an indirect dependency. I also added a comment to make it clear what the 'Over' test tests. Other than completeness, it makes sense to have these tests because if you look at Note [The type family instance consistency story] in FamInsts these cases are checked through different mechanisms. Test Plan: new tests Reviewers: simonmar, rwbarton, simonpj, austin, bgamari Reviewed By: simonpj, bgamari Subscribers: thomie GHC Trac Issues: #13719 Differential Revision: https://phabricator.haskell.org/D3602
* Testcase for #13719Bartosz Nitka2017-05-222-0/+42
| | | | | | | | | | | | | | | | | I expect to improve this, a testcase will ensure it doesn't regress. Test Plan: ./validate Reviewers: simonmar, austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13719 Differential Revision: https://phabricator.haskell.org/D3600
* Add "header" to GHC_COLORSPhil Ruffwind2017-05-224-16/+40
| | | | | | | | | | | | | | | | | Add "header" to GHC_COLORS and allow colors to be inherited from the surroundings. Test Plan: validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13718 Differential Revision: https://phabricator.haskell.org/D3599
* Handle file targets in missing home modules warningHerbert Valerio Riedel2017-05-2217-10/+124
| | | | | | | | | | | | | | | When main module is listed on command line as a file, we should not issue a warning about it. See Trac #13727 Reviewers: austin, bgamari, Yuras Reviewed By: bgamari, Yuras Subscribers: 23Skidoo, rwbarton, thomie GHC Trac Issues: #13727 Differential Revision: https://phabricator.haskell.org/D3598
* fix a memory leak in osNumaMaskKubo Kovac2017-05-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | got an error when using asan: ``` ==1866689==ERROR: LeakSanitizer: detected memory leaks Direct leak of 16 byte(s) in 1 object(s) allocated from: #0 0x10640568 in malloc ??:? #1 0x154d867e in numa_bitmask_alloc .../numactl-2.0.8/libnuma_nosymve r.c:204 #2 0x154d867e in numa_allocate_nodemask .../numactl-2.0.8/libnuma_nosymve r.c:724 #3 0x154d867e in numa_get_mems_allowed .../numactl-2.0.8/libnuma_nosymve r.c:1141 #4 0x10b54a45 in osNumaMask ...ghc-8.0.2/rts/posix/OSMem.c:59 8 ``` Test Plan: compile, validate Reviewers: simonmar, niteria, austin, bgamari, erikd Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3537
* Rewrite boot in PythonBen Gamari2017-05-225-236/+165
| | | | | | | | | | Test Plan: Validate Reviewers: hvr, austin Subscribers: rwbarton, thomie, erikd Differential Revision: https://phabricator.haskell.org/D3567
* Ensure package.cache is newer than registration files after make installBen Gamari2017-05-221-0/+4
| | | | | | | | | | | | | | | | | Rebuild package.cache to ensure that it's newer than the package database registration files, avoiding out-of-date cache warnings from ghc-pkg. See #13375. Test Plan: `make install`, run `ghc-pkg list`, look for out-of-date cache warning Reviewers: austin Subscribers: rwbarton, thomie GHC Trac Issues: #13375 Differential Revision: https://phabricator.haskell.org/D3569
* Add missing "do" to example in arrow docs.null-a2017-05-221-1/+1
|
* Fix levity polymorphism docsAlexey Vagarenko2017-05-211-1/+1
|
* Bump to LLVM 4.0Moritz Angermann2017-05-201-1/+1
| | | | | | | | | | | | | The llvm textual ir seems to have stayed sufficiently similar from llvm 3.9 to llvm 4.0, such that a simple bump is possible. Reviewers: austin, hvr, bgamari, erikd Reviewed By: bgamari, erikd Subscribers: rwbarton, thomie, erikd Differential Revision: https://phabricator.haskell.org/D3591
* Pretty-print strict record fields from ifaces correctlyRyan Scott2017-05-205-1/+31
| | | | | | | | | | | | | | | | | We need to use parentheses more when pretty-printing types with bang patterns within constructors that use record syntax. Fixes #13699. Test Plan: make test TEST=T13699 Reviewers: austin, bgamari, dfeuer Reviewed By: dfeuer Subscribers: dfeuer, rwbarton, thomie GHC Trac Issues: #13699 Differential Revision: https://phabricator.haskell.org/D3587
* A few documentation fixesDavid Feuer2017-05-203-10/+11
| | | | | | | | | | | | | | `MIN_VERSION_pkg` was documented backwards. An important caveat about initializing the Haskell runtime was buried in a footnote. The documentation of `-dynamic` was (even more) confusing. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3582
* Correctly expand lines with multiple tabsPhil Ruffwind2017-05-203-7/+21
| | | | | | | | | | | | | | | | | rwbarton pointed out that tab expansions can affect the column numbers of subsequent characters, so a unstateful map + zip won't do. This commit hopefully fixes that. It also adds a test for this particular case. Test Plan: validate Reviewers: bgamari, rwbarton, austin Reviewed By: bgamari Subscribers: dfeuer, thomie Differential Revision: https://phabricator.haskell.org/D3578
* base: Explicitly mark Data.Either.{left,right} as INLINABLEBen Gamari2017-05-201-0/+2
| | | | | | | | | | | | | | Test Plan: read it Reviewers: dfeuer, austin, hvr, nomeata Reviewed By: dfeuer, nomeata Subscribers: nomeata, rwbarton, thomie GHC Trac Issues: #13689 Differential Revision: https://phabricator.haskell.org/D3576
* Compile modules that are needed by template haskell, even with -fno-code.Douglas Wilson2017-05-209-57/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch relates to Trac #8025 The goal here is to enable typechecking of packages that contain some template haskell. Prior to this patch, compilation of a package with -fno-code would fail if any functions in the package were called from within a splice. downsweep is changed to do an additional pass over the modules, targetting any ModSummaries transitively depended on by a module that has LangExt.TemplateHaskell enabled. Those targeted modules have hscTarget changed from HscNothing to the default target of the platform. There is a small change to the prevailing_target logic to enable this. A simple test is added. I have benchmarked with and without a patched haddock (available:https://github.com/duog/haddock/tree/wip-no-explicit-th-compi lation). Running cabal haddock on the wreq package results in a 25% speedup on my machine: time output from patched cabal haddock: real 0m5.780s user 0m5.304s sys 0m0.496s time output from unpatched cabal haddock: real 0m7.712s user 0m6.888s sys 0m0.736s Reviewers: austin, bgamari, ezyang Reviewed By: bgamari Subscribers: bgamari, DanielG, rwbarton, thomie GHC Trac Issues: #8025 Differential Revision: https://phabricator.haskell.org/D3441
* CNF: Silence pointer fix-up message unless gc debugging is enabledBen Gamari2017-05-202-3/+2
|
* Failing test case for #13734Joachim Breitner2017-05-203-0/+17
|
* Improve error msg for simplifier tick exhaustionDavid Feuer2017-05-191-9/+24
| | | | | | | | | | | | | | | Simplifier tick exhaustion is not necessarily "impossible", and isn't even always a GHC bug, per se. Improve the error message. Furthermore, the simplifier code has access to `IO`, so we can throw a proper `IO` exception instead of panicking. Reviewers: austin, bgamari, angerman Reviewed By: angerman Subscribers: angerman, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3597
* Modern type signature style in ModuleBartosz Nitka2017-05-191-9/+12
|
* Fix scoping of data cons during kind checkingSimon Peyton Jones2017-05-196-73/+109
| | | | | | | | | | | Trac #13625 pointed out that in data X :: Y where Y :: X we need 'Y' to be in scope (as APromotionErr) when dealing with X's kind signature. Previously we got a crash. This patch simplifies the code as well as making it work.
* Account for IfUnpackCo in freeNamesIfDeclSimon Peyton Jones2017-05-191-2/+8
| | | | | | | | | We were simply failing to recognise all the free variables of an IfaceDecl, notably the ones in the coercion of an IfUnpackCo. Result: the dependency analysis got messed up, so that fingerprint calculation went wrong. Trac #13695 showed it up. A test case is tricky but the fix is a solid one.
* Refactor freeNamesIfDeclSimon Peyton Jones2017-05-191-44/+68
| | | | | This just switches to using pattern matching rather than field selectors, which I generally prefer. No change in behaviour.
* Comments and white space onlySimon Peyton Jones2017-05-191-3/+2
|
* Fix Haddock markupAlexey Vagarenko2017-05-191-1/+1
|
* Ensure that insolubles are fully rewrittenSimon Peyton Jones2017-05-198-30/+73
| | | | | | | | | | | | | | | | I was alerted to this by Trac #12468 and #11325. We were treating insolubles (and "hole" constraints are treated as insoluble) inconsistently. In some places we were carefully rewriting them e.g. Note [Make sure that insolubles are fully rewritten] in TcCanonical. But in TcSimplify we weren't feeding them into the solver. As a result, "hole" constraints were not being rewritten, which some users found confusing, and I think rightly so. This patch also fixes a bug in TcSMonad.emitInsoluble, in which two different "hole" constriants could be treated (bogusly) as duplicates, thereby losing one.
* Insert missing newlineFrederik Hanghøj Iversen2017-05-181-1/+1
|
* Handle type-lets betterSimon Peyton Jones2017-05-177-28/+39
| | | | | | | | | | | | | | | Core allows non-recursive type-lets, thus let a = TYPE ty in ... They are substituted away very quickly, but it's convenient for some passes to produce them (rather than to have to substitute immediately). Trac #13708 tried the effect of not running the simplifer at all (a rather bizarre thing to do, but still). That showed that some passes crashed because they always treated a let-bounder binder as an Id. This patch adds some easy fixes.
* Fix #13703 by correctly using munged names in ghc-pkg.Edward Z. Yang2017-05-167-32/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Cabal internal libraries are implemented using a trick, where the 'name' field in ghc-pkg registration file is munged into a new form to keep each internal library looking like a distinct package to ghc-pkg and other tools; e.g. the internal library q from package p is named z-p-z-q. Later, Cabal library got refactored so that we made a closer distinction between these "munged" package names and the true package name of a package. Unfortunately, this is an example of a refactor for clarity in the source code which ends up causing problems downstream, because the point of "munging" the package name was to make it so that ghc-pkg and similar tools transparently used MungedPackageName whereever they previously used PackageName (in preparation for them learning proper syntax for package name + component name). Failing to do this meant that internal libraries from the same package (but with different names) clobber each other. This commit search-replaces most occurrences of PackageName in ghc-pkg and turns them into MungedPackageName. Otherwise there shouldn't be any functional differenes. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: bgamari, austin Subscribers: rwbarton, thomie GHC Trac Issues: #13703 Differential Revision: https://phabricator.haskell.org/D3590
* Fix the pure unifierSimon Peyton Jones2017-05-163-196/+200
| | | | | | This patch fixes Trac #13705, by fixing a long-standing outright bug in the pure unifier. I'm surprised this hasn't caused more trouble before now!
* Tiny refactorSimon Peyton Jones2017-05-161-5/+9
|
* Kill off unused IfaceType.eqIfaceTypeSimon Peyton Jones2017-05-162-120/+21
| | | | | Edward implemented these functions, but they aren't used any more. Trac #13679
* testsuite: Add testcase for T13658Ben Gamari2017-05-152-0/+40
|
* Print warnings on parser failures (#12610).Dave Laing2017-05-1511-31/+67
| | | | | | | | | | | | | | Test Plan: validate Reviewers: austin, bgamari, simonmar, mpickering Reviewed By: mpickering Subscribers: mpickering, rwbarton, thomie GHC Trac Issues: #12610 Differential Revision: https://phabricator.haskell.org/D3584
* users-guide: Document -g flagBen Gamari2017-05-151-6/+7
|
* Revert "Use a deterministic map for imp_dep_mods"Bartosz Nitka2017-05-155-21/+29
| | | | | | | | | | | | | | | | | | | | This reverts commit 7fea7121ce195e562a5443c0a8ef3861504ef1b3. It turns out that on a newly added MultiLayerModules test case it gets very expensive to union the transitive module sets while preserving determinism. Fortunately, we can just sort to restore determinism when converting imp_dep_mods to a list. Test Plan: ./validate Reviewers: simonmar, austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3577
* Stress test for nested module hierarchiesBartosz Nitka2017-05-152-0/+32
| | | | | | | | | | | | | | | | | | I'm optimizing a case that is well approximated by multiple layers of modules where every module in a layer imports all the modules in the layer below. It turns out I regressed performance on such cases in 7fea7121. I'm adding a test case to track improvements and prevent future regressions. Test Plan: ./validate Reviewers: simonmar, austin, bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3575
* Revert "Stress test for nested module hierarchies"Bartosz Nitka2017-05-156-60/+20
| | | | | | | This reverts commit e527fc2e90958280a36645b6bd0223861cc50a55. I merged more than I intended in e527fc2e, I will merge D3575 and D3577 separately.
* Stress test for nested module hierarchiesBartosz Nitka2017-05-156-20/+60
| | | | | | | | | | | | | | | | | | | | I'm optimizing a case that is well approximated by multiple layers of modules where every module in a layer imports all the modules in the layer below. It turns out I regressed performance on such cases in 7fea7121. I'm adding a test case to track improvements and prevent future regressions. Test Plan: ./validate Reviewers: simonmar, austin, bgamari Reviewed By: simonmar Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3575
* rts/linker/ElfTypes.h: restore powerps (and others) supportSergei Trofimovich2017-05-141-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GHC build fails for powerpc-unknown-linux-gnu and hppa-unknown-linux-gnu targets as: rts_dist_HC rts/dist/build/RtsStartup.o rts/linker/ElfTypes.h:23:4: error: error: #error "Unsupported arch!" Before the change code tried to whitelist architectures and classify them into ELF32/ELF64. It does not work for UNREG arches like 'hppa', 'sparc64', 'm68k', 'mips'. It is nuanced for things like mips64 and x86_64: 'mips64-unknown-linux-gnu-gcc -mabi=64' is ELFCLASS64 'mips64-unknown-linux-gnu-gcc' is ELFCLASS32 'x86_64-pc-linux-gnu-gcc' is ELFCLASS64 'x86_64-pc-linux-gnu-gcc -mx32' is ELFCLASS32 Here it's not enough to know HOST_ARCH. We really need to know ABI. The change uses '__LP64__' as a proxy for ELFCLASS64. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Reviewers: angerman, simonmar, austin, bgamari, erikd Reviewed By: angerman, bgamari, erikd Subscribers: rwbarton, thomie GHC Trac Issues: #13696 Differential Revision: https://phabricator.haskell.org/D3583
* rts: annotate switch/case with '/* fallthrough */'Sergei Trofimovich2017-05-145-0/+13
| | | | | | | | | | | | | | Fixes gcc-7.1.0 warnings of form: rts/sm/Scav.c:559:9: error: error: this statement may fall through [-Werror=implicit-fallthrough=] scavenge_fun_srt(info); ^~~~~~~~~~~~~~~~~~~~~~ Many of places are indeed unobvious and some are already annotated by comments. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* ProfilerReportJson.c: fix out-of-bounds accessSergei Trofimovich2017-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by gcc-7.1 which reported build error as: rts/ProfilerReportJson.c:23:16: error: error: comparison between pointer and zero character constant [-Werror=pointer-compare] for (; str != '\0' && len > 0; str++) { ^~ | 23 | for (; str != '\0' && len > 0; str++) { | ^ Unfixed code in context: ```c static void escapeString(char const* str, char *out, int len) { len--; // reserve character in output for terminating NUL for (; str != '\0' && len > 0; str++) { char c = *str; ``` The intent here is to process 'len' (if positive) or '\0'-terminator in 'str' but dereference was missing. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Update unix submoduleBen Gamari2017-05-141-0/+0
|
* includes/Stg.h: '#if sparch_HOST_ARCH' -> '#if defined(sparch_HOST_ARCH)'Sergei Trofimovich2017-05-141-1/+1
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Add a test for #12600David Feuer2017-05-134-0/+39
| | | | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #12600 Differential Revision: https://phabricator.haskell.org/D3580
* Add a test for #11272David Feuer2017-05-134-0/+28
| | | | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #11272 Differential Revision: https://phabricator.haskell.org/D3561
* Revert "Treat banged bindings as FunBinds"Ben Gamari2017-05-1210-99/+40
| | | | | | | | This partially reverts commit 372995364c52eef15066132d7d1ea8b6760034e6 as it doesn't actually fix #13594. Namely it does not revert the mkPrefixFunRhs refactoring since this is rather independent from the functional changes. Going to try again with a whole working patch
* Bump haddock submoduleBen Gamari2017-05-121-0/+0
| | | | Fixes lazy IO bug
* Render \t as 8 spaces in caret diagnosticsPhil Ruffwind2017-05-125-6/+44
| | | | | | | | | | | | | | Test Plan: validate Reviewers: austin, bgamari, rwbarton Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13664 Differential Revision: https://phabricator.haskell.org/D3549