summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Allow CallStacks to be frozenEric Seidel2015-12-2383-280/+404
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces "freezing," an operation which prevents further locations from being appended to a CallStack. Library authors may want to prevent CallStacks from exposing implementation details, as a matter of hygiene. For example, in ``` head [] = error "head: empty list" ghci> head [] *** Exception: head: empty list CallStack (from implicit params): error, called at ... ``` including the call-site of `error` in `head` is not strictly necessary as the error message already specifies clearly where the error came from. So we add a function `freezeCallStack` that wraps an existing CallStack, preventing further call-sites from being pushed onto it. In other words, ``` pushCallStack callSite (freezeCallStack callStack) = freezeCallStack callStack ``` Now we can define `head` to not produce a CallStack at all ``` head [] = let ?callStack = freezeCallStack emptyCallStack in error "head: empty list" ghci> head [] *** Exception: head: empty list CallStack (from implicit params): error, called at ... ``` --- 1. We add the `freezeCallStack` and `emptyCallStack` and update the definition of `CallStack` to support this functionality. 2. We add `errorWithoutStackTrace`, a variant of `error` that does not produce a stack trace, using this feature. I think this is a sensible wrapper function to provide in case users want it. 3. We replace uses of `error` in base with `errorWithoutStackTrace`. The rationale is that base does not export any functions that use CallStacks (except for `error` and `undefined`) so there's no way for the stack traces (from Implicit CallStacks) to include user-defined functions. They'll only contain the call to `error` itself. As base already has a good habit of providing useful error messages that name the triggering function, the stack trace really just adds noise to the error. (I don't have a strong opinion on whether we should include this third commit, but the change was very mechanical so I thought I'd include it anyway in case there's interest) 4. Updates tests in `array` and `stm` submodules Test Plan: ./validate, new test is T11049 Reviewers: simonpj, nomeata, goldfire, austin, hvr, bgamari Reviewed By: simonpj Subscribers: thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1628 GHC Trac Issues: #11049
* Fix ASSERT in buildPatSyn, and T10897 testSimon Peyton Jones2015-12-233-9/+13
| | | | This closes Trac #10897
* Comments onlySimon Peyton Jones2015-12-231-3/+31
|
* Fix super-class cycle checkSimon Peyton Jones2015-12-235-16/+38
| | | | Fixes Trac #11278
* - fix gc_thread related compilation failure on Solaris/i386 platformKarel Gardas2015-12-231-1/+2
| | | | | | | | | | | | | Summary: This patch fixes gc_thread related compilation failure on Solaris/i386 platform. It uses Linux way of __thread declared gc_thread variable for register starving i386 from now. Reviewers: bgamari, austin, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1688
* Delete incorrect *-ws-32 expected test outputErik de Castro Lopo2015-12-2310-513/+0
| | | | | | | | | | | | | | | | | Summary: The *-ws-32 file were too difficult to keep up-to-date so @bgamari updated the test outut normalization code in commit 786d528e8f949d to make these files un-necessary. Test Plan: test on PowerPC Reviewers: hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1690
* Modify Nmax to maxN Trac #10728MarcelineVQ2015-12-237-23/+100
| | | | | | | | | | | | | | | | | Added test and changed -Nmax to -maxN, -n was taken Noticed strange -m behavoir and fixed -m from quietly ignoring being passed invalid opts, e.g. "-msasd" Reviewers: simonmar, hvr, austin, thomie, bgamari Reviewed By: hvr, thomie, bgamari Subscribers: bgamari, hvr, thomie, simonmar Differential Revision: https://phabricator.haskell.org/D1677 GHC Trac Issues: #10728
* Test Trac #11274Simon Peyton Jones2015-12-233-0/+16
|
* Tidy up and comment wildcards in family instancesSimon Peyton Jones2015-12-233-80/+100
| | | | | | I found it was possible to do this a bit more nicely See Note [Family instance declaration binders] in HsDecls, and Note [Wildcards in family instances] in RnSource
* Comments onlySimon Peyton Jones2015-12-231-3/+4
|
* Add a pattern-syn form of PromotionErrSimon Peyton Jones2015-12-2311-119/+165
| | | | | | | | | | The main change is to add PatSynPE to PromotionErr, so that when we get an ill-staged use of a pattern synonym we get a civilised error message. We were already doing this in half-baked form in tcValBinds, but this patch tidies up the impl (which previously used a hack rather than APromotionErr), and does it in tcTyClsInstDecls too.
* Comments and white spaceSimon Peyton Jones2015-12-233-5/+5
|
* Wibble to error message in Trac #10426Simon Peyton Jones2015-12-232-2/+2
|
* Revert "Allow as-patterns in pattern synonym declarations."Simon Peyton Jones2015-12-238-56/+3
| | | | | | | | | | I'm reverting this until we agree a design. See comment:5 in Trac #9793. Incidentally the reference to Trac #9739 in the reverted patch is bogus; it shold have said #9793. This reverts commit 44640af7afa1a01ff2e2357f7c1436b4804866fc.
* - fix tests on OpenBSD which requires _DYNAMIC symbolKarel Gardas2015-12-231-1/+2
| | | | | | | | | | | | | Summary: This patch adds _DYNAMIC symbol to the list of OpenBSD symbols. The patch fixes unknown _DYNAMIC symbol runtime linker error caused by recent update of unix library. Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1689
* Update filepath submodule to latest snapshotHerbert Valerio Riedel2015-12-221-0/+0
|
* Implement -hide-all-plugin-packages and -plugin-package(-id), fixing #11244Edward Z. Yang2015-12-2213-55/+233
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The basic idea is that we have a new set of "exposed modules" which are /only/ used for plugins, i.e. -fplugin Foo and --frontend Foo. You can interact with this namespace using the flags -plugin-package-id and -plugin-package. By default, this namespace contains all modules in the user namespace (as before), but you can toggle that using -hide-all-plugin-packages. There is one nasty hack: GhcMake respects -fplugin in GHC_OPTIONS to make local plugins work correctly. It also bails out of you have an import of a module which doesn't exist locally or in the package database. The upshot is that we need to be sure to check in the plugin modules too, so we don't give a spurious failure when a plugin is in the plugin namespace but not the main namespace. A better way to fix this would be to distinguish between plugin and normal dependencies in ModSummary. I cheated a little and tweaked a few existing plugins tests to exercise the new code paths. TODO: Documentation Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: bgamari, austin, simonpj, duncan Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1661 GHC Trac Issues: #11244
* Refactor package flags into several distinct types.Edward Z. Yang2015-12-222-86/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, all package flags (-package, -trust-package, -ignore-package) were bundled up into a single packageFlags field in DynFlags, under a single type. This commit separates them based on what they do. This is a nice improvement, because it means that Packages can then be refactored so that a number of functions are "tighter": - We know longer have to partition PackageFlags into the ignore flag and other flags; ignore flags are just put into their own field. - Trust flags modify the package database, but exposed flags do not (they modify the visibility map); now applyPackageFlag and applyTrustFlag have tighter signatures which reflect this. This patch was motivated by the need to have a separate visibility map for plugin packages, which will be in a companion patch. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin, bgamari, duncan Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1659
* CoercionN is not in scope in TyCoRepRichard Eisenberg2015-12-221-3/+3
|
* Tweak comments around UnivCos.Richard Eisenberg2015-12-221-16/+18
|
* APIAnnotations:AnnComma in wrong place in qcnames1Alan Zimmerman2015-12-221-1/+1
| | | | | The list is reversed when it is used, so the comma must be added to the item at the front of it, to be following it when used.
* Refactor named wildcards (again)Simon Peyton Jones2015-12-2216-470/+412
| | | | | | | | | | | | | | | | | | | | | | | | | | Michal's work on #10982, #11098, refactored the handling of named wildcards by making them more like ordinary type variables. This patch takes the same idea to its logical conclusion, resulting in a much tidier, tighter implementation. Read Note [The wildcard story for types] in HsTypes. Changes: * Named wildcards are ordinary type variables, throughout * HsType no longer has a data constructor for named wildcards (was NamedWildCard in HsWildCardInfo). Named wildcards are simply HsTyVars * Similarly named wildcards disappear from Template Haskell * I refactored RnTypes to avoid polluting LocalRdrEnv with something as narrow as named wildcards. Instead the named wildcard set is carried in RnTyKiEnv. There is a submodule update for Haddock.
* Remove another duplicate testBen Gamari2015-12-221-1/+0
|
* Localize API Annotation in LInjectivtyAnnAlan Zimmerman2015-12-221-7/+7
| | | | | | | | The injectivity_cond production in Parser.y returns the annotation for the '->' to the calling production, rather than applying it directly. Rather apply it directly, so LInjectivityAnn can be rendered as a unit from the API Annotations.
* Remove duplicate T11224 test definitionBen Gamari2015-12-221-1/+0
|
* Fix typechecking for pattern synonym signaturesSimon Peyton Jones2015-12-2223-245/+419
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various tickets have revealed bad shortcomings in the typechecking of pattern type synonyms. Discussed a lot in (the latter part of) Trac #11224. This patch fixes the most complex issues: - Both parser and renamer now treat pattern synonyms as an ordinary LHsSigType. Nothing special. Hooray. - tcPatSynSig (now in TcPatSyn) typechecks the signature, and decomposes it into its pieces. See Note [Pattern synonym signatures] - tcCheckPatSyn has had a lot of refactoring. See Note [Checking against a pattern signature] The result is a lot tidier and more comprehensible. Plus, it actually works! NB: this patch doesn't actually address the precise target of #11224, namely "inlining pattern synonym does not preserve semantics". That's an unrelated bug, with a separate patch. ToDo: better documentation in the user manual Test Plan: Validate Reviewers: austin, hvr, goldfire Subscribers: goldfire, mpickering, thomie, simonpj Differential Revision: https://phabricator.haskell.org/D1685 GHC Trac Issues: #11224
* Fix grouping for pattern synonymsSimon Peyton Jones2015-12-221-32/+54
| | | | | | | | | | | | | | | | | | | When grouping pattern synonyms in the desugarer, to find when a single match will work for the whole group, we use `Match.sameGroup`. But this function was declaring two pattern-synonym matches equal to often. Result: Lint errors and broken semantics. The fix is easy. See Note [Pattern synonym groups]. Re-do typechecking for pattern synonym signatures Test Plan: Validate Reviewers: austin Subscribers: thomie, mpickering, simonpj Differential Revision: https://phabricator.haskell.org/D1684
* Update stm submodule to v2.4.4.1 releaseHerbert Valerio Riedel2015-12-221-0/+0
| | | | This `stm` release also addresses #10967
* Rework Template Haskell's handling of strictnessRyanGlScott2015-12-2237-224/+622
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, Template Haskell's treatment of strictness is not enough to cover all possible combinations of unpackedness and strictness. In addition, it isn't equipped to deal with new features (such as `-XStrictData`) which can change a datatype's fields' strictness during compilation. To address this, I replaced TH's `Strict` datatype with `SourceUnpackedness` and `SourceStrictness` (which give the programmer a more complete toolkit to configure a datatype field's strictness than just `IsStrict`, `IsLazy`, and `Unpack`). I also added the ability to reify a constructor fields' strictness post-compilation through the `reifyConStrictness` function. Fixes #10697. Test Plan: ./validate Reviewers: simonpj, goldfire, bgamari, austin Reviewed By: goldfire, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1603 GHC Trac Issues: #10697
* Retain AnnTilde in splitTildeAppsAlan Zimmerman2015-12-222-9/+15
| | | | | | | | splitTildeApps can introduce a new HsAppInfix for a tilde, with a fresh SrcSpan, disconnecting its existing AnnTilde API Annotation. A tilde needs AnnTilde to render properly, this patch adds a new one on the fresh SrcSpan
* Comments only, about coercion holesSimon Peyton Jones2015-12-222-106/+167
| | | | Richard, pls take a look
* Update Cabal submodule to latest snapshotHerbert Valerio Riedel2015-12-222-1/+2
| | | | | The addition of several new Semigroup instances caused a Haddock allocation increase.
* Make HsAppsType contents LocatedAlan Zimmerman2015-12-228-37/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | An HsAppInfix can carry a qconop/varop preceded by a SIMPLEQUOTE as a Located RdrName. In this case AnnSimpleQuote is attached to the Located HsAppType. | SIMPLEQUOTE qconop {% ams (sLL $1 $> $ HsAppInfix $2) [mj AnnSimpleQuote $1] } | SIMPLEQUOTE varop {% ams (sLL $1 $> $ HsAppInfix $2) [mj AnnSimpleQuote $1] } This patch changes data HsType name ... | HsAppsTy [HsAppType name] to data HsType name ... | HsAppsTy [LHsAppType name] so that the annotation is not discarded when it reaches the ParsedSource
* Fix GHCi segfault in Windows 32bitTamar Christina2015-12-221-6/+2
| | | | | | | | | | | | | | | | | | Summary: Add missing calling convention to function pointer, incorrect `cdecl` calling convention which should be `stdcall` on x86 was causing the stack to be corrupted. When it tried to return from the function the return pointer would be invalid. Test Plan: ./validate Reviewers: austin, erikd, bgamari, thomie Reviewed By: bgamari, thomie Differential Revision: https://phabricator.haskell.org/D1683 GHC Trac Issues: #11234
* Update hoopl submodule to final 3.10.2.1 releaseHerbert Valerio Riedel2015-12-211-0/+0
| | | | | | This is the designated release to go with GHC 8.0.1 /cc @mlite
* users_guide: Synchronize relnotes with base changelogBen Gamari2015-12-211-5/+34
|
* base: Add sections to changelogBen Gamari2015-12-211-65/+70
|
* testsuite/ClassOperator: Mark as compile_fail instead of should_failBen Gamari2015-12-212-1/+53
|
* Added missing instances for Identity and Const (#11210)Shane O'Brien2015-12-213-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | The following instances are added instance Bounded a => Bounded (Const a b) instance Enum a => Enum (Const a b) instance Ix a => Ix (Const a b) instance Storable a => Storable (Const a b) instance Bounded a => Bounded (Identity a) instance Enum a => Enum (Identity a) instance Ix a => Ix (Identity a) instance Semigroup a => Semigroup (Identity a) instance Storable a => Storable (Identity a) Reviewers: ekmett, RyanGlScott, rwbarton, hvr, austin, bgamari Reviewed By: RyanGlScott, hvr Subscribers: rwbarton, RyanGlScott, thomie Differential Revision: https://phabricator.haskell.org/D1626 GHC Trac Issues: #11210
* Fix #11256 by not immediately erroring if we can't find a module.Edward Z. Yang2015-12-214-12/+10
| | | | | | | | | | | | Test Plan: validate Reviewers: austin, bgamari, thomie Reviewed By: bgamari, thomie Differential Revision: https://phabricator.haskell.org/D1669 GHC Trac Issues: #11256
* Rename GHCi's UI modules into GHCi.UI(.*)Herbert Valerio Riedel2015-12-216-18/+17
| | | | | | | | | | | | Further work refactoring and enhancing GHCi will make it desirable to split up GHCi's code-base into multiple modules with specific functions, and rather than have several top-level 'Ghci*' modules, it's nicer to have a common namespace. This commit is provides the basis for that. Note that the remaining GHCi.* namespace belongs to the new `ghci` package. Differential Revision: https://phabricator.haskell.org/D1593
* Add proper GADTs support to Template HaskellJan Stolarek2015-12-2149-472/+831
| | | | | | | | | | | | | | | | Until now GADTs were supported in Template Haskell by encoding them using normal data types. This patch adds proper support for representing GADTs in TH. Test Plan: T10828 Reviewers: goldfire, austin, bgamari Subscribers: thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1465 GHC Trac Issues: #10828
* testsuite: Add testcase for #8316Ben Gamari2015-12-213-0/+10
| | | | | | | | | | | | | | | | | This is still broken but really out to be fixed. At least know we'll know if someone fixes it inadvertently. Test Plan: validate Reviewers: austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1682 GHC Trac Issues: #8316
* testsuite/ClassOperator: This actually should_failBen Gamari2015-12-213-3/+1
| | | | See #11264 for details.
* TcTyClsDecls: Remove invalid comments about list monadsÖmer Sinan Ağacan2015-12-211-7/+4
|
* Maintain cost-centre stacks in the interpreterSimon Marlow2015-12-2192-610/+829
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Breakpoints become SCCs, so we have detailed call-stack info for interpreted code. Currently this only works when GHC is compiled with -prof, but D1562 (Remote GHCi) removes this constraint so that in the future call stacks will be available without building your own GHCi. How can you get a stack trace? * programmatically: GHC.Stack.currentCallStack * I've added an experimental :where command that shows the stack when stopped at a breakpoint * `error` attaches a call stack automatically, although since calls to `error` are often lifted out to the top level, this is less useful than it might be (ImplicitParams still works though). * Later we might attach call stacks to all exceptions Other related changes in this diff: * I reduced the number of places that get ticks attached for breakpoints. In particular there was a breakpoint around the whole declaration, which was often redundant because it bound no variables. This reduces clutter in the stack traces and speeds up compilation. * I tidied up some RealSrcSpan stuff in InteractiveUI, and made a few other small cleanups Test Plan: validate Reviewers: ezyang, bgamari, austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1595 GHC Trac Issues: #11047
* Encode strictness in GHC generics metadataRyanGlScott2015-12-2113-172/+620
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This augments `MetaSel` with a `Bang` field, which gives generic programmers access to the following information about each field selector: * `SourceUnpackedness`: whether a field was marked `{-# NOUNPACK #-}`, `{-# UNPACK #-}`, or not * `SourceStrictness`: whether a field was given a strictness (`!`) or laziness (`~`) annotation * `DecidedStrictness`: what strictness GHC infers for a field during compilation, which may be influenced by optimization levels, `-XStrictData`, `-funbox-strict-fields`, etc. Unlike in Phab:D1603, generics does not grant a programmer the ability to "splice" in metadata, so there is no issue including `DecidedStrictness` with `Bang` (whereas in Template Haskell, it had to be split off). One consequence of this is that `MetaNoSel` had to be removed, since it became redundant. The `NoSelector` empty data type was also removed for similar reasons. Fixes #10716. Test Plan: ./validate Reviewers: dreixel, goldfire, kosmikus, austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1646 GHC Trac Issues: #10716
* Fix-up GHC 7.12 artifactsHerbert Valerio Riedel2015-12-212-1/+1
| | | | | The haddock submodule also still assumed that GHC 7.12 would be the next major release (rather than GHC 8.0)
* Fix AnnDotDot in module exportAlan Zimmerman2015-12-211-1/+1
| | | | | | | | The annotation for the ".." in module GADTRecords2 (H1(..)) where was in the wrong place
* Minor clean-up to ghc-bin.cabal.inHerbert Valerio Riedel2015-12-211-7/+9
| | | | This has been factored out of D1673