ghc-hetmet.git
13 years agoRemove some flags that are redundant now GHC gets configured by Cabal
Ian Lynagh [Sun, 16 Jan 2011 00:31:54 +0000 (00:31 +0000)]
Remove some flags that are redundant now GHC gets configured by Cabal

13 years agoChange some HC_OPTS var handling
Ian Lynagh [Sun, 16 Jan 2011 00:31:04 +0000 (00:31 +0000)]
Change some HC_OPTS var handling
In particular, this means ghc gets built with -rtsopt, -threaded, etc again.

13 years agoRemove some unnecessary workarounds
Ian Lynagh [Sun, 16 Jan 2011 00:28:03 +0000 (00:28 +0000)]
Remove some unnecessary workarounds
We can now rely on cross-package deps working properly, as we require
GHC 6.12.

13 years agoTidy up a bit
Ian Lynagh [Sun, 16 Jan 2011 00:11:21 +0000 (00:11 +0000)]
Tidy up a bit

13 years agoBuild system improvements
Ian Lynagh [Sat, 15 Jan 2011 23:19:27 +0000 (23:19 +0000)]
Build system improvements
We no longer use dummy-ghc; instead we don't configure most packages
until the stage1 compiler is available.

We also now use Cabal for building the ghc-bin package.

There are a couple more sanity checks too.

13 years agoWhitespace tweak
Ian Lynagh [Sat, 15 Jan 2011 21:41:49 +0000 (21:41 +0000)]
Whitespace tweak

13 years agoFix libffi build rules
Ian Lynagh [Sat, 15 Jan 2011 20:21:04 +0000 (20:21 +0000)]
Fix libffi build rules
Fixes a rare race when both libHSffi.a and libHSffi_p.a were being built
at the same time:

"cp" libffi/dist-install/build/libffi.a libffi/dist-install/build/libHSffi.a
"cp" libffi/dist-install/build/libffi.a libffi/dist-install/build/libHSffi.a
"cp" libffi/dist-install/build/libffi.so libffi/dist-install/build/libHSffi-ghc7.1.20110115.so
cp: cannot create regular file `libffi/dist-install/build/libHSffi.a': File exists

13 years agoFix Trac #4874: specialisation of INLINABLE things
simonpj@microsoft.com [Fri, 14 Jan 2011 16:32:27 +0000 (16:32 +0000)]
Fix Trac #4874: specialisation of INLINABLE things

Johan discovered that when INLINABLE things are specialised
bad things can happen. This patch implements a hack -- but
it's a simple hack and it solves the problem.

See Note [Inline specialisations].

The hack part is that really INLINABLE should not cause *any* loss
optimisation, and it does; see Note [Don't w/w INLINABLE things] in
WorkWrap.

13 years agoComments only
simonpj@microsoft.com [Fri, 14 Jan 2011 16:29:59 +0000 (16:29 +0000)]
Comments only

13 years agoFix a buglet in postInlineUnconditionally
simonpj@microsoft.com [Fri, 14 Jan 2011 16:29:27 +0000 (16:29 +0000)]
Fix a buglet in postInlineUnconditionally

Under obscure circumstances (actually only shown up when fixing something
else) it was possible for a variable binding to be discarded although
it was still used.  See Note [Top level and postInlineUnconditionally]

13 years agocope with empty libraries/stamp directory (in git repo)
Simon Marlow [Fri, 14 Jan 2011 14:24:06 +0000 (14:24 +0000)]
cope with empty libraries/stamp directory (in git repo)

13 years agoadd .gitignore
Simon Marlow [Fri, 14 Jan 2011 14:23:53 +0000 (14:23 +0000)]
add .gitignore

13 years agoFix longstanding bug in C-- inlining for functions calls.
Edward Z. Yang [Thu, 13 Jan 2011 13:06:54 +0000 (13:06 +0000)]
Fix longstanding bug in C-- inlining for functions calls.

13 years agofix for remote repos without -r
Simon Marlow [Thu, 13 Jan 2011 13:11:47 +0000 (13:11 +0000)]
fix for remote repos without -r

13 years agoadd a version of packages that stores all the repos in git
Simon Marlow [Thu, 13 Jan 2011 11:17:33 +0000 (11:17 +0000)]
add a version of packages that stores all the repos in git

13 years agoadd the -r flag from darcs-all
Simon Marlow [Thu, 13 Jan 2011 11:16:54 +0000 (11:16 +0000)]
add the -r flag from darcs-all

13 years agoMake Template Haskell classInstances function return [ClassInstance]
simonpj@microsoft.com [Thu, 13 Jan 2011 11:14:21 +0000 (11:14 +0000)]
Make Template Haskell classInstances function return [ClassInstance]

This is a recently-introduce function, which was returning
a [Name], being the names of the dfuns.  But what you really
want (obviously!) is the ClassInstances, and we have a TH type
for that.

This is an API change, so don't merge into GHC 7.0.  But it's
a new part of TH which is still settling down.

Fixes Trac #4863.

13 years agoImprove the finder's error messages
simonpj@microsoft.com [Thu, 13 Jan 2011 11:12:33 +0000 (11:12 +0000)]
Improve the finder's error messages

I'd done all the work to add fuzzy-match suggestions, but they
weren't really being used!  Here's what you get now

   module Foo where
    import Data.Lst

Foo.hs:3:1:
    Failed to load interface for `Data.Lst'
    Perhaps you meant
      Data.List (from base)
      Data.List (needs flag -package haskell2010-1.0.0.0)
      Data.Int (needs flag -package haskell2010-1.0.0.0)
    Use -v to see a list of the files searched for.

