ghc.git
2 years agoSuppress unused warnings for selectors for some derived classes
Ryan Scott [Tue, 11 Jul 2017 15:57:05 +0000 (11:57 -0400)] 
Suppress unused warnings for selectors for some derived classes

Although derived `Read`, `Show`, and `Generic` instances technically
don't //use// the record selectors of the data type for which an
instance is being derived, the derived code is affected by the
//presence// of record selectors. As a result, we should suppress
`-Wunused-binds` for those record selectors when deriving these classes.
This is accomplished by threading through more information from
`hasStockDeriving`.

Test Plan: make test TEST=T13919

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #13919

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

2 years agoAdd testcase for T13818
Douglas Wilson [Tue, 11 Jul 2017 15:55:15 +0000 (11:55 -0400)] 
Add testcase for T13818

Annotations currently fail to type check if they annotation cannot
be loaded into ghci, such as when built with -fno-code.

Test Plan: ./validate

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #13818

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

2 years agoImprove Wmissing-home-modules warning under Cabal
Ben Gamari [Tue, 11 Jul 2017 15:54:59 +0000 (11:54 -0400)] 
Improve Wmissing-home-modules warning under Cabal

Reviewers: hvr, alanz, austin

Reviewed By: alanz

Subscribers: rwbarton, thomie

GHC Trac Issues: #13899

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

2 years agoFix Work Balance computation in RTS stats
Douglas Wilson [Tue, 11 Jul 2017 15:54:09 +0000 (11:54 -0400)] 
Fix Work Balance computation in RTS stats

An additional stat is tracked per gc: par_balanced_copied This is the
the number of bytes copied by each gc thread under the balanced lmit,
which is simply (copied_bytes / num_gc_threads).  The stat is added to
all the appropriate GC structures, so is visible in the eventlog and in
GHC.Stats.

A note is added explaining how work balance is computed.

Remove some end of line whitespace

Test Plan:
./validate
experiment with the program attached to the ticket
examine code changes carefully

Reviewers: simonmar, austin, hvr, bgamari, erikd

Reviewed By: simonmar

Subscribers: Phyx, rwbarton, thomie

GHC Trac Issues: #13830

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

