ghc-hetmet.git
14 years agoAdd comments about the ForceSpecConstr mechanism
Roman Leshchinskiy [Mon, 15 Feb 2010 03:01:03 +0000 (03:01 +0000)]
Add comments about the ForceSpecConstr mechanism

14 years agoSpot ForceSpecConstr arguments in polymorphic loops
Roman Leshchinskiy [Mon, 15 Feb 2010 02:53:08 +0000 (02:53 +0000)]
Spot ForceSpecConstr arguments in polymorphic loops

14 years agoDon't rely on tar supporting -z; trac #3841
Ian Lynagh [Sun, 14 Feb 2010 22:04:50 +0000 (22:04 +0000)]
Don't rely on tar supporting -z; trac #3841

14 years agodon't constant fold division that would result in negative zero (#3676)
Simon Marlow [Thu, 11 Feb 2010 13:15:43 +0000 (13:15 +0000)]
don't constant fold division that would result in negative zero (#3676)

14 years agoImprove error dump in TcEnv
simonpj@microsoft.com [Wed, 10 Feb 2010 14:52:10 +0000 (14:52 +0000)]
Improve error dump in TcEnv

14 years agoKeep track of explicit kinding in HsTyVarBndr; plus fix Trac #3845
simonpj@microsoft.com [Wed, 10 Feb 2010 14:51:55 +0000 (14:51 +0000)]
Keep track of explicit kinding in HsTyVarBndr; plus fix Trac #3845

To print HsTypes correctly we should remember whether the Kind on
a HsTyVarBndr came from type inference, or was put there by the
user.  See Note [Printing KindedTyVars] in HsTypes.  So instead of
changing a UserTyVar to a KindedTyVar during kind checking, we
simply add a PostTcKind to the UserTyVar.

The change was provoked by Trac #3830, although other changes
mean that #3830 gets a diferent and better error message now.
So this patch is simply doing the Right Thing for the future.

This patch also fixes Trac #3845, which was caused by a *type splice*
not remembering the free *term variables* mentioned in it.  Result
was that we build a 'let' when it should have been 'letrec'.
Hence a new FreeVars field in HsSpliceTy.

While I was at it, I got rid of HsSpliceTyOut and use a PostTcKind
on HsSpliceTy instead, just like on the UserTyVar.

14 years agoDocumentation for changes to Template Haskell and quasi-quotation
simonpj@microsoft.com [Wed, 10 Feb 2010 11:42:13 +0000 (11:42 +0000)]
Documentation for changes to Template Haskell and quasi-quotation

14 years agoRemove redundant import
simonpj@microsoft.com [Mon, 8 Feb 2010 16:57:56 +0000 (16:57 +0000)]
Remove redundant import

14 years agoStop fruitless ANF-ing
simonpj@microsoft.com [Wed, 10 Feb 2010 09:47:33 +0000 (09:47 +0000)]
Stop fruitless ANF-ing

The simplifier is taking more iterations than it should, because we
were fruitlessly ANF-ing a top-level declaration of form

   x = Ptr "foo"#

to get

   x = let v = "foo"# in Ptr v

and then inlining v again.  This patch makes Simplify.makeTrivial
top-level aware, so that it doesn't ANF if it's going to be undone.

14 years agoComments only
simonpj@microsoft.com [Wed, 10 Feb 2010 09:45:37 +0000 (09:45 +0000)]
Comments only

14 years agoSimplify syntax for quasi-quotation
simonpj@microsoft.com [Wed, 10 Feb 2010 09:44:19 +0000 (09:44 +0000)]
Simplify syntax for quasi-quotation

After some discussion we decided to make a quasi-quote look like

   [pads| ...blah... |]

rather than

   [$pads| ...blah... |]

as before. The new syntax is quieter, although it does not signal
quite as clearly that there is a splice going on.

14 years agoSeveral TH/quasiquote changes
simonpj@microsoft.com [Wed, 10 Feb 2010 09:39:10 +0000 (09:39 +0000)]
Several TH/quasiquote changes

