ghc.git
4 years agoImprove the error message with -fwarn-context-quantification context-quantification-4426
Krzysztof Gogolewski [Wed, 17 Sep 2014 21:19:10 +0000 (23:19 +0200)] 
Improve the error message with -fwarn-context-quantification

4 years agoNote context quantification becomes an error in 7.12; add release notes
Krzysztof Gogolewski [Wed, 17 Sep 2014 20:35:43 +0000 (22:35 +0200)] 
Note context quantification becomes an error in 7.12; add release notes

4 years agoAdd -fwarn-context-quantification (#4426)
Krzysztof Gogolewski [Sun, 14 Sep 2014 14:34:01 +0000 (16:34 +0200)] 
Add -fwarn-context-quantification (#4426)

Summary:
This warning (enabled by default) reports places where a context
implicitly binds a type variable, for example

type T a = {-forall m.-} Monad m => a -> m a

Also update Haddock submodule.

Test Plan: validate

Reviewers: hvr, simonpj, goldfire, austin

Subscribers: simonmar, ezyang, carter

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

GHC Trac Issues: #4426

4 years agoAdd -fwarn-context-quantification (#4426)
Krzysztof Gogolewski [Sun, 14 Sep 2014 14:09:16 +0000 (16:09 +0200)] 
Add -fwarn-context-quantification (#4426)

This warning (enabled by default) reports places where a context
implicitly binds a type variable, for example

type T a = {-forall m.-} Monad m => a -> m a

4 years agoSplit SpliceExplicitFlag off HsExplicitFlag
Krzysztof Gogolewski [Sun, 14 Sep 2014 11:17:27 +0000 (13:17 +0200)] 
Split SpliceExplicitFlag off HsExplicitFlag

SpliceExplicitFlag is used for TH splice explicitness, while
HsExplicitFlag for type variable quantification.

4 years agoUpdate libffi-tarballs submodule to libffi 3.1 (re #8701)
Herbert Valerio Riedel [Sat, 13 Sep 2014 17:55:25 +0000 (19:55 +0200)] 
Update libffi-tarballs submodule to libffi 3.1 (re #8701)

4 years agoUpdate haskell2010 submodule
Herbert Valerio Riedel [Sat, 13 Sep 2014 17:10:02 +0000 (19:10 +0200)] 
Update haskell2010 submodule

...to kill "Kill CPP conditionals for HUGS and old GHCs"

4 years agoDetabify primops.txt.pp
Herbert Valerio Riedel [Sat, 13 Sep 2014 16:34:08 +0000 (18:34 +0200)] 
Detabify primops.txt.pp

4 years agoMove docstring of `seq` to primops.txt.pp
Herbert Valerio Riedel [Sat, 13 Sep 2014 16:14:55 +0000 (18:14 +0200)] 
Move docstring of `seq` to primops.txt.pp

The documentation for `seq` was recently augmented via #9390 &
cbfa107604f4cbfaf02bd633c1faa6ecb90c6dd7. However, it doesn't show
up in the Haddock generated docs because `#ifdef __HADDOCK__` doesn't
work as expected.  Also, it's easier to just fix the problem at the
origin (which in this is case is the primops.txt.pp file).

The benefit/downside of this is that now the extended documentation
shows up everywhere `seq` is re-exported directly.

4 years agoFixup test-case broken by Follow-up to b53c95fe621
Herbert Valerio Riedel [Sat, 13 Sep 2014 13:01:16 +0000 (15:01 +0200)] 
Fixup test-case broken by Follow-up to b53c95fe621

4 years agoFollow-up to b53c95fe621d3a66a82e6dad383e1c0c08f3871e
Herbert Valerio Riedel [Sat, 13 Sep 2014 11:24:38 +0000 (13:24 +0200)] 
Follow-up to b53c95fe621d3a66a82e6dad383e1c0c08f3871e

Forgot to fix-up the `haskell2010` and `haskell98` submodules in the previous
commit

4 years agoMove ($!) from Prelude into GHC.Base
Herbert Valerio Riedel [Sat, 13 Sep 2014 09:56:37 +0000 (11:56 +0200)] 
Move ($!) from Prelude into GHC.Base

I don't see any reason why this needs to be in Prelude, where it makes
life harder to avoid import cycles involving Prelude. Ideally, the
`Prelude` module should only re-export entities from other modules, and
not define anything on its own.

So this moves `($!)` close to the definition of its `($)` cousin.

4 years agobase: Drop obsolete/redundant `__GLASGOW_HASKELL__` checks
Herbert Valerio Riedel [Sat, 13 Sep 2014 08:44:20 +0000 (10:44 +0200)] 
base: Drop obsolete/redundant `__GLASGOW_HASKELL__` checks

Since 527bcc41630918977c7 we require GHC >=7.6 for bootstrapping anyway.
This also allows to avoid the CPP-processing overhead for these two modules.

4 years agoRemove obsolete comment about (!!)
Joachim Breitner [Fri, 12 Sep 2014 21:13:07 +0000 (23:13 +0200)] 
Remove obsolete comment about (!!)

as spotted by David Feuer and reported as #9585.
The comment was right until ceb68b9118fa883e88abfaa532fc78f6640cf17f,
which is only 13 years ago :-).

4 years agoFix support for deriving Generic1 for data families (FIX #9563)
Jose Pedro Magalhaes [Fri, 12 Sep 2014 16:44:12 +0000 (17:44 +0100)] 
Fix support for deriving Generic1 for data families (FIX #9563)

4 years agoUpdate nofib submodule: Update gitignore with more generated files
Edward Z. Yang [Thu, 11 Sep 2014 14:40:27 +0000 (07:40 -0700)] 
Update nofib submodule: Update gitignore with more generated files

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoMake GHC `time-1.5`-ready
Herbert Valerio Riedel [Wed, 10 Sep 2014 21:50:38 +0000 (23:50 +0200)] 
Make GHC `time-1.5`-ready

This also updates a few submodules to have their upper-bounds on
`time` relaxed to allow `time-1.5`. The only package that can't be
upgraded yet is `Cabal` due to API changes breaking `ghc-cabal`. This
needs to be addressed in a future commit.

4 years agoKill obsolete pre GHC 7.6 bootstrapping support
Herbert Valerio Riedel [Wed, 10 Sep 2014 21:46:03 +0000 (23:46 +0200)] 
Kill obsolete pre GHC 7.6 bootstrapping support

This left-over is definitely not needed anymore
and was probably missed in 527bcc41630918977c7

4 years agoT4801 perf numbers: Another typo
Joachim Breitner [Wed, 10 Sep 2014 14:18:17 +0000 (16:18 +0200)] 
T4801 perf numbers: Another typo

4 years agoFix T5321Fun perf number
Joachim Breitner [Wed, 10 Sep 2014 12:52:20 +0000 (14:52 +0200)] 
Fix T5321Fun perf number

(I obviously copy’n’pasted the wrong number.)

4 years agoUpdate performance numbers
Joachim Breitner [Wed, 10 Sep 2014 09:26:25 +0000 (11:26 +0200)] 
Update performance numbers

including some that are not failing yet, but did show a significant
change, and some that Austing changed post-AMP, but where both
harbormaster and ghcspeed reported something else. Numbers taken from
the ghcspeed machine.

4 years agotestsuite: AMPify T3001-2
Joachim Breitner [Wed, 10 Sep 2014 09:26:10 +0000 (11:26 +0200)] 
testsuite: AMPify T3001-2

4 years agotestsuite: AMPify ioprof.hs
Joachim Breitner [Wed, 10 Sep 2014 07:01:33 +0000 (09:01 +0200)] 
testsuite: AMPify ioprof.hs

4 years agoUpdate nofib submodule to track gc bitrot updates.
Edward Z. Yang [Wed, 10 Sep 2014 02:39:58 +0000 (19:39 -0700)] 
Update nofib submodule to track gc bitrot updates.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoUpdate nofib submodule to fix errors in main suite.
Edward Z. Yang [Tue, 9 Sep 2014 22:28:00 +0000 (15:28 -0700)] 
Update nofib submodule to fix errors in main suite.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agobuild.mk.sample: Stage1 needn't be built with -fllvm
Ben Gamari [Sat, 6 Sep 2014 17:24:30 +0000 (13:24 -0400)] 
build.mk.sample: Stage1 needn't be built with -fllvm

Summary:
We can use the native codegen for stage 1 as it is to run on the host
platform.

Test Plan:

Reviewers:

Subscribers:

GHC Trac Issues:

4 years agobase: replace ver 4.7.1.0 references by 4.8.0.0
Herbert Valerio Riedel [Tue, 9 Sep 2014 16:46:10 +0000 (18:46 +0200)] 
base: replace ver 4.7.1.0 references by 4.8.0.0

Since we now had to major bump due to AMP being landed, `base-4.7.1.0` is not
gonna happen, as we're going straight for a `base-4.8.0.0` release.

[skip ci] since this is a doc-only change

4 years agoBump `base` version to 4.8.0.0 for real
Herbert Valerio Riedel [Tue, 9 Sep 2014 15:39:57 +0000 (17:39 +0200)] 
Bump `base` version to 4.8.0.0 for real

This commit updates several submodules in order to bump
the upper bounds on `base` of most boot packages

Moreover, this updates some of the test-suite cases which have
version numbers hardcoded within.

However, I'm not sure if this commit didn't introduce the following
two test-failures

   ghc-api  T8628 [bad stdout] (normal)
   ghc-api  T8639_api [bad stdout] (normal)

This needs investigation

4 years agoRevert "base: Bump version to 4.8.0.0"
Austin Seipp [Tue, 9 Sep 2014 13:51:04 +0000 (08:51 -0500)] 
Revert "base: Bump version to 4.8.0.0"

This reverts commit 0829f4c829a92d1287b820b12102a64dac91d35a.

This fails to build, because I'm dumb and hasty, obviously.

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agobase: Bump version to 4.8.0.0
Austin Seipp [Tue, 9 Sep 2014 13:18:56 +0000 (08:18 -0500)] 
base: Bump version to 4.8.0.0

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoMake Applicative a superclass of Monad
Austin Seipp [Tue, 22 Apr 2014 11:09:40 +0000 (06:09 -0500)] 
Make Applicative a superclass of Monad

Summary:
This includes pretty much all the changes needed to make `Applicative`
a superclass of `Monad` finally. There's mostly reshuffling in the
interests of avoid orphans and boot files, but luckily we can resolve
all of them, pretty much. The only catch was that
Alternative/MonadPlus also had to go into Prelude to avoid this.

As a result, we must update the hsc2hs and haddock submodules.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Test Plan: Build things, they might not explode horribly.

Reviewers: hvr, simonmar

Subscribers: simonmar

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

4 years agorules: fix buld failure due to o-boot suffix typo
Sergei Trofimovich [Mon, 8 Sep 2014 16:29:26 +0000 (19:29 +0300)] 
rules: fix buld failure due to o-boot suffix typo

Last-time tweak in commit 049bef7dc8858cff1b69002cde91b9d1cdef8e70
broke build. Update '_o-boot' to '_o-bootsuf' variable name.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
4 years agorules: cleanup: use '$way_*suf' var instead of open-coded '($3_way_)s'
Sergei Trofimovich [Mon, 8 Sep 2014 16:11:49 +0000 (19:11 +0300)] 
rules: cleanup: use '$way_*suf' var instead of open-coded '($3_way_)s'

The changes look like:
    -$1/$2/build/%.$$($3_way_)s : $1/%.c $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP)
    +$1/$2/build/%.$$($3_ssuf)  : $1/%.c $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP)

This way typos will manifest themselves in all ways,
not only non-vanilla.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
4 years agoTypos
Gabor Greif [Thu, 4 Sep 2014 21:00:06 +0000 (23:00 +0200)] 
Typos

4 years agoINLINE unfoldr
Joachim Breitner [Sat, 6 Sep 2014 20:21:54 +0000 (22:21 +0200)] 
INLINE unfoldr

Summary:
to allow GHC to maybe remove the Maybe. See the code comment for more
commentary. This fixes #9369.

Test Plan: see what happens on ghcspeed (once it is merged)

Reviewers: austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter

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

GHC Trac Issues: #9369

4 years agoUpdate T4801 perf numbers
Joachim Breitner [Sat, 6 Sep 2014 19:57:11 +0000 (21:57 +0200)] 
Update T4801 perf numbers

no individual cause indentified, but small improvements happened in
1719c42, 9d6fbcc, 949ad67 (or it is noise...)

4 years agoPostTcType replaced with TypeAnnot
Alan Zimmerman [Fri, 5 Sep 2014 23:11:04 +0000 (18:11 -0500)] 
PostTcType replaced with TypeAnnot

Summary:
This is a first step toward allowing generic traversals of the AST without 'landmines', by removing the `panic`s located throughout `placeHolderType`, `placeHolderKind` & co.

See more on the discussion at https://www.mail-archive.com/ghc-devs@haskell.org/msg05564.html

(This also makes a corresponding update to the `haddock` submodule.)

Test Plan: `sh validate` and new tests pass.

Reviewers: austin, simonpj, goldfire

Reviewed By: austin, simonpj, goldfire

Subscribers: edsko, Fuuzetsu, thomasw, holzensp, goldfire, simonmar, relrod, ezyang, carter

Projects: #ghc

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

4 years agoDo not use max_bytes_used for haddock test
Joachim Breitner [Sat, 6 Sep 2014 10:21:34 +0000 (12:21 +0200)] 
Do not use max_bytes_used for haddock test

Summary: as they are unreliable and hard to re-run.

Test Plan: Run the testsuite

Reviewers: austin

Subscribers: simonmar, ezyang, carter

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

GHC Trac Issues: #9556

4 years agoRevert "Do not test max_bytes_used et. al for haddock tests"
Joachim Breitner [Fri, 5 Sep 2014 21:03:58 +0000 (23:03 +0200)] 
Revert "Do not test max_bytes_used et. al for haddock tests"

This reverts commit 498d7dd2dc731a92eda2210e4ab0a04366511627. Again
sorry for the noise. This is the last reverstion. I will fix this for
good at around 12:13 CEST tomorrow :-)

4 years agopprC: declare extern cmm primitives as functions, not data
Sergei Trofimovich [Thu, 4 Sep 2014 14:50:45 +0000 (17:50 +0300)] 
pprC: declare extern cmm primitives as functions, not data

Summary:
  The commit fixes incorrect code generation of
  integer-gmp package on ia64 due to C prototypes mismatch.
  Before the patch prototypes for "foreign import prim" were:
      StgWord poizh[];
  After the patch they became:
      StgFunPtr poizh();

Long story:

Consider the following simple example:

    {-# LANGUAGE MagicHash, GHCForeignImportPrim, UnliftedFFITypes #-}
    module M where
    import GHC.Prim -- Int#
    foreign import prim "poizh" poi# :: Int# -> Int#

Before the patch unregisterised build generated the
following 'poizh' reference:
    EI_(poizh); /* StgWord poizh[]; */
    FN_(M_poizh_entry) {
    // ...
    JMP_((W_)&poizh);
    }

After the patch it looks this way:
    EF_(poizh); /* StgFunPtr poizh(); */
    FN_(M_poizh_entry) {
    // ...
    JMP_((W_)&poizh);
    }

On ia64 it leads to different relocation types being generated:
  incorrect one:
    addl r14 = @ltoffx(poizh#)
    ld8.mov r14 = [r14], poizh# ; r14 = address-of 'poizh#'
  correct one:
    addl r14 = @ltoff(@fptr(poizh#)), gp ; r14 = address-of-thunk 'poizh#'
    ld8 r14 = [r14]

'@fptr(poizh#)' basically instructs assembler to creates
another obect consisting of real address to 'poizh' instructions
and module address. That '@fptr' object is used as a function "address"
This object is different for every module referencing 'poizh' symbol.

All indirect function calls expect '@fptr' object. That way
call site reads real destination address and set destination
module address in 'gp' register from '@fptr'.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
4 years agoAdd missing changelog/since entry for `uncons`
Herbert Valerio Riedel [Thu, 4 Sep 2014 10:42:54 +0000 (12:42 +0200)] 
Add missing changelog/since entry for `uncons`

This is a follow-up commit to
e428b5b8cc1448dcff7d7cdcbeb738eb0bea102f (refs D195 & #9550)

4 years agoSmall improvement to unsaturated-type-function error message
Simon Peyton Jones [Wed, 3 Sep 2014 20:47:43 +0000 (21:47 +0100)] 
Small improvement to unsaturated-type-function error message

4 years agoAnother test for type function saturation
Simon Peyton Jones [Wed, 3 Sep 2014 20:44:40 +0000 (21:44 +0100)] 
Another test for type function saturation

Came up on GHC users list

4 years agoUpdate performance numbers (mostly improved)
Simon Peyton Jones [Wed, 3 Sep 2014 20:40:59 +0000 (21:40 +0100)] 
Update performance numbers (mostly improved)

4 years agoDo not test max_bytes_used et. al for haddock tests
Joachim Breitner [Thu, 4 Sep 2014 08:52:32 +0000 (10:52 +0200)] 
Do not test max_bytes_used et. al for haddock tests

Summary: as these are unreliable, and it is hard to re-run haddock with other RTS flags.

Test Plan: run validate

Reviewers: austin

Subscribers: simonmar, ezyang, carter

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

GHC Trac Issues: #9551

4 years agoRevert "Remove max_bytes_used test from haddock test cases"
Joachim Breitner [Thu, 4 Sep 2014 08:33:51 +0000 (10:33 +0200)] 
Revert "Remove max_bytes_used test from haddock test cases"

This reverts commit 8c427ebe9c34b9bcecd41fb0584d24989c00ffe6.

Sorry for the noise, but I need to practice my HIW talk, which will
involve some live development...

4 years agoAdd Data.List.uncons
David Feuer [Thu, 4 Sep 2014 06:04:12 +0000 (08:04 +0200)] 
Add Data.List.uncons

Summary:
As discussed in
http://www.haskell.org/pipermail/libraries/2014-July/023314.html and
submitted at #9550.

Test Plan: Submit to phab, see what happens.

Reviewers: austin

Subscribers: simonmar, ezyang, carter

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

GHC Trac Issues: #9550

4 years agoUpdate nofib submodule: Hide Word from Prelude
Joachim Breitner [Tue, 2 Sep 2014 15:55:16 +0000 (17:55 +0200)] 
Update nofib submodule: Hide Word from Prelude

in benchmarks where Word is used. This fixes fall-out from #9531.

4 years agoconfigure.ac: cleanup: remove unused 'HaveLibDL' subst
Sergei Trofimovich [Mon, 1 Sep 2014 15:52:17 +0000 (18:52 +0300)] 
configure.ac: cleanup: remove unused 'HaveLibDL' subst

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
4 years agorts/Printer.c: update comments about using USING_LIBBFD
Sergei Trofimovich [Mon, 1 Sep 2014 15:09:56 +0000 (18:09 +0300)] 
rts/Printer.c: update comments about using USING_LIBBFD

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
4 years agoRemove max_bytes_used test from haddock test cases
Joachim Breitner [Tue, 2 Sep 2014 09:49:49 +0000 (11:49 +0200)] 
Remove max_bytes_used test from haddock test cases

Summary:
as these are not very reliable, and the advice to make them reliable
is hard to apply to them.

(This is just my practicing phab...)

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: carter, ezyang, simonmar

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

GHC Trac Issues: #9535

4 years agoRevert "Fix a couple test failures encountered when building on Windows"
Austin Seipp [Mon, 1 Sep 2014 22:26:47 +0000 (17:26 -0500)] 
Revert "Fix a couple test failures encountered when building on Windows"

This reverts commit 9711f78f790d10d914e08851544c6fc96f9a030a, as it's
causing build phailures in phabricator.

4 years agosystools: fix gcc version detecton on non-english locale
Sergei Trofimovich [Mon, 1 Sep 2014 21:06:56 +0000 (00:06 +0300)] 
systools: fix gcc version detecton on non-english locale

Summary:
ghc runs 'gcc -v' to check if we run under vanilla gcc
or disaguised clang by checking for string

    "gcc version <something>"

But this check does not always work as gcc has that string
localized via gettext mechanism:

    (some gcc's locale strings)
    be.po-msgstr "версія gcc %s\n"
    da.po-msgstr "GCC version %s\n"
    de.po-msgstr "gcc-Version %s %s\n"
    el.po-msgstr "έκδοση gcc %s\n"
    ...

To ping gcc to English locale we now override environment
variable with 'LANGUAGE=en' value.

Fixes Issue #8825

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter

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

GHC Trac Issues: #8825

4 years agoFix a couple test failures encountered when building on Windows
Austin Seipp [Mon, 1 Sep 2014 20:14:18 +0000 (15:14 -0500)] 
Fix a couple test failures encountered when building on Windows

Summary:
* Adjusts performance tests
* Change ghcpkg05.stderr-mingw32 to match ghcpkg05.stderr

Test Plan: Ran 'sh validate' and observed fewer test failures afterwards

Reviewers: austin

Reviewed By: austin

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

4 years agoSet llc and opt commands on all platforms
Austin Seipp [Mon, 1 Sep 2014 20:14:07 +0000 (15:14 -0500)] 
Set llc and opt commands on all platforms

Summary:
LLVM llc and opt commands should be set on all platforms, including
Windows. If they're not, GHC tries to execute an unnamed executable,
resulting in error messages such as:

    Error (figuring out LLVM version): : runInteractiveProcess: invalid argument (Invalid argument)
    <no location info>:
        Warning: Couldn't figure out LLVM version!
                 Make sure you have installed LLVM

This regression was introduced in e6bfc596.

Test Plan: Build GHC and test if --info shows sensible values of "LLVM llc command" and "LLVM opt command"

Reviewers: austin, #ghc

Reviewed By: austin, #ghc

Subscribers: austin

Projects: #ghc

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

GHC Trac Issues: #7143

4 years agoRefactor stack squeezing logic
Arash Rouhani [Mon, 1 Sep 2014 20:13:57 +0000 (15:13 -0500)] 
Refactor stack squeezing logic

Summary:
This patch is only to make the code easier to read.

In addition, this is the first patch I send with the arc/differential workflow.
So I start with something very small.

Test Plan: I have not even tried to compile it yet.

Reviewers: simonmar, austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter

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

4 years agogenprimopcode: GHC.Prim is Unsafe (#9449)
Austin Seipp [Mon, 1 Sep 2014 20:13:44 +0000 (15:13 -0500)] 
genprimopcode: GHC.Prim is Unsafe (#9449)

Summary:
Make sure the documentation for `GHC.Prim` adequately
reflects the fact it is unsafe.

Also clean up some 80-column violations.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Test Plan:
Build documentation, check `GHC.Prim`. It's properly marked
as `Unsafe`.

Reviewers: hvr, goldfire, ezyang

Reviewed By: ezyang

Subscribers: nomeata, simonmar, ezyang, carter

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

GHC Trac Issues: #9449

4 years agoMake Lexer.x more like the 2010 report
Thomas Miedema [Mon, 1 Sep 2014 20:13:00 +0000 (15:13 -0500)] 
Make Lexer.x more like the 2010 report

Summary:
I tried reading the lexer and the 2010 report side-by-side. Althought I didn't
quite finish, here are some small discrepancies that I found.

This revision may be low priority for reviewers, but having these commits just
in my local repository does no good either.

Changes:
* $nl was defined, but not used anywhere
* formfeed is a newline character
* add \: to $ascsymbol
  For simplification reason, the colon (':') was added to the character
  set $ascsymbol in the 2010 report. Here we make the same change.
* introduce the macros `qvarid`, `qconid`, `qvarsym` and `qconsym`
* foreign is a Haskell keyword
* add/update comments

Test Plan: Harbormaster (is awesome)

Reviewers: simonmar, hvr, austin

Reviewed By: austin

Subscribers: hvr, simonmar, ezyang, carter

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

4 years agoCleanup and better documentation of sync-all script
Thomas Miedema [Mon, 1 Sep 2014 20:12:32 +0000 (15:12 -0500)] 
Cleanup and better documentation of sync-all script

Summary:
Rumor has it that sync-all is slowly on the way out. Now that all
subrepositories have been turned into git submodules, sync-all might
not be needed anymore. Nevertheless, here are some changes I had made
while trying to understand why it existed in the first place:

* update comments + help text
* rename some variables for maintainability
    * s/branch_name/remote_name/
    origin is the name of a remote, not a branch

    * s/repo_base/remote_root/
    the word *remote* is key here

    * s/defaultrepo/default_root/
    this was a darcsism, and it doesn't refer to a repository but to the
    root directory of all repositories
* small tweaks
* .git can be a file nowadays
* don't skip END actions on exceptions #8886
  reverts d523f9b3d4ce3463e8816cad2139ea397e00f8d1

Test Plan:
Why revert d523f9b3d4ce3463e8816cad2139ea397e00f8d1?

I put an old haddock repository from
http://darcs.haskell.org/haddock2.git back in my tree. Now, when running
`sync-all get`, the following happens:

1. I get a cryptic error saying:

    fatal: reference is not a tree:
    5412c262f403e52be45d607b34eb3a5806ea2a76
    Unable to checkout '5412c262f403e52be45d607b34eb3a5806ea2a76' in
    submodule path 'utils/haddock'
    git failed: 256 at ./sync-all line 112.

2. sync-all checks if maybe an old haddock repository is present

3. I get a clear warning saying:

    ============================
    ATTENTION!

    You have an old haddock repository in your GHC tree!

    Please remove it (e.g. "rm -r utils/haddock"), and then run
    "./sync-all get" to get the new repository.
    ============================

Without commit d523f9b3d4ce3463e8816cad2139ea397e00f8d1 reverted, steps
2 and 3 were skipped. The problem that commit tried to solve,
is now solved with 7012ed8515100b4947383e93b82dbff7a0aa835c.

Reviewers: nomeata, austin, hvr

Reviewed By: austin, hvr

Subscribers: simonmar, ezyang, carter

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

GHC Trac Issues: #8886, #9212

4 years agoStringBuffer should not contain initial byte-order mark (BOM)
Thomas Miedema [Mon, 1 Sep 2014 20:11:50 +0000 (15:11 -0500)] 
StringBuffer should not contain initial byte-order mark (BOM)

Summary:
Just skipping over a BOM, but leaving it in the Stringbuffer, is not
sufficient. The Lexer calls prevChar when a regular expression starts
with '^' (which is a shorthand for '\n^'). It would never match on the
first line, since instead of '\n', prevChar would still return '\xfeff'.

Test Plan: validate

Reviewers: austin, ezyang

Reviewed By: austin, ezyang

Subscribers: simonmar, ezyang, carter

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

GHC Trac Issues: #6016

4 years agoincludes/Stg.h: remove unused 'wcStore' inline
Sergei Trofimovich [Mon, 1 Sep 2014 18:15:21 +0000 (21:15 +0300)] 
includes/Stg.h: remove unused 'wcStore' inline

Summary:
Commit reverts never used addition in cbd29e0a23bb8e15033edae123d6c8fbe9740c97

I think it might make sense to take advantage of TSO/RMO/PSO models
tome day. But it's highly architecture/model-dependent thus it better
be implemented in per-arch Native CodeGen.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: build-tested on UNREG-amd64

Reviewers: simonmar, austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter

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

4 years agotestsuite: update T6056 rule firing order
Sergei Trofimovich [Mon, 1 Sep 2014 18:13:45 +0000 (21:13 +0300)] 
testsuite: update T6056 rule firing order

Fixes testsuite failure.

Summary: Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

Test Plan: validate --slow

Reviewers: simonpj, austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter

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

4 years agoMake ghc-api cleaning less aggressive.
Edward Z. Yang [Mon, 1 Sep 2014 09:16:15 +0000 (11:16 +0200)] 
Make ghc-api cleaning less aggressive.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoRemove incorrect property in docstring (re #9532)
Herbert Valerio Riedel [Mon, 1 Sep 2014 07:50:16 +0000 (09:50 +0200)] 
Remove incorrect property in docstring (re #9532)

The property

  countLeadingZeros . negate = const 0

doesn't generally hold and it's not such a useful property to state, as
it simply follows from "sign-bit == most-significant-bit" for FiniteBits
types which use twos-complement representation for negative values, and
even then it breaks down for 0...

TLDR, remove thinko from documentation of `countLeadingZeros`

4 years ago`M-x delete-trailing-whitespace` & `M-x untabify`...
Herbert Valerio Riedel [Sun, 31 Aug 2014 14:05:26 +0000 (16:05 +0200)] 
`M-x delete-trailing-whitespace` & `M-x untabify`...

...some files more or less recently touched by me

[ci skip]

4 years agoAdd `FiniteBits(count{Leading,Trailing}Zeros)`
Herbert Valerio Riedel [Thu, 14 Aug 2014 10:32:32 +0000 (12:32 +0200)] 
Add `FiniteBits(count{Leading,Trailing}Zeros)`

This exposes the newly added CLZ/CTZ primops from
e0c1767d0ea8d12e0a4badf43682a08784e379c6 (re #9340)
via two new methods `countLeadingZeros` and `countTrailingZeros`
in the `Data.Bits.FiniteBits` class.

The original proposal can be found at

  http://www.haskell.org/pipermail/libraries/2014-August/023567.html

Test Plan: successful validate

Reviewers: ekmett, tibbe

GHC Trac Issues: #9532

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

4 years agoRe-export Word from Prelude (re #9531)
Herbert Valerio Riedel [Sun, 31 Aug 2014 09:40:50 +0000 (11:40 +0200)] 
Re-export Word from Prelude (re #9531)

The original proposal text can be found at

  http://www.haskell.org/pipermail/libraries/2014-August/023491.html

The proposal passed with a clear majority, and was additionally
confirmed by the core libraries committee.

*Compatibility Note*

Only code that imports `Data.Word` for the sole purpose of using `Word`
*and* requires to be `-Werror`-clean (due to `-fwarn-unused-imports`)
is affected by this change.

In order to write warning-free forward/backward compatible against `base`,
a variant of the following CPP-based snippet can be used:

  -- Starting with base>4.7.0 or GHC>7.8 Prelude re-exports 'Word'
  -- The following is needed, if 'Word' is the *only* entity needed from Data.Word
  #ifdef MIN_VERSION_base
  # if !MIN_VERSION_base(4,7,1)
  import Data.Word (Word)
  # endif
  -- no cabal_macros.h -- fallback to __GLASGOW_HASKELL__
  #elif __GLASGOW_HASKELL__ < 709
  import Data.Word (Word)
  #endif

This also updates the haddock submodule in order to avoid a compile warning

4 years agoRevert "Make sure that a prototype is included for 'setIOManagerControlFd'"
Gabor Greif [Fri, 29 Aug 2014 22:30:39 +0000 (00:30 +0200)] 
Revert "Make sure that a prototype is included for 'setIOManagerControlFd'"

This reverts commit 7bf49f86a20f3beda0ee5fbea2db64cfef730d74.

4 years agoRevert "Comment why the include is necessary"
Gabor Greif [Fri, 29 Aug 2014 22:30:07 +0000 (00:30 +0200)] 
Revert "Comment why the include is necessary"

This reverts commit 15df6d98afb8c3813013c5b97efffe0ba8020d32.

4 years agoSome typos
Gabor Greif [Fri, 29 Aug 2014 21:51:20 +0000 (23:51 +0200)] 
Some typos

4 years agotestsuite: normalise integer library name for T8958
Sergei Trofimovich [Fri, 29 Aug 2014 16:06:14 +0000 (19:06 +0300)] 
testsuite: normalise integer library name for T8958

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
4 years agoFix to bin-package-db for ming32-only code
Simon Peyton Jones [Fri, 29 Aug 2014 21:06:56 +0000 (22:06 +0100)] 
Fix to bin-package-db for ming32-only code

Patch written by Pali Gabor Janos <pali.gabor@gmail.com>

4 years agoTypos in comments
Gabor Greif [Fri, 29 Aug 2014 16:49:01 +0000 (18:49 +0200)] 
Typos in comments

4 years agoDo not say we cannot when we clearly can
Gabor Greif [Thu, 28 Aug 2014 17:14:39 +0000 (19:14 +0200)] 
Do not say we cannot when we clearly can

4 years agoPerformance improvement of the compiler itself
Simon Peyton Jones [Fri, 29 Aug 2014 16:16:36 +0000 (17:16 +0100)] 
Performance improvement of the compiler itself

This is a result of one of these, or a combination
  002b7a2b * Give the worker for an INLINABLE function a suitably-phased Activation
  ca666b8b * When finding loop breakers, distinguish INLINE from INLINEABLE
  a98c9c5e * Fix a bug in CSE, for INLINE/INLNEABLE things

Some changes are quite big: for bytes_allocated we have
  T6048: 13% below expected
  T5837: 15% below expected
  T3064:  5% below expected

Of course, these might have already been close to their lower
threshold, so perhaps not all the improvement is from here.
But it is good news all the same.

4 years agoFinally! Test Trac #6056
Simon Peyton Jones [Fri, 29 Aug 2014 14:37:16 +0000 (15:37 +0100)] 
Finally!  Test Trac #6056

4 years agoGive the worker for an INLINABLE function a suitably-phased Activation
Simon Peyton Jones [Fri, 29 Aug 2014 14:34:19 +0000 (15:34 +0100)] 
Give the worker for an INLINABLE function a suitably-phased Activation

See Note [Activation for INLINABLE worker].  This was preventing
Trac #6056 from working.

4 years agoBetter specImport discarding message (again)
Simon Peyton Jones [Fri, 29 Aug 2014 14:28:15 +0000 (15:28 +0100)] 
Better specImport discarding message (again)

4 years agoWhen finding loop breakers, distinguish INLINE from INLINEABLE
Simon Peyton Jones [Fri, 29 Aug 2014 14:18:08 +0000 (15:18 +0100)] 
When finding loop breakers, distinguish INLINE from INLINEABLE

Previously INLINE and INLINEABLE were treated identically, but it's
crucial that we don't choose a wrapper (INLINE) as a loop breaker,
when it is mutually recursive with an INLINEABLE worker.

4 years agoComments, white space, and rename "InlineRule" to "stable unfolding"
Simon Peyton Jones [Fri, 29 Aug 2014 14:16:16 +0000 (15:16 +0100)] 
Comments, white space, and rename "InlineRule" to "stable unfolding"

The "InlineRule" is gone now, so this is just making the comments line
up with the code.  A function does change its name though:
   updModeForInlineRules  -->  updModeForStableUnfoldings

4 years agoFix a bug in CSE, for INLINE/INLNEABLE things
Simon Peyton Jones [Fri, 29 Aug 2014 14:11:19 +0000 (15:11 +0100)] 
Fix a bug in CSE, for INLINE/INLNEABLE things

Previusly we simply weren't doing CSE at all on things
whose unfolding were not always-active, for reasons explained
in Note [CSE for INLINE and NOINLINE].  But that was bad!
Making something INLNEABLE meant that its RHS was no longer
CSE'd, and that made some nofib programs worse.

And it's entirely unnecessary.  I thoguht it through again,
wrote new comments (under the same Note), and things are
better again.

4 years agoInclude pattern synonyms as AConLikes in the type environment,
Dr. ERDI Gergo [Fri, 29 Aug 2014 13:15:22 +0000 (21:15 +0800)] 
Include pattern synonyms as AConLikes in the type environment,
even for simplified/boot ModDetails (fixes #9417)

4 years agoSuppress binary warnings for bootstrapping as well as stage1.
Edward Z. Yang [Fri, 29 Aug 2014 14:55:59 +0000 (15:55 +0100)] 
Suppress binary warnings for bootstrapping as well as stage1.

This was missed when we added binary to the list of boot packages.
But note: the warnings binary are *legitimate* and really should be fixed!

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoFix failing test on BINDIST=YES
Edward Z. Yang [Fri, 29 Aug 2014 12:35:09 +0000 (13:35 +0100)] 
Fix failing test on BINDIST=YES

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoAdd release notes about ghc-pkg change, and Cabal dep removal
Duncan Coutts [Thu, 28 Aug 2014 04:52:48 +0000 (05:52 +0100)] 
Add release notes about ghc-pkg change, and Cabal dep removal

That ghc-pkg doesn't support single-file style databases, and that
the ghc library does not depend on Cabal any more.

We don't need to document the ghc-pkg change in the ghc-pkg section
itself, since ghc-pkg init is already described there, and that is the
right thing. The old deprecated approach was not documented.

4 years agoFix a few minor issues spotted in code review
Duncan Coutts [Thu, 28 Aug 2014 04:24:04 +0000 (05:24 +0100)] 
Fix a few minor issues spotted in code review

4 years agoChange testsuite to not use old-style file package databases
Duncan Coutts [Wed, 27 Aug 2014 15:33:20 +0000 (16:33 +0100)] 
Change testsuite to not use old-style file package databases

Now uses ghc-pkg init. The file-style databases are no longer supported.

4 years agoUpdate Cabal and haddock submodules to follow the Canal-dep removal changes
Duncan Coutts [Wed, 27 Aug 2014 12:57:46 +0000 (13:57 +0100)] 
Update Cabal and haddock submodules to follow the Canal-dep removal changes

In particular, Cabal was still in one place using old file-style package
databases. Haddock just needed simple changes to follow the change of
representation of packages in the ghc library.

4 years agoFix validation error in Linker arising from package rep changes
Duncan Coutts [Wed, 27 Aug 2014 12:26:24 +0000 (13:26 +0100)] 
Fix validation error in Linker arising from package rep changes

4 years agoAddress a number of Edward's code review comments
Duncan Coutts [Sun, 24 Aug 2014 22:43:40 +0000 (23:43 +0100)] 
Address a number of Edward's code review comments

Some others addressed as part of other recent patches.

4 years agoFix string conversions in ghc-pkg to be correct w.r.t. Unicode
Duncan Coutts [Sun, 24 Aug 2014 21:11:33 +0000 (22:11 +0100)] 
Fix string conversions in ghc-pkg to be correct w.r.t. Unicode

Similar change to that on the ghc library side in the previous patch.
The BinaryStringRep class has to use a ByteString in UTF8 encoding.

4 years agoSwitch the package id types to use FastString (rather than String)
Duncan Coutts [Sun, 24 Aug 2014 20:59:03 +0000 (21:59 +0100)] 
Switch the package id types to use FastString (rather than String)

The conversions should now be correct w.r.t Unicode.

Also move a couple instances to avoid orphan instances.

Strictly speaking there's no need for these types to use FastString as
they do not need the unique feature. They could just use some other
compact string type, but ghc's internal utils don't have much support
for such a type, so we just use FastString.

4 years agoMake mkFastStringByteString pure and fix up uses
Duncan Coutts [Sun, 24 Aug 2014 20:46:17 +0000 (21:46 +0100)] 
Make mkFastStringByteString pure and fix up uses

It's morally pure, and we'll need it in a pure context.

4 years agoAdd a ghc -show-packages mode to display ghc's view of the package env
Duncan Coutts [Sun, 24 Aug 2014 02:38:39 +0000 (03:38 +0100)] 
Add a ghc -show-packages mode to display ghc's view of the package env

You can use ghc -show-packages, in addition to any -package -package-conf
-hide-package, etc flags and see just what ghc's package info looks like.
The format is much like ghc-pkg show.

Like the existing verbose tracing, but a specific mode.
Re-introduce pretty printed package info (Cabal handled this previously).

4 years agoRemove a TODO that is now done
Duncan Coutts [Sun, 24 Aug 2014 02:41:45 +0000 (03:41 +0100)] 
Remove a TODO that is now done

4 years agoFix long lines and trailing whitespace
Duncan Coutts [Sat, 23 Aug 2014 12:12:20 +0000 (13:12 +0100)] 
Fix long lines and trailing whitespace

in the previous patches in this series

4 years agoFix warnings arising from the package db refactoring
Duncan Coutts [Fri, 22 Aug 2014 14:57:07 +0000 (15:57 +0100)] 
Fix warnings arising from the package db refactoring

4 years agoMake binary a boot package
Duncan Coutts [Fri, 22 Aug 2014 14:10:47 +0000 (15:10 +0100)] 
Make binary a boot package

Since ghc-pkg needs a relatively recent version.

4 years agoDrop ghc library dep on Cabal
Duncan Coutts [Fri, 22 Aug 2014 14:09:55 +0000 (15:09 +0100)] 
Drop ghc library dep on Cabal

4 years agoMove Cabal Binary instances from bin-package-db to ghc-pkg itself
Duncan Coutts [Fri, 22 Aug 2014 14:08:24 +0000 (15:08 +0100)] 
Move Cabal Binary instances from bin-package-db to ghc-pkg itself

The ghc-pkg program of course still depends on Cabal, it's just the
bin-package-db library (shared between ghc and ghc-pkg) that does not.