summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge new commands from ghci-ng (re #10874)wip/T10874Herbert Valerio Riedel2015-09-136-7/+680
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was for the major part implemented by Chris Done on https://github.com/chrisdone/ghci-ng and has been in use by Emacs's `haskell-mode` for about a year already. I've squashed the commits, rebased to GHC HEAD, and cleaned up the patch. ----- The new commands this commit adds are (description copied from [1]): * The `:set +c` command: collect information about modules after they've been loaded, and remember it between loads (including failed ones). I recommend adding this line to your `~/.ghci` file. * The `:type-at` command (requires `+c`): show the type at the given position in the module. Example: ``` haskell *X> :type-at X.hs 6 6 6 7 f Int -> Int ``` This can be useful to get the type of a pattern variable or an arbitrary selected expression. The parameters are: <filename> <line> <col> <end-line> <end-col> <text> `text` is used for when the span is out of date, i.e. the file changed and the code has moved, text can be used to confirm the contents of the span matches, and to fallback to a general :t-like lookup. * The `:loc-at` command (requires `+c`): get the location of the thing at the given position in the module. Example: ``` haskell *X> :loc-at X.hs 6 14 6 16 mu X.hs:(8,7)-(8,9) ``` This is useful for goto-definition features of editors and IDEs. Parameters are the same as for `:type-at`. * The `:uses` command (requires `+c`): gets all module-local uses of the thing at the given position in the module. Example: ``` haskell > :uses /home/chris/Projects/ghci-ng/ghc/GhciFind.hs 53 66 53 70 name /home/chris/Projects/ghci-ng/ghc/GhciFind.hs:(46,25)-(46,29) /home/chris/Projects/ghci-ng/ghc/GhciFind.hs:(47,37)-(47,41) /home/chris/Projects/ghci-ng/ghc/GhciFind.hs:(53,66)-(53,70) /home/chris/Projects/ghci-ng/ghc/GhciFind.hs:(57,62)-(57,66) ``` This is useful for highlighting and navigating all uses of an identifier in editors and IDEs. Parameters are the same as for `:type-at`. * The `:all-types` command (requires `+c`): list *all* types in the project: expressions, bindings top-level and local. Sort of like `:browse` on steroids. ``` haskell > :all-types ghc/GhciTypes.hs:(38,13)-(38,24): Maybe Id ghc/GhciTypes.hs:(45,10)-(45,29): Outputable SpanInfo ghc/GhciTypes.hs:(45,10)-(45,29): (Rational -> SpanInfo -> SDoc) -> Outputable SpanInfo ``` [1]: https://github.com/chrisdone/ghci-ng/blob/master/README.md
* Testsuite: mark T6037 expect_fail on Windows (#6037)Thomas Miedema2015-09-122-3/+6
|
* hpc: use `takeDirectory` instead of `dropWhileEnd (/= '/')`Thomas Miedema2015-09-122-4/+1
| | | | This fixes some hpc tests on Windows. Update submodule hpc.
* CodeGen: fix typo in error messageThomas Miedema2015-09-121-1/+1
|
* Testsuite: mark enum01-enum03 expect_broken(#9399) on WindowsThomas Miedema2015-09-121-4/+7
|
* Testsuite: normalise slashes in callstack outputThomas Miedema2015-09-121-3/+5
| | | | This fixes some tests on Windows, for example T2120.
* s/StgArrWords/StgArrBytes/Siddhanathan Shanmugam2015-09-1117-62/+55
| | | | | | | | | | Rename StgArrWords to StgArrBytes (see Trac #8552) Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D1233 GHC Trac Issues: #8552
* Code movementJan Stolarek2015-09-122-72/+75
|
* Dead code removal, export cleanupJan Stolarek2015-09-124-39/+3
|
* Remove redundant language extensionsJan Stolarek2015-09-124-4/+4
|
* Add assertionsJan Stolarek2015-09-121-1/+2
|
* Testsuite cleanupJan Stolarek2015-09-1227-231/+170
| | | | | As a result of fixing #10836 it is now possible to merge 11 different tests for #6018 into one
* Improve documentation of comprehensionsSimon Peyton Jones2015-09-111-1/+1
| | | | Suggestion from Jeremy Gibbons
* Fix broken links in documentationSimon Peyton Jones2015-09-113-3/+3
|
* Improve documentation for transform list-compsSimon Peyton Jones2015-09-111-1/+6
| | | | Thanks to Jeremy Gibbons for spotting the infelictity
* A CFunEqCan can be DerivedSimon Peyton Jones2015-09-113-10/+21
| | | | | | | | | This fixes the ASSERTION failures in indexed-types/should_fail/T5439 typecheck/should_fail/T5490 when GHC is compiled with -DDEBUG See Phab:D202 attached to Trac #6018
* Add a test for Trac #10806Simon Peyton Jones2015-09-113-1/+21
|
* Improve rejigConRes (again)Simon Peyton Jones2015-09-113-35/+52
| | | | | | | | I think this patch finally works around the delicacy in the strictness of TcTyClsDecls.rejigConRes. See the notes with that function and Note [Checking GADT return types]. As a result, we fix Trac #10836, and improve Trac #7175
* Comments on oneShotSimon Peyton Jones2015-09-111-0/+4
|
* Don't check in autogenerated hs files for recomp013.Edward Z. Yang2015-09-094-3/+3
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Testsuite: comment out `setnumcapabilities001` (#10860)Thomas Miedema2015-09-091-6/+8
| | | | Don't mark it expect_broken, because it fails only sometimes.
* Forbid annotations when Safe Haskell safe mode is enabled.David Kraeutmann2015-09-086-2/+39
| | | | | | | | | | | | | For now, this fails compliation immediately with an error. If desired, this can be a warning that annotations in Safe Haskell are ignored. Signed-off-by: David Kraeutmann <kane@kane.cx> Reviewed By: goldfire, austin Differential Revision: https://phabricator.haskell.org/D1226 GHC Trac Issues: #10826
* HeapStackCheck: Small refactoringBen Gamari2015-09-081-2/+2
| | | | | | | | Use modern Cmm argument syntax in stg_block_blackhole definition. Reviewed By: simonmar, austin Differential Revision: https://phabricator.haskell.org/D1210
* Build system: check for inconsistent settings (#10157)Thomas Miedema2015-09-082-3/+42
| | | | | | | | | | | | | | | | | | | | | `configure` currently detects when the docbook and hscolour tools aren't available, and instead of failing outright (as it does for missing alex and happy), sets some variables in mk/config.mk to tell `make` not to build the documentation. Sometimes, however, you want to really make sure all documentation gets built, fully colourized. For example when making a release. To do so, you can override the mentioned variables from mk/config.mk in mk/build.mk (e.g. set HSCOLOUR_SRCS=YES). This patch adds some error checking to make sure that doing so will not result in weird build failures when those tools are still missing. Test Plan: ran `make` a couple of times, with different mk/config.mk settings. Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1232
* Move GeneralCategory et al to GHC.UnicodeBen Gamari2015-09-084-211/+219
| | | | | | | | | | This allows these to be used from Text.Read.Lex import cycles. Reviewed By: thomie, austin Differential Revision: https://phabricator.haskell.org/D1121 GHC Trac Issues: #10444
* Build system: cleanup BUILD_DIRS + add lots of NotesThomas Miedema2015-09-086-59/+176
| | | | | | | | | | | | | | | | | | | | | | | Summary: See Note [CrossCompiling vs Stage1Only] in mk/config.mk.in. See Note [Stage1Only vs stage=1] in mk/config.mk.in. See Note [No stage2 packages when CrossCompiling or Stage1Only]. Also: * use stage2 to build mkUserGuidePart, as was probably intended. Now the following represent the same set of packages: - packages that we build with ghc-stage2 - packages that depend on the ghc library Those packages are: haddock, mkUserGuidePart and ghctags. * don't let utils that don't depend on the ghc library depend on its package-data.mk file. Instead, let those utils directly depend on the package-data.mk files of the stage1 packages. Not sure if it improves anything, but I found it easier to explain what's going on this way. (partially) reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1218
* Build system: make *-cross BuildFlavours consistent (#10223)Thomas Miedema2015-09-082-4/+4
| | | | | | | | | | | | | | | | | | This is a follow up to 841924c9587c10488a18e307b573720977bf4f13, where `-fllvm` was explicitly removed from GhcStage1HcOpts for perf-cross. After removing -fllvm from GhcStage1HcOpts, it should be removed from SRC_HC_OPTS as well, because SRC_HC_OPTS are added to every Haskell compilation. That's what this patch does. BuildFlavour bench-cross (added in ddf79ebf69fe4a6e69d69d451a6040a53b1ea12c), is probably never used. But for consistency, also use -fllvm here, for building stage2 and the libraries. Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1228
* Build system: delete the InstallExtraPackages variableThomas Miedema2015-09-084-33/+12
| | | | | | | | | | | | | | Just install all packages that are built. Don't make an exception for the dph and extra packages. You can control whether the dph and extra packages should be build using the variables BUILD_DPH and BUILD_EXTRA_PKGS. These variables didn't exist before. But now that they do, InstallExtraPackages isn't really needed anymore. Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1227
* Build system: remove hack for Mac OSX in configure.ac (#10476)Thomas Miedema2015-09-081-10/+3
| | | | | | | | | | | | | | | | | | | Cross-compilation on Mac OSX currently doesn't work. While building stage 1, the build system uses the `ar` for the target architecture instead of the `ar` for build/host architecture. The cause is a hack added in 24746fe78024a1edab843bc710c79c55998ab134 (2010), to supporting bootstrap compilers built with older versions of Xcode. Xcode 4.3 started installing command line tools in a different location. Assuming this all behind us now, and the paths didn't change again (you never now), we can delete the hack. Deleting the hack fixes the cross compilation issue. Tested by Trac user jakzale. Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1231
* Build system: detect when user cloned from GitHubThomas Miedema2015-09-081-0/+34
| | | | | | | | | | | | | | | | | | | Cloning the ghc repository from GitHub doesn't work out of the box. It requires installing some special url rewrites into ~/.gitconfig. The build fails mysteriously if you forget. This patch tries to detect when you cloned from GitHub, and warns you if you didn't set those url rewrites. This hopefully lowers to barrier to contribute to GHC by a tiny bit. At least one /r/haskell user ran into this recently. Test Plan: cloned from github, ran ./boot, saw the message. Installed url rewrites, and ran ./boot again, didn't see the message. Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1230
* Further simplify the story around minimum/maximumwip/D1229Joachim Breitner2015-09-071-25/+9
| | | | | | | | | | | | | | | | | | After I have found out that I should look at -ddump-prep and not -ddump-core, I noticed that these days, GHC is perfectly capeable of turning (the equivalent) of foldl to (the equivalent) of foldl' if the operation in question is strict. So instead of using rewrite rules to rewrite maximum to a strictMaximum for certain types, we simply use SPECIALIZE. This also marks maximum/minimum as INLINEABLE, so that client code can get similar specializations, hopefully even automatically. And inded, minimum applied to [Double] produces good code (although due to inlineing, not due to specialization, it seems). I checked (by looking at the core) that this still fixes #10788. Differential revision: https://phabricator.haskell.org/D1229
* SPECIALIZE strictMinimum for Int and IntegerJoachim Breitner2015-09-071-0/+4
| | | | | | | | This fixes a regression reported in #10788, where due to less inlining compared to earlier versions, we’d get worse code. With the SPECIALIZE, we get the good code, and moreover, the good code is in List.hs and _not_ inlined to the use site, so smaller code size and less compilation time.
* Build system: cleanup utils/ghc-pkg/ghc.mkThomas Miedema2015-09-071-17/+31
| | | | | | | | | | | | | | | | | | | | | | | | | There used to be a lot of custom make code to build ghc-pkg with the stage0 compiler. Commit ac5a314504554ddef0e855ef9e2fcf51e961f4a6 thankfully cleaned this up, by using the build settings from the ghc-pkg.cabal file. This commit removes some remains of the old way of installing ghc-pkg when Stage1Only=YES. Notably, we called both `build-prog` as `shell-wrapper`. This is surely wrong, because `build-prog` already calls `shell-wrapper`. It isn't needed to set WANT_INSTALLED_WRAPPER either; build-prog does that for us. This prevents the following warnings when Stage1Only=YES: utils/ghc-pkg/ghc.mk:46: warning: overriding commands for target `install_utils/ghc-pkg_dist_wrapper' utils/ghc-pkg/ghc.mk:37: warning: ignoring old commands for target `install_utils/ghc-pkg_dist_wrapper' Also add more comments and restructure a bit. Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1063
* Build system: simplify *-llvm BuildFlavours (#10223)Thomas Miedema2015-09-074-10/+10
| | | | | | | | | | | | | Note that SRC_HC_OPTS are added to every Haskell compilation. So there isn't any need to also add `-fllvm` to GhcStage1HcOpts, GhcStage2HcOpts and GhcLibHcOpts. Small bug fix: make sure we test for -fllvm in SRC_HC_OPTS, to check whether the bootstrap compiler is affected by bug #9439. Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1188
* Build system: put each BuildFlavour in a separate file (#10223)Thomas Miedema2015-09-0717-294/+207
| | | | | | | | | This allows easier diffing of different BuildFlavours, including `mk/flavours/validate.mk`. Reviewed By: bgamari, austin Differential Revision: https://phabricator.haskell.org/D1050
* tracing: Kill EVENT_STARTUPBen Gamari2015-09-056-52/+2
| | | | | This has been unnecessary for quite some time due to the create/delete capability events.
* EventLog: Factor out ensureRoomFor*EventBen Gamari2015-09-051-83/+41
|
* user-guide: Add missing <para> tags around <listitem> bodyBen Gamari2015-09-051-5/+5
| | | | Otherwise this is ill-formed DocBook
* ghc-pkg: don't print ignored errors when verbosity=0Thomas Miedema2015-09-041-7/+9
| | | | | | | Lines like the following are filling up the build logs: binary-0.7.5.0: cannot find any of ["Data/Binary.hi","Data/Binary.p_hi","Data/Binary.dyn_hi"] (ignoring)
* Build system: implement `make install-strip` (#1851)Thomas Miedema2015-09-045-15/+54
| | | | | | Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1209
* Fix T6018th test failureJan Stolarek2015-09-042-3/+1
|
* Make Data.List.foldr1 inlineJoachim Breitner2015-09-033-3/+9
| | | | | | | | | | Previously, foldr1 would be defiend recursively and thus not inline. This is bad, for example, when maximumBy has a strict comparison function: Before the BBP, it was implemented via foldl1, which inlined and yielded good code. With BBP, it goes via foldr1, so we better inline this as well. Fixes #10830. Differential Revision: https://phabricator.haskell.org/D1205
* Testsuite: ignore line number differences in call stacks (#10834)Thomas Miedema2015-09-041-0/+8
| | | | Differential Revision: https://phabricator.haskell.org/D1206
* Testsuite: only print msg when timeout kills process unexpectedlyThomas Miedema2015-09-042-2/+4
| | | | Differential Revision: https://phabricator.haskell.org/D1207
* Testsuite: fix tcfail220 - Maybe is wired-in nowThomas Miedema2015-09-042-10/+10
| | | | | | | | | | | | | | | | | | This fixes validate. 374457809de343f409fbeea0a885877947a133a2 (D202) mentions: "This patch also wires-in Maybe data type". A conflicting definition of a wired-in type in a .hsig file doesn't seem to cause compilation to fail. This is probably a bug, but a small one. Since SPJ in ffc21506894c7887d3620423aaf86bc6113a1071 swept this under the rug, by removing `data Bool a b c d = False` from tcfail220.hsig, I'm going to do the same here. D1098 touches these files, so ezyang can decide whether this problem warrants fixing when doing a rebase. Differential Revision: https://phabricator.haskell.org/D1208
* Accept underscores in the module parser. (Thanks spinda for the fix.)Edward Z. Yang2015-09-031-1/+1
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Add test for T10836 (expected broken)Jan Stolarek2015-09-033-0/+25
|
* Injective type familiesJan Stolarek2015-09-03127-842/+3962
| | | | | | | | | | | | | | | | | | | For details see #6018, Phab:D202 and the wiki page: https://ghc.haskell.org/trac/ghc/wiki/InjectiveTypeFamilies This patch also wires-in Maybe data type and updates haddock submodule. Test Plan: ./validate Reviewers: simonpj, goldfire, austin, bgamari Subscribers: mpickering, bgamari, alanz, thomie, goldfire, simonmar, carter Differential Revision: https://phabricator.haskell.org/D202 GHC Trac Issues: #6018
* Testsuite: delete dead codeThomas Miedema2015-09-021-3/+0
|
* Testsuite: by default run all tests for a single wayThomas Miedema2015-09-0210-30/+64
| | | | | | | | | | | | | | `make test` now runs all tests for a single way only. Use `make slowtest` to get the previous behaviour (i.e. run all tests for all ways). The intention is to use this new `make test` setting for Phabricator, as a reasonable compromise between `make fasttest` (what it previously used) and a fullblown `make slowtest` (which runs all tests for all ways). See Note [validate and testsuite speed] in toplevel Makefile. Differential Revision: https://phabricator.haskell.org/D1178