a) Added quasi-quote forms for
      declarations
      types
   e.g.   f :: [$qq| ... |]

b) Allow Template Haskell pattern quotes (but not splices)
   e.g.  f x = [p| Int -> $x |]

c) Improve pretty-printing for HsPat to remove superfluous
   parens.  (This isn't TH related really, but it affects
   some of the same code.)

A consequence of (a) is that when gathering and grouping declarations
in RnSource.findSplice, we must expand quasiquotes as we do so.
Otherwise it's all fairly straightforward.  I did a little bit of
refactoring in TcSplice.

User-manual changes still to come.

14 years agogenerate slightly better code for ccall argument-pushing on x86
Simon Marlow [Tue, 9 Feb 2010 10:11:14 +0000 (10:11 +0000)]
generate slightly better code for ccall argument-pushing on x86

14 years ago--lazy overrides --partial too
Simon Marlow [Tue, 9 Feb 2010 09:39:27 +0000 (09:39 +0000)]
--lazy overrides --partial too
At least until we switch to --lazy being the default

14 years agoFix Trac #3850
simonpj@microsoft.com [Mon, 8 Feb 2010 16:37:51 +0000 (16:37 +0000)]
Fix Trac #3850

This patch simply avoids a needless difference in behaviour from
6.10, and one that happens to affect HList. See Note [Stupid theta].

14 years agoFix a bug introduced in the SSE2 support: callClobberedRegs was wrong
Simon Marlow [Fri, 5 Feb 2010 11:29:38 +0000 (11:29 +0000)]
Fix a bug introduced in the SSE2 support: callClobberedRegs was wrong

