ghc.git
4 years agoghc allow --show-options and --interactive together wip/merge
Lennart Kolmodin [Fri, 21 Nov 2014 05:28:34 +0000 (23:28 -0600)] 
ghc allow --show-options and --interactive together

Summary:
Previously --show-options showed all options that GHC accepts.
Now, it'll only show the options that have effect in non-interactive
modes.
This change also adds support for using --interactive together with
--show-options, making it show all options that have effect in the interactive
mode.
The CmdLineParser is updated to know about ghc modes, and then each flag
is annotated with which mode it has effect.
This fixes #9259.

Test Plan:
Try out --show-options with --interactive on the command line. With and without
--interactive should give different results.

Reviewers: austin

Reviewed By: austin

Subscribers: jstolarek, thomie, carter, simonmar

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

GHC Trac Issues: #9259

Conflicts:
compiler/main/DynFlags.hs

4 years agoRevert change to alias handling in ppLlvmGlobal introduced in d87fa34, which requires...
Luke Iannini [Fri, 21 Nov 2014 05:10:57 +0000 (21:10 -0800)] 
Revert change to alias handling in ppLlvmGlobal introduced in d87fa34, which requires LLVM 3.6.

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoAST changes to prepare for API annotations, for #9628
Alan Zimmerman [Fri, 21 Nov 2014 04:55:09 +0000 (22:55 -0600)] 
AST changes to prepare for API annotations, for #9628

Summary:
AST changes to prepare for API annotations

Add locations to parts of the AST so that API annotations can
then be added.

The outline of the whole process is captured here
https://ghc.haskell.org/trac/ghc/wiki/GhcAstAnnotations

Test Plan: sh ./validate

Reviewers: austin, simonpj

Reviewed By: simonpj

Subscribers: thomie, goldfire, carter

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

GHC Trac Issues: #9628

Conflicts:
compiler/parser/RdrHsSyn.hs

4 years agoImplement #5462 (deriving clause for arbitrary classes)
Jose Pedro Magalhaes [Fri, 21 Nov 2014 04:41:28 +0000 (22:41 -0600)] 
Implement #5462 (deriving clause for arbitrary classes)

Summary: (this has been submitted on behalf on @dreixel)

Reviewers: simonpj, hvr, austin

Reviewed By: simonpj, austin

Subscribers: goldfire, thomie, carter, dreixel

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

GHC Trac Issues: #5462

4 years agoAdd flag `-fwarn-missing-exported-sigs`
Eric Seidel [Fri, 21 Nov 2014 04:39:32 +0000 (22:39 -0600)] 
Add flag `-fwarn-missing-exported-sigs`

Summary: add `-fwarn-missing-exported-sigs` to only warn about missing signatures if the name is exported

Test Plan: validate, see testsuite/tests/warnings/should_compile/T2526.hs

Reviewers: ezyang, austin, thomie

Reviewed By: austin, thomie

Subscribers: ezyang, thomie, carter

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

GHC Trac Issues: #2526

Conflicts:
docs/users_guide/7.10.1-notes.xml

4 years agoExport scanl' from Data.OldList and Data.List
David Feuer [Fri, 21 Nov 2014 04:38:57 +0000 (22:38 -0600)] 
Export scanl' from Data.OldList and Data.List

Summary: Fixes #9368

Reviewers: nomeata, hvr, ekmett, austin

Reviewed By: ekmett, austin

Subscribers: thomie, carter

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

GHC Trac Issues: #9368

4 years agoHide `Data.OldList` module
Herbert Valerio Riedel [Fri, 21 Nov 2014 04:21:06 +0000 (22:21 -0600)] 
Hide `Data.OldList` module

Summary:
The `Data.OldList` module was originally created in
3daf0023d2dcf7caf85d61f2dc177f8e9421b2fd to provide a way to access the
original list-specialised functions from `Data.List`. It was also made
an exposed module in order to facilitate adapting the
`haskell2010`/`haskell98` packages. However, since the
`haskell2010`/`haskell98` packages were dropped, we no longer need to
expose `Data.OldList`.

Depends on D511

Reviewers: ekmett, austin

Reviewed By: ekmett, austin

Subscribers: thomie, carter

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

4 years agoDelete old-{time,locale} and haskell{98,2010}
Austin Seipp [Thu, 20 Nov 2014 19:30:56 +0000 (13:30 -0600)] 
Delete old-{time,locale} and haskell{98,2010}

Summary:
Depends on D510. This is the final blow and removes them from
the tree completely.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Test Plan: I looked really hard but didn't see them.

Reviewers: hvr, ekmett

Subscribers: thomie, carter

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

GHC Trac Issues: #9590

4 years agoDon't build old-{time,locale} and haskell{98,2010}
Austin Seipp [Fri, 21 Nov 2014 03:29:04 +0000 (21:29 -0600)] 
Don't build old-{time,locale} and haskell{98,2010}

Summary:
As discussed on ghc-devs@haskell.org and the trac ticket, we're removing
these packages from the 7.10 release as they no longer work correctly,
and can't easily be made to properly follow the standard as `base`
changes over time.

This does not remove the packages from the tree, only the build system.

https://www.haskell.org/pipermail/ghc-devs/2014-November/007357.html

Signed-off-by: Austin Seipp <austin@well-typed.com>
Test Plan: iiam

