summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* function-section: enable on windowsTamar Christina2018-08-211-1/+1
| | | | | | | | | | | | | | | | | gc-sections was onced observed to be slow on Windows, which is the only reason it's not enabled yet. However, it seems to be better now. Test Plan: ./validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15051 Differential Revision: https://phabricator.haskell.org/D4916
* Replace most occurences of foldl with foldl'.klebinger.andreas@gmx.at2018-08-2169-128/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds foldl' to GhcPrelude and changes must occurences of foldl to foldl'. This leads to better performance especially for quick builds where GHC does not perform strictness analysis. It does change strictness behaviour when we use foldl' to turn a argument list into function applications. But this is only a drawback if code looks ONLY at the last argument but not at the first. And as the benchmarks show leads to fewer allocations in practice at O2. Compiler performance for Nofib: O2 Allocations: -1 s.d. ----- -0.0% +1 s.d. ----- -0.0% Average ----- -0.0% O2 Compile Time: -1 s.d. ----- -2.8% +1 s.d. ----- +1.3% Average ----- -0.8% O0 Allocations: -1 s.d. ----- -0.2% +1 s.d. ----- -0.1% Average ----- -0.2% Test Plan: ci Reviewers: goldfire, bgamari, simonmar, tdammers, monoidal Reviewed By: bgamari, monoidal Subscribers: tdammers, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4929
* Fix #line pragmas in nested commentsBen Sklaroff2018-08-217-58/+179
| | | | | | | | | | | | | | | | | | | | | When parsing a nested comment or nested doc comment in the lexer, if we see a line starting with '#' we attempt to parse a #line pragma. This fixes how ghc handles output of the C preproccesor (-cpp flag) when the original source has C comments or pragmas inside haskell comments. Updates haddock submodule. Test Plan: ./validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #314 Differential Revision: https://phabricator.haskell.org/D4934
* Fix redundant imports of ClassBen Gamari2018-08-213-3/+0
|
* driver: unconditionally disable relaxation when linking partiallySergei Trofimovich2018-08-211-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In https://github.com/gentoo-haskell/gentoo-haskell/issues/704 user explicitly uses -Wl,--relax for most built binaries. Most of the time this works fine except for capi haskell code similar to the following: ```haskell {-# LANGUAGE CApiFFI #-} module Z where import Foreign.C foreign import capi "unistd.h close" c_close :: CInt -> IO CInt ``` In this case compilation fails as: ``` $ inplace/bin/ghc-stage2 -c Z.hs -optl-Wl,--relax -fforce-recomp ld: --relax and -r may not be used together ``` GHC's driver already disables relaxation on sparc as there relaxation is already a default mode. This change disables relaxation on partial linking for all platforms where linker is binutils linker. Reported-by: wmyrda Bug: https://github.com/gentoo-haskell/gentoo-haskell/issues/704 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: pass -optl-Wl,--relax in test above Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4888
* Add a solveEqualities to tcClassDecl1Simon Peyton Jones2018-08-217-202/+222
| | | | | | | | | | | | | | Trac #15505 showed that, when we have a type error, we could have an unfilled-in coercion hole. We don't want an assertion error in that case. The underlying cause is that tcClassDecl1 should call solveEqualities to fully solve all top-level equalities (or fail in the attempt). I also refactored the ClassDecl case for tcTyClDecl1 into a new function tcClassDecl1. That makes it symmetrical with the others.
* Comments onlySimon Peyton Jones2018-08-211-2/+3
|
* Improve ambiguous-occurrence error messageSimon Peyton Jones2018-08-217-21/+64
| | | | | | | | | | | | Trac #15487 correctly reported that the qualification of a Name in an ambiguous-occurrence error message was wrong. This patch fixes it. It's easily done, in RnUtils.addNameClashErrRn The problem was that in complaining about M.x we must enusre that 'M' part is the same as that used in pprNameProvenance.
* Set strictness correctly for JoinIdsSimon Peyton Jones2018-08-216-8/+160
| | | | | | | | | | | | | | | | | | | | | | | | We were failing to keep correct strictness info when eta-expanding join points; Trac #15517. The situation was something like \q v eta -> let j x = error "blah -- STR Lx bottoming! in case y of A -> j x eta B -> blah C -> j x eta So we spot j as a join point and eta-expand it. But we must also adjust the stricness info, else it vlaimes to bottom after one arg is applied but now it has become two. I fixed this in two places: - In CoreOpt.joinPointBinding_maybe, adjust strictness info - In SimplUtils.tryEtaExpandRhs, return consistent values for arity and bottom-ness
* Expose the StableName constructorDavid Feuer2018-08-203-73/+109
| | | | | | | | | | | | | | | | | | | | * Move the definition of `StableName` from `System.Mem.StableName` to a new `GHC.StableName` module. * Expose the `StableName` data constructor from `GHC.StableName`. Once we have `UnliftedArray#`, this will enable `StableName`s to be stored in `UnliftedArray`s (from `primitive`) without unsafe coercions. Reviewers: hvr, bgamari, andrewthad, osa1 Reviewed By: osa1 Subscribers: osa1, rwbarton, carter GHC Trac Issues: #15535 Differential Revision: https://phabricator.haskell.org/D5078
* Bump stm submoduleBen Gamari2018-08-201-0/+0
|
* Update .mailmap [skip ci]Thomas Miedema2018-08-201-16/+57
|
* Initialise cec_suppress properlySimon Peyton Jones2018-08-207-75/+28
| | | | | | | | | | | In TcErrors, cec_suppress is used to suppress low-priority errors in favour of truly insoluble ones. But I was failing to initialise it correcly at top level, which resulted in Trac #15539. Easy to fix. A few regression tests have fewer errors reported, but that seems to be an improvement.
* CSE should deal with letrec (#9441)roland2018-08-185-16/+3
| | | | | | | | | | | | | | | | | Summary: Write tests with fewer lines. See comments of nomeata in https://phabricator.haskell.org/D5038. Test Plan: make test TESTS='T9441a T9441b T9441c' Reviewers: nomeata, dfeuer, bgamari Reviewed By: nomeata Subscribers: rwbarton, carter GHC Trac Issues: #9441 Differential Revision: https://phabricator.haskell.org/D5076
* Add test cases for Ticket #12146.Aditya2018-08-173-0/+10
| | | | Two tests - a ghci script and a compile fail test have been added.
* Add comment explaining change in syntax error suggestion for #12146.Aditya2018-08-171-0/+4
|
* Make ghci work for stage1 and HadrianNeil Mitchell2018-08-171-3/+19
| | | | | | This allows you to use the ghc-in-ghci script in Make even if you haven't built stage2, and also with Hadrian. Because of the way -I works, it will prefer Make/stage2.
* base: Rewrite semigroup documentationTobias Pflug2018-08-171-8/+45
|
* base: rewrite Monoid module docsTobias Pflug2018-08-171-2/+37
|
* Be mindful of GADT tyvar order when desugaring record updatesRyan Scott2018-08-173-12/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: After commit ef26182e2014b0a2a029ae466a4b121bf235e4e4, the type variable binders in GADT constructor type signatures are now quantified in toposorted order, instead of always having all the universals before all the existentials. Unfortunately, that commit forgot to update some code (which was assuming the latter scenario) in `DsExpr` which desugars record updates. This wound up being the cause of #15499. This patch makes up for lost time by desugaring record updates in a way such that the desugared expression applies type arguments to the right-hand side constructor in the correct order—that is, the order in which they were quantified by the user. Test Plan: make test TEST=T15499 Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15499 Differential Revision: https://phabricator.haskell.org/D5060
* Document default value of +RTS -N in user's guideÖmer Sinan Ağacan2018-08-171-0/+2
| | | | | | | | | | | | Summary: (This is documented in `+RTS -?` but wasn't documented in the user's guide) Reviewers: simonmar, bgamari, monoidal Reviewed By: monoidal Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5065
* Rename SigTv to TyVarTv (#15480)Joachim Breitner2018-08-1622-173/+165
| | | | | | | | | | | | | because since #15050, these are no longer used in pattern SIGnatures, but still in other places where meta-variables should only be unified with TYpe VARiables. I also found mentions of `SigTv` in parts of the renamer and desugarer that do not seem to directly relate to `SigTv` as used in the type checker, but rather to uses of `forall a.` in type signatures. I renamed these to `ScopedTv`. Differential Revision: https://phabricator.haskell.org/D5074
* Fix #15527 by pretty-printing an RdrName prefixlyRyan Scott2018-08-164-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | Summary: When `(.) @Int` is used without enabling `TypeApplications`, the resulting error message will pretty-print the (symbolic) `RdrName` `(.)`. However, it does so without parenthesizing it, which causes the pretty-printed expression to appear as `.@Int`. Yuck. Since the expression in a type application will always be prefix, we can fix this issue by using `pprPrefixOcc` instead of plain ol' `ppr`. Test Plan: make test TEST=T15527 Reviewers: bgamari, monoidal, simonpj Reviewed By: monoidal, simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15527 Differential Revision: https://phabricator.haskell.org/D5071
* primops: Drop documentation for WORD_SIZE_IN_BITS < 32Chai T. Rex2018-08-161-4/+5
| | | | Removes documentation suggesting that 30 and 31-bit code generation is supported (in support of https://github.com/ghc/ghc/commit/290889927244c79479c4347dfa6c851a134dd6e0).
* Cosmetics in GraphColorKrzysztof Gogolewski2018-08-151-1/+1
| | | | | This allows to run ghc-in-ghci when :set -XTypeApplications is in .ghciconfig.
* Add a test for Trac #15523Krzysztof Gogolewski2018-08-153-0/+13
| | | | | | | | | | | | | | | | Summary: Fortunately the bug is not present in master. Test Plan: make test TEST=T15523 Reviewers: bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, carter GHC Trac Issues: #15523 Differential Revision: https://phabricator.haskell.org/D5070
* primops: Drop support for WORD_SIZE_IN_BITS < 32Ben Gamari2018-08-151-27/+0
| | | | | | | | | | | | | | | | Summary: Fixes #15486. Test Plan: Validate Reviewers: monoidal Reviewed By: monoidal Subscribers: rwbarton, carter GHC Trac Issues: #15486 Differential Revision: https://phabricator.haskell.org/D5050
* Properly designate LambdaCase alts as CaseAlt in THRyan Scott2018-08-144-1/+20
| | | | | | | | | | | | | | | | | | | | | | Summary: When `\case` expressions are parsed normally, their alternatives are marked as `CaseAlt` (which means that they are pretty-printed without a `\` character in front of them, unlike for lambda expressions). However, `\case` expressions created by way of Template Haskell (in `Convert`) inconsistently designated the case alternatives as `LambdaExpr`, causing them to be pretty-printed poorly (as shown in #15518). The fix is simple: use `CaseAlt` consistently. Test Plan: make test TEST=T15518 Reviewers: goldfire, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15518 Differential Revision: https://phabricator.haskell.org/D5069
* Bump parsec submoduleBen Gamari2018-08-131-0/+0
|
* Suppress redundant givens during error reportingRyan Scott2018-08-125-3/+100
| | | | | | | | | | | | | | | | | | | Summary: When GHC reports that it cannot solve a constraint in error messages, it often reports what given constraints it has in scope. Unfortunately, sometimes redundant constraints (like `* ~ *`, from #15361) can sneak in. The fix is simple: blast away these redundant constraints using `mkMinimalBySCs`. Test Plan: make test TEST=T15361 Reviewers: simonpj, bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15361 Differential Revision: https://phabricator.haskell.org/D5002
* Check if files are same in combineSrcSpansZubin Duggal2018-08-125-2/+29
| | | | | | | | | | | | | | | | Summary: If this is not checked, SrcSpans are sometimes mangled by CPP. Test Plan: ./validate Reviewers: bgamari, dfeuer Reviewed By: bgamari Subscribers: dfeuer, rwbarton, thomie, carter GHC Trac Issues: #15279 Differential Revision: https://phabricator.haskell.org/D4866
* --show-iface: Qualify all non-local namesSimon Jakobi2018-08-125-16/+28
| | | | | | | | | | | | | | | | | | | | Summary: In order to disambiguate names from different modules, qualify all names that don't originate in the current module. Also update docs for QueryQualifyName Test Plan: validate Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, thomie, carter, tdammers GHC Trac Issues: #15269 Differential Revision: https://phabricator.haskell.org/D4852
* use *test instead of *slowtest for llvm validation on Circle CIAlp Mestanogullari2018-08-121-1/+1
| | | | | | | | | | | | | | | | | | Summary: Since the LLVM backend is slow enough that *slowtest can't run in the allocated time on Circle CI, let's just use *test. If that still doesn't fit in the allocated 5 hours, we can try running just the compiler tests. Test Plan: Circle CI validation for LLVM Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D5033
* CSE should deal with letrecroland2018-08-128-1/+57
| | | | | | | | | | | | | | | | Summary: Add testcase for #9441 Test Plan: make test TESTS="T9441a T9441b T9441c" Reviewers: dfeuer, simonpj, thomie, austin, bgamari Reviewed By: dfeuer Subscribers: rwbarton, carter GHC Trac Issues: #9441 Differential Revision: https://phabricator.haskell.org/D5038
* Simplify testsuite driver, part 2Krzysztof Gogolewski2018-08-126-38/+37
| | | | | | | | | | | | | | | | | | Summary: - Avoid import *; this helps tools such as pyflakes. The last occurrence in runtests.py is not easy to remove as it's used by .T files. - Use False/True instead of 0/1. Test Plan: validate Reviewers: bgamari, thomie, simonmar Reviewed By: thomie Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5062
* Simplify testsuite driverKrzysztof Gogolewski2018-08-117-26/+10
| | | | | | | | | | | | | | | | | | | Summary: - remove clean_cmd - framework_failures was undefined - times_file was not used - if_verbose_dump was called only when verbose >= 1; remove the check - simplify normalise_whitespace Test Plan: validate Reviewers: bgamari, thomie Reviewed By: thomie Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5061
* Filter plugin dylib locationsChristiaan Baaij2018-08-115-8/+59
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously we just created a cartesian product of the library paths of the plugin package and the libraries of the package. Of course, some of these combinations result in a filepath of a file doesn't exists, leading to #15475. Instead of making `haskFile` return Nothing in case a file doesn't exist (which would hide errors), we look at all the possible dylib locations and ensure that at least one of those locations is an existing file. If the list turns out to be empty however, we panic. Reviewers: mpickering, bgamari Reviewed By: mpickering Subscribers: monoidal, rwbarton, carter GHC Trac Issues: #15475 Differential Revision: https://phabricator.haskell.org/D5048
* testsuite: Bump for unix 2.7Ben Gamari2018-08-091-1/+1
|
* Bump unix submoduleBen Gamari2018-08-091-0/+0
|
* base: improve Functor documentationTobias Pflug2018-08-092-9/+30
| | | | | - Rewrite module documentation - Rewrite class documentation
* Add FreeBSD amd64 LLVM targetViktor Dukhovni2018-08-092-0/+4
|
* circleci: Reduce compression effort to 3Ben Gamari2018-08-081-1/+2
|
* circleci: Reduce build verbosityBen Gamari2018-08-081-1/+1
|
* circleci: Fix documentation buildingBen Gamari2018-08-086-15/+95
|
* Revert "rts: Ensure that the_gc_thread is aligned"Ben Gamari2018-08-081-5/+1
| | | | | | This caused segmentation faults on Darwin. This reverts commit c6cc93bca69abc258513af8cf2370b14e70fd8fb.
* Allow arbitrary options to be passed to tar compressionBen Gamari2018-08-081-3/+3
|
* Yet another Cabal submodule bumpBen Gamari2018-08-071-0/+0
|
* testsuite: Add (broken) test for #15473Ben Gamari2018-08-072-0/+13
|
* Bump Cabal submoduleBen Gamari2018-08-071-0/+0
|
* Turn on MonadFail desugaring by defaultHerbert Valerio Riedel2018-08-0728-67/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This contains two commits: ---- Make GHC's code-base compatible w/ `MonadFail` There were a couple of use-sites which implicitly used pattern-matches in `do`-notation even though the underlying `Monad` didn't explicitly support `fail` This refactoring turns those use-sites into explicit case discrimations and adds an `MonadFail` instance for `UniqSM` (`UniqSM` was the worst offender so this has been postponed for a follow-up refactoring) --- Turn on MonadFail desugaring by default This finally implements the phase scheduled for GHC 8.6 according to https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail#Transitionalstrategy This also preserves some tests that assumed MonadFail desugaring to be active; all ghc boot libs were already made compatible with this `MonadFail` long ago, so no changes were needed there. Test Plan: Locally performed ./validate --fast Reviewers: bgamari, simonmar, jrtc27, RyanGlScott Reviewed By: bgamari Subscribers: bgamari, RyanGlScott, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D5028