2 years agoMake ':info Coercible' display an arbitrary string (fixes #12390)
Patrick Dougherty [Tue, 11 Jul 2017 15:53:40 +0000 (11:53 -0400)] 
Make ':info Coercible' display an arbitrary string (fixes #12390)

This change enables the addition of an arbitrary string to the output of
GHCi's ':info'. It was made for Coercible in particular but could be
extended if desired.

Updates haddock submodule.

Test Plan: Modified test 'ghci059' to match new output.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: goldfire, rwbarton, thomie

GHC Trac Issues: #12390

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

2 years agouser-guide: Various fixes to FFI section
Ben Gamari [Wed, 5 Jul 2017 19:01:47 +0000 (15:01 -0400)] 
user-guide: Various fixes to FFI section

2 years agotestsuite: Decrease T13701 allocations
Ben Gamari [Tue, 11 Jul 2017 17:19:53 +0000 (13:19 -0400)] 
testsuite: Decrease T13701 allocations

2 years agoPretty-printer no longer butchers function arrow fixity
Alan Zimmerman [Mon, 10 Jul 2017 11:00:36 +0000 (13:00 +0200)] 
Pretty-printer no longer butchers function arrow fixity

It now correctly prints the parens around '(Int -> Int)' in

    {-# LANGUAGE TemplateHaskell #-}
    {-# OPTIONS_GHC -ddump-splices #-}
    module Bug where

    $([d| f :: Either Int (Int -> Int)
          f = undefined
        |])

Closes #13942

2 years agoBig-obj support for the Windows runtime linker
Tamar Christina [Sat, 8 Jul 2017 08:57:55 +0000 (09:57 +0100)] 
Big-obj support for the Windows runtime linker

Summary:
The normal object file on Windows has a limit of `2^16`
sections that can be in an object-file.

The `big-obj` format raises this to `2^32` sections.

The implementation is made difficult because we now need to support
two header formats and two section formats that differ only by a single
element size within each. The element that's different is in the middle
of the structs and since the structs are used to map regions of memory
directly, it means we need to know which struct it is when we do the
mapping or pointer arithmetics.

This is the final Object-Code format which Windows compilers can generate
which we do not support yet in GHCI. All other major compilers on the platforms
can produce it and all linkers consume it (bfd and lld).

See http://tinyurl.com/bigobj

This patch abstracts away retrieving the fields to functions which all take
an struct which describes which object format is currently being parsed.
These functions are always in-lined as they're small but would looks messy
being copy-pasted everywhere.

Test Plan:
./validate and new test `big-obj`

```
Tamar@Rage MINGW64 /r
$ gcc -c -Wa,-mbig-obj foo.c -o foo.o

Tamar@Rage MINGW64 /r
$ objdump -h foo.o

foo.o:     file format pe-bigobj-x86-64

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         00000010  0000000000000000  0000000000000000  00000128  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000000  0000000000000000  0000000000000000  00000000  2**4
                  ALLOC, LOAD, DATA
  2 .bss          00000000  0000000000000000  0000000000000000  00000000  2**4
                  ALLOC
  3 .xdata        00000008  0000000000000000  0000000000000000  00000138  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .pdata        0000000c  0000000000000000  0000000000000000  00000140  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
  5 .rdata$zzz    00000030  0000000000000000  0000000000000000  0000014c  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA

Tamar@Rage MINGW64 /r
$ echo main | ~/ghc/inplace/bin/ghc-stage2.exe --interactive bar.hs foo.o
GHCi, version 8.3.20170430: http://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( bar.hs, interpreted )
Ok, modules loaded: Main.
*Main> 17
*Main> Leaving GHCi.
```

Reviewers: austin, bgamari, erikd, simonmar

Subscribers: awson, rwbarton, thomie, #ghc_windows_task_force

GHC Trac Issues: #13815

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

2 years agoFix typos in Bag.hs [ci skip]
Ömer Sinan Ağacan [Sat, 8 Jul 2017 11:22:17 +0000 (14:22 +0300)] 
Fix typos in Bag.hs [ci skip]

2 years agoaclocal.m4: allow arbitrary <vendor> string in toolchain triplets
Sergei Trofimovich [Sat, 8 Jul 2017 08:47:12 +0000 (09:47 +0100)] 
aclocal.m4: allow arbitrary <vendor> string in toolchain triplets

Canonical triplets have a form of
    <arch>-<vendor>-<os>[-<abi>]

Checking for vendor is almost never correct as it's an
arbitrary string.

It's useful to have multiple "vendors" to denote
otherwise the same (WRT <arch>, <os>, <abi>) target:
    --target=x86_64-pc-linux-gnu
    --target=x86_64-unknown-linux-gnu
    --target=x86_64-ghc80-linux-gnu
    --target=x86_64-ghchead-linux-gnu

Do not fail unknown vendors. Only emit a warning.
Ideally configure checks should never use "vendor".

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2 years agoImplement split-sections support for windows.
Tamar Christina [Sun, 26 Mar 2017 18:05:46 +0000 (19:05 +0100)] 
Implement split-sections support for windows.

Summary:
Initial implementation of split-section on Windows.

This also corrects section namings and uses the platform
convention of `$` instead of `.` to separate sections.

Implementation is based on @awson's patches to binutils.

Binutils requires some extra help when compiling the libraries
for GHCi usage. We drop the `-T` and use implicit scripts to amend
the linker scripts instead of replacing it.

Because of these very large GHCi object files, we need big-obj support,
which will be added by another patch.

Test Plan: ./validate

Reviewers: awson, austin, bgamari

Subscribers: dfeuer, rwbarton, thomie, snowleopard, #ghc_windows_task_force

GHC Trac Issues: #12913

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

2 years agoTypos in comments [ci skip]
Gabor Greif [Thu, 6 Jul 2017 08:48:52 +0000 (10:48 +0200)] 
Typos in comments [ci skip]

2 years agolowercase clang
Moritz Angermann [Thu, 6 Jul 2017 03:31:20 +0000 (11:31 +0800)] 
lowercase clang

2 years agomkDocs: Don't install *.ps
Ben Gamari [Wed, 5 Jul 2017 18:48:26 +0000 (14:48 -0400)] 
mkDocs: Don't install *.ps

We now longer produce PostScript output.

2 years agorts: Address AP_STACK comment suggestion from Simon
Ben Gamari [Tue, 4 Jul 2017 16:45:30 +0000 (12:45 -0400)] 
rts: Address AP_STACK comment suggestion from Simon

2 years agorts/sm/Storage.c: tweak __clear_cache proto for clang
Sergei Trofimovich [Wed, 5 Jul 2017 07:36:08 +0000 (08:36 +0100)] 
rts/sm/Storage.c: tweak __clear_cache proto for clang

clang defines '__clear_cache' slightly differently from gcc:
    rts/sm/Storage.c:1349:13: error:
         error: conflicting types for '__clear_cache'
         |
    1349 | extern void __clear_cache(char * begin, char * end);
         |             ^
    extern void __clear_cache(char * begin, char * end);
                ^
         note: '__clear_cache' is a builtin with type 'void (void *, void *)'

Reported by Moritz Angermann.

While at it used '__builtin___clear_cache' if advertised by clang.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2 years agoRevert "rts/sm/Storage.c: tweak __clear_cache proto for clang"
Sergei Trofimovich [Wed, 5 Jul 2017 08:13:09 +0000 (09:13 +0100)] 
Revert "rts/sm/Storage.c: tweak __clear_cache proto for clang"

This reverts commit 9492703a5862ee8623455209e50344cf8c4de077.

Incomplete patch (missing begin, end assignments).

2 years agorts/sm/Storage.c: tweak __clear_cache proto for clang
Sergei Trofimovich [Wed, 5 Jul 2017 07:36:08 +0000 (08:36 +0100)] 
rts/sm/Storage.c: tweak __clear_cache proto for clang

clang defines '__clear_cache' slightly differently from gcc:
    rts/sm/Storage.c:1349:13: error:
         error: conflicting types for '__clear_cache'
         |
    1349 | extern void __clear_cache(char * begin, char * end);
         |             ^
    extern void __clear_cache(char * begin, char * end);
                ^
         note: '__clear_cache' is a builtin with type 'void (void *, void *)'

Reported by Moritz Angermann.

While at it used '__builtin___clear_cache' if advertised by clang.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2 years agoEagerly blackhole AP_STACKs
Ben Gamari [Mon, 3 Jul 2017 23:10:07 +0000 (19:10 -0400)] 
Eagerly blackhole AP_STACKs

This fixes #13615. See the rather lengthy Note [AP_STACKs must be
eagerly blackholed] for details.

Reviewers: simonmar, austin, erikd, dfeuer

Subscribers: duog, dfeuer, hsyl20, rwbarton, thomie

GHC Trac Issues: #13615

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

2 years agotestsuite: Add testcase for #13615
Ben Gamari [Mon, 3 Jul 2017 23:09:58 +0000 (19:09 -0400)] 
testsuite: Add testcase for #13615

Reviewers: austin

Subscribers: dfeuer, rwbarton, thomie

GHC Trac Issues: #13615

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

2 years agoAdd -fuse-ld flag to CFLAGS during configure
Ben Gamari [Mon, 3 Jul 2017 23:09:39 +0000 (19:09 -0400)] 
Add -fuse-ld flag to CFLAGS during configure

The decisions made by configure later in the script may depend upon the
linker used. Consequently, it is important that configure uses the same
linker as GHC will eventually use.

For instance, on Nix I found that a program requiring `libpthread` would
link fine with only `-lrt` when linked with BFD ld. However, with gold
we needed to explicitly provide the `-lpthread` dependency. Presumably
the former would happily loaded any `NEEDED` libraries whereas the
latter wants them explicitly given. Regardless, since `configure`'s
`NEED_PTHREAD_LIB` check didn't use the `-fuse-ld` flag that GHC would
eventually use, we inferred the wrong value, resulting in link errors
later in the build.

Test Plan: Validate

Reviewers: austin, hvr

Subscribers: rwbarton, thomie, erikd

GHC Trac Issues: #13541

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

2 years agorts: Fix isByteArrayPinned#'s treatment of large arrays
Ben Gamari [Mon, 3 Jul 2017 23:09:03 +0000 (19:09 -0400)] 
rts: Fix isByteArrayPinned#'s treatment of large arrays

It should respond with True to both BF_PINNED and BF_LARGE byte arrays.
However, previously it would only check the BF_PINNED flag.

Test Plan: Validate

Reviewers: simonmar, austin, erikd

Subscribers: winterland1989, rwbarton, thomie

GHC Trac Issues: #13894

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

2 years agoconfigure: Remove --with-curses-includes flag
Ben Gamari [Mon, 3 Jul 2017 23:08:43 +0000 (19:08 -0400)] 
configure: Remove --with-curses-includes flag

terminfo no longer needs to be able to find the ncurses headers.
See https://github.com/judah/terminfo/pull/22.

Reviewers: austin, hvr

Subscribers: rwbarton, thomie, erikd

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

2 years agoApplicativeDo: document behaviour with strict patterns (#13875)
Simon Marlow [Mon, 3 Jul 2017 23:08:30 +0000 (19:08 -0400)] 
ApplicativeDo: document behaviour with strict patterns (#13875)

Test Plan: unit tests, built docs

Reviewers: dfeuer, bgamari, simonpj, austin, erikd

Subscribers: rwbarton, thomie

GHC Trac Issues: #13875, #13242

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

2 years agorts: Fix uninitialised variable uses
Ben Gamari [Mon, 3 Jul 2017 23:07:59 +0000 (19:07 -0400)] 
rts: Fix uninitialised variable uses

Strangely gcc 5.4 compiling on amd64 (nixos) complained about these.
Both warnings look correct, so I'm not sure why we haven't been seeing
these up until now.

Test Plan: Validate

Reviewers: simonmar, austin, erikd

Subscribers: rwbarton, thomie

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

2 years agoBump array submodule to v0.5.2.0
Ben Gamari [Mon, 3 Jul 2017 22:22:38 +0000 (18:22 -0400)] 
Bump array submodule to v0.5.2.0

2 years agoCmmParse: Emit source notes for assignments
Ben Gamari [Mon, 3 Jul 2017 21:15:23 +0000 (17:15 -0400)] 
CmmParse: Emit source notes for assignments

Currently the line information for bare source C-- is rather spartan. These add
notes for assignments, which tend to be useful to identify. Unfortunately, we
had to settle for approximate source locations as none of the parsers in
CmmParse return located things. However, I don't think it's worth changing this.

2 years agoFix -fno-code for modules that use -XQuasiQuotes
Douglas Wilson [Mon, 3 Jul 2017 20:54:29 +0000 (16:54 -0400)] 
Fix -fno-code for modules that use -XQuasiQuotes

In commit 53c78be0aab76a3107c4dacbb1d177afacdd37fa object code is
generated for modules depended on by modules that use -XTemplateHaskell.
This turns the same logic on for modules that use -XQuasiQuotes.

A test is added.

Note that I've based this of D3646, as it has a function I want to use.

Test Plan: ./validate

Reviewers: austin, bgamari, alexbiehl

Reviewed By: alexbiehl

Subscribers: alexbiehl, rwbarton, thomie

GHC Trac Issues: #13863

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

2 years agoFix #13311 by using tcSplitNestedSigmaTys in the right place
Ryan Scott [Mon, 3 Jul 2017 20:54:14 +0000 (16:54 -0400)] 
Fix #13311 by using tcSplitNestedSigmaTys in the right place

Previously, we we only using `tcSplitSigmaTy` when determining if a
function had been applied to too few arguments, so it wouldn't work for
functions with nested `forall`s. Thankfully, this is easily fixed with a
dash of `tcSplitNestedSigmaTys`.

Test Plan: make test TEST=T13311

Reviewers: austin, bgamari, simonpj

Reviewed By: bgamari

Subscribers: goldfire, simonpj, rwbarton, thomie

GHC Trac Issues: #13311

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

2 years agoTag the FUN before making a PAP (#13767)
Simon Marlow [Mon, 3 Jul 2017 20:54:00 +0000 (16:54 -0400)] 
Tag the FUN before making a PAP (#13767)

Pointers to FUNs are not guaranteed to be tagged in general, because
the compiler doesn't always know the arity of a FUN when it needs to
reference it, e.g. with -O0 when the function is in another module.

However, there's one case where we can put the correct tag on a FUN:
when it is referenced by a PAP, because when building the PAP we know
the arity and we can tag the pointer correctly.  The AutoApply code
does this, and the sanity checker checks it, but the interpreter did
not respect this invariant.  This patch fixes it.

Test Plan:
```
(cd ghc && make 2 GhcDebugged=YES)
./inplace/bin/ghc-stage2 --interpreter +RTS -DS
```

Reviewers: niteria, bgamari, austin, erikd

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #13767

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

2 years agoImplement recompilation checking for -fignore-asserts
Ömer Sinan Ağacan [Mon, 3 Jul 2017 20:53:31 +0000 (16:53 -0400)] 
Implement recompilation checking for -fignore-asserts

Test Plan: Added a test which was previously failing

Reviewers: austin, bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, thomie

GHC Trac Issues: #13914

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

2 years agoAllow per-argument documentation on pattern synonym signatures
alexbiehl [Mon, 3 Jul 2017 20:53:10 +0000 (16:53 -0400)] 
Allow per-argument documentation on pattern synonym signatures

haddock-2.18 supports user defined pattern synonym signatures so this
seems like a welcomed addition.

Reviewers: austin, bgamari, mpickering

Reviewed By: bgamari, mpickering

Subscribers: rwbarton, thomie, mpickering

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

2 years agousers-guide: Wibbles in shared libraries discussion
Ben Gamari [Fri, 30 Jun 2017 18:10:35 +0000 (14:10 -0400)] 
users-guide: Wibbles in shared libraries discussion

2 years agorename tcInstBinder(s)X to tcInstBinder(s)
Gabor Greif [Fri, 30 Jun 2017 12:49:03 +0000 (14:49 +0200)] 
rename tcInstBinder(s)X to tcInstBinder(s)

Summary: Simplify naming scheme of tcInstBinder(s)X

Test Plan: Eyeball and compile

Reviewers: austin, goldfire, bgamari

Subscribers: goldfire, rwbarton, thomie

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

2 years agoFix paper link in MVar docs [ci skip]
Ömer Sinan Ağacan [Sun, 2 Jul 2017 06:59:57 +0000 (09:59 +0300)] 
Fix paper link in MVar docs [ci skip]

2 years agoPrevent ApplicativeDo from applying to strict pattern matches (#13875)
Simon Marlow [Thu, 29 Jun 2017 23:39:45 +0000 (19:39 -0400)] 
Prevent ApplicativeDo from applying to strict pattern matches (#13875)

Test Plan:
* New unit tests
* validate

Reviewers: dfeuer, simonpj, niteria, bgamari, austin, erikd

Reviewed By: dfeuer

Subscribers: rwbarton, thomie

GHC Trac Issues: #13875

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

2 years agorts/RetainerProfile: Const-correctness fixes
Ben Gamari [Thu, 29 Jun 2017 23:39:28 +0000 (19:39 -0400)] 
rts/RetainerProfile: Const-correctness fixes

These were found while using Hadrian, which apparently uses slightly
stricter warning flags than the make-based build system.

Test Plan: Validate

Reviewers: austin, erikd, simonmar

Reviewed By: erikd

Subscribers: rwbarton, thomie

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

2 years agoconfigure: Coerce gcc to use $LD instead of system default
Ben Gamari [Thu, 29 Jun 2017 23:38:51 +0000 (19:38 -0400)] 
configure: Coerce gcc to use $LD instead of system default

The configure script will now try to coerce gcc to use the linker
pointed to by $LD instead of the system default (typically bfd ld).
Moreover, we now check for `ld.gold` and `ld.lld` before trying `ld`.

The previous behavior can be reverted to by using the new
--disable-ld-override flag.

On my machine gold seems to trigger an apparent infelicity in
constructor behavior, causing T5435_asm to fail. I've opened #13883 to
record this issue and have accepted the questionable constructor
ordering for the time being.

Test Plan: Validate with `config_args='--enable-ld-override'`

Reviewers: austin, hvr, simonmar

Subscribers: duog, nh2, rwbarton, thomie, erikd, snowleopard

GHC Trac Issues: #13541, #13810, #13883

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

2 years agoAllow optional instance keyword in associated type family instances
Tibor Erdesz [Thu, 29 Jun 2017 23:37:13 +0000 (19:37 -0400)] 
Allow optional instance keyword in associated type family instances

Add the missing branch for parsing the optional 'instance' keyword
in associated type family instance declarations.

Fixes #13747

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: simonpj, RyanGlScott, rwbarton, thomie, mpickering

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

2 years agoconfigure: Check for binutils #17166
Ben Gamari [Thu, 29 Jun 2017 23:37:03 +0000 (19:37 -0400)] 
configure: Check for binutils #17166

This bug affects bfd ld on ARMv7, causing ld to incorrectly emit
R_REL_COPY relocations, breaking tables-next-to-code. We've known about
it for several years now and there is not yet a fix upstream. Previously
we would simply force use of ld.gold on ARM. However, given the rework
of linking configuration, I thought a more principled solution was in
order.

Test Plan: Validate on armv7

Reviewers: austin, hvr

Subscribers: angerman, rwbarton, thomie, erikd

GHC Trac Issues: #4210

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

2 years agousers-guide: Document FFI safety guarantees
Ben Gamari [Thu, 29 Jun 2017 23:36:51 +0000 (19:36 -0400)] 
users-guide: Document FFI safety guarantees

Test Plan: Read it

Reviewers: austin

Subscribers: simonmar, rwbarton, thomie

GHC Trac Issues: #13730, #8281

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

2 years agoFix T13701 allocation for Linux
David Feuer [Thu, 29 Jun 2017 23:36:42 +0000 (19:36 -0400)] 
Fix T13701 allocation for Linux

For some reason, this test seems to allocate rather more under
Linux than under OSX or Windows.

Reviewers: austin, bgamari

Subscribers: rwbarton, thomie

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

2 years agoTypos in comments
Ryan Scott [Thu, 29 Jun 2017 18:00:03 +0000 (14:00 -0400)] 
Typos in comments

[ci skip]

2 years agoRevert "Remove the Windows GCC driver."
Simon Peyton Jones [Thu, 29 Jun 2017 14:34:39 +0000 (15:34 +0100)] 
Revert "Remove the Windows GCC driver."

This reverts commit d6cecde585b0980ed8e0050c5a1d315789fb6356.

The patch broke Simon PJ's Windows build, becuase he didn't
have (and should not need) a separate msys2 gcc.

Following an exchange on the ghc-devs list, Tamar wrote

  Oops, sorry, didn’t notice it because both mine and harbormaster’s
  msys2 have separate GCCs installed as well.

  I don’t see an easy fix that would also work for end user Configure
  based cabal installs. So I think I’ll have to go back to the drawing
  board for this one.

  You can just leave it reverted.

2 years agoFix lexically-scoped type variables
Simon Peyton Jones [Thu, 29 Jun 2017 14:26:54 +0000 (15:26 +0100)] 
Fix lexically-scoped type variables

Trac #13881 showed that our handling of lexically scoped type
variables was way off when we bring into scope a name 'y' for
a pre-existing type variable 'a', perhaps with an entirely
different name.

This patch fixes it; see TcHsType
  Note [Pattern signature binders]

2 years agoremove dead function 'tcInstBinders'
Gabor Greif [Thu, 29 Jun 2017 08:20:11 +0000 (10:20 +0200)] 
remove dead function 'tcInstBinders'

2 years agoRemove unneeded import
Gabor Greif [Wed, 28 Jun 2017 18:04:53 +0000 (20:04 +0200)] 
Remove unneeded import

This fails in stage 2 when bootstrapping HEAD with HEAD
due to -Werror.

Turns out that tcInstBinders is now dead, and I'll remove it if nobody
protests. I'd like to hear opinions whether
tcInstBindersX then should be renamed to tcInstBinders.

2 years agoMore typos in comments [ci skip]
Gabor Greif [Wed, 28 Jun 2017 15:15:23 +0000 (17:15 +0200)] 
More typos in comments [ci skip]

2 years agoTypos in comments and manual [ci skip]
Gabor Greif [Wed, 28 Jun 2017 14:40:45 +0000 (16:40 +0200)] 
Typos in comments and manual [ci skip]

2 years agoZap stable unfoldings in worker/wrapper
Simon Peyton Jones [Wed, 28 Jun 2017 13:45:40 +0000 (14:45 +0100)] 
Zap stable unfoldings in worker/wrapper

This patch fixes the buglet described in Trac #13890.

2 years agoFix constraint solving for forall-types
Simon Peyton Jones [Wed, 28 Jun 2017 11:38:59 +0000 (12:38 +0100)] 
Fix constraint solving for forall-types

Trac #13879 showed that when we were trying to solve

  (forall z1 (y1::z1). ty1)  ~  (forall z2 (y2:z2). ty2)

we'd end up spitting out z1~z2 with no binding site for them.
Those kind equalities need to be inside the implication.

I ended up re-factoring the code for solving forall-equalities.
It's quite nice now.

2 years agoDo zonking in tcLHsKindSig
Simon Peyton Jones [Wed, 28 Jun 2017 11:34:41 +0000 (12:34 +0100)] 
Do zonking in tcLHsKindSig

Trac #13879 showed that there was a missing zonk in tcLHsKind.

I also renamed it to tcLHsKindSig, for consistency with type signatures
There's a commment to explain why the zonk is needed.

2 years agoFix the in-scope set in TcHsType.instantiateTyN
Simon Peyton Jones [Wed, 28 Jun 2017 11:32:48 +0000 (12:32 +0100)] 
Fix the in-scope set in TcHsType.instantiateTyN

See Trac #13879

2 years agoRevert "Make module membership on ModuleGraph faster"
Ben Gamari [Tue, 27 Jun 2017 17:36:29 +0000 (13:36 -0400)] 
Revert "Make module membership on ModuleGraph faster"

I had not intended on merging this.

This reverts commit b0708588e87554899c2efc80a2d3eba353dbe926.

2 years agoMake module membership on ModuleGraph faster
Bartosz Nitka [Tue, 27 Jun 2017 16:55:17 +0000 (12:55 -0400)] 
Make module membership on ModuleGraph faster

When loading/reloading with a large number of modules
(>5000) the cost of linear lookups becomes significant.

The changes here made `:reload` go from 6s to 1s on my
test case.

The bottlenecks were `needsLinker` in `DriverPipeline` and
`getModLoop` in `GhcMake`.

Test Plan: ./validate

Reviewers: simonmar, austin, bgamari

Subscribers: rwbarton, thomie

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

2 years agoTreat banged bindings as FunBinds
Ben Gamari [Tue, 27 Jun 2017 14:30:20 +0000 (10:30 -0400)] 
Treat banged bindings as FunBinds

This is another attempt at resolving #13594 by treating strict variable
binds as FunBinds instead of PatBinds (as suggested in comment:1).

Test Plan: Validate

Reviewers: austin, alanz

Subscribers: rwbarton, thomie, mpickering

GHC Trac Issues: #13594

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

2 years agorts: Clarify whitehole logic in threadPaused
Ben Gamari [Tue, 27 Jun 2017 14:30:00 +0000 (10:30 -0400)] 
rts: Clarify whitehole logic in threadPaused

Previously we would look at the indirectee field of a WHITEHOLE object.
However, WHITEHOLE isn't a sort of indirection and therefore has no
indirectee field.

I encountered this while investigating #13615, although it doesn't fix
that bug.

Test Plan: Validate

Reviewers: simonmar, austin, erikd

Subscribers: rwbarton, thomie

GHC Trac Issues: #13615

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

2 years agotypecheck: Consider types containing coercions non-Typeable
Ben Gamari [Tue, 27 Jun 2017 14:29:33 +0000 (10:29 -0400)] 
typecheck: Consider types containing coercions non-Typeable

This was previously a panic and caused #13871. I believe just saying
these types simply aren't Typeable should be correct.

Test Plan: Validate, check `T13871`

Reviewers: goldfire, austin

Subscribers: rwbarton, thomie, RyanGlScott

GHC Trac Issues: #13871

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

2 years agotestsuite: Add broken test for #13871
Ben Gamari [Tue, 27 Jun 2017 14:29:23 +0000 (10:29 -0400)] 
testsuite: Add broken test for #13871

Test Plan: Validate

Reviewers: austin

Subscribers: rwbarton, thomie, RyanGlScott

GHC Trac Issues: #13871

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

2 years agoAllow bytecode interpreter to make unsafe foreign calls
Ben Gamari [Tue, 27 Jun 2017 14:26:01 +0000 (10:26 -0400)] 
Allow bytecode interpreter to make unsafe foreign calls

Reviewers: austin, hvr, erikd, simonmar

Reviewed By: simonmar

Subscribers: rwbarton, thomie

GHC Trac Issues: #8281, #13730.

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

2 years agoUpdate docs to reflect changes to DeriveDataTypeable
Chris Martin [Mon, 26 Jun 2017 18:55:15 +0000 (14:55 -0400)] 
Update docs to reflect changes to DeriveDataTypeable

2 years agobase/inputReady: Whitespace cleanup
Ben Gamari [Tue, 27 Jun 2017 14:22:49 +0000 (10:22 -0400)] 
base/inputReady: Whitespace cleanup

2 years agousers-guide/debug-info: Fix incorrect DWARF tags
Ben Gamari [Mon, 26 Jun 2017 20:27:34 +0000 (16:27 -0400)] 
users-guide/debug-info: Fix incorrect DWARF tags

Reviewers: austin

Subscribers: rwbarton, thomie, niteria

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

2 years agorts: Always collect stats
Ben Gamari [Mon, 26 Jun 2017 20:27:23 +0000 (16:27 -0400)] 
rts: Always collect stats

It seems that 12ad4d417b89462ba8e19a3c7772a931b3a93f0e enabled
collection by default as its needs stats.allocated_bytes to determine
whether the program has exceeded its grace limit.

However, enabling stats also enables some potentially expensive times
checks.  In general GC statistics should be cheap to compute (relative
to the GC itself), so now we always compute them. This allows us to once
again disable giveStats by default.

Fixes #13864.

Reviewers: simonmar, austin, erikd

Reviewed By: simonmar

Subscribers: rwbarton, thomie

GHC Trac Issues: #13864

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

2 years agoDWARF: Use .short to render half-machine-words
Ben Gamari [Mon, 26 Jun 2017 20:27:11 +0000 (16:27 -0400)] 
DWARF: Use .short to render half-machine-words

The binutils documentation states that .short is a synonym for .word,
which I assumed to mean "machine word", leading me to believe that we
needed to use .hword to render half-machine-words. However, Darwin's
toolchain doesn't understand .hword, so there we instead used .short.

However, as it turns out the binutils documentation confusingly uses
"word" to refer to a 16-bit word, so .short should work fine. Moreover,
LLVM's internal assembler also doesn't understand .hword, so using
.short consistently simplies things remarkably.

Test Plan: Validate using binutils and LLVM internal assembler,
validate on Darwin

Reviewers: niteria, austin

Reviewed By: niteria

Subscribers: rwbarton, thomie

GHC Trac Issues: #13866

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

2 years agousers guide: Rephrasing
Ben Gamari [Fri, 23 Jun 2017 20:34:49 +0000 (16:34 -0400)] 
users guide: Rephrasing

2 years agodocumentation: fix trac issue #12978
Tibor Erdesz [Fri, 23 Jun 2017 20:33:18 +0000 (16:33 -0400)] 
documentation: fix trac issue #12978

Add reference to TypeApplications to the AllowAmbiguousType section of
the user docs

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #12978

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

2 years agoHoopl: remove dependency on Hoopl package
Michal Terepeta [Fri, 23 Jun 2017 15:41:50 +0000 (11:41 -0400)] 
Hoopl: remove dependency on Hoopl package

This copies the subset of Hoopl's functionality needed by GHC to
`cmm/Hoopl` and removes the dependency on the Hoopl package.

The main motivation for this change is the confusing/noisy interface
between GHC and Hoopl:
- Hoopl has `Label` which is GHC's `BlockId` but different than
  GHC's `CLabel`
- Hoopl has `Unique` which is different than GHC's `Unique`
- Hoopl has `Unique{Map,Set}` which are different than GHC's
  `Uniq{FM,Set}`
- GHC has its own specialized copy of `Dataflow`, so `cmm/Hoopl` is
  needed just to filter the exposed functions (filter out some of the
  Hoopl's and add the GHC ones)
With this change, we'll be able to simplify this significantly.
It'll also be much easier to do invasive changes (Hoopl is a public
package on Hackage with users that depend on the current behavior)

This should introduce no changes in functionality - it merely
copies the relevant code.

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
Test Plan: ./validate

Reviewers: austin, bgamari, simonmar

Reviewed By: bgamari, simonmar

Subscribers: simonpj, kavon, rwbarton, thomie

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

2 years agoUse actual universal tvs in check for naughty record selectors
Matthew Pickering [Fri, 23 Jun 2017 15:40:50 +0000 (11:40 -0400)] 
Use actual universal tvs in check for naughty record selectors

The naughty record selector check means to limit selectors which would
lead to existential tyvars escaping their scope. With record pattern
synonyms, there are situations where universal tyvars don't appear in
the result type, for example:

```
pattern ReadP :: Read a => a -> String
pattern ReadP{readp} <- (read -> readp)
```

This is a similar issue to #11224 where we assumed that we can decide
which variables are universal and which are existential by the syntactic
check of seeing which appear in the result type. The fix is to use
`univ_tvs` from `conLikeFullSig` rather than the previous approximation.
But we must also remember to apply `EqSpec`s so we use the free
variables from `inst_tys` which is precisely `univ_tvs` with `EqSpecs`
applied.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

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

2 years agoFix pretty-printing of zero-argument lambda expressions
Ryan Scott [Fri, 23 Jun 2017 15:40:10 +0000 (11:40 -0400)] 
Fix pretty-printing of zero-argument lambda expressions

Using Template Haskell, one can construct lambda expressions with no
arguments. The pretty-printer isn't aware of this fact, however. This
changes that.

Test Plan: make test TEST=T13856

Reviewers: bgamari, austin, goldfire

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #13856

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

2 years agoAdd fixity declaration for Data.List.NonEmpty.!!
Ryan Scott [Fri, 23 Jun 2017 15:37:19 +0000 (11:37 -0400)] 
Add fixity declaration for Data.List.NonEmpty.!!

We have `infixl 9 !!` for `Data.List.!!`, but not for
`Data.List.NonEmpty.!!`. We ought to.

Test Plan: Read it

Reviewers: bgamari, austin, hvr

Reviewed By: bgamari

Subscribers: rwbarton, thomie

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

2 years agotestsuite: Fix cabal01 test
Ben Gamari [Fri, 23 Jun 2017 15:36:38 +0000 (11:36 -0400)] 
testsuite: Fix cabal01 test

The other-modules field listed things that weren't in fact modules,
causing this test to fail. See Cabal #4567.

Test Plan: Validate

Reviewers: hvr, austin

Subscribers: rwbarton, thomie

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

2 years agocompiler: Eliminate pprTrace in SPT entry addition codepath
Ben Gamari [Fri, 23 Jun 2017 15:35:48 +0000 (11:35 -0400)] 
compiler: Eliminate pprTrace in SPT entry addition codepath

Test Plan: Load program with StaticPointers into GHCi, ensure no
tracing output makes it in.

Reviewers: austin

Subscribers: rwbarton, thomie, RyanGlScott

GHC Trac Issues: #12356

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

2 years agoUNREG: use __builtin___clear_cache where available
Sergei Trofimovich [Wed, 21 Jun 2017 20:17:51 +0000 (21:17 +0100)] 
UNREG: use __builtin___clear_cache where available

Noticed when was building UNREG ghc with -optc{-Wall,-Werror}:

  rts/sm/Storage.c:1359:3: error:
     error: implicit declaration of function '__clear_cache'
       [-Werror=implicit-function-declaration]
       __clear_cache((void*)begin, (void*)end);
       ^~~~~~~~~~~~~
       |
  1359 |   __clear_cache((void*)begin, (void*)end);
       |   ^

Left direct '__clear_cache' usage gcc toolchain before 4.4.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2 years agoFix typo
5outh [Thu, 22 Jun 2017 14:29:53 +0000 (10:29 -0400)] 
Fix typo

2 years agoRevert "rts: Suppress unused gcc_clear_cache warning"
Ben Gamari [Wed, 21 Jun 2017 21:56:59 +0000 (17:56 -0400)] 
Revert "rts: Suppress unused gcc_clear_cache warning"

This reverts commit d1d3e98443cf263ef09253e2478e3e638e174e0d.

2 years agorts: Suppress unused gcc_clear_cache warning
Ben Gamari [Wed, 21 Jun 2017 20:57:07 +0000 (16:57 -0400)] 
rts: Suppress unused gcc_clear_cache warning

2 years agoRevert "UNREG: use __builtin___clear_cache where available"
Sergei Trofimovich [Wed, 21 Jun 2017 21:15:22 +0000 (22:15 +0100)] 
Revert "UNREG: use __builtin___clear_cache where available"

This reverts commit 6dd1257fdd4d18e84d32e89bf0ec664b3c8f7b93.

Change fails vaildation:
  rts/sm/Storage.c:1351:20: error:
     error: ‘gcc_clear_cache’ defined but not used [-Werror=unused-function]
     STATIC_INLINE void gcc_clear_cache(void * begin, void * end)

2 years agochange filtering of variables in extract_hs_tv_bndrs (fixes #13782)
Carlos Tomé [Tue, 20 Jun 2017 19:00:46 +0000 (15:00 -0400)] 
change filtering of variables in extract_hs_tv_bndrs (fixes #13782)

Reviewers: austin, bgamari, goldfire

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #13782

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

2 years agoShow only the number of modules in ghci
Francesco Mazzoli [Tue, 20 Jun 2017 19:00:20 +0000 (15:00 -0400)] 
Show only the number of modules in ghci

Reviewers: bgamari, austin, simonmar

Reviewed By: bgamari

Subscribers: mpickering, rwbarton, thomie

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

2 years agobase: Export Fingerprint accessors from Type.Reflection.Unsafe
Ben Gamari [Tue, 20 Jun 2017 18:59:40 +0000 (14:59 -0400)] 
base: Export Fingerprint accessors from Type.Reflection.Unsafe

Reviewers: dfeuer, austin, hvr

Reviewed By: dfeuer

Subscribers: rwbarton, thomie

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

2 years agoUNREG: use __builtin___clear_cache where available
Sergei Trofimovich [Wed, 21 Jun 2017 20:17:51 +0000 (21:17 +0100)] 
UNREG: use __builtin___clear_cache where available

Noticed when was building UNREG ghc with -optc{-Wall,-Werror}:

  rts/sm/Storage.c:1359:3: error:
     error: implicit declaration of function '__clear_cache'
       [-Werror=implicit-function-declaration]
       __clear_cache((void*)begin, (void*)end);
       ^~~~~~~~~~~~~
       |
  1359 |   __clear_cache((void*)begin, (void*)end);
       |   ^

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2 years agoFix note reference [ci skip]
Gabor Greif [Tue, 20 Jun 2017 10:00:30 +0000 (12:00 +0200)] 
Fix note reference [ci skip]

2 years agoImprove comments on AbsBinds
Simon Peyton Jones [Mon, 19 Jun 2017 10:50:37 +0000 (11:50 +0100)] 
Improve comments on AbsBinds

See Trac #13827.

2 years agoAdd missing -Wdeprecations flag to the users guide
erdeszt [Sat, 17 Jun 2017 11:47:10 +0000 (13:47 +0200)] 
Add missing -Wdeprecations flag to the users guide

2 years agoReword documentation region overlap documentation for copying mutable arrays
Andrew Martin [Sat, 17 Jun 2017 21:35:32 +0000 (17:35 -0400)] 
Reword documentation region overlap documentation for copying mutable arrays

2 years agocmm/CmmLayoutStack: avoid generating unnecessary reloads
Michal Terepeta [Sun, 18 Jun 2017 20:51:08 +0000 (16:51 -0400)] 
cmm/CmmLayoutStack: avoid generating unnecessary reloads

This tries to be more precise when generating reloads of local
registers in proc points. Previously we'd reload all local registers
that were live. But we used liveness information that assumed local
registers survive native calls. For the purpose of reloading registers
this is an overapproximation and might lead to generating huge amounts
of unnecessary reloads (in case there's another proc point before the
register is used).

This change takes the approach of moving the generation of reloads to
a second pass over the Cmm, which allows to recompute the liveness and
can use the knowledge that local registers do *not* survive calls.
This leads to generating only useful reloads. For an extreme example
where this helps a lot please see T3294. This should also fix #7198

Finally, this re-introduces the code to do Cmm rewriting using in
`Dataflow` module (with the difference that we know operate on a whole
block at a time).

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
Reviewers: austin, bgamari, simonmar

Reviewed By: simonmar

Subscribers: kavon, rwbarton, thomie

GHC Trac Issues: #7198

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

2 years agoconfigure: Look for objdump on OpenBSD and AIX
Ben Gamari [Sun, 18 Jun 2017 20:50:51 +0000 (16:50 -0400)] 
configure: Look for objdump on OpenBSD and AIX

deriveConstants requires objdump for both of these operating systems, in
addition to Windows. See #13812.

Test Plan: Validate on OpenBSD and AIX

Reviewers: hvr, austin

Reviewed By: hvr

Subscribers: rwbarton, thomie, erikd

GHC Trac Issues: #13812

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

2 years agoAdd test cases for #13821
Douglas Wilson [Sun, 18 Jun 2017 20:50:38 +0000 (16:50 -0400)] 
Add test cases for #13821

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #13821

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

2 years agoDon't expose fingerprints from Type.Reflection
David Feuer [Sun, 18 Jun 2017 20:50:25 +0000 (16:50 -0400)] 
Don't expose fingerprints from Type.Reflection

The `Fingerprint` type is not exported from any "public"
module. It therefore seems quite strange that `Type.Reflection`
exports functions for extracting fingerprints. Remove those
exports. If fingerprints are eventually considered public,
this can be reconsidered.

Reviewers: austin, hvr, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

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

2 years agoFix GCC 7 warning in the RTS
Sylvain Henry [Sun, 18 Jun 2017 20:50:09 +0000 (16:50 -0400)] 
Fix GCC 7 warning in the RTS

Test Plan: validate

Reviewers: austin, bgamari, erikd, simonmar

Reviewed By: bgamari, simonmar

Subscribers: rwbarton, thomie

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

2 years agoAdd T9630
David Feuer [Sun, 18 Jun 2017 20:49:14 +0000 (16:49 -0400)] 
Add T9630

This is not the most precise test, unfortunately, but it does
demonstrate a modest improvement in compiler residency as a
result of the specializer don't-loop patch. A rather less
realistic variation on this has somewhat more dramatic effects.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

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

2 years agoAdd fixity declaration for :~~:
Ryan Scott [Sun, 18 Jun 2017 20:49:02 +0000 (16:49 -0400)] 
Add fixity declaration for :~~:

We have one for `(:~:)`, but not for `(:~~:)`! Let's fix this
oversight.

Reviewers: bgamari, austin, hvr

Reviewed By: bgamari

Subscribers: rwbarton, thomie

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

2 years agotestsuite: Add testcase for #13822
Ben Gamari [Sun, 18 Jun 2017 20:48:31 +0000 (16:48 -0400)] 
testsuite: Add testcase for #13822

Reviewers: austin

Subscribers: rwbarton, thomie

GHC Trac Issues: #13822

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

2 years agorts: A bit of cleanup around the eventlog
Ben Gamari [Fri, 16 Jun 2017 19:41:18 +0000 (15:41 -0400)] 
rts: A bit of cleanup around the eventlog

2 years agorts: Ensure that new capability count is > 0
Ben Gamari [Fri, 16 Jun 2017 19:23:07 +0000 (15:23 -0400)] 
rts: Ensure that new capability count is > 0

The Haskell wrapper already checks this but we should also check it in the RTS
to catch non-Haskell callers. See #13832.

2 years agoTypofix in Data.Type.Equality comments
Ryan Scott [Sun, 18 Jun 2017 18:30:38 +0000 (14:30 -0400)] 
Typofix in Data.Type.Equality comments

2 years agoLook through type synonyms in existential contexts when deriving Functor
Ryan Scott [Sun, 18 Jun 2017 18:23:43 +0000 (14:23 -0400)] 
Look through type synonyms in existential contexts when deriving Functor

Summary:
This amounts to using `exactTyCoVarsOfType` instead of
`tyCoVarsOfType` in the right place. I also fixed a similar issue for
`-XDatatypeContexts` while I was in town (but couldn't be bothered to add a
test for it).

Test Plan: make test TEST=T13813

Reviewers: austin, bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, thomie

GHC Trac Issues: #13813

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

2 years agoFix out-of-date comments in TyCoRep
Ryan Scott [Sun, 18 Jun 2017 16:00:06 +0000 (12:00 -0400)] 
Fix out-of-date comments in TyCoRep

s/tyVarsOfType/tyCoFVsOfType/g