13 years agoWhite space only
simonpj@microsoft.com [Thu, 13 Jan 2011 09:39:31 +0000 (09:39 +0000)]
White space only

13 years agoProduce an error message, not a crash, for HsOpApp with non-var operator
simonpj@microsoft.com [Wed, 12 Jan 2011 17:07:19 +0000 (17:07 +0000)]
Produce an error message, not a crash, for HsOpApp with non-var operator

Fixes Trac #4877.

13 years agoupdate to work with current packages file format
Simon Marlow [Wed, 12 Jan 2011 16:02:24 +0000 (16:02 +0000)]
update to work with current packages file format

13 years agoIn configure, test that GHC generates code for the correct platform (#4819)
Simon Marlow [Fri, 7 Jan 2011 16:35:41 +0000 (16:35 +0000)]
In configure, test that GHC generates code for the correct platform (#4819)
Patch supplied by the bug reporter, tidied up by me.

$ ./configure --with-ghc=$HOME/fp/bin/i386-unknown-linux/ghc --build=x86_64-unknown-linux
checking for gfind... no
checking for find... /usr/bin/find
checking for sort... /usr/bin/sort
checking for GHC version date... inferred 7.1.20110107
checking version of ghc... 7.0.1
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
Host platform inferred as: i386-unknown-linux
Target platform inferred as: i386-unknown-linux
This GHC (/home/simonmar/fp/bin/i386-unknown-linux/ghc) does not generate code for the build platform
   GHC target platform    : i386-unknown-linux
   Desired build platform : x86_64-unknown-linux

13 years agoMajor refactoring of the type inference engine
simonpj@microsoft.com [Wed, 12 Jan 2011 14:56:04 +0000 (14:56 +0000)]
Major refactoring of the type inference engine

This patch embodies many, many changes to the contraint solver, which
make it simpler, more robust, and more beautiful.  But it has taken
me ages to get right. The forcing issue was some obscure programs
involving recursive dictionaries, but these eventually led to a
massive refactoring sweep.

Main changes are:
 * No more "frozen errors" in the monad.  Instead "insoluble
   constraints" are now part of the WantedConstraints type.

 * The WantedConstraint type is a product of bags, instead of (as
   before) a bag of sums.  This eliminates a good deal of tagging and
   untagging.

 * This same WantedConstraints data type is used
     - As the way that constraints are gathered
     - As a field of an implication constraint
     - As both argument and result of solveWanted
     - As the argument to reportUnsolved

 * We do not generate any evidence for Derived constraints. They are
   purely there to allow "impovement" by unifying unification
   variables.

 * In consequence, nothing is ever *rewritten* by a Derived
   constraint.  This removes, by construction, all the horrible
   potential recursive-dictionary loops that were making us tear our
   hair out.  No more isGoodRecEv search either. Hurrah!

 * We add the superclass Derived constraints during canonicalisation,
   after checking for duplicates.  So fewer superclass constraints
   are generated than before.

 * Skolem tc-tyvars no longer carry SkolemInfo.  Instead, the
   SkolemInfo lives in the GivenLoc of the Implication, where it
   can be tidied, zonked, and substituted nicely.  This alone is
   a major improvement.

 * Tidying is improved, so that we tend to get t1, t2, t3, rather
   than t1, t11, t111, etc

   Moreover, unification variables are always printed with a digit
   (thus a0, a1, etc), so that plain 'a' is available for a skolem
   arising from a type signature etc. In this way,
     (a) We quietly say which variables are unification variables,
         for those who know and care
     (b) Types tend to get printed as the user expects.  If he writes
             f :: a -> a
             f = ...blah...
         then types involving 'a' get printed with 'a', rather than
         some tidied variant.

 * There are significant improvements in error messages, notably
   in the "Cannot deduce X from Y" messages.

13 years agoFix installation on cygwin
Ian Lynagh [Tue, 11 Jan 2011 19:48:38 +0000 (19:48 +0000)]
Fix installation on cygwin

13 years agoDo dependency analysis when kind-checking type declarations
simonpj@microsoft.com [Mon, 10 Jan 2011 11:03:51 +0000 (11:03 +0000)]
Do dependency analysis when kind-checking type declarations

This patch fixes Trac #4875.  The main point is to do dependency
analysis on type and class declarations, and kind-check them in
dependency order, so as to improve error messages.

This patch means that a few programs that would typecheck before won't
typecheck any more; but before we were (naughtily) going beyond
Haskell 98 without any language-extension flags, and Trac #4875
convinces me that doing so is a Bad Idea.

Here's an example that won't typecheck any more
       data T a b = MkT (a b)
       type F k = T k Maybe

If you look at T on its own you'd default 'a' to kind *->*;
and then kind-checking would fail on F.

But GHC currently accepts this program beause it looks at
the *occurrences* of T.

13 years agoMove imports around (no change in behaviour)
simonpj@microsoft.com [Mon, 10 Jan 2011 10:56:47 +0000 (10:56 +0000)]
Move imports around (no change in behaviour)

13 years agoMake fuzzy matching a little less eager for short identifiers
simonpj@microsoft.com [Fri, 7 Jan 2011 10:28:55 +0000 (10:28 +0000)]
Make fuzzy matching a little less eager for short identifiers

For single-character identifiers we now don't make any suggestions
See comments in Util.fuzzyLookup

13 years agoFix Trac #4870: get the inlining for an imported INLINABLE Id
simonpj@microsoft.com [Wed, 5 Jan 2011 00:27:12 +0000 (00:27 +0000)]
Fix Trac #4870: get the inlining for an imported INLINABLE Id

We need the unfolding even for a *recursive* function (indeed
that's the point) and I was using the wrong function to get it
(idUnfolding rather than realIdUnfolding).

13 years agoRejig the includes/ installation rules
Ian Lynagh [Sun, 9 Jan 2011 18:11:58 +0000 (18:11 +0000)]
Rejig the includes/ installation rules
They're a little nicer now, and a regression in the cygwin build is
fixed (the $i in the destination wasn't surviving being passed through
cygpath).

13 years agoMake DESTDIR an absolute path when installing; fixes #4883
Ian Lynagh [Sat, 8 Jan 2011 17:16:35 +0000 (17:16 +0000)]
Make DESTDIR an absolute path when installing; fixes #4883

13 years agoAdd utils/ghc-cabal/Makefile
Ian Lynagh [Sat, 8 Jan 2011 14:40:49 +0000 (14:40 +0000)]
Add utils/ghc-cabal/Makefile

13 years agoRemove redundant import
Ian Lynagh [Sat, 8 Jan 2011 13:00:47 +0000 (13:00 +0000)]
Remove redundant import

13 years agoImprove error message of :set in ghci (ticket #4190).
Michal Terepeta [Tue, 30 Nov 2010 21:15:05 +0000 (21:15 +0000)]
Improve error message of :set in ghci (ticket #4190).

13 years agoImprove error message when importing data constructors (ticket #4058).
Michal Terepeta [Sat, 27 Nov 2010 21:13:38 +0000 (21:13 +0000)]
Improve error message when importing data constructors (ticket #4058).

13 years agocatch SIGTSTP and save/restore terminal settings (#4460)
Simon Marlow [Fri, 7 Jan 2011 12:40:42 +0000 (12:40 +0000)]
catch SIGTSTP and save/restore terminal settings (#4460)
As far as I can tell, it is the responsibility of the program to save
and restore its own terminal settings across a suspend/foreground, the
shell doesn't do it (which seems odd).  So I've added a signal handler
for SIGTSTP to the RTS which will save and restore the terminal
settings iff we modified them with hSetBuffering or hSetEcho (we
already restore them at exit time in these cases).

13 years agocomment updates
Simon Marlow [Fri, 7 Jan 2011 09:42:36 +0000 (09:42 +0000)]
comment updates

13 years agoOn Cygwin, use a Cygwin-style path for /bin/install's destination
Ian Lynagh [Thu, 6 Jan 2011 22:30:30 +0000 (22:30 +0000)]
On Cygwin, use a Cygwin-style path for /bin/install's destination

cygwin's /bin/install doesn't set file modes correctly if the
destination path is a C: style path:

$ /bin/install -c -m 644 foo /cygdrive/c/cygwin/home/ian/foo2
$ /bin/install -c -m 644 foo c:/cygwin/home/ian/foo3
$ ls -l foo*
-rw-r--r-- 1 ian None 0 2011-01-06 18:28 foo
-rw-r--r-- 1 ian None 0 2011-01-06 18:29 foo2
-rwxrwxrwx 1 ian None 0 2011-01-06 18:29 foo3

This causes problems for bindisttest/checkBinaries.sh which then
thinks that e.g. the userguide HTML files are binaries.

We therefore use a /cygdrive path if we are on cygwin

13 years agoFix mkUserGuidePart program name on Windows
Ian Lynagh [Thu, 6 Jan 2011 14:37:07 +0000 (14:37 +0000)]
Fix mkUserGuidePart program name on Windows

13 years agoadd comment to remind people to update driver/gcc/gcc.c
Simon Marlow [Thu, 6 Jan 2011 15:24:02 +0000 (15:24 +0000)]
add comment to remind people to update driver/gcc/gcc.c

13 years agouse Win32 CreateProcess() rather than mingw spawnv() (#4531)
Simon Marlow [Thu, 6 Jan 2011 13:38:34 +0000 (13:38 +0000)]
use Win32 CreateProcess() rather than mingw spawnv() (#4531)

13 years agoupdate paths now that we upgraded gcc to 4.5.0
Simon Marlow [Thu, 6 Jan 2011 13:37:29 +0000 (13:37 +0000)]
update paths now that we upgraded gcc to 4.5.0

13 years agofix markup
Simon Marlow [Thu, 6 Jan 2011 09:31:52 +0000 (09:31 +0000)]
fix markup

13 years agofix up multi-line GHCi patch (#4316)
Simon Marlow [Wed, 5 Jan 2011 15:45:48 +0000 (15:45 +0000)]
fix up multi-line GHCi patch (#4316)

13 years agomultiline commands in GHCi #4316
Vivian McPhail [Fri, 5 Nov 2010 05:13:08 +0000 (05:13 +0000)]
multiline commands in GHCi #4316
This patch adds support for multiline commands in GHCi.

The first line of input is lexed.  If there is an active
layout context once the lexer reaches the end of file, the
user is prompted for more input.

Multiline input is exited by an empty line and can be escaped
with a user interrupt.

Multiline mode is toggled with `:set +m`

13 years agoReplace a #if with a Haskell conditional
Ian Lynagh [Wed, 5 Jan 2011 18:30:11 +0000 (18:30 +0000)]
Replace a #if with a Haskell conditional

13 years agoWhitespace only in X86.Ppr
Ian Lynagh [Wed, 5 Jan 2011 17:11:24 +0000 (17:11 +0000)]
Whitespace only in X86.Ppr

13 years agoFix error compiling AsmCodeGen.lhs for PPC Mac (unused makeFar addr)
naur@post11.tele.dk [Sun, 19 Dec 2010 21:35:55 +0000 (21:35 +0000)]
Fix error compiling AsmCodeGen.lhs for PPC Mac (unused makeFar addr)

13 years agoDefine cTargetArch and start to use it rather than ifdefs
Ian Lynagh [Tue, 4 Jan 2011 22:00:13 +0000 (22:00 +0000)]
Define cTargetArch and start to use it rather than ifdefs
Using Haskell conditionals means the compiler sees all the code, so
there should be less rot of code specific to uncommon arches. Code
for other platforms should still be optimised away, although if we want
to support targetting other arches then we'll need to compile it
for-real anyway.

13 years agoFix error compiling AsmCodeGen.lhs for PPC Mac (rtsPackageId)
naur@post11.tele.dk [Sun, 19 Dec 2010 21:25:30 +0000 (21:25 +0000)]
Fix error compiling AsmCodeGen.lhs for PPC Mac (rtsPackageId)

13 years agoRename the c*Platform variables to c*PlatformString
Ian Lynagh [Tue, 4 Jan 2011 21:02:50 +0000 (21:02 +0000)]
Rename the c*Platform variables to c*PlatformString

13 years agoFix #4829 (build does not respect --with-gcc option)
gwright@antiope.com [Tue, 21 Dec 2010 13:32:33 +0000 (13:32 +0000)]
Fix #4829 (build does not respect --with-gcc option)

This patch fixes what seems to be the last problem with the --with-gcc
option.  On OS X, we need to pass the path to gcc to dtrace as the
preprocessor.  (Internally, dtrace on OS X sets the default preprocessor
to /usr/bin/gcc.)  ATM, dtrace is only supported on OS X, so we don't
need any conditionalization.  If dtrace is ported to other platforms,
we might need to change this. However, usage on other platforms will
probably be similar to OS X, since many of Apple's changes are to
use the gnu toolchain instead of the Sun toolchain.

13 years agoDrop a seven years old workaround for happy
Matthias Kilian [Fri, 31 Dec 2010 19:23:43 +0000 (19:23 +0000)]
Drop a seven years old workaround for happy

13 years agoAdd gcc and ld flags to --info output
Ian Lynagh [Mon, 20 Dec 2010 17:35:20 +0000 (17:35 +0000)]
Add gcc and ld flags to --info output

13 years agoFix Trac #4525: report type errors in terms of the immediate type synonym
simonpj@microsoft.com [Fri, 24 Dec 2010 08:25:20 +0000 (08:25 +0000)]
Fix Trac #4525: report type errors in terms of the immediate type synonym

This small change means that if you have
     type Age = Int
and you try to unify Age and Bool, you'll get a complaint about
not matching Age and Bool, rather than Int and Bool.  See the notes
with Trac #4525

13 years agoComments only
simonpj@microsoft.com [Fri, 24 Dec 2010 08:23:10 +0000 (08:23 +0000)]
Comments only

13 years agoImplement fuzzy matching for the Finder
simonpj@microsoft.com [Wed, 22 Dec 2010 17:54:00 +0000 (17:54 +0000)]
Implement fuzzy matching for the Finder

..so that you get a more helpful message when
you mis-spell a module name in an 'import'.

Validates, but not fully tested.

Based on Max's patch in Trac #2442, but heavily refactored.

13 years agoImplement fuzzy matching for the renamer
simonpj@microsoft.com [Wed, 22 Dec 2010 17:53:06 +0000 (17:53 +0000)]
Implement fuzzy matching for the renamer

...so that you get helpful suggestions when you mis-spell a name
Based on Max's patch in Trac #2442, but heavily refactored.

13 years agoAdd fuzzyLookup, a variant of fuzzyMatch
simonpj@microsoft.com [Wed, 22 Dec 2010 17:51:24 +0000 (17:51 +0000)]
Add fuzzyLookup, a variant of fuzzyMatch

Plus, I changed quite a bit of layout to make the lines shorter.

13 years agoWhite space only
simonpj@microsoft.com [Wed, 22 Dec 2010 17:50:01 +0000 (17:50 +0000)]
White space only

13 years agoLayout and white space only
simonpj@microsoft.com [Wed, 22 Dec 2010 17:49:50 +0000 (17:49 +0000)]
Layout and white space only

13 years agoTidy up rebindable syntax for MDo
simonpj@microsoft.com [Wed, 22 Dec 2010 13:22:10 +0000 (13:22 +0000)]
Tidy up rebindable syntax for MDo

For a long time an 'mdo' expression has had a SyntaxTable
attached to it.  However, we're busy deprecating SyntaxTables
in favour of rebindable syntax attached to individual Stmts,
and MDoExpr was totally inconsistent with DoExpr in this
regard.

This patch tidies it all up.  Now there's no SyntaxTable on
MDoExpr, and 'modo' is generally handled much more like 'do'.

There is resulting small change in behaviour: now MonadFix is
required only if you actually *use* recursion in mdo. This
seems consistent with the implicit dependency analysis that
is done for mdo.

Still to do:
  * Deal with #4148 (this patch is on the way)
  * Get rid of the last remaining SyntaxTable on HsCmdTop

13 years agoMake the occurrence analyser track preInlineUnconditionally
simonpj@microsoft.com [Wed, 22 Dec 2010 13:11:56 +0000 (13:11 +0000)]
Make the occurrence analyser track preInlineUnconditionally

This fixes a somewhat obscure situation in which an
over-optimistic use of "occurs once" led to an infinite
sequence of simplifier iterations.  Se Note [Cascading inlines]
for the details.

This showed up when compiling rather large DPH programs, which
run lots of iterations of the simplifier, which in turn made
compilation take much longer than necessary.

13 years agoMake mkDFunUnfolding more robust
simonpj@microsoft.com [Wed, 22 Dec 2010 13:08:54 +0000 (13:08 +0000)]
Make mkDFunUnfolding more robust

It now uses tcSplitDFunTy, which is designed for the purpose and
allows arbitrary argument types to the dfun, rather than
tcSplitSigmaTy.  This generality is used in DPH, which has
internally-generated dfuns with impliciation-typed arguments.

To do this I had to make tcSplitDFunTy return the number of
arguments, so there are some minor knock-on effects in other
modules.

13 years agoCount allocations more accurately
Simon Marlow [Tue, 21 Dec 2010 15:29:56 +0000 (15:29 +0000)]
Count allocations more accurately
The allocation stats (+RTS -s etc.) used to count the slop at the end
of each nursery block (except the last) as allocated space, now we
count the allocated words accurately.  This should make allocation
figures more predictable, too.

This has the side effect of reducing the apparent allocations by a
small amount (~1%), so remember to take this into account when looking
at nofib results.

13 years agoAdd a simple arity analyser
simonpj@microsoft.com [Tue, 21 Dec 2010 16:58:00 +0000 (16:58 +0000)]
Add a simple arity analyser

I've wanted to do this for ages, but never gotten around to
it.  The main notes are in Note [Arity analysis] in SimplUtils.

The motivating example for arity analysis is this:

  f = \x. let g = f (x+1)
          in \y. ...g...

What arity does f have?  Really it should have arity 2, but a naive
look at the RHS won't see that.  You need a fixpoint analysis which
says it has arity "infinity" the first time round.

This makes things more robust to the way in which you write code.  For
example, see Trac #4474 which is fixed by this change.

Not a huge difference, but worth while:

        Program           Size    Allocs   Runtime   Elapsed
--------------------------------------------------------------------------------
            Min          -0.4%     -2.2%    -10.0%    -10.0%
            Max          +2.7%     +0.3%     +7.1%     +6.9%
 Geometric Mean          -0.3%     -0.2%     -2.1%     -2.2%

I don't really believe the runtime numbers, because the machine was
busy, but the bottom line is that not much changes, and what does
change reliably (allocation and size) is in the right direction.

13 years agoMiscellaneous tidying up and refactoring
simonpj@microsoft.com [Tue, 21 Dec 2010 16:19:31 +0000 (16:19 +0000)]
Miscellaneous tidying up and refactoring

13 years agoComments only
simonpj@microsoft.com [Tue, 21 Dec 2010 16:19:18 +0000 (16:19 +0000)]
Comments only

13 years agoSingle-method classes are implemented with a newtype
simonpj@microsoft.com [Tue, 21 Dec 2010 16:19:11 +0000 (16:19 +0000)]
Single-method classes are implemented with a newtype

This patch changes things so that such classes rely on the coercion
mechanism for inlining (since the constructor is really just a cast)
rather than on the dfun mechanism, therby removing some needless
runtime indirections.

13 years agoFor single-method classes use newtypes
simonpj@microsoft.com [Mon, 1 Nov 2010 08:07:36 +0000 (08:07 +0000)]
For single-method classes use newtypes

This clears up an awkward hack for exprIsConApp_maybe, and
works better too.  See Note [Single-method classes] in
TcInstDcls.

13 years agoboundTaskExiting: don't set task->stopped unless this is the last call (#4850)
Simon Marlow [Tue, 21 Dec 2010 11:58:07 +0000 (11:58 +0000)]
boundTaskExiting: don't set task->stopped unless this is the last call (#4850)
The bug in this case was that we had a worker thread making a foreign
call which invoked a callback (in this case it was performGC, I
think).  When the callback ended, boundTaskExiting() was setting
task->stopped, but the Task is now per-OS-thread, so it is shared by
the worker that made the original foreign call.  When the foreign call
returned, because task->stopped was set, the worker was not placed on
the queue of spare workers.  Somehow the worker woke up again, and
found the spare_workers queue empty, which lead to a crash.

Two bugs here: task->stopped should not have been set by
boundTaskExiting (this broke when I split the Task and InCall structs,
in 6.12.2), and releaseCapabilityAndQueueWorker() should not be
testing task->stopped anyway, because it should only ever be called
when task->stopped is false (this is now an assertion).

13 years agoreleaseCapabilityAndQueueWorker: task->stopped should be false (#4850)
Simon Marlow [Tue, 21 Dec 2010 11:49:11 +0000 (11:49 +0000)]
releaseCapabilityAndQueueWorker: task->stopped should be false (#4850)

13 years agoFix Windows build
Simon Marlow [Tue, 21 Dec 2010 10:21:01 +0000 (10:21 +0000)]
Fix Windows build

13 years agoraiseExceptionHelper: update tso->stackobj->sp before calling threadStackOverflow...
Simon Marlow [Tue, 21 Dec 2010 10:14:11 +0000 (10:14 +0000)]
raiseExceptionHelper: update tso->stackobj->sp before calling threadStackOverflow (#4845)

13 years agoadd 'make re2' for rebuilding stage2 (similarly re1 and re3)
Simon Marlow [Tue, 21 Dec 2010 10:02:54 +0000 (10:02 +0000)]
add 'make re2' for rebuilding stage2 (similarly re1 and re3)

13 years agofix warning
Simon Marlow [Thu, 16 Dec 2010 16:04:15 +0000 (16:04 +0000)]
fix warning

13 years agoSmall improvement to CorePrep
simonpj@microsoft.com [Mon, 20 Dec 2010 12:37:15 +0000 (12:37 +0000)]
Small improvement to CorePrep

This change avoids unnecessary bindings. Example

     foo (let fn = \x.blah in
          in fn)

We were generating something stupid like

    let fn = \x.blah in
    let fn' = \eta. fn eta
    in foo fn

Now we don't.  The change is quite small.

Thanks to Ben for showing me an example of this happening.

13 years agoFix warnings
Ian Lynagh [Sun, 19 Dec 2010 20:27:11 +0000 (20:27 +0000)]
Fix warnings

13 years agoSmall refactoring
Ian Lynagh [Sun, 19 Dec 2010 19:40:32 +0000 (19:40 +0000)]
Small refactoring

13 years agoDrop GhcWithLlvmCodeGen configuration bits
Matthias Kilian [Sun, 19 Dec 2010 18:02:39 +0000 (18:02 +0000)]
Drop GhcWithLlvmCodeGen configuration bits
The LLVM code generator is always built unconditionally, so both the
configuration variable in mk/config.mk.in as well as the string in
compilerInfo can be removed.

13 years agoPass --hoogle to haddock; fixes trac #4521
Ian Lynagh [Sun, 19 Dec 2010 12:52:43 +0000 (12:52 +0000)]
Pass --hoogle to haddock; fixes trac #4521

13 years agovectoriser: don't always pass superclass dictionaries to PA dfuns
Roman Leshchinskiy [Sat, 18 Dec 2010 23:48:38 +0000 (23:48 +0000)]
vectoriser: don't always pass superclass dictionaries to PA dfuns

This is just a guess at how this should work.

13 years agovectoriser: delete dead code
Roman Leshchinskiy [Sat, 18 Dec 2010 12:53:50 +0000 (12:53 +0000)]
vectoriser: delete dead code

13 years agovectoriser: adapt to new superclass story part I (dictionary construction)
Roman Leshchinskiy [Sat, 18 Dec 2010 11:49:53 +0000 (11:49 +0000)]
vectoriser: adapt to new superclass story part I (dictionary construction)

13 years agoReplace uses of the old try function with the new one
Ian Lynagh [Sat, 18 Dec 2010 23:08:27 +0000 (23:08 +0000)]
Replace uses of the old try function with the new one

13 years agoReplace uses of the old catch function with the new one
Ian Lynagh [Sat, 18 Dec 2010 21:33:50 +0000 (21:33 +0000)]
Replace uses of the old catch function with the new one

13 years agoCreate ~/.ghc/ if it doesn't already exist; fixes trac #4522
Ian Lynagh [Sat, 18 Dec 2010 18:49:25 +0000 (18:49 +0000)]
Create ~/.ghc/ if it doesn't already exist; fixes trac #4522

13 years agoDocument GADTSyntax extension
Ian Lynagh [Sat, 18 Dec 2010 15:01:21 +0000 (15:01 +0000)]
Document GADTSyntax extension

13 years agoImplement GADTSyntax extension
Ian Lynagh [Sat, 18 Dec 2010 14:45:50 +0000 (14:45 +0000)]
Implement GADTSyntax extension

13 years agoWhitespace-only in rts/Linker.c
Ian Lynagh [Fri, 17 Dec 2010 23:41:24 +0000 (23:41 +0000)]
Whitespace-only in rts/Linker.c

13 years agoAdd some casts to fix warnings; patch from Greg Wright
Ian Lynagh [Fri, 17 Dec 2010 22:38:11 +0000 (22:38 +0000)]
Add some casts to fix warnings; patch from Greg Wright

13 years agoPut an up-to-date Makefile in docs/Makefile
Ian Lynagh [Fri, 17 Dec 2010 22:37:07 +0000 (22:37 +0000)]
Put an up-to-date Makefile in docs/Makefile
It doesn't do anything useful yet, but it works with the new build system

13 years agodo not compile part of shared lib RTS with -fno-PIC on Solaris
Karel Gardas [Fri, 17 Dec 2010 08:51:33 +0000 (08:51 +0000)]
do not compile part of shared lib RTS with -fno-PIC on Solaris

13 years agoprovide shared libraries support on i386-unknown-solaris2 platform
Karel Gardas [Fri, 17 Dec 2010 08:46:17 +0000 (08:46 +0000)]
provide shared libraries support on i386-unknown-solaris2 platform

13 years agofix CPP detection of Solaris in NCG
Karel Gardas [Fri, 17 Dec 2010 08:45:10 +0000 (08:45 +0000)]
fix CPP detection of Solaris in NCG

13 years agoFix checkBinaries on OS X
Ian Lynagh [Thu, 16 Dec 2010 20:11:21 +0000 (20:11 +0000)]
Fix checkBinaries on OS X

13 years agoRemove redundant HpcMap and HpcSet wrappers around Data.{Map,Set}
Ian Lynagh [Thu, 16 Dec 2010 19:06:05 +0000 (19:06 +0000)]
Remove redundant HpcMap and HpcSet wrappers around Data.{Map,Set}

13 years agoUse "-perm -u+x" rather than "-executable" to find executables
Ian Lynagh [Thu, 16 Dec 2010 14:52:35 +0000 (14:52 +0000)]
Use "-perm -u+x" rather than "-executable" to find executables
On Windows, -executable is matching the html docs.

13 years agoRemove a debugging print
Ian Lynagh [Thu, 16 Dec 2010 01:14:59 +0000 (01:14 +0000)]
Remove a debugging print

13 years ago__GLASGOW_HASKELL__ >= 604 is now always true
Ian Lynagh [Wed, 15 Dec 2010 21:46:56 +0000 (21:46 +0000)]
__GLASGOW_HASKELL__ >= 604 is now always true

13 years agoRemove more dead code now we require GHC >= 6.12
Ian Lynagh [Wed, 15 Dec 2010 21:37:15 +0000 (21:37 +0000)]
Remove more dead code now we require GHC >= 6.12