ghc-hetmet.git
11 years agoSeparate NondecreasingIndentation out into its own extension
Ian Lynagh [Wed, 24 Nov 2010 22:05:07 +0000 (22:05 +0000)]
Separate NondecreasingIndentation out into its own extension

11 years agoAdd another GHC layout rule relaxation to RelaxedLayout
Ian Lynagh [Wed, 24 Nov 2010 20:59:57 +0000 (20:59 +0000)]
Add another GHC layout rule relaxation to RelaxedLayout

11 years agoRemove an unused build system variable: GhcDir
Ian Lynagh [Wed, 24 Nov 2010 14:04:55 +0000 (14:04 +0000)]
Remove an unused build system variable: GhcDir

11 years agoRemove unused build system variable: GhcHasEditline
Ian Lynagh [Wed, 24 Nov 2010 14:04:15 +0000 (14:04 +0000)]
Remove unused build system variable: GhcHasEditline

11 years agoRemove unused variables from the build system: HBC, NHC, MKDEPENDHS
Ian Lynagh [Wed, 24 Nov 2010 14:00:52 +0000 (14:00 +0000)]
Remove unused variables from the build system: HBC, NHC, MKDEPENDHS

11 years agoRemove references to Haskell 98
Ian Lynagh [Tue, 23 Nov 2010 23:35:36 +0000 (23:35 +0000)]
Remove references to Haskell 98
They are no longer right, as we have Haskell' generating new Haskell
standards.

11 years agoTweak a configure test
Ian Lynagh [Tue, 23 Nov 2010 17:06:21 +0000 (17:06 +0000)]
Tweak a configure test

11 years agoAdd a configure test for the visibility hidden attribute
Ian Lynagh [Tue, 23 Nov 2010 17:05:41 +0000 (17:05 +0000)]
Add a configure test for the visibility hidden attribute

11 years agosanity: fix places where we weren't filling fresh memory with 0xaa
Simon Marlow [Fri, 29 Oct 2010 09:28:43 +0000 (09:28 +0000)]
sanity: fix places where we weren't filling fresh memory with 0xaa

11 years agoJust some alpha renaming
Ian Lynagh [Sun, 21 Nov 2010 14:44:55 +0000 (14:44 +0000)]
Just some alpha renaming

11 years agoFix bug #3165 (:history throws irrefutable pattern failed)
pepeiborra@gmail.com [Mon, 15 Nov 2010 22:36:23 +0000 (22:36 +0000)]
Fix bug #3165 (:history throws irrefutable pattern failed)

I ran across this bug and took the time to fix it, closing
a long time due TODO in InteractiveEval.hs

Instead of looking around to find the enclosing declaration
of a tick, this patch makes use of the information already collected during the
coverage desugaring phase

11 years agoFor bindists, build ghc-pwd with stage 1
Ian Lynagh [Sun, 21 Nov 2010 18:35:20 +0000 (18:35 +0000)]
For bindists, build ghc-pwd with stage 1
rather then the bootstrapping compiler. This fixes problems where the
bootstrapping compiler dynamically links against libraries not on the
target machine.

11 years agoMakefile tweak
Ian Lynagh [Sun, 21 Nov 2010 18:33:42 +0000 (18:33 +0000)]
Makefile tweak

11 years agoFix a makefile include ordering sanity check
Ian Lynagh [Sun, 21 Nov 2010 17:49:16 +0000 (17:49 +0000)]
Fix a makefile include ordering sanity check

