ghc.git
5 years agoUpdate `sync-all` and others files w.r.t. merged testsuite (re #8545)
Herbert Valerio Riedel [Sun, 12 Jan 2014 11:05:23 +0000 (12:05 +0100)] 
Update `sync-all` and others files w.r.t. merged testsuite (re #8545)

See merge commit 66693401b98cb5aa912948af7bbd2182474f50c4

This commit also adds a check for a left-over testsuite/.git folder to sync-all

This way, the first time sync-all is called after updating to a
post-testsuite-merge (see #8545) state of ghc.git, the sync-all script
aborts with an error message if a `testsuite/.git` folder is detected and
thus forces the user to take action.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoFold testsuite.git into ghc.git (re #8545)
Herbert Valerio Riedel [Sun, 12 Jan 2014 10:40:09 +0000 (11:40 +0100)] 
Fold testsuite.git into ghc.git (re #8545)

This commit performs a subtree merge of testsuite.git into ghc.git;
The next commit will adapt `sync-all` et al. to the new situation.

At the time of merge, testsuite.git was at commit
[998a816ae89c4fd573f4abd7c6abb346cf7ee9af/testsuite]

The following steps have been used to accomplish this merge:

1. Clone a fresh testsuite.git copy (& cd into)

2. Remove accidentally committed binary files from history

 git filter-branch \
  --index-filter "git rm -r --cached --ignore-unmatch \
    tests/haddock/should_compile_flag_nohaddock/a.out \
    tests/haddock/should_compile_noflag_nohaddock/a.out \
    tests/ghc-regress/haddock/should_compile_flag_nohaddock/a.out \
    tests/ghc-regress/haddock/should_compile_noflag_nohaddock/a.out \
    tests/ghc-regress/dph/diophantine/dph-diophantine-fast \
    tests/ghc-regress/dph/diophantine/dph-diophantine-opt \
    tests/ghc-regress/dph/primespj/dph-primespj-fast \
    tests/ghc-regress/dph/quickhull/dph-quickhull-fast \
    tests/ghc-regress/dph/smvm/dph-smvm \
    tests/ghc-regress/dph/sumnats/dph-sumnats \
    tests/ghc-regress/dph/words/dph-words-fast \
    tests/ghc-regress/plugins/plugins01" \
   HEAD

3. Rename all paths in testsuite.git to be prefixed with `testsuite/`

 git filter-branch -f --prune-empty --tree-filter \
  "mkdir -p testsuite; \
   git ls-tree --name-only \$GIT_COMMIT | xargs -I files mv files testsuite/"

4. cd into ghc/ checkout, and perform subtree merge of testsuite into ghc
   (see also http://nuclearsquid.com/writings/subtree-merging-and-you/)

 cd ../ghc/
 git remote add -f testsuite ../testsuite/.git
 git merge -s ours --no-commit testsuite/master
 git read-tree --prefix=/ -u testsuite/master
 git commit

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agofix a mistyped label that caused a stray reference
Gabor Greif [Sun, 12 Jan 2014 02:26:33 +0000 (03:26 +0100)] 
fix a mistyped label that caused a stray reference

Richard, you may want to regenerate the PDF
as I get

! LaTeX Error: File `stmaryrd.sty' not found.

with my setup and do not want to mess things up.

Also for me ?? appear twice on top of the page 13
and I have tp 'rm core-spec.pdf; make' to get it
right.

5 years agoFix typo in error message
Herbert Valerio Riedel [Sat, 11 Jan 2014 10:20:26 +0000 (11:20 +0100)] 
Fix typo in error message

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoUpdate mailmap
Herbert Valerio Riedel [Mon, 16 Dec 2013 16:18:17 +0000 (17:18 +0100)] 
Update mailmap

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoFix #8599.
Richard Eisenberg [Fri, 10 Jan 2014 20:26:02 +0000 (15:26 -0500)] 
Fix #8599.

This change is just some documentation around ignoring the context
of an enclosing instance when processing `deriving` clauses of an
associated data instance.

5 years agoClarify issue in #8630 in users' guide.
Richard Eisenberg [Fri, 10 Jan 2014 15:06:53 +0000 (10:06 -0500)] 
Clarify issue in #8630 in users' guide.

We do *not* propagate kind information from an instance declaration's
members back into the instance head.

5 years agoDocument the fact that Areas overlap, and why.
Simon Marlow [Fri, 10 Jan 2014 20:29:41 +0000 (20:29 +0000)] 
Document the fact that Areas overlap, and why.

5 years agoComment typos only
Gabor Greif [Fri, 10 Jan 2014 18:23:02 +0000 (19:23 +0100)] 
Comment typos only

5 years agoMake initGhcMonad call setUnsafeGlobalDynFlags
Simon Peyton Jones [Fri, 10 Jan 2014 18:16:34 +0000 (18:16 +0000)] 
Make initGhcMonad call setUnsafeGlobalDynFlags

If we don't do this, then in various GHC API scenarios
(which use runGhc) with tracing/debugging/ASSERTs on,
we try to read those unsafe global dynamic flags and
find them uninitialised.

5 years agoMake showSDoc and friends respect -dppr-cols
Simon Peyton Jones [Fri, 10 Jan 2014 18:14:57 +0000 (18:14 +0000)] 
Make showSDoc and friends respect -dppr-cols

Previously they just used a fixed width of 100, ignoring
-dppr-cols.  I think this dates back to a time when
the flag didn't exist, or wasn't conveniently available.

Thanks to Andrew Gibiansky for pointing this out.

5 years agoBring kind variables into the type-checker's scope as well as type variables
Simon Peyton Jones [Fri, 10 Jan 2014 18:12:50 +0000 (18:12 +0000)] 
Bring kind variables into the type-checker's scope as well as type variables

Fixes Trac #8616

5 years agoNotes and code cosmetics
Joachim Breitner [Fri, 10 Jan 2014 14:22:41 +0000 (14:22 +0000)] 
Notes and code cosmetics

Explain why defaultDmd resTypeArgDmd are similar, but both needed, and
apply slight code cosmetics.

5 years agoAdd forgotten stderr output for T5498
Joachim Breitner [Fri, 10 Jan 2014 11:55:14 +0000 (11:55 +0000)] 
Add forgotten stderr output for T5498

5 years agoFix a typo in comment
Gabor Greif [Fri, 10 Jan 2014 11:05:14 +0000 (12:05 +0100)] 
Fix a typo in comment

5 years agoTest Trac #8651
Simon Peyton Jones [Fri, 10 Jan 2014 09:28:11 +0000 (09:28 +0000)] 
Test Trac #8651

5 years agoTest Trac #8649
Simon Peyton Jones [Fri, 10 Jan 2014 09:22:57 +0000 (09:22 +0000)] 
Test Trac #8649

5 years agoAdjust "max_bytes_used" upward for T4801
Simon Peyton Jones [Fri, 10 Jan 2014 08:48:53 +0000 (08:48 +0000)] 
Adjust "max_bytes_used" upward for T4801

5 years agoChanges in error messages when fixing Trac #8649
Simon Peyton Jones [Thu, 9 Jan 2014 17:59:51 +0000 (17:59 +0000)] 
Changes in error messages when fixing Trac #8649

Mostly improvements, happily

5 years agoTest Trac #5498
Simon Peyton Jones [Tue, 7 Jan 2014 12:21:28 +0000 (12:21 +0000)] 
Test Trac #5498

5 years agoComments only
Simon Peyton Jones [Thu, 9 Jan 2014 17:58:37 +0000 (17:58 +0000)] 
Comments only

5 years agoRe-work the naming story for the GHCi prompt (Trac #8649)
Simon Peyton Jones [Thu, 9 Jan 2014 17:58:18 +0000 (17:58 +0000)] 
Re-work the naming story for the GHCi prompt (Trac #8649)

The basic idea here is simple, and described in Note [The interactive package]
in HscTypes, which starts thus:

    Note [The interactive package]
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Type and class declarations at the command prompt are treated as if
    they were defined in modules
       interactive:Ghci1
       interactive:Ghci2
       ...etc...
    with each bunch of declarations using a new module, all sharing a
    common package 'interactive' (see Module.interactivePackageId, and
    PrelNames.mkInteractiveModule).

    This scheme deals well with shadowing.  For example:

       ghci> data T = A
       ghci> data T = B
       ghci> :i A
       data Ghci1.T = A  -- Defined at <interactive>:2:10

    Here we must display info about constructor A, but its type T has been
    shadowed by the second declaration.  But it has a respectable
    qualified name (Ghci1.T), and its source location says where it was
    defined.

    So the main invariant continues to hold, that in any session an original
    name M.T only refers to oe unique thing.  (In a previous iteration both
    the T's above were called :Interactive.T, albeit with different uniques,
    which gave rise to all sorts of trouble.)

This scheme deals nicely with the original problem.  It allows us to
eliminate a couple of grotseque hacks
  - Note [Outputable Orig RdrName] in HscTypes
  - Note [interactive name cache] in IfaceEnv
(both these comments have gone, because the hacks they describe are no
longer necessary). I was also able to simplify Outputable.QueryQualifyName,
so that it takes a Module/OccName as args rather than a Name.

However, matters are never simple, and this change took me an
unreasonably long time to get right.  There are some details in
Note [The interactive package] in HscTypes.

5 years agoFurther improve the "same-occurrence" error messages (Trac #8278)
Simon Peyton Jones [Thu, 9 Jan 2014 16:55:31 +0000 (16:55 +0000)] 
Further improve the "same-occurrence" error messages (Trac #8278)

Sometimes we actually have a good SrcSpan for the type constructor
and reporting that is better than just reporting which module it
was defined on

5 years agoA little refactoring so that we print package-qualified modules names if necessary
Simon Peyton Jones [Thu, 9 Jan 2014 16:19:22 +0000 (16:19 +0000)] 
A little refactoring so that we print package-qualified modules names if necessary

5 years agoImprove documentation of :module etc (Trac #8622)
Simon Peyton Jones [Thu, 9 Jan 2014 16:17:59 +0000 (16:17 +0000)] 
Improve documentation of :module etc (Trac #8622)

I did quite a bit of restructuring, as well as adding
the note specifically referred to in #8622

5 years agoComment typo
Simon Peyton Jones [Tue, 7 Jan 2014 10:03:56 +0000 (10:03 +0000)] 
Comment typo

5 years agoFurther refine the test for 'given' equalities
Simon Peyton Jones [Tue, 7 Jan 2014 10:03:42 +0000 (10:03 +0000)] 
Further refine the test for 'given' equalities

Trac #8651 revealed that my previous fix (itself in response to #8644)
wasn't quite right.  The plan, using the CtOrigin to identify
constraints arising from flattening, is described in TcSimplify,
Note [When does an implication have given equalities?]

5 years agoDocument Proxy# (#8658)
Austin Seipp [Thu, 9 Jan 2014 07:02:56 +0000 (01:02 -0600)] 
Document Proxy# (#8658)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoTest that runST is not inlined prematurely
Joachim Breitner [Wed, 8 Jan 2014 18:23:56 +0000 (18:23 +0000)] 
Test that runST is not inlined prematurely

This resulted form a discussion about #5916.

5 years agoExtend runRnSpliceHook to decls and patterns
Edsko de Vries [Wed, 8 Jan 2014 15:48:32 +0000 (15:48 +0000)] 
Extend runRnSpliceHook to decls and patterns

5 years agoTests for #8601
John Lenz [Tue, 7 Jan 2014 13:22:56 +0000 (07:22 -0600)] 
Tests for #8601

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorunghc: Fix interaction of stdin and --ghc-args
John Lenz [Tue, 7 Jan 2014 13:21:23 +0000 (07:21 -0600)] 
runghc: Fix interaction of stdin and --ghc-args

When reading the program from standard input, runghc did not properly
handle the --ghc-arg= escape for arguments to ghc which do not start
with a dash, since arguments were processed twice and the first time the
--ghc-arg= was stripped.  Now arguments are only processed once.  For
backwards compatibility, a prefix of --ghc-arg=--ghc-arg= is allowed
since this prefix will work on both old and new versions of ghc.

This fixes #8601

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix validate failure.
Austin Seipp [Tue, 7 Jan 2014 13:18:51 +0000 (07:18 -0600)] 
Fix validate failure.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoRemove trailing whitespace.
Austin Seipp [Tue, 7 Jan 2014 13:12:36 +0000 (07:12 -0600)] 
Remove trailing whitespace.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoLlvmMangler: Make sure no symbols slip through re-.typing
Ben Gamari [Wed, 18 Dec 2013 15:09:31 +0000 (10:09 -0500)] 
LlvmMangler: Make sure no symbols slip through re-.typing

Previously a few symbols weren't flipped from %function to %object
as the section splitter was emitting them without processes. This
may be a bug in itself but for now let's just work around the issue
but rewriting all symbol `.types`.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoLlvmMangler: Rewrite @function symbols to @object
Ben Gamari [Sat, 14 Dec 2013 17:04:28 +0000 (12:04 -0500)] 
LlvmMangler: Rewrite @function symbols to @object

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoAdd test suite for #8602
Chris Heller [Thu, 2 Jan 2014 21:54:58 +0000 (16:54 -0500)] 
Add test suite for #8602

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoRe-order preprocessor args to agree with User Guide (fixes #8602)
Chris Heller [Thu, 2 Jan 2014 21:55:52 +0000 (16:55 -0500)] 
Re-order preprocessor args to agree with User Guide (fixes #8602)

The section of the User Guide in reference is 4.12.4

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoLower unfolding threshold for windows (again.)
Austin Seipp [Tue, 7 Jan 2014 07:42:29 +0000 (01:42 -0600)] 
Lower unfolding threshold for windows (again.)

We creeped back up again past the symbol threshold on my test x86_64
win2k8 test machine. This brings it down to 60600 symbols in split
windows DLL.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agonativeGen: Fix spelling in comment
Ben Gamari [Sat, 21 Dec 2013 14:44:38 +0000 (09:44 -0500)] 
nativeGen: Fix spelling in comment

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix specification of -z origin for gold.
Austin Seipp [Tue, 7 Jan 2014 07:06:10 +0000 (01:06 -0600)] 
Fix specification of -z origin for gold.

Gold apparently doesn't recognize `-z origin`, only `-zorigin` it seems.

Authored-by: Ben Gamari <bgamari.foss@gmail.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoLLVM mangler: fix AVX instruction rewriter.
Austin Seipp [Tue, 7 Jan 2014 07:03:48 +0000 (01:03 -0600)] 
LLVM mangler: fix AVX instruction rewriter.

This was pretty badly broken...

Authored-by: Ben Gamari <bgamari.foss@gmail.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix __GLASGOW_HASKELL_LLVM__ #define
Austin Seipp [Tue, 7 Jan 2014 06:59:17 +0000 (00:59 -0600)] 
Fix __GLASGOW_HASKELL_LLVM__ #define

(It improperly used 'show' on the Maybe Int, not the Int.)

Authored-by: Karel Gardas <karel.gardas@centrum.cz>
Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix -dynamic-too clashing with -o (#8180)
Austin Seipp [Mon, 16 Dec 2013 15:04:44 +0000 (09:04 -0600)] 
Fix -dynamic-too clashing with -o (#8180)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoUpdate perf values for T5237
Joachim Breitner [Mon, 6 Jan 2014 10:57:28 +0000 (10:57 +0000)] 
Update perf values for T5237

Probably improved by [9e10d188]

5 years agoAdd output for T8639
Joachim Breitner [Mon, 6 Jan 2014 10:54:45 +0000 (10:54 +0000)] 
Add output for T8639

(probably forgotten in [0a0ca809])

5 years agoUpdate T7594 properly
Joachim Breitner [Mon, 6 Jan 2014 10:50:08 +0000 (10:50 +0000)] 
Update T7594 properly

The previous updates had the line numbers wrong.

5 years agoFix #5209: Reset GHCi prompt in multiline mode
Benno Fünfstück [Fri, 3 Jan 2014 16:17:30 +0000 (17:17 +0100)] 
Fix #5209: Reset GHCi prompt in multiline mode

GHCi didn't reset the multiline prompt when an exception (in particular,
the UserInterrupt exception) occured. This commit uses `finally` to
reset the prompt in all cases.

5 years agoTest Trac #8579
Simon Peyton Jones [Fri, 3 Jan 2014 16:50:12 +0000 (16:50 +0000)] 
Test Trac #8579

5 years agoTest Trac #8628
Simon Peyton Jones [Fri, 3 Jan 2014 16:33:59 +0000 (16:33 +0000)] 
Test Trac #8628

5 years agoTest Trac #8640
Simon Peyton Jones [Fri, 3 Jan 2014 16:22:01 +0000 (16:22 +0000)] 
Test Trac #8640

5 years agoDo hFlush in the T8639_api test
Simon Peyton Jones [Fri, 3 Jan 2014 16:10:27 +0000 (16:10 +0000)] 
Do hFlush in the T8639_api test

5 years agoUpdate T7594 as a result of fixing #8644
Simon Peyton Jones [Fri, 3 Jan 2014 16:09:47 +0000 (16:09 +0000)] 
Update T7594 as a result of fixing #8644

The fix to #8644 makes the original T7594 pass (rightly).
I've added a variant that shouuld and does fail

5 years agoWhite space only
Simon Peyton Jones [Fri, 3 Jan 2014 16:07:17 +0000 (16:07 +0000)] 
White space only

5 years agoTest Trac #8644
Simon Peyton Jones [Fri, 3 Jan 2014 16:06:04 +0000 (16:06 +0000)] 
Test Trac #8644

5 years agoImprove the equality-floating story (again), to fix Trac #8644
Simon Peyton Jones [Fri, 3 Jan 2014 16:04:04 +0000 (16:04 +0000)] 
Improve the equality-floating story (again), to fix Trac #8644

We float equalities out of implications whose 'givens' include equalities.
But it's a bit tricky knowing whether some givens do or do not include
equalities, as #8644 shows.  There the given has type 'c' (which might
have equalities), but we discover that 'c ~ ()', which definitely doesn't.

In short, we must look at the givens *after* normalisation, not before.
Moreover, something similar happens in approximateWC, where we need
to ask whether an implication has given equalities.

This patch does the job:

* Add a Boolean field inert_no_eqs to InertCans, which records
  whether we've added a non-constant equality

* Add a field ic_no_eqs to Implication, which records whether the
  ic_given binders include any equalities

* Get rid of Inst.hasEqualities altogether

On the way I did some un-forced refactoring

* Introduce the auxiliary function TcCanonical.flattenNestedFamApp

* Kill off FamHeadMap and PredMap in favour of
  the new FunEqMap and DictMap respectively

5 years agoRefactor the way shadowing in handled in GHCi
Simon Peyton Jones [Fri, 3 Jan 2014 15:50:39 +0000 (15:50 +0000)] 
Refactor the way shadowing in handled in GHCi

If you say
  ghci> import Foo( T )
  ghci> data T = MkT
  ghci> data T = XXX
then the second 'data T' should shadow the first.  But the qualified
Foo.T should still be available.  We really weren't handling this
correctly at all, resulting in Trac #8639 and #8628 among others

This patch:

* Add RdrName.extendGlobalRdrEnv, which does shadowing properly

* Change HscTypes.icExtendGblRdrEnv (was badly-named icPlusGblRdrEnv)
  to use the new function

* Change RnNames.extendGobalRdrEnvRn to use the new function

* Move gresFrom Avails into RdrName
* Better pprGlobalRdrEnv function in RdrName

5 years agoImprove error message when using qualified names in GHCi
Simon Peyton Jones [Fri, 3 Jan 2014 15:39:35 +0000 (15:39 +0000)] 
Improve error message when using qualified names in GHCi

When you say
  ghci> :i Foo.x
GHCi tries to find module Foo and get 'x' from it.  But
if Foo doesn't exist we don't want to say:
  Attempting to use module ‛Foo’ which is not loaded

This is a bit confusing. Rather we just want to say that
Foo.x is not in scope.

5 years agoAdd alterOccEnv
Simon Peyton Jones [Fri, 3 Jan 2014 15:36:31 +0000 (15:36 +0000)] 
Add alterOccEnv

5 years agoUse the GlobalRdrEnv when renaming the axuiliary bindings in 'deriving'
Simon Peyton Jones [Fri, 3 Jan 2014 15:35:45 +0000 (15:35 +0000)] 
Use the GlobalRdrEnv when renaming the axuiliary bindings in 'deriving'

I'm not sure why were were using bindLocalNames before, but it triggers
an assert failure that checks that local names are Internal.  This
change makes things more uniform and straightforward.

5 years agoImproved out-of-scope error for qualified names in GHCi
Simon Peyton Jones [Thu, 2 Jan 2014 15:18:45 +0000 (15:18 +0000)] 
Improved out-of-scope error for qualified names in GHCi

5 years agoTest Trac #8639
Simon Peyton Jones [Thu, 2 Jan 2014 15:18:10 +0000 (15:18 +0000)] 
Test Trac #8639

5 years agoTest Trac #8639 (just the GHCi version)
Simon Peyton Jones [Tue, 31 Dec 2013 17:07:31 +0000 (17:07 +0000)] 
Test Trac #8639 (just the GHCi version)

5 years agoIn ':show imports' take account of -XNoImplicitPrelude
Simon Peyton Jones [Thu, 2 Jan 2014 15:16:32 +0000 (15:16 +0000)] 
In ':show imports' take account of -XNoImplicitPrelude

Fixes Trac #8640

5 years agoTest Trac #8625
Simon Peyton Jones [Tue, 31 Dec 2013 21:28:51 +0000 (21:28 +0000)] 
Test Trac #8625

5 years agoHandle parens in predicates when converting to TH
Simon Peyton Jones [Tue, 31 Dec 2013 21:25:19 +0000 (21:25 +0000)] 
Handle parens in predicates when converting to TH

This fixes Trac #8625

5 years agoUpdate Note [Coercible instances]
Joachim Breitner [Thu, 2 Jan 2014 11:39:45 +0000 (12:39 +0100)] 
Update Note [Coercible instances]

5 years agoClean up block allocator, fixes #8609
Edward Z. Yang [Thu, 12 Dec 2013 00:17:39 +0000 (16:17 -0800)] 
Clean up block allocator, fixes #8609

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
5 years agoFix number literal syntax mistake
Joachim Breitner [Mon, 30 Dec 2013 21:14:19 +0000 (22:14 +0100)] 
Fix number literal syntax mistake

introduced in c2e88b34cd3cb48d4bb203b6f0e7de1980e9c570.

5 years agoComments only
Simon Peyton Jones [Mon, 30 Dec 2013 12:10:45 +0000 (12:10 +0000)] 
Comments only

5 years agoComments only
Simon Peyton Jones [Sat, 28 Dec 2013 12:29:05 +0000 (12:29 +0000)] 
Comments only

5 years agoRe-factor TcCanonical (again), fixes Trac #8603
Simon Peyton Jones [Sat, 28 Dec 2013 12:28:52 +0000 (12:28 +0000)] 
Re-factor TcCanonical (again), fixes Trac #8603

This is a substantial refactoring of the canonicaliser. The proximate
cause was that we were sometimes failing to correctly orient a
tyvar/tyvar equality (x ~ y), because the kind of x or y was not fully
zonked at the moment we compared them.  That in turn led me to look
closely at the way that canEvNC (which decomposes equalities) worked.

* The big change is that the 'reOrient' and 'classify' functions are gone,
  along with classify's 'TypeClassifier' return type.  Instead the
  re-orientation is built into canEqNC.  When we find a type variable
  we divert into canEqTyVar, and so on, very much as in TcUnify.

* TcCanonical.canEqTyVar, canEqLeafFun, etc now carry a SwapFlag (to
  reduce duplication), just as in TcUnify; now SwapFlag itself is
  defined in BasicTypes

* I renamed TcSMonad.rewriteCtFlavor to rewriteEvidence,

* I added a new specialised version of rewriteEvidence, called
  TcSMonad.rewriteEqEvidence.  It is easier to use, and removes
  the crafty but brain-mangling higher order casts that we were
  using before.

The result is not exactly simpler, but it's pretty clear and, I think,
significantly more efficient.  And it fixes Trac #8603!

5 years agoDefine mkTcNomReflCo = TcRefl Nominal, and use it all over
Simon Peyton Jones [Sat, 28 Dec 2013 12:05:45 +0000 (12:05 +0000)] 
Define mkTcNomReflCo = TcRefl Nominal, and use it all over

This patch doesn't include the changes to TcCanonical and TcSMonad,
which are a bigger follow-up patch, so it is tightly coupled to the
follow-up.

5 years agoError message wibbles
Simon Peyton Jones [Sat, 28 Dec 2013 12:51:19 +0000 (12:51 +0000)] 
Error message wibbles

5 years agoTest Trac #8603
Simon Peyton Jones [Sat, 28 Dec 2013 12:45:35 +0000 (12:45 +0000)] 
Test Trac #8603

5 years agoTest Trac #8633
Simon Peyton Jones [Sat, 28 Dec 2013 12:45:06 +0000 (12:45 +0000)] 
Test Trac #8633

5 years agoUpdate perf numbers for 32-bit This has not been done for ages
Simon Peyton Jones [Fri, 22 Nov 2013 22:53:50 +0000 (22:53 +0000)] 
Update perf numbers for 32-bit This has not been done for ages

5 years agoAdd hook for splicing in renamer
Edsko de Vries [Tue, 17 Dec 2013 17:28:44 +0000 (17:28 +0000)] 
Add hook for splicing in renamer

With the recent modifications to the TH infrastructure, many splices are now
expanded in the renamer rather than the typechecker. This means that tools
which inspect the renamed tree don't get to see the original splices. Added a
new hook which gets called before such a splice gets expanded, analogous to the
runQuasiQuoteHook.

5 years agoFix #8607.
Richard Eisenberg [Fri, 27 Dec 2013 03:34:03 +0000 (22:34 -0500)] 
Fix #8607.

The solution (after many false starts) is to change the behavior of
hsLTyClDeclBinders. The idea is that the locations of the names that
the parser generates should really be the names' locations, unlike
what was done in 1745779... But, when the renamer is creating Names
from the RdrNames, the locations stored in the Names should be the
declarations' locations. This is now achieved in hsLTyClDeclBinders,
which returns [Located name], but the location is that of the
*declaration*, not the name itself.

5 years agoError wibbles while fixing #8607.
Richard Eisenberg [Fri, 27 Dec 2013 03:32:56 +0000 (22:32 -0500)] 
Error wibbles while fixing #8607.

5 years agoRevert "Simplify the plumbing for checkValidTyCl"
Richard Eisenberg [Wed, 18 Dec 2013 19:58:12 +0000 (14:58 -0500)] 
Revert "Simplify the plumbing for checkValidTyCl"

This reverts commit 174577912de7a21b8fe01881a28f5aafce02b92e.

This is part of the fix for #8607. Only reverting RdrHsSyn.lhs.

Conflicts:

compiler/parser/RdrHsSyn.lhs
compiler/typecheck/TcTyClsDecls.lhs

5 years agoRemove unused eqExprX
Joachim Breitner [Tue, 17 Dec 2013 15:34:28 +0000 (16:34 +0100)] 
Remove unused eqExprX

5 years agoMention '-fno-ignore-asserts' in documentation.
Mikhail Glushenkov [Tue, 17 Dec 2013 06:51:02 +0000 (07:51 +0100)] 
Mention '-fno-ignore-asserts' in documentation.

(Closes: #8617)

5 years agoCopy-pasto.
Mikhail Glushenkov [Tue, 17 Dec 2013 05:33:17 +0000 (06:33 +0100)] 
Copy-pasto.

5 years agoUpdate comments: Void# instead of State# RealWorld#
Joachim Breitner [Mon, 16 Dec 2013 22:20:24 +0000 (23:20 +0100)] 
Update comments: Void# instead of State# RealWorld#

5 years agoMake types of bothDmdType more precise
Joachim Breitner [Mon, 9 Dec 2013 18:40:09 +0000 (18:40 +0000)] 
Make types of bothDmdType more precise

by only passing the demand on the free variables, and whether the
argument (resp. scrunitee) may or will diverge.

5 years agoDisentangle postProcessDmdTypeM and postProcessUnsat
Joachim Breitner [Mon, 9 Dec 2013 18:40:09 +0000 (18:40 +0000)] 
Disentangle postProcessDmdTypeM and postProcessUnsat

Make different postProcess code paths for function arguments (which are
post-processed just to be both'ed) and unsaturated functions (which are
post-processed for other reasons.)

5 years agoRefactor peelManyCalls
Joachim Breitner [Sat, 14 Dec 2013 21:07:04 +0000 (22:07 +0100)] 
Refactor peelManyCalls

its first argument is just used for its length (the arity of the call).
So changing the type to Int to reflect that.

Also add a note [Demands from unsaturated function calls] that hopefully
comprehensively and comprehensibly explains what is going on here.

5 years agoRename postProcessDmdType to postProcessUnsat and use* to reuse*
Joachim Breitner [Thu, 12 Dec 2013 16:12:00 +0000 (16:12 +0000)] 
Rename postProcessDmdType to postProcessUnsat and use* to reuse*

5 years agoDo not export DmdResult constructors in Demand.lhs
Joachim Breitner [Mon, 9 Dec 2013 16:56:32 +0000 (16:56 +0000)] 
Do not export DmdResult constructors in Demand.lhs

5 years agoSplit DmdResult into DmdResult and CPRResult
Joachim Breitner [Thu, 12 Dec 2013 15:39:30 +0000 (15:39 +0000)] 
Split DmdResult into DmdResult and CPRResult

this is a small-step-refactoring patch and not very interesting on its
own.

5 years agoAdd Note [non-algebraic or open body type warning]
Joachim Breitner [Wed, 4 Dec 2013 17:12:07 +0000 (17:12 +0000)] 
Add Note [non-algebraic or open body type warning]

5 years agoRemove dmdAnalArg and replace by easier to understand code
Joachim Breitner [Wed, 4 Dec 2013 17:38:25 +0000 (17:38 +0000)] 
Remove dmdAnalArg and replace by easier to understand code

5 years agoClarify the default demand on demand environments
Joachim Breitner [Wed, 4 Dec 2013 17:59:09 +0000 (17:59 +0000)] 
Clarify the default demand on demand environments

by adding Notes and using easier to understand combinators.

5 years agoUpdate compiler performance values
Joachim Breitner [Thu, 12 Dec 2013 14:22:35 +0000 (14:22 +0000)] 
Update compiler performance values

5 years agolazy-bs-alloc improved from oneshotness stuff
Joachim Breitner [Thu, 12 Dec 2013 12:01:04 +0000 (12:01 +0000)] 
lazy-bs-alloc improved from oneshotness stuff

5 years agoAdjust output to new oneshotness
Joachim Breitner [Thu, 12 Dec 2013 11:59:33 +0000 (11:59 +0000)] 
Adjust output to new oneshotness

5 years agoMove peelFV from DmdAnal to Demand
Joachim Breitner [Wed, 4 Dec 2013 16:09:34 +0000 (16:09 +0000)] 
Move peelFV from DmdAnal to Demand

5 years agoImprove the handling of used-once stuff
Simon Peyton Jones [Fri, 22 Nov 2013 17:13:05 +0000 (17:13 +0000)] 
Improve the handling of used-once stuff

Joachim and I are committing this onto a branch so that we can share it,
but we expect to do a bit more work before merging it onto head.

Nofib staus:
  - Most programs, no change
  - A few improve
  - A couple get worse (cacheprof, tak, rfib)
Investigating the "get worse" set is what's holding up putting this
on head.

The major issue is this.  Consider

    map (f g) ys

where f's demand signature looks like

   f :: <L,C1(C1(U))> -> <L,U> -> .

So 'f' is not saturated.  What demand do we place on g?
Answer
        C(C1(U))
That is, the inner C1 should stay, even though f is not saturated.

I found that this made a significant difference in the demand signatures
inferred in GHC.IO, which uses lots of higher-order exception handlers.

I also had to add used-once demand signatures for some of the
'catch' primops, so that we know their handlers are only called once.

5 years agoGuarding against silly shifts
Simon Peyton Jones [Wed, 11 Dec 2013 18:19:34 +0000 (18:19 +0000)] 
Guarding against silly shifts

This patch was authored by SPJ and extracted from "Improve the handling
of used-once stuff" by Joachim.