ghc.git
3 years agoTestsuite: failing profiling tests (#10037)
Thomas Miedema [Mon, 22 Feb 2016 16:57:43 +0000 (17:57 +0100)] 
Testsuite: failing profiling tests (#10037)

These tests fail not only for WAY=prof, but also for WAY=profllvm.

3 years agoFilter out -prof callstacks from test output (#11521)
Thomas Miedema [Mon, 22 Feb 2016 16:44:17 +0000 (17:44 +0100)] 
Filter out -prof callstacks from test output (#11521)

3 years agoTestsuite: cleanup profiling/should_run/all.T (#11521)
Thomas Miedema [Sun, 21 Feb 2016 12:40:56 +0000 (13:40 +0100)] 
Testsuite: cleanup profiling/should_run/all.T (#11521)

Refactoring only. I compared before and after with 'make slow', and it
still runs each test with the same 'ways' as before.

3 years agoTestsuite: delete Windows line endings [skip ci] (#11631)
Thomas Miedema [Mon, 22 Feb 2016 20:32:51 +0000 (21:32 +0100)] 
Testsuite: delete Windows line endings [skip ci] (#11631)

3 years agoTestsuite: delete Windows line endings [skip ci] (#11631)
Thomas Miedema [Mon, 22 Feb 2016 20:32:51 +0000 (21:32 +0100)] 
Testsuite: delete Windows line endings [skip ci] (#11631)

3 years agoTestsuite: accept output without Windows line endings (#11631)
Thomas Miedema [Tue, 23 Feb 2016 01:25:17 +0000 (02:25 +0100)] 
Testsuite: accept output without Windows line endings (#11631)

3 years agoTestsuite: accept output without Windows line endings (#11631)
Thomas Miedema [Tue, 23 Feb 2016 01:57:53 +0000 (02:57 +0100)] 
Testsuite: accept output without Windows line endings (#11631)

3 years agoTestsuite: delete Windows line endings [skip ci] (#11631)
Thomas Miedema [Mon, 22 Feb 2016 20:32:51 +0000 (21:32 +0100)] 
Testsuite: delete Windows line endings [skip ci] (#11631)

3 years agoTestsuite: delete Windows line endings [skip ci] (#11631)
Thomas Miedema [Mon, 22 Feb 2016 20:32:51 +0000 (21:32 +0100)] 
Testsuite: delete Windows line endings [skip ci] (#11631)

3 years agoTestsuite: delete Windows line endings [skip ci] (#11631)
Thomas Miedema [Mon, 22 Feb 2016 20:32:51 +0000 (21:32 +0100)] 
Testsuite: delete Windows line endings [skip ci] (#11631)

3 years agoTestsuite: delete Windows line endings [skip ci] (#11631)
Thomas Miedema [Mon, 22 Feb 2016 20:31:35 +0000 (21:31 +0100)] 
Testsuite: delete Windows line endings [skip ci] (#11631)

3 years agoTestsuite: delete Windows line endings [skip ci] (#11631)
Thomas Miedema [Mon, 22 Feb 2016 20:31:24 +0000 (21:31 +0100)] 
Testsuite: delete Windows line endings [skip ci] (#11631)

3 years agoAdd missing files
Simon Marlow [Tue, 23 Feb 2016 09:05:37 +0000 (09:05 +0000)] 
Add missing files

3 years agoDocs: -keep-llvm-file(s)/-ddump-llvm imply -fllvm
Thomas Miedema [Mon, 22 Feb 2016 13:31:40 +0000 (14:31 +0100)] 
Docs: -keep-llvm-file(s)/-ddump-llvm imply -fllvm

This fixes #9917.

3 years agoFix GHC.Stats documentation markup (#11619)
Thomas Miedema [Sun, 21 Feb 2016 17:31:00 +0000 (18:31 +0100)] 
Fix GHC.Stats documentation markup (#11619)

3 years agoBuild system: fix sed expression (#11537)
Thomas Miedema [Sun, 21 Feb 2016 11:23:25 +0000 (12:23 +0100)] 
Build system: fix sed expression (#11537)

This allows building ghc in '/ghc'.

3 years agoTestsuite: pass '-s --no-print-directory' to MAKE
Thomas Miedema [Sun, 21 Feb 2016 00:50:22 +0000 (01:50 +0100)] 
Testsuite: pass '-s --no-print-directory' to MAKE

This seems necessary after 9634e24 (#11569).

3 years agoAdd test for #6132: hash bang + CPP
Thomas Miedema [Sat, 20 Feb 2016 22:07:50 +0000 (23:07 +0100)] 
Add test for #6132: hash bang + CPP

3 years agounexport MAKEFLAGS when running tests (#11569)
Thomas Miedema [Sat, 20 Feb 2016 20:09:12 +0000 (21:09 +0100)] 
unexport MAKEFLAGS when running tests (#11569)

3 years agoAdd test (only) to assure that #11535 is fixed
Takayuki Muranushi [Sat, 20 Feb 2016 12:28:32 +0000 (13:28 +0100)] 
Add test (only) to assure that #11535 is fixed

Ticket #11535 dealt with derived Read instances of infix Unicode
value constructors. GHC 7.10.3 used to derive (Read/Show)
instances so that `read . show` for values of such types had no
parse.

The issue has been fixed by other compiler update. This patch
adds only tests, so that derived instance of Read/Show for infix
Unicode value constructors has correct parse, satisfying Haskell
2010 Specification.

Resolves: #11535

Test Plan: `make test TEST=T11535`

Reviewers: austin, rwbarton, thomie, bgamari

Reviewed By: rwbarton, thomie, bgamari

Subscribers: rwbarton, thomie

Projects: #ghc

Differential Revision: https://phabricator.haskell.org/D1884

GHC Trac Issues: #11535

3 years agoUse a better test for profiling
Simon Marlow [Sat, 20 Feb 2016 08:25:50 +0000 (08:25 +0000)] 
Use a better test for profiling

The previous test failed for me because I had

    GhcRTSWays += thr_debug_p

in my validate.mk, which doesn't enable profiling by itself.

3 years agoFix a double-free bug in -fexternal-interpreter
Simon Marlow [Sat, 20 Feb 2016 07:39:34 +0000 (07:39 +0000)] 
Fix a double-free bug in -fexternal-interpreter

Originally I planned to make this reference manually managed, but it
looks like at some point I gave it a finalizer on the GHC side, but
forgot to remove the manual free here.  The result is that ghc-iserv
could crash in getStablePtr sometimes when using TH.

3 years agoFix a bug in ApplicativeDo (#11612)
Simon Marlow [Sat, 20 Feb 2016 07:23:37 +0000 (07:23 +0000)] 
Fix a bug in ApplicativeDo (#11612)

In some cases ApplicativeDo would miss some opportunities, due to a
wrong calculation of free variables in RnExpr.segments.

3 years agoRefactoring only: use ExprLStmt
Simon Marlow [Sat, 20 Feb 2016 06:59:10 +0000 (06:59 +0000)] 
Refactoring only: use ExprLStmt

3 years agoDocs: no space in `-i⟨dir1⟩:⟨dir2⟩` [skip ci]
Thomas Miedema [Fri, 19 Feb 2016 17:58:03 +0000 (18:58 +0100)] 
Docs: no space in `-i⟨dir1⟩:⟨dir2⟩` [skip ci]

3 years agoPass -haddock to tests in should_compile_*flag*_nohaddock
Thomas Miedema [Fri, 19 Feb 2016 16:37:29 +0000 (17:37 +0100)] 
Pass -haddock to tests in should_compile_*flag*_nohaddock

should_compile_flag_nohaddock and should_compile_noflag_nohaddock
contain the exact same tests. By passing `-haddock` to the tests in
should_compile_**flag**_nohaddock, at least they're now testing
different things.

Add documentation.

3 years agoModifier letter in middle of identifier is ok
Thomas Miedema [Fri, 19 Feb 2016 14:25:40 +0000 (15:25 +0100)] 
Modifier letter in middle of identifier is ok

Refactoring only. Cleanup some loose ends from #10196.

Initially the idea was to only allow modifier letters at the end of
identifiers. Since we later decided to allow modifier letters also in
the middle of identifiers (because not doing so would not fix the
regression completely), the names `suffix` and `okIdSuffixChar` don't
seem appropriate anymore.

Remove TODO. Move test from should_fail to should_compile.

3 years agoDelete support for deprecated "-- # ..."-style haddock options
Thomas Miedema [Fri, 19 Feb 2016 09:27:02 +0000 (10:27 +0100)] 
Delete support for deprecated "-- # ..."-style haddock options

A long time ago, you could use `"-- # <haddock options>"` to mean that
`<haddock options.` should be passed to `haddock`. Since 2007
(03d8585e0940e28e024548654fe3505685aca94f), using `OPTIONS_HADDOCK` is
the preferred way to do this.

Why is ok to remove support for "-- # .."?

* It is not mentioned in the Haddock user's guide, nor are there any
  tests that use it.

* Ever since 2011 (b3e30449aa6d6eaa978eb3c7447ca85985d9d251), it doesn't
  actually work anymore. The function `getOptionsFromFile` uses
  `gopt_unset dflags Opt_Haddock` for other reasons, so even when
  running ghc with `--haddock`, the following rule always fires when the
  lexer sees "-- # ..", and it gets treated as a normal comment:

```
    -- Next, match Haddock comments if no -haddock flag
    "-- " [$docsym \#] .* / { ifExtension (not . haddockEnabled) } { lineCommentToken }
```

Reviewed by: bgamari

Differential Revision: https://phabricator.haskell.org/D1932

3 years agoA few more typos in non-code
Gabor Greif [Fri, 19 Feb 2016 11:57:03 +0000 (12:57 +0100)] 
A few more typos in non-code

3 years agoBump haddock submodule
Ben Gamari [Thu, 18 Feb 2016 22:16:19 +0000 (23:16 +0100)] 
Bump haddock submodule

3 years agoUnwire Typeable representation types
Ben Gamari [Thu, 18 Feb 2016 21:05:02 +0000 (22:05 +0100)] 
Unwire Typeable representation types

In order to make this work I needed to shuffle around typechecking a bit
such that `TyCon` and friends are available during compilation of
GHC.Types.  I also did a bit of refactoring of `TcTypeable`.

Test Plan: Validate

Reviewers: simonpj, austin

Subscribers: simonpj, thomie

Differential Revision: https://phabricator.haskell.org/D1906

GHC Trac Issues: #11120

3 years agoTake type-function arity into account
Simon Peyton Jones [Thu, 18 Feb 2016 12:52:18 +0000 (12:52 +0000)] 
Take type-function arity into account

...when computing the size of a call on the RHS of a type
instance declaration.

This came up in Trac #11581.  The change is in
   TcType.tcTyFamInsts
which now trims the type arguments in a call.  See the
comments with that function definition.

3 years agoImprove piResultTys and friends
Simon Peyton Jones [Thu, 18 Feb 2016 11:34:12 +0000 (11:34 +0000)] 
Improve piResultTys and friends

Several things here:

* Re-implement piResultTys so that its substitution has
  the correct in-scope set

  That means paying close attention to performance, since as we
  discovered in Trac #11371, it's a heavily used function and
  is often used on ordinary function types, with no foralls to
  worry about substituting.

* Kill off applyTys, which was just the same as piResultTys.

* Re-engineer MkCore.mkCoreApps so that it calls piResultTys,
  rather than repeatedly calling piResultTy.

3 years ago(Another) minor refactoring of substitutions
Simon Peyton Jones [Thu, 18 Feb 2016 11:25:38 +0000 (11:25 +0000)] 
(Another) minor refactoring of substitutions

No change in functionality here, but greater clarity:

* In FamInstEnv.FlattenEnv, kill off the fi_in_scope field
  We are already maintaining an in-scope set in the fe_subst field,
  so it's silly do to it twice.

  (This isn't strictly connected to the rest of this patch, but
  the nomenclature changes below affect the same code, so I put
  them together.)

* TyCoRep.extendTCVSubst used to take a TyVar or a CoVar and work
  out what to do, but in fact we almost always know which of the
  two we are doing.  So:
    - define extendTvSubst, extendCvSubst
    - and use them

* Similar renamings in TyCoRep:
   - extendTCvSubstList        -->   extendTvSubstList
   - extendTCvSubstBinder      -->   extendTvSubstBinder
   - extendTCvSubstAndInScope  --> extendTvSubstAndInScope

* Add Type.extendTvSubstWithClone, extendCvSubstWithClone

* Similar nomenclature changes in Subst, SimplEnv, Specialise

* Kill off TyCoRep.substTelescope (never used)

3 years agoFix desugaring of bang-pattern let-bindings
Simon Peyton Jones [Thu, 18 Feb 2016 11:05:45 +0000 (11:05 +0000)] 
Fix desugaring of bang-pattern let-bindings

When implementing Strict Haskell, the patch 46a03fbe didn't faithfully
implement the semantics given in the manual. In particular there was
an ad-hoc case in mkSelectorBinds for "strict and no binders" that
didn't work.

This patch fixes it, curing Trac #11572.

Howver it forced me to think about banged let-bindings, and I rather
think we do not have quite the right semantics yet, so I've opened
Trac #11601.

3 years agoFix thinko that crept into D1908
Ben Gamari [Wed, 17 Feb 2016 20:18:00 +0000 (21:18 +0100)] 
Fix thinko that crept into D1908

RyanGlScott updated the Diff only after I had merged it.

3 years agoComments only (#11513)
Richard Eisenberg [Wed, 17 Feb 2016 21:22:22 +0000 (16:22 -0500)] 
Comments only (#11513)

3 years agousers-guide: Fix typos
Mark Christiaens [Wed, 17 Feb 2016 13:04:42 +0000 (14:04 +0100)] 
users-guide: Fix typos

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1927

GHC Trac Issues: #11590

3 years agoRemove superfluous code when deriving Foldable/Traversable
RyanGlScott [Wed, 17 Feb 2016 11:06:17 +0000 (12:06 +0100)] 
Remove superfluous code when deriving Foldable/Traversable

Currently, `-XDeriveFoldable` and `-XDeriveTraversable` generate
unnecessary `mempty` and `pure` expressions when it traverses of an
argument of a constructor whose type does not mention the last type
parameter. Not only is this inefficient, but it prevents `Traversable`
from being derivable for datatypes with unlifted arguments (see
Trac #11174).

The solution to this problem is to adopt a slight change to the
algorithms for `-XDeriveFoldable` and `-XDeriveTraversable`, which is
described in [this wiki
page](https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/DeriveFu
nctor#Proposal:alternativestrategyforderivingFoldableandTraversable).
The wiki page also describes why we don't apply the same changes to the
algorithm for `-XDeriveFunctor`.

This is techincally a breaking change for users of `-XDeriveFoldable`
and `-XDeriveTraversable`, since if someone was using a law-breaking
`Monoid` instance with a derived `Foldable` instance (i.e., one where `x
<> mempty` does not equal `x`) or a law-breaking `Applicative` instance
with a derived `Traversable` instance, then the new generated code could
result in different behavior. I suspect the number of scenarios like
this is very small, and the onus really should be on those users to fix
up their `Monoid`/`Applicative` instances.

Fixes #11174.

Test Plan: ./validate

Reviewers: hvr, simonpj, austin, bgamari

Reviewed By: simonpj, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1908

GHC Trac Issues: #11174

3 years agoDerive Eq and Ord instance for SrcLoc and RealSrcLoc
Gabriel Gonzalez [Wed, 17 Feb 2016 09:59:09 +0000 (10:59 +0100)] 
Derive Eq and Ord instance for SrcLoc and RealSrcLoc

The Eq and Ord instance were previously hand-written and this change
updates them to be automatically derived by the compiler.  The derived
behavior should be equivalent to the original.

Reviewers: hvr, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1913

3 years agoFix #11313.
Richard Eisenberg [Wed, 10 Feb 2016 14:38:09 +0000 (09:38 -0500)] 
Fix #11313.

Previously, we looked through synonyms when counting arguments,
but that's a bit silly.

3 years agoFix #11246.
Richard Eisenberg [Wed, 10 Feb 2016 14:09:26 +0000 (09:09 -0500)] 
Fix #11246.

We have to instantiate any invisible arguments to type families
right away. This is now done in tcTyCon in TcHsType.

testcase: typecheck/should_compile/T11246

3 years agoFix #11241.
Richard Eisenberg [Wed, 10 Feb 2016 13:35:22 +0000 (08:35 -0500)] 
Fix #11241.

When renaming a type, now looks for wildcards in bound variables'
kinds.

testcase: dependent/should_compile/T11241

3 years agoUse CoercionN and friends in TyCoRep
Richard Eisenberg [Wed, 10 Feb 2016 13:03:56 +0000 (08:03 -0500)] 
Use CoercionN and friends in TyCoRep

3 years agoRemove extraneous fundeps on (~)
Richard Eisenberg [Thu, 4 Feb 2016 23:31:25 +0000 (18:31 -0500)] 
Remove extraneous fundeps on (~)

3 years agoAdd missing kind cast to pure unifier.
Richard Eisenberg [Sat, 30 Jan 2016 21:49:22 +0000 (16:49 -0500)] 
Add missing kind cast to pure unifier.

3 years agoExistentials should be specified.
Richard Eisenberg [Fri, 29 Jan 2016 18:09:42 +0000 (13:09 -0500)] 
Existentials should be specified.

This addresses point (2) from #11513.

3 years agoMake exactTyCoVarsOfTypes closed over kinds.
Richard Eisenberg [Thu, 28 Jan 2016 22:39:03 +0000 (17:39 -0500)] 
Make exactTyCoVarsOfTypes closed over kinds.

3 years agoSmall refactor and comments
Simon Peyton Jones [Wed, 17 Feb 2016 14:37:42 +0000 (14:37 +0000)] 
Small refactor and comments

Related to the fix to Trac #9611

3 years agoSimplify the defn of coreViewOneStarKind
Simon Peyton Jones [Wed, 17 Feb 2016 14:36:49 +0000 (14:36 +0000)] 
Simplify the defn of coreViewOneStarKind

I discussed it with Richard, but this version is much
simmpler and more efficient.

3 years agoComments only
Simon Peyton Jones [Wed, 17 Feb 2016 09:20:41 +0000 (09:20 +0000)] 
Comments only

3 years agoTestsuite: delete compiler_lt/le/gt/ge setup functions
Thomas Miedema [Tue, 16 Feb 2016 13:17:35 +0000 (14:17 +0100)] 
Testsuite: delete compiler_lt/le/gt/ge setup functions

Since we're not consisently keeping track of which tests should pass
with which compiler versions, there is no point in keeping these
functions.

Update submodules containers, hpc and stm.

3 years agoDynFlags: Don't panic on incompatible Safe Haskell flags
Ben Gamari [Tue, 16 Feb 2016 21:45:57 +0000 (22:45 +0100)] 
DynFlags: Don't panic on incompatible Safe Haskell flags

We just return an arbitrary value since we are destined to fail due to
the error anyways.

Fixes #11580.

Test Plan: Needs to be tested

Reviewers: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1925

GHC Trac Issues: #11580

3 years agoRemove documentation for -Wlazy-unlifted-bindings
Ben Gamari [Tue, 16 Feb 2016 21:45:33 +0000 (22:45 +0100)] 
Remove documentation for -Wlazy-unlifted-bindings

This flag was supposed to be removed in 7.10. This finally resolves
Trac #8022.

Test Plan: Read it

Reviewers: austin

Reviewed By: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1922

GHC Trac Issues: #8022

3 years agoSuggest candidate instances in error message
Yuras Shumovich [Tue, 16 Feb 2016 21:45:13 +0000 (22:45 +0100)] 
Suggest candidate instances in error message

See Trac #9611. In "No instance..." error message we suggest instances
for other types with the same occ name. It is usefull e.g. when we have
two different versions of the same package installed.

Test Plan: typecheck/should_fail/tcfail224

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1919

GHC Trac Issues: #9611

3 years agoFix typos
Rik Steenkamp [Tue, 16 Feb 2016 21:44:42 +0000 (22:44 +0100)] 
Fix typos

Reviewers: bgamari, austin

Reviewed By: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1915

3 years agoPowerPC: Improve float register assignment.
Peter Trommler [Tue, 16 Feb 2016 21:44:25 +0000 (22:44 +0100)] 
PowerPC: Improve float register assignment.

On Linux assign F5 and F6 and D3 through D6 to caller-saved registers.

Fixes #11273

Test Plan: validate on powerpc (I validated on powerpc64)

Reviewers: bgamari, erikd, austin

Reviewed By: erikd, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1914

GHC Trac Issues: #11273

3 years agoFix two wrong uses of "data constructor" in error msgs
Rik Steenkamp [Tue, 16 Feb 2016 21:42:08 +0000 (22:42 +0100)] 
Fix two wrong uses of "data constructor" in error msgs

Replace `NoDataKinds :: PromotionErr` by `NoDataKindsTC` and
`NoDataKindsDC` (just like there is `NoTypeInTypeTC` and
`NoTypeInTypeDC`). This allows for a correct error message when a kind
signature contains a type constructor and `-XDataKinds` is not
specified.

Apply a small fix to `TcError.hs` where instead of "data constructor" we
should say "pattern synonym".

Reviewers: austin, goldfire, bgamari

Reviewed By: bgamari

Subscribers: goldfire, thomie

Differential Revision: https://phabricator.haskell.org/D1909

3 years agoImproved error message about exported type operators.
Ulya Trofimovich [Tue, 16 Feb 2016 21:41:50 +0000 (22:41 +0100)] 
Improved error message about exported type operators.

There is ambiguty between (1) type constructors and (2) data
constructors in export lists, e.g. '%%' can stand for both of them. This
ambiguity is resolved in favor of (2).

If the exported data constructor is not in scope, but type constructor
with the same name is in scope, GHC should suggest adding 'type' keyword
to resolve ambiguity in favor of (1) and enabling 'TypeOperators'
extension.

The patch only extends the error message.

See Trac #11432.

Test Plan: `make test`

Reviewers: simonpj, bgamari, austin

Reviewed By: simonpj

Subscribers: mpickering, thomie, goldfire, kosmikus

Differential Revision: https://phabricator.haskell.org/D1902

GHC Trac Issues: #11432

3 years agoMake bootstrapping more robust
Herbert Valerio Riedel [Tue, 16 Feb 2016 21:41:29 +0000 (22:41 +0100)] 
Make bootstrapping more robust

Starting with GHC 8.0 we rely on GHC's native cabal macro generation.

As a side-effect, this limits the packages in scope when compiling
`ghc-cabal` for all bootstrapping GHCs.

Reviewers: ezyang, austin, thomie, bgamari

Reviewed By: thomie, bgamari

Differential Revision: https://phabricator.haskell.org/D1897

GHC Trac Issues: #11413

3 years agoBump haddock submodule
Ben Gamari [Fri, 12 Feb 2016 09:04:48 +0000 (10:04 +0100)] 
Bump haddock submodule

3 years agoTestsuite: delete only_compiler_types, assume ghc
Thomas Miedema [Mon, 15 Feb 2016 22:31:58 +0000 (23:31 +0100)] 
Testsuite: delete only_compiler_types, assume ghc

Update submodules stm, hpc and unix.

Differential Revision: https://phabricator.haskell.org/D1921

3 years agoAdd missing newlines at end of file [skip ci]
Thomas Miedema [Mon, 15 Feb 2016 22:20:56 +0000 (23:20 +0100)] 
Add missing newlines at end of file [skip ci]

3 years agoRename missing-pat-syn-sigs to missing-pat-syn-signatures
Matthew Pickering [Mon, 15 Feb 2016 23:33:04 +0000 (23:33 +0000)] 
Rename missing-pat-syn-sigs to missing-pat-syn-signatures

3 years agoMake T11361 actually run with reversed uniques
Bartosz Nitka [Mon, 15 Feb 2016 17:36:17 +0000 (09:36 -0800)] 
Make T11361 actually run with reversed uniques

`-dunique-increment` doesn't work inside the file.

Test Plan: I've discovered it doesn't work in D1917.

Reviewers: simonpj, bgamari, austin

Subscribers: thomie, simonmar

Differential Revision: https://phabricator.haskell.org/D1918

GHC Trac Issues: #11361

3 years agoAdd a testcase for #11362
Bartosz Nitka [Mon, 15 Feb 2016 17:16:43 +0000 (09:16 -0800)] 
Add a testcase for #11362

This reproduces the issue that I encountered in #11362.

Test Plan: this testcase

Reviewers: simonpj, bgamari, austin

Reviewed By: simonpj

Subscribers: thomie, simonmar

Differential Revision: https://phabricator.haskell.org/D1917

GHC Trac Issues: #11362

3 years agoA tiny, outright bug in tcDataFamInstDecl
Simon Peyton Jones [Mon, 15 Feb 2016 15:51:50 +0000 (15:51 +0000)] 
A tiny, outright bug in tcDataFamInstDecl

This bug was revealed by Trac #11362.  It turns out that in my patch
for Trac #11148 (namely 1160dc5), I failed to turn one occurrence of
tvs' into full_tvs.  Sigh.  This is tricky stuff and it cost me
several hours to page it back in and figure out what was happening.

The result was a CoAxiom whose lhs had rhs had different kinds.  Eeek!

Anyway it's fixed.

I also added an ASSERT, in FamInst.newFamInst, that trips on such
bogus CoAxioms.

3 years agoComments and white space
Simon Peyton Jones [Mon, 15 Feb 2016 15:50:24 +0000 (15:50 +0000)] 
Comments and white space

3 years agoTiny refactor; use guards instead of 'if'
Simon Peyton Jones [Mon, 15 Feb 2016 15:49:41 +0000 (15:49 +0000)] 
Tiny refactor; use guards instead of 'if'

3 years agoDocument -dynamic-too (#11488)
Simon Marlow [Mon, 15 Feb 2016 11:47:12 +0000 (11:47 +0000)] 
Document -dynamic-too (#11488)

3 years agoComments only
Simon Peyton Jones [Mon, 15 Feb 2016 08:46:36 +0000 (08:46 +0000)] 
Comments only

3 years agoImprove error message suppression
Simon Peyton Jones [Mon, 15 Feb 2016 08:39:23 +0000 (08:39 +0000)] 
Improve error message suppression

TcErrors has a system for suppressing some type errors if a more
serious one occurs.  But there was a crucial missing case, which
sometimes resulted in a cascade of irrelevant errors overwhelming
the actual cause. This was Trac #11541.

The fix is simple.  Worth merging to 8.0

3 years agoUpdate directory submodule to v1.2.5.1 release
Herbert Valerio Riedel [Sun, 14 Feb 2016 22:53:37 +0000 (23:53 +0100)] 
Update directory submodule to v1.2.5.1 release

3 years agorenamer discards name location for HsRecField
Alan Zimmerman [Sun, 14 Feb 2016 19:43:55 +0000 (21:43 +0200)] 
renamer discards name location for HsRecField

When renaming a HsVar it can be converted to a HsRecField. In the
process the location of the enclosed name is converted to a noLoc

Closes #11576

3 years agotestsuite: tweak error messages for new Show instance
Sergei Trofimovich [Fri, 12 Feb 2016 17:43:18 +0000 (17:43 +0000)] 
testsuite: tweak error messages for new Show instance

be3d7f661968a7b8c6751c0be3bf23e703b32c3e added Show
instance for Callstack.

That made a couple of error messages to drift as:

             instance Show Ordering -- Defined in ‘GHC.Show’
             instance Show Integer -- Defined in ‘GHC.Show’
             ...plus 23 others
    -        ...plus 20 instances involving out-of-scope types
    +        ...plus 21 instances involving out-of-scope types

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
3 years agoUser manual improvments
Simon Peyton Jones [Fri, 12 Feb 2016 14:38:22 +0000 (14:38 +0000)] 
User manual improvments

- Document that you can use 'forall' in instance decls

- Change the sections a bit, so that big sections (like
  lexically scoped type variables, pattern synonyms,
  implicit parameters) become more visible

3 years agoMinor refactoring to tauifyMultipleMatches
Simon Peyton Jones [Fri, 12 Feb 2016 13:44:44 +0000 (13:44 +0000)] 
Minor refactoring to tauifyMultipleMatches

No change in behaviour

3 years agoImprove pretty-printing of HsWrappers
Simon Peyton Jones [Fri, 12 Feb 2016 13:42:55 +0000 (13:42 +0000)] 
Improve pretty-printing of HsWrappers

Reduces un-neede parens.

Also -fprint-typechecker-elaboration now makes type applications
and casts in expressions also appear.  (Previously those were
confusingly controlled by -fprint-explicit-coercions.)

3 years agoBeef up tc124
Simon Peyton Jones [Fri, 12 Feb 2016 13:41:39 +0000 (13:41 +0000)] 
Beef up tc124

Makes it a slightly more stringent test of record pattern bindings

3 years agoSimplify AbsBinds wrapping
Simon Peyton Jones [Fri, 12 Feb 2016 13:36:17 +0000 (13:36 +0000)] 
Simplify AbsBinds wrapping

In poking Trac #11414 I found myself sinking into the abe_inst_wrap
swamp.  What is this strange thing?  (It turned out that #11414 was
breaking because of it.)

Thrillingly, I found a way to sweep it away again, putting the deep
instantation into tcMonoBinds instead of mkExport; and it turned out
that the fun_co_fn field of FunBind was already there ready to receive
exactly this wrapper. Hooray.  Result

* Death to abe_inst_wrap
* Death to mbi_orig
* Death to the plumbing in tcPolyInfer that did the
  deep instantiation

I did find that I had to re-engineer the treatment of instance type
signatures (again), but the result looks more modular and robust to
me.

And #11414 is fixed.

3 years agoRevert "Build the substitution correctly in piResultTy"
Bartosz Nitka [Fri, 12 Feb 2016 14:38:29 +0000 (06:38 -0800)] 
Revert "Build the substitution correctly in piResultTy"

This reverts commit dbf72dbc6e49b3db7f2337a7a41e95c1d0169163.
This commit introduced performance regressions:
https://ghc.haskell.org/trac/ghc/ticket/11371#comment:27,
I will push it again after I fix it.

Test Plan: revert

Reviewers: simonpj, bgamari, simonmar, austin, goldfire, thomie

Differential Revision: https://phabricator.haskell.org/D1907

3 years agoAdd IsList instance for CallStack, restore Show instance for CallStack
RyanGlScott [Fri, 12 Feb 2016 14:24:38 +0000 (09:24 -0500)] 
Add IsList instance for CallStack, restore Show instance for CallStack

Summary:
Ties up loose ends from D1894.

GHC 7.10.2 and 7.10.3 featured a `Show` instance for `CallStack`, but since it
was derived, it broke encapsulation. This adds a `Show` instance which displays
the `CallStack` as if it were a `[(String, SrcLoc)]`.

To ensure that the output of `Show` is technically a valid Haskell term, we
also add a corresponding `IsList CallStack` instance.

Reviewers: gridaphobe, austin, hvr, bgamari

Reviewed By: gridaphobe, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1903

3 years agoRevert "sizeExpr: fix a bug in the size calculation"
Simon Marlow [Fri, 12 Feb 2016 09:52:21 +0000 (09:52 +0000)] 
Revert "sizeExpr: fix a bug in the size calculation"

This reverts commit 51a33924fc118d9b6c1db556c75c0d010ef95e18.

3 years agoAdd test for #11319
Reid Barton [Fri, 12 Feb 2016 02:04:17 +0000 (21:04 -0500)] 
Add test for #11319

3 years agoBuild the substitution correctly in piResultTy
Bartosz Nitka [Thu, 11 Feb 2016 17:44:53 +0000 (09:44 -0800)] 
Build the substitution correctly in piResultTy

This fixes a bug where piResultTy created
substitutions that would violate both of the invariants
in Note [The substitution invariant].

Test Plan: ./validate --slow

Reviewers: goldfire, simonpj, austin, bgamari

Reviewed By: simonpj, bgamari

Subscribers: simonmar, thomie

Differential Revision: https://phabricator.haskell.org/D1855

GHC Trac Issues: #11371

3 years agoAnother batch of typo fixes in non-code
Gabor Greif [Thu, 11 Feb 2016 11:38:21 +0000 (12:38 +0100)] 
Another batch of typo fixes in non-code

3 years agocompiler: Do not suggest nor complete deprecated flags fix trac issue #11454
Nikita Kartashov [Thu, 11 Feb 2016 10:58:30 +0000 (11:58 +0100)] 
compiler: Do not suggest nor complete deprecated flags fix trac issue #11454

Previously, all flags were present in user suggest and completion. This commit
removes the deprecated ones from there. It is done by saving deprecation info
at the moment of flag definition.

Reviewers: rwbarton, austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D1883

3 years agosizeExpr: fix a bug in the size calculation
Simon Marlow [Wed, 10 Feb 2016 09:19:34 +0000 (09:19 +0000)] 
sizeExpr: fix a bug in the size calculation

There were two bugs here:

* We weren't ignoring Cast in size_up_app
* An application of a non-variable wasn't being charged correct

The result was that some things looked too cheap.  In my case I had
things like

    ((f x) `cast` ...) y

which was given size 21 instead of 30, and this had knock-on effects
elsewhere that caused some large code bloat.

Test Plan:
* nofib runs (todo)
* validate

Reviewers: simonpj, austin, bgamari, erikd

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1900

GHC Trac Issues: #11564

3 years agoIgnore untracked in nofib
Simon Marlow [Wed, 10 Feb 2016 22:23:14 +0000 (22:23 +0000)] 
Ignore untracked in nofib

3 years agoComments about ru_auto
Simon Peyton Jones [Thu, 11 Feb 2016 11:00:24 +0000 (11:00 +0000)] 
Comments about ru_auto

...following a question from Conal

3 years agoAlways do eta-reduction
Simon Peyton Jones [Thu, 11 Feb 2016 10:38:33 +0000 (10:38 +0000)] 
Always do eta-reduction

See Note [Eta-reduction in -O0] in DynFlags.

Bottom line: doing eta reduction unconditionally is benign, and
removes an ASSERT failure (Trac #11562).

3 years agoReplace mkTvSubstPrs (a `zip` b) with zipTvSubst a b
Bartosz Nitka [Wed, 10 Feb 2016 16:12:44 +0000 (08:12 -0800)] 
Replace mkTvSubstPrs (a `zip` b) with zipTvSubst a b

It's just a small cleanup. There should be no change in
behaviour.

Test Plan: ./validate --slow

Reviewers: austin, bgamari, simonpj

Reviewed By: simonpj

Subscribers: thomie, simonmar

Differential Revision: https://phabricator.haskell.org/D1901

3 years agoWrap solveEqualities in checkNoErrs
Simon Peyton Jones [Wed, 10 Feb 2016 14:32:22 +0000 (14:32 +0000)] 
Wrap solveEqualities in checkNoErrs

This simple change fixes Trac #11563, #11520, #11516, #11399.
See esp the comments in #11520.

See Note [Fail fast on kind errors] in TcSimplify

Merge to 8.0 branch

3 years agomkUserGuide: fix option wrapping in a table
Sergei Trofimovich [Wed, 10 Feb 2016 14:12:03 +0000 (14:12 +0000)] 
mkUserGuide: fix option wrapping in a table

Noticed as a sphinx warning:
    docs/users_guide/flags-warnings.gen.rst:97:
        WARNING: Inline interpreted text or phrase
        reference start-string without end-string.

Which pointed to broken table.

Before the patch table looked like:

    | :ghc-flag:`-Wno-unticked-promoted-constructors |
    | `                                              |

After the patch long link is on a single line:

    | :ghc-flag:`-Wno-unticked-promoted-constructors`    |

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
3 years agodocs: add newline after '.. ghc-flag::'
Sergei Trofimovich [Wed, 10 Feb 2016 14:10:03 +0000 (14:10 +0000)] 
docs: add newline after '.. ghc-flag::'

Noticed when looked through sphinx warnings:
    docs/users_guide/safe_haskell.rst:4:
        SEVERE: Duplicate ID: "ghc-flag-Issue"

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
3 years agoError early when you register with too old a version of Cabal.
Edward Z. Yang [Wed, 10 Feb 2016 10:09:53 +0000 (11:09 +0100)] 
Error early when you register with too old a version of Cabal.

On the GHC 8.0 RCs, multiple users reported a very strange error
whereby GHC would complain that the symbols names recorded in interface
files did not match the expected name.  The reason for this is
that they were using an old version of Cabal which chose symbol
names differently from the installed package ID ('id' field) which
the package was to be installed with; GHC 8.0 now mandates that
these coincides.

This change adds a test to ghc-pkg to make sure that 'id' and 'key'
(which is how Cabal previously reported what the symbol name
was supposed to be) match; if they don't match or key is missing,
we assume that the Cabal was too old.

Bikeshed points:

    - Should we offer more information about how to upgrade
      Cabal correctly (i.e. specify a version?)

    - Should we allow for a missing 'key'?  If we allow for
      'key' to be missing, we lose the ability to detect
      Cabal from GHC 7.8 or earlier being used.  If we
      require it to be specified, then it will not be possible
      for Cabal to deprecate the (unused) field and remove it
      without having BC for 8.0.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: austin, bgamari, hvr

Reviewed By: hvr

Subscribers: bergmark, thomie

Differential Revision: https://phabricator.haskell.org/D1892

GHC Trac Issues: #11558

3 years agoExpand users' guide TH declaration groups section (#9813)
Owen Stephens [Wed, 10 Feb 2016 09:18:41 +0000 (10:18 +0100)] 
Expand users' guide TH declaration groups section (#9813)

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1899

3 years agoadd Template Haskell regression test for #9022.
Dominik Bollmann [Wed, 10 Feb 2016 09:18:29 +0000 (10:18 +0100)] 
add Template Haskell regression test for #9022.

The bug itself has already been fixed in #10734, so this
only adds another regression test (as given in the ticket).

Test Plan: ./validate

Reviewers: goldfire, austin, thomie, bgamari

Reviewed By: bgamari

Differential Revision: https://phabricator.haskell.org/D1898

GHC Trac Issues: #9022

3 years agoDynFlags: drop tracking of '-#include' flags
Sergei Trofimovich [Sun, 3 Jan 2016 12:07:10 +0000 (12:07 +0000)] 
DynFlags: drop tracking of '-#include' flags

GHC does not use passed paramaters anywhere
for this deprecated option.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
3 years agoTcPatSyn: Fix spelling of "pattern" in error message
Ben Gamari [Tue, 9 Feb 2016 13:42:01 +0000 (14:42 +0100)] 
TcPatSyn: Fix spelling of "pattern" in error message