11 years agoAdd an extension for GHC's layout-rule relaxations
Ian Lynagh [Sat, 20 Nov 2010 21:53:40 +0000 (21:53 +0000)]
Add an extension for GHC's layout-rule relaxations
Still TODO: Add the other relaxation (#1060) and update the alternative
layout rule to use the extension.

11 years agoTweak the bindist configure.ac.in
Ian Lynagh [Sat, 20 Nov 2010 17:37:35 +0000 (17:37 +0000)]
Tweak the bindist configure.ac.in

11 years agoconfigure.ac tweaks
Ian Lynagh [Sat, 20 Nov 2010 17:02:45 +0000 (17:02 +0000)]
configure.ac tweaks

11 years agoWhen testing the bindist, tell it where gcc is
Ian Lynagh [Sat, 20 Nov 2010 15:59:20 +0000 (15:59 +0000)]
When testing the bindist, tell it where gcc is
The location isn't baked into the bindist, as it may differ from
machine to machine.

11 years agoComments only
simonpj@microsoft.com [Fri, 19 Nov 2010 10:01:53 +0000 (10:01 +0000)]
Comments only

11 years agoForceSpecConstr now forces specialisation even for arguments which aren't scrutinised
Roman Leshchinskiy [Thu, 18 Nov 2010 21:28:39 +0000 (21:28 +0000)]
ForceSpecConstr now forces specialisation even for arguments which aren't scrutinised

11 years agoMove the superclass generation to the canonicaliser
simonpj@microsoft.com [Thu, 18 Nov 2010 12:05:33 +0000 (12:05 +0000)]
Move the superclass generation to the canonicaliser

Doing superclass generation in the canonicaliser (rather than
TcInteract) uses less code, and is generally more efficient.

See Note [Adding superclasses] in TcCanonical.

Fixes Trac #4497.

11 years agoFix the generation of in-scope variables for IfaceLint check
simonpj@microsoft.com [Thu, 18 Nov 2010 09:00:57 +0000 (09:00 +0000)]
Fix the generation of in-scope variables for IfaceLint check

11 years agoComments only
simonpj@microsoft.com [Thu, 18 Nov 2010 09:00:34 +0000 (09:00 +0000)]
Comments only

11 years agoOmit bogus test for -XDeriveFunctor
simonpj@microsoft.com [Thu, 18 Nov 2010 09:00:28 +0000 (09:00 +0000)]
Omit bogus test for -XDeriveFunctor

It was duplicated in the case of 'deriving( Functor )'
and wrong for 'deriving( Foldable )'

11 years agoImprove error message on advice from a user
simonpj@microsoft.com [Thu, 18 Nov 2010 08:53:06 +0000 (08:53 +0000)]
Improve error message on advice from a user

See Trac #4499

11 years agoFix the type sanity test in genprimopcode's Syntax.hs 2010-11-18
Ian Lynagh [Wed, 17 Nov 2010 16:30:31 +0000 (16:30 +0000)]
Fix the type sanity test in genprimopcode's Syntax.hs
We assume this is what it's supposed to be checking. Certainly the old
test (t2 == t2) can't be right.
Spotted by Andres Loeh.

11 years agoBuild random with the stage2 compiler
Ian Lynagh [Wed, 17 Nov 2010 15:52:59 +0000 (15:52 +0000)]
Build random with the stage2 compiler

11 years agoremove -XNoMonomorphismRestriction
Simon Marlow [Wed, 17 Nov 2010 12:49:26 +0000 (12:49 +0000)]
remove -XNoMonomorphismRestriction
This was apparently needed at some point during the new typechecker
development, but does not seem to be required now.

11 years agoadd some {-# LANGUAGE BangPatterns #-} to mollify GHC
Simon Marlow [Wed, 17 Nov 2010 11:37:05 +0000 (11:37 +0000)]
add some {-# LANGUAGE BangPatterns #-} to mollify GHC

11 years agoEventlog: Put correct size for startup event
scpmw@leeds.ac.uk [Fri, 5 Nov 2010 15:16:55 +0000 (15:16 +0000)]
Eventlog: Put correct size for startup event

11 years agoDocument SPECIALISE for imported functions
simonpj@microsoft.com [Wed, 17 Nov 2010 11:15:59 +0000 (11:15 +0000)]
Document SPECIALISE for imported functions

This is a really useful new facility, but I'd forgotten to document it.
Pls merge to 7.0 branch

11 years agoFix Trac #4498: bang-pattern bindings are monomorphic
simonpj@microsoft.com [Wed, 17 Nov 2010 10:10:58 +0000 (10:10 +0000)]
Fix Trac #4498: bang-pattern bindings are monomorphic

This patch forces bang patterns to be monomorphic,
and documents this fact.

11 years agoComments only
simonpj@microsoft.com [Wed, 17 Nov 2010 10:08:39 +0000 (10:08 +0000)]
Comments only

11 years agoFix Trac #4501: a transposition error in DynFlags
simonpj@microsoft.com [Wed, 17 Nov 2010 10:08:32 +0000 (10:08 +0000)]
Fix Trac #4501: a transposition error in DynFlags

Push to STABLE

11 years agoRefactoring of the way that inlinings and rules are activated
simonpj@microsoft.com [Tue, 16 Nov 2010 17:37:19 +0000 (17:37 +0000)]
Refactoring of the way that inlinings and rules are activated

Principally, the SimplifierMode now carries several (currently
four) flags in *all* phases, not just the "Gentle" phase.
This makes things simpler and more uniform.

As usual I did more refactoring than I had intended.

This stuff should go into 7.0.2 in due course, once
we've checked it solves the DPH performance problems.

11 years agoSome infrastruture for lambda-lifting
simonpj@microsoft.com [Tue, 16 Nov 2010 17:35:00 +0000 (17:35 +0000)]
Some infrastruture for lambda-lifting

This stuff should have no effect but it sets things
up so that we can try floating out lambdas of n value
arguments.

The new (secret) flag is -ffloatt-lam-args=n.

This is *not* working yet, but it's got tangled up with
other stuff I want to commit, and it does no harm.

11 years agoOccurrence analyser takes account of the phase when handing RULES
simonpj@microsoft.com [Tue, 16 Nov 2010 17:33:12 +0000 (17:33 +0000)]
Occurrence analyser takes account of the phase when handing RULES

See Note [Finding rule RHS free vars]

This should make Roman happy.

11 years agoAdd -fwarn-lazy-unlifted-bindings to the list of flags
simonpj@microsoft.com [Tue, 16 Nov 2010 17:22:11 +0000 (17:22 +0000)]
Add -fwarn-lazy-unlifted-bindings to the list of flags

11 years agoWarn a bit less often about unlifted bindings.
simonpj@microsoft.com [Tue, 16 Nov 2010 17:18:43 +0000 (17:18 +0000)]
Warn a bit less often about unlifted bindings.

Warn when
   (a) a pattern bindings binds unlifted values
   (b) it has no top-level bang
   (c) the RHS has a *lifted* type

Clause (c) is new, argued for by Simon M

Eg     x# = 4# + 4#      -- No warning
       (# a,b #) = blah  -- No warning
       I# x = blah       -- Warning

11 years agoLibraries bytestirng, time, binary need -fno-warn-identities
simonpj@microsoft.com [Tue, 16 Nov 2010 17:16:10 +0000 (17:16 +0000)]
Libraries bytestirng, time, binary need -fno-warn-identities

They all have redundant uses of fromIntegral, but are no under
GHC HQ control.

11 years agoImprove documentation for -fwarn-incomplete-patterns
simonpj@microsoft.com [Tue, 16 Nov 2010 17:15:27 +0000 (17:15 +0000)]
Improve documentation for -fwarn-incomplete-patterns

11 years agoAdd warning for probable identities (fromIntegral and friends)
simonpj@microsoft.com [Tue, 16 Nov 2010 17:15:10 +0000 (17:15 +0000)]
Add warning for probable identities (fromIntegral and friends)

See Trac #4488.  The basic idea is to check for

    fun :: ty -> ty

where fun is one of
  toIntegerName     toRationalName
  fromIntegralName  realToFracName

There's a (documented) flag to control it -fwarn-identities.
Currently -Wall switches it on.

11 years agoRemove unncessary fromIntegral calls
simonpj@microsoft.com [Tue, 16 Nov 2010 17:12:47 +0000 (17:12 +0000)]
Remove unncessary fromIntegral calls

11 years agoFix -fwarn-missing-import-lists (fix Trac #4489)
simonpj@microsoft.com [Mon, 15 Nov 2010 23:21:42 +0000 (23:21 +0000)]
Fix -fwarn-missing-import-lists (fix Trac #4489)

11 years agoDeriving Typeable changes
simonpj@microsoft.com [Mon, 15 Nov 2010 23:11:46 +0000 (23:11 +0000)]
Deriving Typeable changes

* Fix a bug that led to a crash with
    data family T a
    deriving Functor T

* Allow deriving Typeable for data families
    data family T a
    deriving Typeable1 T

* Some refactoring and tidying

11 years agoEnsure that instance overlap errors are report properly
simonpj@microsoft.com [Mon, 15 Nov 2010 14:28:05 +0000 (14:28 +0000)]
Ensure that instance overlap errors are report properly

This (annoyingly) requires us to re-flatten the class predicate.
See Note [Flattening in error message generation]

11 years agoEnsure that unification variables alloc'd during solving are untouchable
simonpj@microsoft.com [Mon, 15 Nov 2010 12:15:40 +0000 (12:15 +0000)]
Ensure that unification variables alloc'd during solving are untouchable

This fixes Trac #4494.  See Note [Extra TcsTv untouchables] in TcSimplify.

11 years agoFix paths used for doc publishing in the nightly builds
Ian Lynagh [Sun, 14 Nov 2010 20:55:27 +0000 (20:55 +0000)]
Fix paths used for doc publishing in the nightly builds

11 years agoRemove -Ofile docs
Ian Lynagh [Sun, 14 Nov 2010 17:33:32 +0000 (17:33 +0000)]
Remove -Ofile docs
They said:
    (NOTE: not supported since GHC 4.x.  Please ask if you're interested
    in this.)

11 years agoUpdate to docbook 4.5; fixes trac #4447
Ian Lynagh [Sun, 14 Nov 2010 15:50:23 +0000 (15:50 +0000)]
Update to docbook 4.5; fixes trac #4447

11 years agoAdd a build system dependency; fixes #4357
Ian Lynagh [Sun, 14 Nov 2010 14:03:11 +0000 (14:03 +0000)]
Add a build system dependency; fixes #4357

11 years agoBuild system tweak: Inline DQ now it's the same on all platforms
Ian Lynagh [Sun, 14 Nov 2010 13:46:36 +0000 (13:46 +0000)]
Build system tweak: Inline DQ now it's the same on all platforms

11 years agoFix up the ifdefs in Task.c
Ian Lynagh [Sat, 13 Nov 2010 12:53:14 +0000 (12:53 +0000)]
Fix up the ifdefs in Task.c

11 years agoUse standard task ID print style (hexadecimal).
Edward Z. Yang [Thu, 11 Nov 2010 00:09:12 +0000 (00:09 +0000)]
Use standard task ID print style (hexadecimal).

11 years agoRemove use of (now-gone) VarPatOut
simonpj@microsoft.com [Fri, 12 Nov 2010 23:07:01 +0000 (23:07 +0000)]
Remove use of (now-gone) VarPatOut

11 years agoRemove the now-unused constructor VarPatOut
simonpj@microsoft.com [Fri, 5 Nov 2010 13:16:36 +0000 (13:16 +0000)]
Remove the now-unused constructor VarPatOut

11 years agoTrack change in isInlinePragma
simonpj@microsoft.com [Fri, 5 Nov 2010 13:15:45 +0000 (13:15 +0000)]
Track change in isInlinePragma

In TcBinds we want to use isAnyInlinePragma, to get
both INLINE and INLINABLE.  I don't know why this isn't
leading to failures for others!  The (bogus) error I got,
triggered by this bug was:

  libraries\haskeline\System\Console\Haskeline\Key.hs:23:1:
    You cannot SPECIALISE `M.findWithDefault'
      because its definition has no INLINE/INLINABLE pragma

11 years agoMore modules that need LANGUAGE BangPatterns
simonpj@microsoft.com [Fri, 12 Nov 2010 17:44:39 +0000 (17:44 +0000)]
More modules that need LANGUAGE BangPatterns

11 years agoAdd LANGUAGE BangPatterns to modules that use them
simonpj@microsoft.com [Fri, 12 Nov 2010 17:20:49 +0000 (17:20 +0000)]
Add LANGUAGE BangPatterns to modules that use them

11 years agoWarn about top-level bangs (Trac #4477)
simonpj@microsoft.com [Fri, 12 Nov 2010 16:08:01 +0000 (16:08 +0000)]
Warn about top-level bangs (Trac #4477)

A simple refactoring in the parser

11 years agoSlurp author spellings file from base and add more authors
Ben Lippmeier [Fri, 12 Nov 2010 13:46:41 +0000 (13:46 +0000)]
Slurp author spellings file from base and add more authors

11 years agoA (final) re-engineering of the new typechecker
simonpj@microsoft.com [Fri, 12 Nov 2010 13:00:11 +0000 (13:00 +0000)]
A (final) re-engineering of the new typechecker

Regression testing and user feedback for GHC 7.0 taught
us a lot.  This patch fixes numerous small bugs, and some
major ones (eg Trac #4484, #4492), and improves type
error messages.

The main changes are:

* Entirely remove the "skolem equivalance class" stuff;
  a very useful simplification

* Instead, when flattening "wanted" constraints we generate
  unification variables (not flatten-skolems) for the
  flattened type function application

* We then need a fixup pass at the end, TcSimplify.solveCTyFunEqs,
  which resolves any residual equalities of form
      F xi ~ alpha

* When we come across a definite failure (e.g. Int ~ [a]),
  we now defer reporting the error until the end, in case we
  learn more about 'a'.  That is particularly important for
  occurs-check errors.  These are called "frozen" type errors.

* Other improvements in error message generation.

* Better tracing messages

11 years agoAllow the old [$foo| ... |] syntax for quasi-quotes
simonpj@microsoft.com [Fri, 12 Nov 2010 08:30:52 +0000 (08:30 +0000)]
Allow the old [$foo| ... |] syntax for quasi-quotes

This is just a backward-compatibility thing, to be removed
eventually.

11 years agoFix multi-line string (minor glitch in stage-1 compiler)
simonpj@microsoft.com [Thu, 11 Nov 2010 13:45:03 +0000 (13:45 +0000)]
Fix multi-line string (minor glitch in stage-1 compiler)

11 years agoAdd upstream URLs for vector and primitive
Roman Leshchinskiy [Wed, 10 Nov 2010 21:02:58 +0000 (21:02 +0000)]
Add upstream URLs for vector and primitive

11 years agoObey the -rtsopts flag when making shared libraries; part of #4464
Ian Lynagh [Wed, 10 Nov 2010 14:54:49 +0000 (14:54 +0000)]
Obey the -rtsopts flag when making shared libraries; part of #4464

11 years agoAvoid scary message from tar if dph isn't in the tree
Ian Lynagh [Wed, 3 Nov 2010 21:33:54 +0000 (21:33 +0000)]
Avoid scary message from tar if dph isn't in the tree

11 years agoWhitespace only
Ian Lynagh [Wed, 3 Nov 2010 21:33:18 +0000 (21:33 +0000)]
Whitespace only

11 years agoRemove no-longer-necessary withFlattenedDynflags
Ian Lynagh [Wed, 3 Nov 2010 21:27:18 +0000 (21:27 +0000)]
Remove no-longer-necessary withFlattenedDynflags

11 years agoUse liftIO rather than io
Ian Lynagh [Wed, 3 Nov 2010 21:22:16 +0000 (21:22 +0000)]
Use liftIO rather than io

11 years agoFix a #if test
Ian Lynagh [Tue, 2 Nov 2010 19:24:46 +0000 (19:24 +0000)]
Fix a #if test
showMultiLineString is only in >= 7.1.

11 years agoFix building genprimopcode with GHC 7.0, and remove haskell98 imports
Ian Lynagh [Tue, 2 Nov 2010 18:58:31 +0000 (18:58 +0000)]
Fix building genprimopcode with GHC 7.0, and remove haskell98 imports

11 years agoOn Windows, when returning memory to the OS, we try to release it
Ian Lynagh [Mon, 1 Nov 2010 16:18:02 +0000 (16:18 +0000)]
On Windows, when returning memory to the OS, we try to release it
as well as decommiting it.

11 years agoWhitespace only, in rts/win32/OSMem.c
Ian Lynagh [Fri, 29 Oct 2010 20:41:58 +0000 (20:41 +0000)]
Whitespace only, in rts/win32/OSMem.c

11 years agoImprove error messages
simonpj@microsoft.com [Mon, 1 Nov 2010 16:46:30 +0000 (16:46 +0000)]
Improve error messages

In particular, instead of
   Cannot match 'a' with 'b'
we get
   Could not deduce (a~b) from context (F a ~ b)
or whatever

11 years agoUncomment and fix an OS X linker debug print
Ian Lynagh [Fri, 29 Oct 2010 13:58:05 +0000 (13:58 +0000)]
Uncomment and fix an OS X linker debug print

11 years agofix bugs in tryTakeMVar/tryPutMVar
Simon Marlow [Fri, 29 Oct 2010 09:04:23 +0000 (09:04 +0000)]
fix bugs in tryTakeMVar/tryPutMVar
I'm surprised that these haven't caused any problems (or maybe they have?)

11 years agoRemove duplicate PrimopWrappers generation
Simon Marlow [Thu, 28 Oct 2010 10:16:24 +0000 (10:16 +0000)]
Remove duplicate PrimopWrappers generation
We were generating PrimopWrappers.hs twice in two different places,
one for the normal build and one for Haddock (I think).  Unfortunately
one of these was causing extra rebuilding, because the file dropped
into the dist-install/build/autogen directory, where it was picked up
by the automatic HS_SRCS detection in subsequent make runs.  This was
exposed by a recent change to HS_SRCS:

  Wed Oct 20 11:47:59 BST 2010  Ian Lynagh <igloo@earth.li>
    * Look for sources in Cabal's autogen directory too

This should fix the stage3 failures in the build bots.

11 years agoComment out bogus debug line that broke build on OSX
benl@ouroborus.net [Fri, 29 Oct 2010 07:44:05 +0000 (07:44 +0000)]
Comment out bogus debug line that broke build on OSX

11 years agoFix import warning
benl@ouroborus.net [Fri, 29 Oct 2010 07:16:17 +0000 (07:16 +0000)]
Fix import warning

11 years agoCleanup comments and formatting only
benl@ouroborus.net [Fri, 29 Oct 2010 06:58:37 +0000 (06:58 +0000)]
Cleanup comments and formatting only

11 years agoNicer error message for #3782
benl@ouroborus.net [Fri, 29 Oct 2010 06:33:20 +0000 (06:33 +0000)]
Nicer error message for #3782
It now says:

ghc-stage2: sorry! (this is work in progress)
  (GHC version 7.1.20101028 for i386-apple-darwin):
Vectorise.Builtins.indexBuiltin

    DPH builtin function 'sumTyCon' of size '11' is not yet implemented.
    This function does not appear in your source program, but it is needed
    to compile your code in the backend. This is a known, current limitation
    of DPH. If you want it to to work you should send mail to cvs-ghc@haskell.org
    and ask what you can do to help (it might involve some GHC hacking).

I added 'pprSorry' that behaves like 'pprPanic' except it say sorry! instead
of panic!, and doesn't ask the user to report a bug.

11 years agoReplace some exit(n) calls with stg_exit(n); fixes trac #4445
Ian Lynagh [Thu, 28 Oct 2010 13:48:54 +0000 (13:48 +0000)]
Replace some exit(n) calls with stg_exit(n); fixes trac #4445
Also changed exitcode of -1 to 1 in hpc.

11 years agoRemove -ds-multi-tyvar static flag
simonpj@microsoft.com [Thu, 28 Oct 2010 14:25:48 +0000 (14:25 +0000)]
Remove -ds-multi-tyvar static flag

It was always secret, and has now vanished as silently as it came

11 years agoDeprecate -fmethod-sharing, which no longer does anything
simonpj@microsoft.com [Thu, 28 Oct 2010 14:24:29 +0000 (14:24 +0000)]
Deprecate -fmethod-sharing, which no longer does anything

We can remove it altogether in GHC 7.2

11 years agoDo w/w *recursive* things even if they are small
simonpj@microsoft.com [Thu, 28 Oct 2010 14:21:50 +0000 (14:21 +0000)]
Do w/w *recursive* things even if they are small

A wibble to my previous change in WorkWrap, fixes simplrun010

11 years agoTwo signficant changes to the simplifier
simonpj@microsoft.com [Wed, 27 Oct 2010 19:37:29 +0000 (19:37 +0000)]
Two signficant changes to the simplifier

1. Do eta-expansion at let-bindings, not lambdas.
   I have wanted to do this for a long time.
   See Note [Eta-expanding at let bindings] in SimplUtils

2. Simplify the rather subtle way in which InlineRules (the
   template captured by an INLINE pragma) was simplified.
   Now, these templates are always simplified in "gentle"
   mode only, and only INLINE things inline inside them.

   See Note Note [Gentle mode], Note [Inlining in gentle mode]
   and Note [RULEs enabled in SimplGently] in SimplUtils

11 years agoYet another go at CoreArity
simonpj@microsoft.com [Wed, 27 Oct 2010 18:56:30 +0000 (18:56 +0000)]
Yet another go at CoreArity

Amazingly, there were still Wrong Things in the arity analysis,
exposed by my fiddling with eta expansion.

I simplified the code, clarified the comments, added more examples,
and tidied it all up.  I hope it's better this time.

11 years agoBuglet in tcIface, now that nested binders can have pragmas
simonpj@microsoft.com [Wed, 27 Oct 2010 18:42:35 +0000 (18:42 +0000)]
Buglet in tcIface, now that nested binders can have pragmas

This fix ties the knot for recursive groups properly

11 years agoAdd strictness for raiseIO# primop
simonpj@microsoft.com [Wed, 27 Oct 2010 18:41:28 +0000 (18:41 +0000)]
Add strictness for raiseIO# primop

11 years agoDon't worker-wrapper INLINABLE things
simonpj@microsoft.com [Wed, 27 Oct 2010 18:41:07 +0000 (18:41 +0000)]
Don't worker-wrapper INLINABLE things

See Note [Don't w/w INLINABLE things] in WorkWrap

This fixes a bug that Milan found.

11 years agoRefactoring and tidyup of HscMain and related things (also fix #1666)
Simon Marlow [Wed, 27 Oct 2010 12:11:32 +0000 (12:11 +0000)]
Refactoring and tidyup of HscMain and related things (also fix #1666)
While trying to fix #1666 (-Werror aborts too early) I decided to some
tidyup in GHC/DriverPipeline/HscMain.

 - The GhcMonad overloading is gone from DriverPipeline and HscMain
   now.  GhcMonad is now defined in a module of its own, and only
   used in the top-level GHC layer.  DriverPipeline and HscMain
   use the plain IO monad and take HscEnv as an argument.

 - WarnLogMonad is gone.  printExceptionAndWarnings is now called
   printException (the old name is deprecated).  Session no longer
   contains warnings.

 - HscMain has its own little monad that collects warnings, and also
   plumbs HscEnv around.  The idea here is that warnings are collected
   while we're in HscMain, but on exit from HscMain (any function) we
   check for warnings and either print them (via log_action, so IDEs
   can still override the printing), or turn them into an error if
   -Werror is on.

 - GhcApiCallbacks is gone, along with GHC.loadWithLogger.  Thomas
   Schilling told me he wasn't using these, and I don't see a good
   reason to have them.

 - there's a new pure API to the parser (suggestion from Neil Mitchell):
      parser :: String
             -> DynFlags
             -> FilePath
             -> Either ErrorMessages (WarningMessages,
                                      Located (HsModule RdrName))

11 years agofollow changes in the GHC API
Simon Marlow [Wed, 27 Oct 2010 11:10:03 +0000 (11:10 +0000)]
follow changes in the GHC API

11 years agotweaks
Simon Marlow [Wed, 13 Oct 2010 18:43:22 +0000 (18:43 +0000)]
tweaks

11 years agocomment
Simon Marlow [Wed, 13 Oct 2010 18:43:00 +0000 (18:43 +0000)]
comment

11 years agoWarn (not error) for SPECIALISE pragmas without INLINE
simonpj@microsoft.com [Wed, 27 Oct 2010 16:29:22 +0000 (16:29 +0000)]
Warn (not error) for SPECIALISE pragmas without INLINE

See Note [SPECIALISE pragmas] in TcBinds.  Fixes Trac #444.

11 years agofix stage1_libs pseudo-target
Simon Marlow [Tue, 26 Oct 2010 12:29:06 +0000 (12:29 +0000)]
fix stage1_libs pseudo-target

11 years agoFix #4424. Allow `-hide-all-packages` to be set dynamically.
Thomas Schilling [Thu, 21 Oct 2010 17:04:32 +0000 (17:04 +0000)]
Fix #4424.  Allow `-hide-all-packages` to be set dynamically.

11 years agoFix whitespace and layout in PrelRules.
Michal Terepeta [Sun, 24 Oct 2010 17:41:34 +0000 (17:41 +0000)]
Fix whitespace and layout in PrelRules.

11 years agoFix for #4318 (Linker failure on OS X 10.6)
gwright@antiope.com [Tue, 26 Oct 2010 13:51:53 +0000 (13:51 +0000)]
Fix for #4318 (Linker failure on OS X 10.6)

This patch fixes two bugs in the Mach-O linker and adds debugging statements
to the same. The bugs:

1. The test for symbol->n_value == 0 is removed and replaced by a test of the
flag field.  Checking the n_value field was just wrong; the value of a
symbol should only be examined when allocating space for a common block,
in which case the n_value field gives the size of the block.  This bug
led to an infrequently occuring linker crash.

I believe the behavior of the linker now agrees with the intent of the
sketchy Apple documentation.

2. Jump islands were being filled with garbage instead of the the location
of the referenced symbol. This caused relocations of type X86_64_RELOC_GOT and
X86_64_RELOC_GOT_LOAD to eventually lead to crashes.  The fix is simply to
look up the symbol.

Enough debug statements have been added to follow the operation of the Mach-O
linker while it loads modules.  They are not yet as informative and well
organized as for ELF.  Improving the debug statements will require some
reorganization of the code -- the Mach-O linker seems basically sound, but
is crying out for some refactoring and commenting.