summaryrefslogtreecommitdiff
path: root/ghc
Commit message (Collapse)AuthorAgeFilesLines
* ghc-bin.cabal.in: add a 'threaded' flag for hadrianAlp Mestanogullari2018-10-011-0/+12
| | | | | | | | | | | | | | | | | | | | | Summary: hadrian will explicitly enable this flag, but more importantly needs it as otherwise we just never end up passing -threaded to GHC when building a new GHC binary. We could quite likely unconditionally pass -threaded, as the corresponding logic for GhcThreaded in mk/config.mk.in seems to always lead to it being set to True, but we instead leave a way out for anyone in need of a GHC linked against a non-threaded runtime system in the future. Test Plan: T8242 (with a GHC built by hadrian) Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5146
* Turn on MonadFail desugaring by defaultHerbert Valerio Riedel2018-08-071-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* GHC doesn't handle ./ prefixed paths correctly (#12674)roland2018-07-301-3/+17
| | | | | | | | | | | | | | | | Summary: If a filename starts with a hypen, GHC keeps the prefixed "./" path. Test Plan: make test TEST=T12674 Reviewers: Phyx, nomeata, bgamari, erikd Reviewed By: Phyx Subscribers: rwbarton, thomie, carter GHC Trac Issues: #12674 Differential Revision: https://phabricator.haskell.org/D5009
* Modifications to support loading GHC into GHCiMichael Sloan2018-07-274-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change was previously part of [D4904](https://phabricator.haskell.org/D4904), but is being split off to aid in getting this reviewed and merged. * The compiler code is built with `NoImplicitPrelude`, but GHCi's modules are incompatible with it. So, this adds the pragma to all GHCi modules that didn't have it, and adds imports of Prelude. * In order to run GHC within itself, a `call of 'initGCStatistics` needed to be skipped. This uses CPP to skip it when `-DGHC_LOADED_INTO_GHCI` is set. * There is an environment variable workaround suggested by Ben Gamari [1], where `_GHC_TOP_DIR` can be used to specify GHC's top dir if `-B` isn't provided. This can be used to solve a problem where the GHC being run within GHCi attempts to look in `inplace/lib/lib/` instead of `inplace/lib/`. [1]: https://phabricator.haskell.org/D4904#135438 Reviewers: goldfire, bgamari, erikd, alpmestan Reviewed By: alpmestan Subscribers: alpmestan, lelf, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4986
* Fix space leaksSimon Marlow2018-07-161-3/+4
| | | | | | | | | | | | | | | | | | | | | Summary: All these were detected by -fghci-leak-check when GHC was compiled *without* optimisation (e.g. using the "quick" build flavour). Unfortunately I don't know of a good way to keep this working. I'd like to just disable the -fghci-leak-check flag when the compiler is built without optimisation, but it doesn't look like we have an easy way to do that. And even if we could, it would be fragile anyway, Test Plan: `cd testsuite/tests/ghci; make` Reviewers: bgamari, hvr, erikd, tdammers Subscribers: tdammers, rwbarton, thomie, carter GHC Trac Issues: #15246 Differential Revision: https://phabricator.haskell.org/D4872
* Add ghc-prim as dependency to ghc-binÖmer Sinan Ağacan2018-06-272-8/+5
| | | | | | | | | | | | Remove unsafeCoerce introduced by a54c94f08b Reviewers: simonmar, bgamari Reviewed By: simonmar Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4901
* Show addresses of live objects in GHCi leak checkÖmer Sinan Ağacan2018-06-271-5/+26
| | | | | | | | Reviewers: simonmar, bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4892
* containers: Bump to 0.6.0.1Ben Gamari2018-06-201-1/+1
| | | | Bumps containers submodule, among others.
* Revert "containers: Bump to 0.6.0.1"Ben Gamari2018-06-191-1/+1
| | | | | | | | This reverts commit 50e7bff7514ebbd74976c1a9fa0db7a8275178ae. Reverts submodule changes. Sigh, the haskeline commit isn't quite upstream yet.
* containers: Bump to 0.6.0.1Ben Gamari2018-06-191-1/+1
| | | | Bumps containers submodule, among others.
* Disable `-fdefer-out-of-scope-variables` in ghci.HE, Tao2018-06-141-0/+4
| | | | | | | | | | | | | | | | | | | | We have already disabled `-fdefer-type-errors` and `-fdefer-typed-holes` in ghci. This patch disables `-fdefer-out-of-scope-variables` as well. Fixes Trac #15259, as well as #14963. Test Plan: make test TEST="T15259 T14963a T14963b T14963c" Reviewers: bgamari, tdammers Reviewed By: tdammers Subscribers: tdammers, rwbarton, thomie, carter GHC Trac Issues: #15259, #14963 Differential Revision: https://phabricator.haskell.org/D4830
* Serialize docstrings to ifaces, display them with new GHCi :doc commandSimon Jakobi2018-06-041-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | If `-haddock` is set, we now extract docstrings from the renamed ast and serialize them in the .hi-files. This includes some of the changes from D4749 with the notable exceptions of the docstring lexing and renaming. A currently limited and experimental GHCi :doc command can be used to display docstrings for declarations. The formatting of pretty-printed docstrings is changed slightly, causing some changes in testsuite/tests/haddock. Test Plan: ./validate Reviewers: alexbiehl, hvr, gershomb, harpocrates, bgamari Reviewed By: alexbiehl Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4758
* Extract hard-coded LLVM opt flags into a fileKavon Farvardin2018-05-302-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | To resolve ticket #11295, I think it makes sense to stop hard-coding the pass sequences used by GHC when compiling with LLVM into the compiler itself. This patchset introduces a companion to the existing `llvm-targets` file called `llvm-passes`. The passes file is a simple association list that holds the default LLVM `opt` pass sequence used by GHC. This allows end users to easily save their favorite optimization flags when compiling with LLVM. The main benefit for ticket #11295 is that when adding a custom pass sequence, it tends to be an extremely long string that would be unsightly in the code. This is essentially part 1 of 2 for ticket #11295. Test Plan: ./validate Reviewers: bgamari, angerman Reviewed By: angerman Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4695
* Add -fghci-leak-check to check for space leaksSimon Marlow2018-05-253-1/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: (re-applying this patch now that D4659 is committed) Space leaks in GHCi emerge from time to time and tend to come back again after they get fixed. This is an attempt to limit regressions by * adding a reliable detection for some classes of space leaks in GHCi * turning on leak checking for all GHCi tests in the test suite, so that we'll notice if the leak appears again. The idea for detecting space leaks is quite simple: * find some data that we expect to be GC'd later, make a weak pointer to it * when we expect the data to be dead, do a `performGC` and then check the status of the weak pointer. It would be nice to apply this trick to lots of things in GHC, e.g. ensuring that HsSyn is not retained after the desugarer, or ensuring that CoreSyn from the previous simplifier pass is not retained. Test Plan: validate Reviewers: bgamari, simonpj, erikd, niteria Subscribers: thomie, carter GHC Trac Issues: #15111
* Fix #14973Denis M2018-05-141-8/+4
| | | | | | | | | | Reviewers: bgamari Reviewed By: bgamari Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D4661
* ghc-pkg: Configure handle encodingsBen Gamari2018-05-131-12/+2
| | | | | | | | | | | | | | | | | | This fixes #15021 using a the same approach as was used to fix the issue in ghc (#10762). Test Plan: Validate on Windows as user whose username contains non-ASCII characters Reviewers: simonmar Reviewed By: simonmar Subscribers: lehins, thomie, carter GHC Trac Issues: #15021 Differential Revision: https://phabricator.haskell.org/D4642
* Revert "Add -fghci-leak-check to check for space leaks"Simon Marlow2018-05-103-74/+1
| | | | This reverts commit 5fe6aaa3756cda654374ebfd883fa8f064ff64a4.
* Add -fghci-leak-check to check for space leaksSimon Marlow2018-05-093-1/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Space leaks in GHCi emerge from time to time and tend to come back again after they get fixed. This is an attempt to limit regressions by * adding a reliable detection for some classes of space leaks in GHCi * turning on leak checking for all GHCi tests in the test suite, so that we'll notice if the leak appears again. The idea for detecting space leaks is quite simple: * find some data that we expect to be GC'd later, make a weak pointer to it * when we expect the data to be dead, do a `performGC` and then check the status of the weak pointer. It would be nice to apply this trick to lots of things in GHC, e.g. ensuring that HsSyn is not retained after the desugarer, or ensuring that CoreSyn from the previous simplifier pass is not retained. Test Plan: validate Reviewers: bgamari, simonpj, erikd, niteria Subscribers: thomie, carter GHC Trac Issues: #15111 Differential Revision: https://phabricator.haskell.org/D4658
* TTG : complete for balance of hsSyn ASTAlan Zimmerman2018-04-271-1/+1
| | | | | | | | | | | | | | | | | | Summary: - remove PostRn/PostTc fields - remove the HsVect In/Out distinction for Type, Class and Instance - remove PlaceHolder in favour of NoExt - Simplify OutputableX constraint Updates haddock submodule Test Plan: ./validate Reviewers: goldfire, bgamari Subscribers: goldfire, thomie, mpickering, carter Differential Revision: https://phabricator.haskell.org/D4625
* Bump unix submodule to version 2.8.0.0Ryan Scott2018-04-191-1/+1
| | | | | | | | | | | | | | Summary: Requires bumping several submodules. Test Plan: ./validate Reviewers: hvr, bgamari Subscribers: thomie, carter GHC Trac Issues: #15042 Differential Revision: https://phabricator.haskell.org/D4604
* Restore Trees That Grow reverted commitsAlan Zimmerman2018-04-092-8/+8
| | | | | | | | | | | | | | | | | | The following commits were reverted prior to the release of GHC 8.4.1, because the time to derive Data instances was too long [1]. 438dd1cbba13d35f3452b4dcef3f94ce9a216905 Phab:D4147 e3ec2e7ae94524ebd111963faf34b84d942265b4 Phab:D4177 47ad6578ea460999b53eb4293c3a3b3017a56d65 Phab:D4186 The work is continuing, as the minimum bootstrap compiler is now GHC 8.2.1, and this allows Plan B[2] for instances to be used. This will land in a following commit. Updates Haddock submodule [1] https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/Instances [2] https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/Instances#PLANB
* GHCi info: Use src file for cache invalidationalexbiehl2018-03-021-1/+3
| | | | | | | | | | | | | | | | | | | | Prior to this patch GHCi used the modification time of a module's object file to invalidate the info cache. We now look at the modification time of the source file, if present. This addresses part of https://ghc.haskell.org/trac/ghc/ticket/12706#comment:3. Reviewers: bgamari Reviewed By: bgamari Subscribers: lelf, alpmestan, rwbarton, thomie, carter GHC Trac Issues: #12706 Differential Revision: https://phabricator.haskell.org/D4459
* Don't add targets that can't be found in GHCiJulian Priestley2018-01-311-1/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | When using the :add command in haxlsh/ghci, a module/file that can't be found is still added to the list of targets, resulting in an error message for the bad module/file for every subsequent usage of the command. The add command should verify that the module/file can be found before adding it to the list of targets. Also add a ":show targets" command to show the currently added list of commands, and an ":unadd" command to remove a target. Test Plan: Add a new GHCi testcase that checks that :add doesn't remember either files or modules that could not be found, and that both the new :show and :unadd commands work as expected. Reviewers: simonmar, bgamari Reviewed By: simonmar Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14676 Differential Revision: https://phabricator.haskell.org/D4321
* Allow users to ignore optimization changesDavid Feuer2017-12-111-3/+9
| | | | | | | | | | | | | | | | | | | | * Add a new flag, `-fignore-optim-changes`, allowing them to avoid recompilation if the only changes are to the `-O` level or to flags controlling optimizations. * When `-fignore-optim-changes` is *off*, recompile when optimization flags (e.g., `-fno-full-laziness`) change. Previously, we ignored these unconditionally when deciding whether to recompile a module. Reviewers: austin, bgamari, simonmar Reviewed By: simonmar Subscribers: duog, carter, simonmar, rwbarton, thomie GHC Trac Issues: #13604 Differential Revision: https://phabricator.haskell.org/D4123
* Revert "trees that grow" workBen Gamari2017-11-212-8/+8
| | | | | | | | | | | | | | As documented in #14490, the Data instances currently blow up compilation time by too much to stomach. Alan will continue working on this in a branch and we will perhaps merge to 8.2 before 8.2.1 to avoid having to perform painful cherry-picks in 8.2 minor releases. Reverts haddock submodule. This reverts commit 47ad6578ea460999b53eb4293c3a3b3017a56d65. This reverts commit e3ec2e7ae94524ebd111963faf34b84d942265b4. This reverts commit 438dd1cbba13d35f3452b4dcef3f94ce9a216905. This reverts commit 0ff152c9e633accca48815e26e59d1af1fe44ceb.
* WIP on combined Step 1 and 3 for Trees That Grow, HsExprAlan Zimmerman2017-11-112-6/+6
| | | | | | | | | | | | | | | | | See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow Trees that grow extension points are added for - HsExpr Updates haddock submodule Test Plan: ./validate Reviewers: bgamari, goldfire Subscribers: rwbarton, thomie, shayan-najd, mpickering Differential Revision: https://phabricator.haskell.org/D4177
* Update Win32 version for GHC 8.4.Tamar Christina2017-11-091-1/+1
| | | | | | | | | | | | | | | | | | | Update to Win32 2.6 which is the expected version release for 8.4 This involves moving Cabal forward which brings some backwards incompatible changes that needs various fixups. Bump a bunch of submodules Test Plan: ./validate Reviewers: austin, bgamari, angerman Reviewed By: bgamari, angerman Subscribers: angerman, thomie, rwbarton Differential Revision: https://phabricator.haskell.org/D4133
* WIP on Doing a combined Step 1 and 3 for Trees That GrowAlan Zimmerman2017-11-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow Trees that grow extension points are added for - ValBinds - HsPat - HsLit - HsOverLit - HsType - HsTyVarBndr - HsAppType - FieldOcc - AmbiguousFieldOcc Updates haddock submodule Test Plan: ./validate Reviewers: shayan-najd, simonpj, austin, goldfire, bgamari Subscribers: goldfire, rwbarton, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D4147
* Revert "WIP on combining Step 1 and 3 of Trees That Grow"Ben Gamari2017-11-071-2/+2
| | | | | | | | This reverts commit 0ff152c9e633accca48815e26e59d1af1fe44ceb. Sadly this broke when bootstrapping with 8.0.2 due to #14396. Reverts haddock submodule.
* WIP on combining Step 1 and 3 of Trees That GrowAlan Zimmerman2017-11-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow Trees that grow extension points are added for - ValBinds - HsPat - HsLit - HsOverLit - HsType - HsTyVarBndr - HsAppType - FieldOcc - AmbiguousFieldOcc Updates haddock submodule Test Plan: ./validate Reviewers: shayan-najd, simonpj, austin, goldfire, bgamari Subscribers: goldfire, rwbarton, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D4147
* DynFlags: Introduce -show-mods-loaded flagBen Gamari2017-11-061-12/+26
| | | | | | | | | | | | | | | | | | | This flag reintroduces the verbose module name output produced by GHCi's :load command behind a new flag, -show-mods-loaded. This was originally removed in D3651 but apparently some tools (e.g. haskell-mode) rely on this output. Addresses #14427. Test Plan: Validate Reviewers: svenpanne Reviewed By: svenpanne Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4164
* Catch a few more typos in commentsGabor Greif2017-10-301-1/+1
|
* Revert "Update Win32 version for GHC 8.4."Tamar Christina2017-10-251-1/+1
| | | | | | This reverts commit 561bdca16e2fe88d0b96fc10098955eabca81bba. submodule
* Update Win32 version for GHC 8.4.Tamar Christina2017-10-251-1/+1
| | | | | | | | | | | | | | | | Summary: Update to Win32 2.6 which is the expected version release for 8.4 This bumps the required submodule s as well. Test Plan: ./validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4117
* Disable -XRebindableSyntax when running internal GHCi expressionsRyan Scott2017-10-191-10/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It's well known that `-XRebindableSyntax` doesn't play nicely with some of the internal expressions that GHCi runs. #13385 was one example where this problem arose, which was fixed at the time by simply avoiding the use of `do`-notation in these internal GHCi expressions. That seemed to work, but it was a technique that proved not to scale, as #14342 demonstrated //another// example where `-XRebindableSyntax` can bite. Instead of delicately arranging the internal GHCi expressions to avoid anything that might be covered under `-XRebindableSyntax`, this patch takes the much more direct approach of disabling `-XRebindableSyntax` entirely when running any internal GHCi expression. This shouldn't hurt, since nothing internal to GHCi was taking advantage of the extension in the first place, and moreover, we can have greater confidence that some other obscure `-XRebindableSyntax` corner case won't pop up in the future. As an added bonus, this lets us once again use `do`-notation in the code that had to be changed when #13385 was (hackily) fixed before. Test Plan: make test TEST=T14342 Reviewers: bgamari, austin Subscribers: rwbarton, thomie GHC Trac Issues: #14342 Differential Revision: https://phabricator.haskell.org/D4086
* Reexport Semigroup's <> operator from Prelude (#14191)Herbert Valerio Riedel2017-09-224-2/+4
| | | | | | | This completes the 2nd phase of the Semigroup=>Monoid Proposal (SMP) initiated in 8ae263ceb3566a7c82336400b09cb8f381217405. This updates a couple submodules to address <> naming clashes.
* Canonicalise MonoidFail instances in GHCHerbert Valerio Riedel2017-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | IOW, code compiles -Wnoncanonical-monoidfail-instances clean now This is easy now since we require GHC 8.0/base-4.9 or later for bootstrapping. Note that we can easily enable `MonadFail` via default-extensions: MonadFailDesugaring in compiler/ghc.cabal.in which currently would point out that NatM doesn't have a proper `fail` method, even though failable patterns are made use of: compiler/nativeGen/SPARC/CodeGen.hs:425:25: error: * No instance for (Control.Monad.Fail.MonadFail NatM) arising from a do statement with the failable pattern ‘(dyn_c, [dyn_r])’
* Canonicalise Monoid instances in GHCHerbert Valerio Riedel2017-09-091-0/+3
| | | | IOW, code compiles -Wnoncanonical-monoid-instances clean now
* Clean up opt and llcMoritz Angermann2017-09-062-2/+7
| | | | | | | | | | | | | | | | | | | | | The LLVM backend shells out to LLVMs `opt` and `llc` tools. This clean up introduces a shared data structure to carry the arguments we pass to each tool so that corresponding flags are next to each other. It drops the hard coded data layouts in favor of using `-mtriple` and have LLVM infer them. Furthermore we add `clang` as a proper tool, so we don't rely on assuming that `clang` is called `clang` on the `PATH` when using `clang` as the assembler. Finally this diff also changes the type of `optLevel` from `Int` to `Word`, as we do not have negative optimization levels. Reviewers: erikd, hvr, austin, rwbarton, bgamari, kavon Reviewed By: kavon Subscribers: michalt, Ericson2314, ryantrinkle, dfeuer, carter, simonpj, kavon, simonmar, thomie, erikd, snowleopard Differential Revision: https://phabricator.haskell.org/D3352
* fix typo (expreesions -> expressions)Chris Martin2017-08-221-1/+1
|
* Drop GHC 7.10 compatibilityRyan Scott2017-08-011-2/+0
| | | | | | | | | | | | | | | | GHC 8.2.1 is out, so now GHC's support window only extends back to GHC 8.0. This means we can delete gobs of code that was only used for GHC 7.10 support. Hooray! Test Plan: ./validate Reviewers: hvr, bgamari, austin, goldfire, simonmar Reviewed By: bgamari Subscribers: Phyx, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3781
* Make module membership on ModuleGraph fasterBartosz Nitka2017-07-182-11/+14
| | | | | | | | | | | | | | | | | | | When loading/reloading with a large number of modules (>5000) the cost of linear lookups becomes significant. The changes here made `:reload` go from 6s to 1s on my test case. The bottlenecks were `needsLinker` in `DriverPipeline` and `getModLoop` in `GhcMake`. Test Plan: ./validate Reviewers: simonmar, austin, bgamari Subscribers: thomie, rwbarton Differential Revision: https://phabricator.haskell.org/D3703
* Make ':info Coercible' display an arbitrary string (fixes #12390)Patrick Dougherty2017-07-111-6/+8
| | | | | | | | | | | | | | | | | | | | This change enables the addition of an arbitrary string to the output of GHCi's ':info'. It was made for Coercible in particular but could be extended if desired. Updates haddock submodule. Test Plan: Modified test 'ghci059' to match new output. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: goldfire, rwbarton, thomie GHC Trac Issues: #12390 Differential Revision: https://phabricator.haskell.org/D3634
* Revert "Make module membership on ModuleGraph faster"Ben Gamari2017-06-272-14/+11
| | | | | | I had not intended on merging this. This reverts commit b0708588e87554899c2efc80a2d3eba353dbe926.
* Make module membership on ModuleGraph fasterBartosz Nitka2017-06-272-11/+14
| | | | | | | | | | | | | | | | | | | When loading/reloading with a large number of modules (>5000) the cost of linear lookups becomes significant. The changes here made `:reload` go from 6s to 1s on my test case. The bottlenecks were `needsLinker` in `DriverPipeline` and `getModLoop` in `GhcMake`. Test Plan: ./validate Reviewers: simonmar, austin, bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3646
* Show only the number of modules in ghciFrancesco Mazzoli2017-06-211-18/+9
| | | | | | | | | | Reviewers: bgamari, austin, simonmar Reviewed By: bgamari Subscribers: mpickering, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3651
* Make -w less aggressive (Trac #12056)Sean Gillespie2017-06-121-4/+4
| | | | | | | | | | | | | | | Previously -w combined with -Wunrecognised-warning-flags would not report unrecognized flags. Reviewers: austin, bgamari, dfeuer Reviewed By: bgamari Subscribers: dfeuer, rwbarton, thomie GHC Trac Issues: #12056 Differential Revision: https://phabricator.haskell.org/D3581
* Refactor temp files cleanupDouglas Wilson2017-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove filesToNotIntermediateClean from DynFlags, create a data type FilesToClean, and change filesToClean in DynFlags to be a FilesToClean. Modify SysTools.newTempName and the Temporary constructor of PipelineMonad.PipelineOutput to take a TempFileLifetime, which specifies whether a temp file should live until the end of GhcMonad.withSession, or until the next time cleanIntermediateTempFiles is called. These changes allow the cleaning of intermediate files in GhcMake to be much more efficient. HscTypes.hptObjs is removed as it is no longer used. A new performance test T13701 is added, which passes both with and without -keep-tmp-files. The test fails by 25% without the patch, and passes when -keep-tmp-files is added. Note that there are still at two hotspots caused by algorithms quadratic in the number of modules, however neither of them allocate. They are: * DriverPipeline.compileOne'.needsLinker * GhcMake.getModLoop DriverPipeline.compileOne'.needsLinker is changed slightly to improve the situation. I don't like adding these Types to DynFlags, but they need to be seen by Dynflags, SysTools and PipelineMonad. The alternative seems to be to create a new module. Reviewers: austin, hvr, bgamari, dfeuer, niteria, simonmar, erikd Reviewed By: simonmar Subscribers: rwbarton, thomie GHC Trac Issues: #13701 Differential Revision: https://phabricator.haskell.org/D3620
* Udate hsSyn AST to use Trees that GrowAlan Zimmerman2017-06-063-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow This commit prepares the ground for a full extensible AST, by replacing the type parameter for the hsSyn data types with a set of indices into type families, data GhcPs -- ^ Index for GHC parser output data GhcRn -- ^ Index for GHC renamer output data GhcTc -- ^ Index for GHC typechecker output These are now used instead of `RdrName`, `Name` and `Id`/`TcId`/`Var` Where the original name type is required in a polymorphic context, this is accessible via the IdP type family, defined as type family IdP p type instance IdP GhcPs = RdrName type instance IdP GhcRn = Name type instance IdP GhcTc = Id These types are declared in the new 'hsSyn/HsExtension.hs' module. To gain a better understanding of the extension mechanism, it has been applied to `HsLit` only, also replacing the `SourceText` fields in them with extension types. To preserve extension generality, a type class is introduced to capture the `SourceText` interface, which must be honoured by all of the extension points which originally had a `SourceText`. The class is defined as class HasSourceText a where -- Provide setters to mimic existing constructors noSourceText :: a sourceText :: String -> a setSourceText :: SourceText -> a getSourceText :: a -> SourceText And the constraint is captured in `SourceTextX`, which is a constraint type listing all the extension points that make use of the class. Updating Haddock submodule to match. Test Plan: ./validate Reviewers: simonpj, shayan-najd, goldfire, austin, bgamari Subscribers: rwbarton, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D3609
* Use lengthIs and friends in more placesRyan Scott2017-06-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | While investigating #12545, I discovered several places in the code that performed length-checks like so: ``` length ts == 4 ``` This is not ideal, since the length of `ts` could be much longer than 4, and we'd be doing way more work than necessary! There are already a slew of helper functions in `Util` such as `lengthIs` that are designed to do this efficiently, so I found every place where they ought to be used and did just that. I also defined a couple more utility functions for list length that were common patterns (e.g., `ltLength`). Test Plan: ./validate Reviewers: austin, hvr, goldfire, bgamari, simonmar Reviewed By: bgamari, simonmar Subscribers: goldfire, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3622