Reviewers: hvr, ekmett

Reviewed By: hvr, ekmett

Subscribers: thomie, carter

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

GHC Trac Issues: #9590

4 years agoTest #9109 in typecheck/should_fail/T9109
Richard Eisenberg [Tue, 18 Nov 2014 20:19:20 +0000 (15:19 -0500)] 
Test #9109 in typecheck/should_fail/T9109

4 years agoUpdate manual to get rid of bogus `coerce` example (#9788)
Richard Eisenberg [Tue, 18 Nov 2014 19:22:30 +0000 (14:22 -0500)] 
Update manual to get rid of bogus `coerce` example (#9788)

4 years agoTest #9201 in typecheck/should_fail/T9201
Richard Eisenberg [Tue, 18 Nov 2014 18:19:42 +0000 (13:19 -0500)] 
Test #9201 in typecheck/should_fail/T9201

4 years agoTest #9318 in typecheck/should_fail/T9318
Richard Eisenberg [Tue, 18 Nov 2014 18:16:01 +0000 (13:16 -0500)] 
Test #9318 in typecheck/should_fail/T9318

4 years agoAdd release notes for #8100, #9527, and #9064.
Richard Eisenberg [Wed, 12 Nov 2014 20:13:34 +0000 (15:13 -0500)] 
Add release notes for #8100, #9527, and #9064.

4 years agoTest #9151 in typecheck/should_compile/T9151.
Richard Eisenberg [Wed, 12 Nov 2014 19:48:25 +0000 (14:48 -0500)] 
Test #9151 in typecheck/should_compile/T9151.

This test case should pass right now -- the bug is fixed,
presumably by #9200.

4 years agoFix #9220 by adding role annotations.
Richard Eisenberg [Fri, 7 Nov 2014 22:34:59 +0000 (17:34 -0500)] 
Fix #9220 by adding role annotations.

This includes a submodule update for `array`.
There is also an added test in libraries/array/tests/T9220.

4 years agoFix #9209, by reporting an error instead of panicking on bad splices.
Richard Eisenberg [Mon, 3 Nov 2014 18:49:59 +0000 (13:49 -0500)] 
Fix #9209, by reporting an error instead of panicking on bad splices.

4 years agoTest #9209 in th/T9209
Richard Eisenberg [Mon, 3 Nov 2014 18:46:58 +0000 (13:46 -0500)] 
Test #9209 in th/T9209

4 years agoKill trailing whitespace
Jan Stolarek [Thu, 20 Nov 2014 16:41:10 +0000 (17:41 +0100)] 
Kill trailing whitespace

4 years agoSplit SynTyCon to SynonymTyCon and FamilyTyCon
Jan Stolarek [Wed, 19 Nov 2014 21:03:05 +0000 (22:03 +0100)] 
Split SynTyCon to SynonymTyCon and FamilyTyCon

This patch refactors internal representation of type synonyms and type families by splitting them into two separate data constructors of TyCon data type. The main motivation is is that some fields make sense only for type synonyms and some make sense only for type families. This will be even more true with the upcoming injective type families.

There is also some refactoring of names to keep the naming constistent. And thus tc_kind field has become tyConKind and tc_roles has become tcRoles. Both changes are not visible from the outside of TyCon module.

Updates haddock submodule

Reviewers: simonpj

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

GHC Trac Issues: #9812

4 years agoImplement typechecker plugins
Adam Gundry [Thu, 20 Nov 2014 13:32:26 +0000 (13:32 +0000)] 
Implement typechecker plugins

Summary:
See https://ghc.haskell.org/trac/ghc/wiki/Plugins/TypeChecker

This is based on work by Iavor Diatchki and Eric Seidel.

Test Plan: validate

Reviewers: simonpj, austin

Reviewed By: austin

Subscribers: gridaphobe, yav, thomie, carter

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

Conflicts:
docs/users_guide/7.10.1-notes.xml

4 years agoAdd support for pattern synonym type signatures.
Dr. ERDI Gergo [Thu, 20 Nov 2014 14:38:11 +0000 (22:38 +0800)] 
Add support for pattern synonym type signatures.
Syntax is of the form

    pattern P :: (Prov b) => (Req a) => a -> b -> Int -> T a

which declares a pattern synonym called `P`, with argument types `a`, `b`,
and `Int`, and result type `T a`, with provided context `(Prov b)` and required
context `(Req a)`.

The Haddock submodule is also updated to use this new syntax in generated docs.

4 years agoUpdate shift/reduce conflict number in parser
Dr. ERDI Gergo [Thu, 20 Nov 2014 10:21:30 +0000 (18:21 +0800)] 
Update shift/reduce conflict number in parser

4 years agoMake Data.Functor.Identity trustworthy again
Herbert Valerio Riedel [Thu, 20 Nov 2014 08:53:46 +0000 (09:53 +0100)] 
Make Data.Functor.Identity trustworthy again

Alas `{-# LANGUAGE Safe #-}` can't be used since `Data.Coerce` isn't "safe".
However, we use `coerce` just as an optimisation
(see also 4ba884bdd3a9521ea92fcda8f601a7d0f3537bc1 which broke the
safe-inferred status of `Data.Functor.Identity`), so this module at least
deserves `{-# LANGUAGE Trustworthy #-}`.

NOTE: `Data.Functor.Identity` was added to `base` in the context of #9664

Reviewed By: luite

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

4 years agoMake calling conventions in template haskell Syntax.hs consistent with those in ghc...
Luite Stegeman [Thu, 20 Nov 2014 00:38:58 +0000 (18:38 -0600)] 
Make calling conventions in template haskell Syntax.hs consistent with those in ghc ForeignCall.hs
this impliments #9703 from ghc trac

Test Plan: still needs tests

Reviewers: cmsaperstein, ekmett, goldfire, austin

Reviewed By: goldfire, austin

Subscribers: goldfire, thomie, carter, simonmar

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

GHC Trac Issues: #9703

4 years agoghc generates more user-friendly error messages
Mike Izbicki [Thu, 20 Nov 2014 00:29:37 +0000 (18:29 -0600)] 
ghc generates more user-friendly error messages

Test Plan: Compiled ghc fine.  Opened ghci and fed it invalid code.  It gave the improved error messages in response.

Reviewers: austin

Subscribers: thomie, simonpj, spacekitteh, rwbarton, simonmar, carter

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

4 years agoarm64: 64bit iOS and SMP support (#7942)
Luke Iannini [Wed, 19 Nov 2014 23:23:35 +0000 (17:23 -0600)] 
arm64: 64bit iOS and SMP support (#7942)

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agocompiler/main: fixes #9776
Carlos Tomé [Wed, 19 Nov 2014 23:07:53 +0000 (17:07 -0600)] 
compiler/main: fixes #9776

Test Plan: test T9776 under tests/driver

Reviewers: jstolarek, austin

Reviewed By: jstolarek, austin

Subscribers: jstolarek, thomie, carter

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

GHC Trac Issues: #9776

4 years agouse correct word size for shiftRightLogical and removeOp32
Luite Stegeman [Wed, 19 Nov 2014 23:00:49 +0000 (17:00 -0600)] 
use correct word size for shiftRightLogical and removeOp32

Summary:
shiftRightLogical used a host sized Word for the intermediate value,
which would produce the wrong result when cross compiling to a target
with a different word size than the host.

removeOp32 used the preprocessor to bake in word size assumptions,
rather than getting the target word size from DynFlags

Test Plan: validate

Reviewers: hvr, rwbarton, carter, austin

Reviewed By: austin

Subscribers: thomie, carter

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

GHC Trac Issues: #9736

4 years agomake TcRnMonad.lhs respect -ddump-to-file
Greg Weber [Wed, 19 Nov 2014 22:43:26 +0000 (16:43 -0600)] 
make TcRnMonad.lhs respect -ddump-to-file

Summary: allows things such as: -ddump-to-file -ddump-splices

Test Plan:
compile with flags -ddump-to-file -ddump-splices
verify that it does output an extra file

Try out other flags.
I noticed that with -ddump-tc there is some output going to file and some to stdout.

Reviewers: hvr, austin

Reviewed By: austin

Subscribers: simonpj, thomie, carter

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

GHC Trac Issues: #9126

4 years agoAllow -dead_strip linking on platforms with .subsections_via_symbols
Moritz Angermann [Wed, 19 Nov 2014 22:38:22 +0000 (16:38 -0600)] 
Allow -dead_strip linking on platforms with .subsections_via_symbols

Summary:
This allows to link objects produced with the llvm code generator to be linked with -dead_strip. This applies to at least the iOS cross compiler and OS X compiler.

Signed-off-by: Moritz Angermann <moritz@lichtzwerge.de>
Test Plan: Create a ffi library and link it with -dead_strip. If the resulting binary does not crash, the patch works as advertised.

Reviewers: rwbarton, simonmar, hvr, dterei, mzero, ezyang, austin

Reviewed By: dterei, ezyang, austin

Subscribers: thomie, mzero, simonmar, ezyang, carter

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

4 years agoOnly test for bug #9439 when llvm is installed
Thomas Miedema [Wed, 19 Nov 2014 04:23:27 +0000 (22:23 -0600)] 
Only test for bug #9439 when llvm is installed

Reviewers: bgamari, austin

Reviewed By: austin

Subscribers: thomie, carter

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

GHC Trac Issues: #9807

4 years agoadd missing instances for Loc and a few missing Eq instances
Luite Stegeman [Wed, 19 Nov 2014 04:21:44 +0000 (22:21 -0600)] 
add missing instances for Loc and a few missing Eq instances

Summary: This adds a few missing instances that can be automatically derived

Reviewers: hvr, goldfire, austin

Reviewed By: goldfire, austin

Subscribers: thomie, carter

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

4 years agotemplate-haskell: Missing instances for Rational and ().
Mathieu Boespflug [Wed, 19 Nov 2014 04:21:15 +0000 (22:21 -0600)] 
template-haskell: Missing instances for Rational and ().

Test Plan: ./validate

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

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

4 years agoFilter input to abiHash early
Mateusz Kowalczyk [Wed, 19 Nov 2014 04:21:03 +0000 (22:21 -0600)] 
Filter input to abiHash early

Summary:
This is already done near the only call site so why not. It is ugly to
see it at 'abiHash' itself.

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

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

4 years agoAdd remaining <unknown>s and comments to .mailmap
Thomas Miedema [Wed, 19 Nov 2014 04:20:14 +0000 (22:20 -0600)] 
Add remaining <unknown>s and comments to .mailmap

Summary:
All done, except for these 2 empty commits:

$ git log --author=unknown --use-mailmap --oneline
7e5c2b2 [project @ 2001-12-06 10:17:35 by mbs] Established under cvs.
6456598 [project @ 2000-12-01 10:33:41 by cryder] Initial revision

Reviewers: hvr, austin

Reviewed By: austin

Subscribers: thomie, carter

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

4 years agoTurn CoreWriter into a newtype; fix comment
David Feuer [Wed, 19 Nov 2014 04:19:46 +0000 (22:19 -0600)] 
Turn CoreWriter into a newtype; fix comment

Summary:
Turn CoreWriter into a newtype. A comment claimed something is forced
before returning, but it's actually not. Change comment to match
reality.

Reviewers: xich, simonpj, ezyang, austin

Reviewed By: ezyang, austin

Subscribers: thomie, carter

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

4 years agoImplement new Foldable methods for HsPatSynDetails
David Feuer [Wed, 19 Nov 2014 04:18:57 +0000 (22:18 -0600)] 
Implement new Foldable methods for HsPatSynDetails

Summary: Also explicitly define foldl1 and foldr1, which should generally work better with list-specific versions.

Reviewers: austin

Reviewed By: austin

Subscribers: rwbarton, thomie, carter

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

4 years agoUpdate documentation for "Batch compiler mode"
Thomas Miedema [Wed, 19 Nov 2014 04:18:43 +0000 (22:18 -0600)] 
Update documentation for "Batch compiler mode"

Summary:
Since commit 7828bf3ea2ea34e7a3a8662f5f621ef706ffee5c
* --make is the default
* -c is a mode flag, except when used in combination with --make

Also:
* -C (generate C code) is only available in unregisterised mode.

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

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

4 years agoRefactor: use System.FilePath.splitSearchPath
Thomas Miedema [Wed, 19 Nov 2014 04:17:47 +0000 (22:17 -0600)] 
Refactor: use System.FilePath.splitSearchPath

Summary:
To address #2521 ("Trailing colon on GHC_PACKAGE_PATH doesn't work with
ghc-pkg"), we were using a custom version of splitSearchPath (e4f46f5de). This
solution however caused issue #9698 ("GHC_PACKAGE_PATH should be more lenient
for empty paths").

This patch reverts back to System.FilePath.splitSearchPath (fixes #9698) and
adresses (#2521) by testing for a trailing search path separators explicitly
(instead of implicitly using empty search path elements).

Empty paths are now allowed (ignored on Windows, interpreted as current
directory on Posix systems), and trailing path separator still tack on the
user and system package databases.

Also update submodule filepath, which has a version of splitSearchPath which
handles quotes in the same way as our custom version did.

Test Plan:
$ GHC_PACKAGE_PATH=/::/home: ./ghc-pkg list
...
db stack: ["/",".","/home","<userdb>","<systemdb>"]
...

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter, simonmar

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

GHC Trac Issues: #2521, #9698

4 years agoThe test runner now also works under the msys-native Python.
Gintautas Miliauskas [Mon, 22 Sep 2014 21:10:56 +0000 (23:10 +0200)] 
The test runner now also works under the msys-native Python.

Msys binaries apply heuristics to escape paths in arguments intended for
non-msys binaries, which breaks timeout invocations, see #9626.

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agorts: remove old-style field designator extension (#9396)
Austin Seipp [Wed, 19 Nov 2014 03:21:47 +0000 (21:21 -0600)] 
rts: remove old-style field designator extension (#9396)

Authored-by: jrp
Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoOptimise `Identity` instances with `coerce`
Herbert Valerio Riedel [Wed, 19 Nov 2014 10:44:37 +0000 (11:44 +0100)] 
Optimise `Identity` instances with `coerce`

This also overrides all optional `Foldable` methods
(which would otherwise be default-implemented in terms of `foldMap`)
with supposedly optimally minimal implementations.

While at it, this also removes the redundant `{-# LANGUAGE CPP #-}`.

Reviewed By: austin, dfeuer

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

4 years agoRestore exact old semantics of `decodeFloat`
Herbert Valerio Riedel [Wed, 19 Nov 2014 10:09:33 +0000 (11:09 +0100)] 
Restore exact old semantics of `decodeFloat`

`integer-gmp2` uses the new 64bit-based IEEE deconstructing primop
introduced in b62bd5ecf3be421778e4835010b6b334e95c5a56.

However, the returned values differ for exceptional IEEE values:

Previous (expected) semantics:

  > decodeFloat (-1/0)
  (-4503599627370496,972)

  > decodeFloat (1/0)
  (4503599627370496,972)

  > decodeFloat (0/0)
  (-6755399441055744,972)

Currently (broken) semantics:

  > decodeFloat (-1/0 :: Double)
  (-9223372036854775808,-53)

  > decodeFloat (1/0 :: Double)
  (-9223372036854775808,-53)

  > decodeFloat (0/0 :: Double)
  (-9223372036854775808,-53)

This patch reverts to the old expected semantics.

I plan to revisit the implementation during GHC 7.11 development.

This should address #9810

Reviewed By: austin, ekmett, luite

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

4 years agoReimplement im/export primitives for integer-gmp2
Herbert Valerio Riedel [Tue, 18 Nov 2014 15:52:02 +0000 (16:52 +0100)] 
Reimplement im/export primitives for integer-gmp2

The import/export operations were available in `integer-gmp-0.5.1`
already, but need to be reimplemented from scratch for the
`integer-gmp-1.0.0` rewrite.

This also adds a few more operations than were previously available for
use w/ the `BigNat` type (which will be useful for implementing
serialisation for the upcoming `Natural` type)

Specifically, the following operations are (re)added (albeit with
slightly different type-signatures):

 - `sizeInBaseBigNat`
 - `sizeInBaseInteger`
 - `sizeInBaseWord#`

 - `exportBigNatToAddr`
 - `exportIntegerToAddr`
 - `exportWordToAddr`
 - `exportBigNatToMutableByteArray`
 - `exportIntegerToMutableByteArray`
 - `exportWordToMutableByteArray`

 - `importBigNatFromAddr`
 - `importIntegerFromAddr`
 - `importBigNatFromByteArray`
 - `importIntegerFromByteArray`

NOTE: The `integerGmpInternals` test-case is updated but not yet
      re-enabled as it contains tests for other primitives which aren't
      yet reimplemented.

This addresses #9281

Reviewed By: austin, duncan

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

4 years agoSupport for "with" renaming syntax, and output a feature flag.
Edward Z. Yang [Mon, 11 Aug 2014 17:40:13 +0000 (18:40 +0100)] 
Support for "with" renaming syntax, and output a feature flag.

Summary:
- Feature flag indicates to Cabal that we support thinning and renaming as
  it needs.

- Support -package "base with (Foo as Bar)" which brings the ordinary
  modules into scope, as well as adding the renamings to scope.

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

Reviewers: simonpj, austin

Subscribers: thomie, carter

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

4 years agoWhen outputting list of available instances, sort it.
Edward Z. Yang [Tue, 11 Nov 2014 00:25:58 +0000 (16:25 -0800)] 
When outputting list of available instances, sort it.

Summary:
The intent of this commit is to make test suite cases more stable, so that
it doesn't matter what order we load interface files in, the test output
doesn't change.

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

Reviewers: simonpj, austin

Subscribers: thomie, carter

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

4 years agoComments only
Simon Peyton Jones [Tue, 18 Nov 2014 22:27:01 +0000 (22:27 +0000)] 
Comments only

4 years agoRevert "base: Fix (**) instance for Data.Complex (#8539)"
Austin Seipp [Tue, 18 Nov 2014 19:12:12 +0000 (13:12 -0600)] 
Revert "base: Fix (**) instance for Data.Complex (#8539)"

This broke validate due to name shadowing warnings.

This reverts commit 1f6b1ab4b6d7203481bfaf374b014972f7756fb2.

4 years agoFix detection of GNU gold linker if invoked via gcc with parameters
Sebastian Dröge [Tue, 18 Nov 2014 18:40:20 +0000 (12:40 -0600)] 
Fix detection of GNU gold linker if invoked via gcc with parameters

Previously the linker was called without any commandline parameters to
detect whether bfd or gold is used. However the -fuse-ld parameter can
be used to switch between gold and bfd and should be taken into account
here.

Trac #9336

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoDisable AVX for LLVM 3.2 by default (#9391)
Peter Wortmann [Tue, 18 Nov 2014 18:33:05 +0000 (12:33 -0600)] 
Disable AVX for LLVM 3.2 by default (#9391)

Due to a bug LLVM generates a C-like frame pointer prelude for functions
that use AVX instructions. This causes programs using the GHC calling
convention to crash, therefore we simply disable them. People that want
to use AVX should consider upgrading to a more current LLVM version.

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agomapMaybe: Typo in the comment (#9644)
Wieland Hoffmann [Sun, 28 Sep 2014 17:22:37 +0000 (19:22 +0200)] 
mapMaybe: Typo in the comment (#9644)

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoFix usage of `find -perm` in aclocal.m4 (#9697)
Nicholas Hart [Tue, 18 Nov 2014 18:21:03 +0000 (12:21 -0600)] 
Fix usage of `find -perm` in aclocal.m4 (#9697)

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoUpdate comment about C helper for foreign exports (#9713)
Bertram Felgenhauer [Tue, 18 Nov 2014 18:15:33 +0000 (12:15 -0600)] 
Update comment about C helper for foreign exports (#9713)

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agobase: Fix (**) instance for Data.Complex (#8539)
Austin Seipp [Tue, 18 Nov 2014 18:10:34 +0000 (12:10 -0600)] 
base: Fix (**) instance for Data.Complex (#8539)

Reviewed-by: Edward Kmett <ekmett@gmail.com>
Authored-by: Yalas, Scott Turner
Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoAdd missing semicolon in Schedule.c
Simon Peyton Jones [Tue, 18 Nov 2014 17:07:41 +0000 (17:07 +0000)] 
Add missing semicolon in Schedule.c

I think this went wrong in 2a6f193b

4 years agoOutputable instance for IfaceVectInfo
Mateusz Kowalczyk [Tue, 18 Nov 2014 16:58:56 +0000 (16:58 +0000)] 
Outputable instance for IfaceVectInfo

4 years agoWhitespace only
Mateusz Kowalczyk [Tue, 18 Nov 2014 16:58:45 +0000 (16:58 +0000)] 
Whitespace only

4 years agoFix ffi023
Simon Marlow [Tue, 18 Nov 2014 15:40:45 +0000 (15:40 +0000)] 
Fix ffi023

4 years agoBuild xhtml and haddock only when `HADDOCK_DOCS=YES`
Joachim Breitner [Tue, 18 Nov 2014 09:44:23 +0000 (10:44 +0100)] 
Build xhtml and haddock only when `HADDOCK_DOCS=YES`

This fixes #8558

4 years agoAdd a note why tcGetInstEnvs is duplicated.
Edward Z. Yang [Thu, 6 Nov 2014 04:57:03 +0000 (20:57 -0800)] 
Add a note why tcGetInstEnvs is duplicated.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoRemove optimized package lookup, simplifying code.
Edward Z. Yang [Sat, 15 Nov 2014 09:43:42 +0000 (01:43 -0800)] 
Remove optimized package lookup, simplifying code.

Summary:
A while back when I was refactoring the package code, I tried to solve
a performance problem by introducing a fastpath for module lookups.  Well,
it turned out the performance problem was unrelated, but I kept the optimization
because it seemed vaguely useful.

In this commit, I remove the optimization because I don't really think it's
buying us much and it increased code complexity.

ToDo: Inline mkModuleToPkgConfGeneric into mkModuleToPkgConfAll

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

Reviewers: simonpj, austin

Reviewed By: austin

Subscribers: thomie, carter

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

4 years agoChange a comment referring falsely to seq
David Feuer [Tue, 18 Nov 2014 01:19:18 +0000 (19:19 -0600)] 
Change a comment referring falsely to seq

Summary: Instead, describe what it actually does.

Reviewers: austin, ekmett, simonpj, hvr

Reviewed By: austin, ekmett

Subscribers: simonpj, thomie, carter

Projects: #ghc

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

4 years agoAdding dedicated Show instances for SrcSpan/SrcLoc
Alan Zimmerman [Tue, 18 Nov 2014 01:19:10 +0000 (19:19 -0600)] 
Adding dedicated Show instances for SrcSpan/SrcLoc

Summary:
The derived Show instances for SrcSpan and SrcLoc are very verbose.

This patch replaces them with hand-made ones which use positional
syntax for the record constructors, rather than exhaustively listing
each one.

Test Plan: sh ./validate

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

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

4 years agoDocs only
Edward Z. Yang [Tue, 18 Nov 2014 01:19:00 +0000 (19:19 -0600)] 
Docs only

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

Test Plan: n/a

Reviewers: austin, Mikolaj

Reviewed By: austin, Mikolaj

Subscribers: thomie, carter

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

4 years agoMake listArray fuse
David Feuer [Tue, 18 Nov 2014 01:16:16 +0000 (19:16 -0600)] 
Make listArray fuse

Summary: Make listArray fuse with a list producer. Note: if code size increases too much, we can fix that with some `RULES`.

Reviewers: nomeata, hvr, austin, ekmett, simonmar, bgamari

Reviewed By: bgamari

Subscribers: bgamari, thomie, carter

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

GHC Trac Issues: #9801

4 years agoRemove outdated TODO in TimeManager
Yuras Shumovich [Tue, 18 Nov 2014 01:16:08 +0000 (19:16 -0600)] 
Remove outdated TODO in TimeManager

Summary:
It describes a work around Trac #3838, but it is already fixed and the
workaround removed, Trac #7653

Test Plan: not needed

Reviewers: hvr, Mikolaj, austin

Reviewed By: austin

Subscribers: thomie, carter

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

4 years agoDon't use absolute paths for perl in validate
Mateusz Kowalczyk [Tue, 18 Nov 2014 01:15:59 +0000 (19:15 -0600)] 
Don't use absolute paths for perl in validate

Summary: This will *not* work on NixOS for example.

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

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

GHC Trac Issues: #9057

4 years agodocument addDependentFile uses contents, not mtime
Greg Weber [Tue, 18 Nov 2014 01:15:51 +0000 (19:15 -0600)] 
document addDependentFile uses contents, not mtime

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter

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

GHC Trac Issues: #4900

4 years agoFix a bug introduced with allocation counters
Simon Marlow [Mon, 17 Nov 2014 13:03:56 +0000 (13:03 +0000)] 
Fix a bug introduced with allocation counters

4 years agoUpdate validate settings now that containers and process have been
David Terei [Mon, 17 Nov 2014 02:29:58 +0000 (18:29 -0800)] 
Update validate settings now that containers and process have been
updated to handle `-fwarn-trustworthy-safe`.

4 years agoFix compilation of `integer-gmp2` with `-O0`
Herbert Valerio Riedel [Sat, 15 Nov 2014 17:05:58 +0000 (18:05 +0100)] 
Fix compilation of `integer-gmp2` with `-O0`

At optimization level `-O0` `wordToInteger` wasn't inlined, and this caused a
`__integer` literal to turn up in final Core, which would trigger the GHC panic

  ghc-stage1: panic! (the 'impossible' happened)
    (GHC version 7.9.20141114 for x86_64-unknown-linux):
Can't use Integer in integer-*

By forcing inlining via `inline` this is avoided.
This should hopefully address #9800.

4 years agoUpdate to (unreleased) `deepseq-1.4.0.0`
Herbert Valerio Riedel [Sat, 15 Nov 2014 11:16:38 +0000 (12:16 +0100)] 
Update to (unreleased) `deepseq-1.4.0.0`

This pulls in the new `Generic`-based `-XDefaultSignature`-based default
implementation for `rnf`[1], and will be interesting to use in combination
with the soon to be merged `-XDeriveAnyClass` extension.

This requires updating several other submodules as well in order
to relax the upper bound on `deepseq` and/or in a few cases to
avoid relying on the default method implementation of `rnf`:

 - `Cabal`
 - `bytestring`
 - `containers`
 - `parallel`
 - `process`
 - `time`

 [1]: http://permalink.gmane.org/gmane.comp.lang.haskell.libraries/23031

4 years agoWorkaround 452d6aa95b7 breaking TrustworthySafe03
Herbert Valerio Riedel [Sat, 15 Nov 2014 10:18:12 +0000 (11:18 +0100)] 
Workaround 452d6aa95b7 breaking TrustworthySafe03

This is only a temporary kludge until the issue workarounded by 452d6aa95b7
gets properly fixed

4 years agoGeneralize exposed-modules field in installed package database
Edward Z. Yang [Sat, 15 Nov 2014 08:08:53 +0000 (00:08 -0800)] 
Generalize exposed-modules field in installed package database

Summary:
Instead of recording exposed-modules and reexported-modules as seperate
fields in the installed package database, this commit merges them into
a single field (exposed-modules).  The motivation for this change is
in preparation for the inclusion of *signatures* into the installed
package database, which may also be reexported.  Merging the representation
means that we can treat reexports uniformly, no matter if they're a normal
module or a signature.

This commit adds a stub for signatures, but that code isn't wired up to
anything yet.

Contains Cabal submodule update to accommodate these changes.

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

Reviewers: simonpj, duncan, austin

Subscribers: thomie, carter, simonmar

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

4 years agoPartially revert 475dd93efa
Austin Seipp [Fri, 14 Nov 2014 17:51:31 +0000 (11:51 -0600)] 
Partially revert 475dd93efa

This introduces ./validate failures for Windows right now, so in the
mean time let's just back this flag out as a default -Wall flag.

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoUpdate .mailmap
Thomas Miedema [Sat, 8 Nov 2014 12:44:57 +0000 (13:44 +0100)] 
Update .mailmap

[skip ci]

4 years agoImplement amap/coerce for Array (re #9796)
David Feuer [Thu, 13 Nov 2014 20:12:05 +0000 (21:12 +0100)] 
Implement amap/coerce for Array (re #9796)

Implement an `amap`/`coerce` rule in `GHC.Arr` to match the
`map`/`coerce` rule in GHC.Base.

In order to do so, delay inlining `amap` until phase 1.

To prevent the inlining delay from causing major inefficiencies due to
missed list fusion, rewrite `amap` to avoid relying on list fusion. This
has the extra benefit of reducing the size of the compiled amap code by
skipping the impossible case of an array with a negative size.

Reviewed By: nomeata

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

4 years agoWhen calling the success continuation of a matcher, pass existential tyvars
Dr. ERDI Gergo [Thu, 13 Nov 2014 09:47:18 +0000 (17:47 +0800)] 
When calling the success continuation of a matcher, pass existential tyvars
as type arguments, not value arguments

4 years agonlHsTyApps: for applying a function both on type- and term-level arguments
Dr. ERDI Gergo [Fri, 7 Nov 2014 14:49:52 +0000 (22:49 +0800)] 
nlHsTyApps: for applying a function both on type- and term-level arguments

4 years agoApply compulsory unfoldings during desugaring, except for `seq` which is special.
Dr. ERDI Gergo [Wed, 12 Nov 2014 10:18:09 +0000 (18:18 +0800)] 
Apply compulsory unfoldings during desugaring, except for `seq` which is special.
See Note [Unfolding while desugaring] for the rationale.

4 years agoIf pattern synonym is bidirectional and its type is some unboxed type T#,
Dr. ERDI Gergo [Sat, 8 Nov 2014 10:38:12 +0000 (18:38 +0800)] 
If pattern synonym is bidirectional and its type is some unboxed type T#,
generate a worker function of type Void# -> T#, and redirect the wrapper
(via a compulsory unfolding) to the worker. Fixes #9732.

4 years agoBinding things matched by an unboxed pattern synonym should require a bang
Dr. ERDI Gergo [Sat, 8 Nov 2014 08:59:47 +0000 (16:59 +0800)] 
Binding things matched by an unboxed pattern synonym should require a bang

4 years agoFix typo in panic message
Dr. ERDI Gergo [Thu, 6 Nov 2014 11:38:40 +0000 (19:38 +0800)] 
Fix typo in panic message

4 years agoFix `integer-gmp2` compilation with GMP 4.x (#9281)
Herbert Valerio Riedel [Thu, 13 Nov 2014 09:49:43 +0000 (10:49 +0100)] 
Fix `integer-gmp2` compilation with GMP 4.x (#9281)

GMP 4.x didn't provide the `mp_bitcnt_t` typedef yet, so we locally
define one if GMP 4.x is detected.

4 years agoImprove `Foldable` instance for `Array`
David Feuer [Thu, 13 Nov 2014 08:10:57 +0000 (09:10 +0100)] 
Improve `Foldable` instance for `Array`

Previously, `Array`s were simply converted to lists, and the list
methods used. That works acceptably well for `foldr` and `foldr1`, but
not so sensibly for most other things. Left folds ended up "twisted" the
way they are for lists, leading to surprising performance
characteristics.

Moreover, this implements `length` and `null` so they check the array
size directly.

Finally, a test is added to the testsuite ensuring the overridden
`Foldable` methods agree with their expected default semantics.

Addresses #9763

Reviewed By: hvr, austin

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

4 years agobase: define `sequence = mapM id`
David Feuer [Thu, 13 Nov 2014 08:05:22 +0000 (09:05 +0100)] 
base: define `sequence = mapM id`

This avoids duplication in `GHC.Base`; originally, we had

  mapM f = sequence . map f

This led to excessive allocation in `cryptarithm2`. Defining

  sequence = mapM id

does not appear to cause any `nofib` problems.

Reviewed By: hvr

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

4 years agoMake unwords and words fuse somewhat
David Feuer [Thu, 13 Nov 2014 07:59:14 +0000 (08:59 +0100)] 
Make unwords and words fuse somewhat

Make `words` a good producer and `unwords` a good consumer for list
fusion. Thus `unwords . words` will avoid producing an intermediate list
of words, although it will produce each individual word.

Make `unwords` slightly lazier, so that
`unwords (s : undefined) = s ++ undefined` instead of `= undefined`.

Reviewed By: austin

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

4 years agobase: Fix map/coerce comment
David Feuer [Thu, 13 Nov 2014 07:43:33 +0000 (08:43 +0100)] 
base: Fix map/coerce comment

Make the comment on the map/coerce rule refer to the right section in
the paper; give the full name of the papers, and name its authors.

[skip ci]

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

4 years agoUpdate userguide for new `-fwarn-trustworthy-safe` flag.
David Terei [Thu, 13 Nov 2014 02:39:01 +0000 (18:39 -0800)] 
Update userguide for new `-fwarn-trustworthy-safe` flag.

4 years agoAdd `--fwarn-trustworthy-safe` to `-Wall`
David Terei [Thu, 13 Nov 2014 00:11:39 +0000 (16:11 -0800)] 
Add `--fwarn-trustworthy-safe` to `-Wall`

Update submodule haskell2010, haskell98, hoop, hpc and stm to fix new
warnings.

4 years agoAdd in `-fwarn-trustworthy-safe` flag.
David Terei [Fri, 7 Nov 2014 22:11:19 +0000 (14:11 -0800)] 
Add in `-fwarn-trustworthy-safe` flag.

This warns when a module marked as `-XTrustworthy` could have been
inferred as safe instead.

4 years agoRemove a stray Trustworthy flag in ghc.
David Terei [Wed, 12 Nov 2014 21:54:55 +0000 (13:54 -0800)] 
Remove a stray Trustworthy flag in ghc.

4 years agoincludes/Stg.h: define _DEFAULT_SOURCE for glibc-2.20
Sergei Trofimovich [Wed, 12 Nov 2014 23:18:38 +0000 (23:18 +0000)] 
includes/Stg.h: define _DEFAULT_SOURCE for glibc-2.20

_BSD_SOURCE we are using for 'gamma()' and friends
was deprecated in glibc-2.20 in favour of '_DEFAULT_SOURCE'.

gcc says:

    In file included from /usr/include/math.h:26:0:
        0,
                         from includes/Stg.h:69,
                         from /tmp/ghc19488_0/ghc19488_2.hc:3:

    /usr/include/features.h:148:3:
         warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
         # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
           ^

Patch fixes testsuite failures on UNREG
(stderr are not cluttered by warnings anymore).

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
4 years agoFix #9404 by removing tcInfExpr.
Richard Eisenberg [Tue, 11 Nov 2014 02:27:58 +0000 (21:27 -0500)] 
Fix #9404 by removing tcInfExpr.

See the ticket for more info about the new algorithm. This is a small
simplification, unifying the treatment of type checking in a few
similar situations.

4 years agoTestsuite wibble due to #9404
Richard Eisenberg [Tue, 11 Nov 2014 12:58:03 +0000 (07:58 -0500)] 
Testsuite wibble due to #9404

[skip ci]

4 years agoTest #9404 (typecheck/should_compile/T9404 and T9404b)
Richard Eisenberg [Thu, 7 Aug 2014 13:20:41 +0000 (09:20 -0400)] 
Test #9404 (typecheck/should_compile/T9404 and T9404b)

4 years agoFix #9788 by giving `coerce` the right type.
Richard Eisenberg [Tue, 11 Nov 2014 01:41:38 +0000 (20:41 -0500)] 
Fix #9788 by giving `coerce` the right type.

No test case added, as the original mistake is just one level
up from a typo.

4 years agoTestsuite wibbles due to #9204
Richard Eisenberg [Fri, 7 Nov 2014 21:32:39 +0000 (16:32 -0500)] 
Testsuite wibbles due to #9204

4 years agoFix #9204 by outputting extra info on boot file mismatch.
Richard Eisenberg [Wed, 5 Nov 2014 15:52:57 +0000 (10:52 -0500)] 
Fix #9204 by outputting extra info on boot file mismatch.

[skip ci] -- testsuite wibbles are in next commit