14 years agoImplement SSE2 floating-point support in the x86 native code generator (#594)
Simon Marlow [Thu, 4 Feb 2010 10:48:49 +0000 (10:48 +0000)]
Implement SSE2 floating-point support in the x86 native code generator (#594)

The new flag -msse2 enables code generation for SSE2 on x86.  It
results in substantially faster floating-point performance; the main
reason for doing this was that our x87 code generation is appallingly
bad, and since we plan to drop -fvia-C soon, we need a way to generate
half-decent floating-point code.

The catch is that SSE2 is only available on CPUs that support it (P4+,
AMD K8+).  We'll have to think hard about whether we should enable it
by default for the libraries we ship.  In the meantime, at least
-msse2 should be an acceptable replacement for "-fvia-C
-optc-ffast-math -fexcess-precision".

SSE2 also has the advantage of performing all operations at the
correct precision, so floating-point results are consistent with other
platforms.

I also tweaked the x87 code generation a bit while I was here, now
it's slighlty less bad than before.

14 years agoadd libraries/binary
Simon Marlow [Wed, 3 Feb 2010 13:54:21 +0000 (13:54 +0000)]
add libraries/binary

14 years agoadd comment for srt_bitmap field
Simon Marlow [Wed, 3 Feb 2010 10:34:31 +0000 (10:34 +0000)]
add comment for srt_bitmap field

14 years agoUse bash to run boot-pkgs, the default Solaris shell doesn't support the -ot test...
benl@cse.unsw.edu.au [Wed, 3 Feb 2010 03:07:48 +0000 (03:07 +0000)]
Use bash to run boot-pkgs, the default Solaris shell doesn't support the -ot test flag

14 years agoDisable -Wcast-align when building the rts
benl@cse.unsw.edu.au [Wed, 3 Feb 2010 02:46:05 +0000 (02:46 +0000)]
Disable -Wcast-align when building the rts
This flag seems buggy on GCC 4.1.2, which is the only GCC version we
have that can bootstrap the SPARC build. We end up with lots of supurious
warnings of the form "cast increases required alignment of target type".
Some legitimate warnings can be fixed by adding an intermediate cast to
(void*), but we get others in rts/sm/GCUtils.c concerning the gct var
that look innocuous to me. We could enable this again once we deprecate
support for registerised builds on this arch.

14 years agoStifle warning about printf format strings
benl@cse.unsw.edu.au [Wed, 3 Feb 2010 02:31:24 +0000 (02:31 +0000)]
Stifle warning about printf format strings

14 years agoCast to (void*) to stifle warning about signedness
benl@cse.unsw.edu.au [Wed, 3 Feb 2010 02:30:29 +0000 (02:30 +0000)]
Cast to (void*) to stifle warning about signedness

14 years agoAdd missing import sm_mutex, which fixes the -fvia-c build
benl@cse.unsw.edu.au [Tue, 2 Feb 2010 05:14:51 +0000 (05:14 +0000)]
Add missing import sm_mutex, which fixes the -fvia-c build

14 years agoFix typo in error message (#3848)
Simon Marlow [Sat, 30 Jan 2010 09:46:28 +0000 (09:46 +0000)]
Fix typo in error message (#3848)

14 years agoFix Trac #3831: blowup in SpecConstr
simonpj@microsoft.com [Mon, 1 Feb 2010 00:24:20 +0000 (00:24 +0000)]
Fix Trac #3831: blowup in SpecConstr

It turned out that there were two bugs.  First, we were getting an
exponential number of specialisations when we had a deep nest of
join points.  See Note [Avoiding exponential blowup]. I fixed this
by dividing sc_count (in ScEnv) by the number of specialisations
when recursing.  Crude but effective.

Second, when making specialisations I was looking at the result of
applying specExpr to the RHS of the function, whereas I should have
been looking at the original RHS.  See Note [Specialise original
body].

There's a tantalising missed opportunity here, though.  In this
example (recorded as a test simplCore/should_compile/T3831), each join
point has *exactly one* call pattern, so we should really just
specialise for that alone, in which case there's zero code-blow-up.
In particular, we don't need the *original* RHS at all.  I need to think
more about how to exploit this.

But the blowup is now limited, so compiling terminfo with -O2 works again.

14 years agoRe-read pragmas after preprocessing (#2464, #3674, #3457)
Simon Marlow [Fri, 29 Jan 2010 11:40:50 +0000 (11:40 +0000)]
Re-read pragmas after preprocessing (#2464, #3674, #3457)
This was a lot easier than I imagined.

14 years agotweak the totally-bogus arbitrary stack-squeezing heuristic to fix #2797
Simon Marlow [Thu, 28 Jan 2010 12:44:54 +0000 (12:44 +0000)]
tweak the totally-bogus arbitrary stack-squeezing heuristic to fix #2797
In #2797, a program that ran in constant stack space when compiled
needed linear stack space when interpreted.  It turned out to be
nothing more than stack-squeezing not happening.  We have a heuristic
to avoid stack-squeezing when it would be too expensive (shuffling a
large amount of memory to save a few words), but in some cases even
expensive stack-squeezing is necessary to avoid linear stack usage.
One day we should implement stack chunks, which would make this less
expensive.

14 years agofix warning on Windows
Simon Marlow [Wed, 27 Jan 2010 16:29:54 +0000 (16:29 +0000)]
fix warning on Windows

14 years agofix Windows build (GHC.Conc.runHandlers is Unix-only)
Simon Marlow [Wed, 27 Jan 2010 14:57:18 +0000 (14:57 +0000)]
fix Windows build (GHC.Conc.runHandlers is Unix-only)

14 years agoDon't Terminate the ticker thread (#3748)
Simon Marlow [Wed, 27 Jan 2010 13:54:30 +0000 (13:54 +0000)]
Don't Terminate the ticker thread (#3748)

14 years agoWin32 yieldThread(): use SwitchToThread() instead of Sleep(0)
Simon Marlow [Wed, 27 Jan 2010 13:31:06 +0000 (13:31 +0000)]
Win32 yieldThread(): use SwitchToThread() instead of Sleep(0)

14 years agofix warnings
Simon Marlow [Wed, 27 Jan 2010 13:30:40 +0000 (13:30 +0000)]
fix warnings

14 years agocatch SIGHUP and SIGTERM and raise an exception (#3656)
Simon Marlow [Wed, 27 Jan 2010 14:04:38 +0000 (14:04 +0000)]
catch SIGHUP and SIGTERM and raise an exception (#3656)

14 years agodefine INFINITY and NAN if they don't exist (#2929)
Simon Marlow [Wed, 27 Jan 2010 13:36:32 +0000 (13:36 +0000)]
define INFINITY and NAN if they don't exist (#2929)

14 years agoremove suspicious whitespace-only lines
Simon Marlow [Wed, 27 Jan 2010 13:30:08 +0000 (13:30 +0000)]
remove suspicious whitespace-only lines

14 years agoaddCoverageTicksToBinds: tolerate a non-existent .hs file (#3803)
Simon Marlow [Wed, 27 Jan 2010 11:32:05 +0000 (11:32 +0000)]
addCoverageTicksToBinds: tolerate a non-existent .hs file (#3803)

14 years agoavoid using non-standard %zd format specifier (#3804)
Simon Marlow [Tue, 26 Jan 2010 16:33:22 +0000 (16:33 +0000)]
avoid using non-standard %zd format specifier (#3804)

14 years agoFix signal segfaults on Solaris (#3790)
Simon Marlow [Tue, 26 Jan 2010 15:54:49 +0000 (15:54 +0000)]
Fix signal segfaults on Solaris (#3790)

14 years agocomment-out an incorrect assertion
Simon Marlow [Tue, 26 Jan 2010 15:01:03 +0000 (15:01 +0000)]
comment-out an incorrect assertion

14 years agoFix a deadlock, and possibly other problems
Simon Marlow [Tue, 26 Jan 2010 15:00:37 +0000 (15:00 +0000)]
Fix a deadlock, and possibly other problems
After a bound thread had completed, its TSO remains in the heap until
it has been GC'd, although the associated Task is returned to the
caller where it is freed and possibly re-used.

The bug was that GC was following the pointer to the Task and updating
the TSO field, meanwhile the Task had already been recycled (it was
being used by exitScheduler()). Confusion ensued, leading to a very
occasional deadlock at shutdown, but in principle it could result in
other crashes too.

The fix is to remove the link between the TSO and the Task when the
TSO has completed and the call to schedule() has returned; see
comments in Schedule.c.

14 years agoWhen acquiring a spinlock, yieldThread() every 1000 spins (#3553, #3758)
Simon Marlow [Fri, 22 Jan 2010 16:49:11 +0000 (16:49 +0000)]
When acquiring a spinlock, yieldThread() every 1000 spins (#3553, #3758)

This helps when the thread holding the lock has been descheduled,
which is the main cause of the "last-core slowdown" problem.  With
this patch, I get much better results with -N8 on an 8-core box,
although some benchmarks are still worse than with 7 cores.

I also added a yieldThread() into the any_work() loop of the parallel
GC when it has no work to do. Oddly, this seems to improve performance
on the parallel GC benchmarks even when all the cores are busy.
Perhaps it is due to reducing contention on the memory bus.

14 years ago'store' should be static (#3835)
Simon Marlow [Fri, 22 Jan 2010 16:48:34 +0000 (16:48 +0000)]
'store' should be static (#3835)

14 years agoAdd some missing getStablePtr()s for CAFs that the RTS refers to
Simon Marlow [Fri, 22 Jan 2010 14:36:58 +0000 (14:36 +0000)]
Add some missing getStablePtr()s for CAFs that the RTS refers to

A recent patch ("Refactor CoreArity a bit") changed the arity of
GHC.Conc.runSparks such that it became a CAF, and the RTS was not
explicitly retaining it, which led to a crash when the CAF got GC'd.
While fixing this I found a couple of other closures that the RTS
refers to which weren't getting the correct CAF treatment.

14 years agoRemove an out-of-date comment
Ian Lynagh [Fri, 22 Jan 2010 13:08:53 +0000 (13:08 +0000)]
Remove an out-of-date comment

14 years agofix build on Windows
Simon Marlow [Fri, 22 Jan 2010 12:10:16 +0000 (12:10 +0000)]
fix build on Windows

14 years agofix warning on Windows
Simon Marlow [Fri, 22 Jan 2010 12:03:28 +0000 (12:03 +0000)]
fix warning on Windows

14 years agoFix docs for sizeofByteArray#/sizeofMutableByteArray# (#3800)
Simon Marlow [Tue, 19 Jan 2010 10:38:25 +0000 (10:38 +0000)]
Fix docs for sizeofByteArray#/sizeofMutableByteArray# (#3800)
In 6.14.1 we'll switch these primops to return the exact byte size,
but for 6.12.2 we need to fix the docs.

14 years agoInclude regex.h in Linker.c on OS X too
Ian Lynagh [Wed, 20 Jan 2010 20:19:58 +0000 (20:19 +0000)]
Include regex.h in Linker.c on OS X too

14 years agoWe no longer need a prototype for __eprintf
Ian Lynagh [Wed, 20 Jan 2010 19:50:24 +0000 (19:50 +0000)]
We no longer need a prototype for __eprintf
It looks like it was only needed on OSX, but it has a prototype in
assert.h which now gets #included.

14 years agoFix build
Ian Lynagh [Wed, 20 Jan 2010 16:31:01 +0000 (16:31 +0000)]
Fix build
Remove a prototype of a function that wasn't defined

14 years agoFIX #2615 (linker scripts in .so files)
howard_b_golden@yahoo.com [Wed, 16 Dec 2009 18:51:55 +0000 (18:51 +0000)]
FIX #2615 (linker scripts in .so files)
This patch does not apply to Windows. It only applies to systems with
ELF binaries.

This is a patch to rts/Linker.c to recognize linker scripts in .so
files and find the real target .so shared library for loading.

14 years agoFix Trac #3813: unused variables in GHCi bindings
simonpj@microsoft.com [Wed, 20 Jan 2010 09:45:33 +0000 (09:45 +0000)]
Fix Trac #3813: unused variables in GHCi bindings

In a GHCi stmt we don't want to report unused variables,
because we don't know the scope of the binding, eg

Prelude> x <- blah

Fixing this needed a little more info about the context of the stmt,
thus the new constructor GhciStmt in the HsStmtContext type.

14 years agoFix Trac #3823, plus warning police in TcRnDriver
simonpj@microsoft.com [Wed, 20 Jan 2010 09:42:21 +0000 (09:42 +0000)]
Fix Trac #3823, plus warning police in TcRnDriver

The immediate reason for this patch is to fix #3823. This was
rather easy: all the work was being done but I was returning
type_env2 rather than type_env3.

An unused-veriable warning would have shown this up, so I fixed all
the other warnings in TcRnDriver.  Doing so showed up at least two
genuine lurking bugs.  Hurrah.

14 years agoChange how RTS libraries get installed; fixes trac #3794
Ian Lynagh [Tue, 19 Jan 2010 23:26:23 +0000 (23:26 +0000)]
Change how RTS libraries get installed; fixes trac #3794

14 years agoEscape some more $s in makefiles, for consistency
Ian Lynagh [Tue, 19 Jan 2010 22:55:33 +0000 (22:55 +0000)]
Escape some more $s in makefiles, for consistency

14 years agoEscape some $s in makefiles for consistency
Ian Lynagh [Tue, 19 Jan 2010 22:14:40 +0000 (22:14 +0000)]
Escape some $s in makefiles for consistency

14 years agoAllow GNU-standard --host, --build, --target configure options (#3637)
Simon Marlow [Tue, 19 Jan 2010 10:28:19 +0000 (10:28 +0000)]
Allow GNU-standard --host, --build, --target configure options (#3637)
Patch contributed by asuffield@suffields.me.uk

14 years agoUpdate some comments about how autoconf/configure works
Ian Lynagh [Mon, 18 Jan 2010 14:59:59 +0000 (14:59 +0000)]
Update some comments about how autoconf/configure works

14 years agoFix a warning message
Ian Lynagh [Mon, 18 Jan 2010 14:20:20 +0000 (14:20 +0000)]
Fix a warning message
We were printing the wrong value, so getting confusing messages like:
    Function `$wa{v s17LO} [lid]'
        has 2 call pattterns, but the limit is 3

14 years agoTeach the alternative layout rule about mdo and rec
Ian Lynagh [Sat, 16 Jan 2010 21:55:45 +0000 (21:55 +0000)]
Teach the alternative layout rule about mdo and rec

14 years agoTeach the alternative layout rule about $( ... )
Ian Lynagh [Sat, 16 Jan 2010 21:39:41 +0000 (21:39 +0000)]
Teach the alternative layout rule about $( ... )
It thought the ) needed to close something, but the $( hadn't
opened anything.

14 years agoFix typo
Ian Lynagh [Sat, 16 Jan 2010 13:49:15 +0000 (13:49 +0000)]
Fix typo

14 years agoRemove declaration of non-existent mark_splim
Simon Marlow [Thu, 31 Dec 2009 10:42:41 +0000 (10:42 +0000)]
Remove declaration of non-existent mark_splim

14 years agofix a comment
Simon Marlow [Wed, 30 Dec 2009 15:08:52 +0000 (15:08 +0000)]
fix a comment

14 years agoremove an unnecessary debug trace, duplicated by a traceSchedEvent
Simon Marlow [Wed, 30 Dec 2009 15:08:32 +0000 (15:08 +0000)]
remove an unnecessary debug trace, duplicated by a traceSchedEvent

14 years agohide modules properly with haddock
Simon Marlow [Wed, 13 Jan 2010 21:03:11 +0000 (21:03 +0000)]
hide modules properly with haddock

14 years agofix for HSCOLOUR_SRCS=NO
Simon Marlow [Wed, 13 Jan 2010 19:15:55 +0000 (19:15 +0000)]
fix for HSCOLOUR_SRCS=NO

14 years agoDo some recompilation avoidance in GHC.loadModule
Simon Marlow [Tue, 12 Jan 2010 22:58:53 +0000 (22:58 +0000)]
Do some recompilation avoidance in GHC.loadModule
GHC.loadModule compiles a module after it has been parsed and
typechecked explicity. If we are compiling to object code and there is
a valid object file already on disk, then we can skip the compilation
step. This is useful in Haddock, when processing a package that uses
Template Haskell and hence needs actual compilation, and the package
has already been compiled.

As usual, the recomp avoidance can be disabled with -fforce-recomp.

14 years agoInvoke Haddock directly from the build system, instead of via Cabal
Simon Marlow [Tue, 12 Jan 2010 22:55:48 +0000 (22:55 +0000)]
Invoke Haddock directly from the build system, instead of via Cabal

Partly this is cleaner as we only have to preprocess the source files
once, but also it is necessary to avoid Haddock recompiling source
files when Template Haskell is in use, saving some time in validate
and fixing a problem whereby when HADDOCK_DOCS=YES, make always
re-haddocks the DPH packages.  This also needs an additional fix to
GHC.

HsColour support still uses Cabal, and hence preprocesses the source
files again. We could move this into the build system too, but there
is a version dependency that would mean adding extra autoconf stuff.

14 years agorefactoring while I try to make sense of the hsc interface
Simon Marlow [Mon, 4 Jan 2010 11:28:33 +0000 (11:28 +0000)]
refactoring while I try to make sense of the hsc interface

14 years agoFix running in-place gen_contents_index; trac #3716
Ian Lynagh [Fri, 8 Jan 2010 13:34:16 +0000 (13:34 +0000)]
Fix running in-place gen_contents_index; trac #3716
It was making incorrect URLs due to a shell script error.

14 years agoRespect SPECIALISE pragmas even for apparently-non-overloaded things
simonpj@microsoft.com [Fri, 8 Jan 2010 08:45:47 +0000 (08:45 +0000)]
Respect SPECIALISE pragmas even for apparently-non-overloaded things

This is an implementation matter really (the key word is "apparently"!).
See Note [Specialising in no-dict case] in DsBinds.

It showed up when compiling GHC.Float.

14 years agoComment out debug warnings; they are fine
simonpj@microsoft.com [Fri, 8 Jan 2010 08:44:28 +0000 (08:44 +0000)]
Comment out debug warnings; they are fine

14 years agoImprove error locations
simonpj@microsoft.com [Thu, 7 Jan 2010 15:32:34 +0000 (15:32 +0000)]
Improve error locations

More on Trac #597

14 years agoSpelling error in comment
simonpj@microsoft.com [Thu, 7 Jan 2010 15:11:27 +0000 (15:11 +0000)]
Spelling error in comment

14 years agoA little refactoring, plus improve error locations
simonpj@microsoft.com [Thu, 7 Jan 2010 15:11:13 +0000 (15:11 +0000)]
A little refactoring, plus improve error locations

Fixes some sub-items of Trac #597

14 years agoClarify error message (Trac #3805)
simonpj@microsoft.com [Thu, 7 Jan 2010 15:10:02 +0000 (15:10 +0000)]
Clarify error message (Trac #3805)

14 years agoComments only
simonpj@microsoft.com [Thu, 7 Jan 2010 15:09:39 +0000 (15:09 +0000)]
Comments only

14 years agoSpecConstr: Remove -fspec-inline-join-points, and add let-binding specialisation
simonpj@microsoft.com [Wed, 6 Jan 2010 16:52:51 +0000 (16:52 +0000)]
SpecConstr: Remove -fspec-inline-join-points, and add let-binding specialisation

The -fspec-inline-join-point thing was a gross hack intended to help
Roman play around, but he's not using it and it was a terribly blunt
instrument so I've nuked it.

Instead I've re-instated the let-binding specialiser.
See Note [Local let bindings]

14 years agoMake SpecConstr more informative output when there are too many specialisations
simonpj@microsoft.com [Wed, 6 Jan 2010 16:10:26 +0000 (16:10 +0000)]
Make SpecConstr more informative output when there are too many specialisations

It now says something like

  SpecConstr
    Function `happyDoAction'
      has 17 call pattterns, but the limit is 3
    Use -fspec-constr-count=n to set the bound
    Use -dppr-debug to see specialisations

Previously it just silently did no specialisation

14 years agoMake view patterns right-associate
simonpj@microsoft.com [Wed, 6 Jan 2010 16:06:42 +0000 (16:06 +0000)]
Make view patterns right-associate

So that you can write

   f (v1 -> v2 -> pat)

14 years agoImprove the handling of default methods
simonpj@microsoft.com [Wed, 6 Jan 2010 16:06:03 +0000 (16:06 +0000)]
Improve the handling of default methods

See the long Note [INLINE and default methods].

This patch changes a couple of data types, with a knock-on effect on
the format of interface files.  A lot of files get touched, but is a
relatively minor change.  The main tiresome bit is the extra plumbing
to communicate default methods between the type checker and the
desugarer.

14 years agoPatch for shared libraries support on FreeBSD
Ian Lynagh [Wed, 6 Jan 2010 18:53:21 +0000 (18:53 +0000)]
Patch for shared libraries support on FreeBSD
From Maxime Henrion <mhenrion@gmail.com>

14 years agoFollowing Simon M's "take newCAF() out from sm_mutex" patch
dias@cs.tufts.edu [Tue, 5 Jan 2010 21:15:43 +0000 (21:15 +0000)]
Following Simon M's "take newCAF() out from sm_mutex" patch

14 years agoVery minor refactoring
simonpj@microsoft.com [Tue, 5 Jan 2010 10:18:33 +0000 (10:18 +0000)]
Very minor refactoring

14 years agoUndo the fix for Trac #3772 and do it a new way
simonpj@microsoft.com [Tue, 5 Jan 2010 10:16:00 +0000 (10:16 +0000)]
Undo the fix for Trac #3772 and do it a new way

The main idea is that I'm now treating a single-method dictionary very
much like a multi-method dictionary.  In particular, it respond to
exprIsConApp_maybe, even though newtypes aren't *really* proper
constructors.

See long comments with Note [Single-method classes] for why
this slight hack is justified.

14 years agoFix warnings
simonpj@microsoft.com [Tue, 5 Jan 2010 10:09:45 +0000 (10:09 +0000)]
Fix warnings

14 years agoImprove error message (idea in Trac #3805)
simonpj@microsoft.com [Tue, 5 Jan 2010 09:55:32 +0000 (09:55 +0000)]
Improve error message (idea in Trac #3805)

If we see

   foreign export ccall foo :: ...blah...

we now use the "foreign" to suggest -XForeignFunctionInterface

14 years agoComments only
simonpj@microsoft.com [Tue, 5 Jan 2010 09:53:56 +0000 (09:53 +0000)]
Comments only

14 years agoContinue refactoring the core-to-core pipeline
simonpj@microsoft.com [Thu, 24 Dec 2009 15:46:43 +0000 (15:46 +0000)]
Continue refactoring the core-to-core pipeline

This patch mainly concerns the plumbing for running
the passes and printing intermediate output

14 years agoA bunch of stuff relating to substitutions on core
simonpj@microsoft.com [Thu, 24 Dec 2009 15:39:49 +0000 (15:39 +0000)]
A bunch of stuff relating to substitutions on core

* I was debugging so I added some call-site info
  (that touches a lot of code)

* I used substExpr a bit less in Simplify, hoping to
  make the simplifier a little faster and cleaner

14 years agoRefactor CoreArity a bit
simonpj@microsoft.com [Thu, 24 Dec 2009 15:34:48 +0000 (15:34 +0000)]
Refactor CoreArity a bit

I was experimenting with making coercions opaque to
arity.  I think this is ultimately the right thing to do
but I've left the functionality unchanged for now.

14 years agoWibbles to inlining for small functions
simonpj@microsoft.com [Tue, 22 Dec 2009 16:27:31 +0000 (16:27 +0000)]
Wibbles to inlining for small functions

See Note [INLINE for small functions]

14 years agoPrint out a bit more info with the "arity decrease" waring
simonpj@microsoft.com [Tue, 22 Dec 2009 16:26:06 +0000 (16:26 +0000)]
Print out a bit more info with the "arity decrease" waring

14 years agoMove isDictTy from TcType to Type
simonpj@microsoft.com [Tue, 22 Dec 2009 16:25:50 +0000 (16:25 +0000)]
Move isDictTy from TcType to Type

14 years agoAllow instance heads to use infix syntax
simonpj@microsoft.com [Tue, 22 Dec 2009 16:23:25 +0000 (16:23 +0000)]
Allow instance heads to use infix syntax

  class C a b
  instance Int `C` Bool

This was accidentally disallowed before.

14 years agoFix pretty-printer
simonpj@microsoft.com [Tue, 22 Dec 2009 16:21:30 +0000 (16:21 +0000)]
Fix pretty-printer

14 years agoFix Trac #3792: check for qualified names in import items
simonpj@microsoft.com [Mon, 4 Jan 2010 21:59:50 +0000 (21:59 +0000)]
Fix Trac #3792: check for qualified names in import items

14 years agoFix bugs in STG Lint
simonpj@microsoft.com [Mon, 4 Jan 2010 21:46:59 +0000 (21:46 +0000)]
Fix bugs in STG Lint

The Stg Lint failure reported in Trac #3789 were bogus.
This patch fixes STG Lint, which must have been unused
for ages.