ghc-hetmet.git
13 years agoAdd PrimCall to the STG layer and update Core -> STG translation
Duncan Coutts [Tue, 9 Jun 2009 15:11:55 +0000 (15:11 +0000)]
Add PrimCall to the STG layer and update Core -> STG translation
It adds a third case to StgOp which already hold StgPrimOp and StgFCallOp.
The code generation for the new StgPrimCallOp case is almost exactly the
same as for out-of-line primops. They now share the tailCallPrim function.
In the Core -> STG translation we map foreign calls using the "prim"
calling convention to the StgPrimCallOp case. This is because in Core we
represent prim calls using the ForeignCall stuff. At the STG level however
the prim calls are really much more like primops than foreign calls.

13 years agoDesugaring for "foreign import prim"
Duncan Coutts [Tue, 9 Jun 2009 10:59:45 +0000 (10:59 +0000)]
Desugaring for "foreign import prim"
Unlike normal foreign imports which desugar into a separate worker and
wrapper, we use just a single wrapper decleration. The representation
in Core of the call is currently as a foreign call. This means the
args are all treated as fully strict. This is ok at the moment because
we restrict the types for foreign import prim to be of unboxed types,
however in future we may want to make prim imports be the normal cmm
calling convention for Haskell functions, in which case we would not
be able to assume all args are strict. At that point it may make more
sense to represent cmm/prim calls distinct from foreign calls, and
more like the we the existing PrimOp calls are handled.

13 years agoTypechecking for "foreign import prim"
Duncan Coutts [Tue, 9 Jun 2009 10:48:26 +0000 (10:48 +0000)]
Typechecking for "foreign import prim"
The main restriction is that all args and results must be unboxed types.
In particular we allow unboxed tuple results (which is a primary
motivation for the whole feature). The normal rules apply about
"void rep" result types like State#. We only allow "prim" calling
convention for import, not export. The other forms of import, "dynamic",
"wrapper" and data label are banned as a conseqence of checking that the
imported name is a valid C string. We currently require prim imports to
be marked unsafe, though this is essentially arbitrary as the safety
information is unused.

13 years agoLexing and parsing for "foreign import prim"
Duncan Coutts [Tue, 9 Jun 2009 10:45:36 +0000 (10:45 +0000)]
Lexing and parsing for "foreign import prim"
We only allow simple function label imports, not the normal complicated
business with "wrapper" "dynamic" or data label "&var" imports.

13 years agoAdd new FFI calling convention "prim"
Duncan Coutts [Tue, 9 Jun 2009 10:44:03 +0000 (10:44 +0000)]
Add new FFI calling convention "prim"
First in a series of patches to add the feature.
This patch just adds PrimCallConv to the CCallConv type.

13 years agoThe IO type has moved to GHC.Types in ghc-prim
Ian Lynagh [Sat, 20 Jun 2009 15:51:54 +0000 (15:51 +0000)]
The IO type has moved to GHC.Types in ghc-prim

13 years agoFix the way in the +RTS --info output
Ian Lynagh [Sat, 20 Jun 2009 14:26:00 +0000 (14:26 +0000)]
Fix the way in the +RTS --info output

13 years agoSet DELETE_ON_ERROR in ghc.mk
Ian Lynagh [Wed, 17 Jun 2009 12:18:06 +0000 (12:18 +0000)]
Set DELETE_ON_ERROR in ghc.mk

13 years agoFix the ghci wrapper
Ian Lynagh [Tue, 16 Jun 2009 18:25:01 +0000 (18:25 +0000)]
Fix the ghci wrapper
The ${1+"$@"} was being evaluated by make, rather than being escaped.

13 years agoFix #3132: a case of bogus code generation
Simon Marlow [Thu, 18 Jun 2009 09:07:18 +0000 (09:07 +0000)]
Fix #3132: a case of bogus code generation

13 years agoFix #3279, #3288: fix crash encountered when calling unblock inside unsafePerformIO
Simon Marlow [Tue, 16 Jun 2009 15:24:55 +0000 (15:24 +0000)]
Fix #3279, #3288: fix crash encountered when calling unblock inside unsafePerformIO
See comments for details

13 years agodrop packedstring; it is no longer required by template-haskell
Simon Marlow [Mon, 18 May 2009 12:09:57 +0000 (12:09 +0000)]
drop packedstring; it is no longer required by template-haskell

13 years agosuggest "cd <dir>; make help"
Simon Marlow [Tue, 16 Jun 2009 08:57:08 +0000 (08:57 +0000)]
suggest "cd <dir>; make help"

13 years agoAdd support for 'make help' in subdirectories
Simon Marlow [Tue, 16 Jun 2009 08:53:41 +0000 (08:53 +0000)]
Add support for 'make help' in subdirectories
Including help for directory-specific targets, such as 'make 1' in ghc

13 years agomention 'make {html,ps,pdf}'
Simon Marlow [Tue, 16 Jun 2009 08:53:02 +0000 (08:53 +0000)]
mention 'make {html,ps,pdf}'

13 years agoeliminate "warning: overriding commnds..." from make when we're cleaning
Simon Marlow [Tue, 16 Jun 2009 08:44:51 +0000 (08:44 +0000)]
eliminate "warning: overriding commnds..." from make when we're cleaning

13 years agoAdd 'make help', displaying a list of useful make targets
Simon Marlow [Mon, 15 Jun 2009 14:00:08 +0000 (14:00 +0000)]
Add 'make help', displaying a list of useful make targets

13 years agoAdd 'make fast' which omits deps (for a library) and some of the phases
Simon Marlow [Mon, 15 Jun 2009 13:58:01 +0000 (13:58 +0000)]
Add 'make fast' which omits deps (for a library) and some of the phases

13 years agoadd the missing final row of dashes in the success message
Simon Marlow [Mon, 15 Jun 2009 13:57:16 +0000 (13:57 +0000)]
add the missing final row of dashes in the success message

13 years ago'make 1' in libraries builds just the stage1 libs
Simon Marlow [Mon, 15 Jun 2009 13:56:51 +0000 (13:56 +0000)]
'make 1' in libraries builds just the stage1 libs
i.e. not dph, and hence not stage2

13 years agoadd 'make stage1_libs', to make just the stage 1 libs
Simon Marlow [Mon, 15 Jun 2009 13:55:32 +0000 (13:55 +0000)]
add 'make stage1_libs', to make just the stage 1 libs
i.e. not dph, and hence not the stage 2 compiler.

13 years agocopyFileWithHeader: use binary Handles
Simon Marlow [Mon, 15 Jun 2009 11:05:45 +0000 (11:05 +0000)]
copyFileWithHeader: use binary Handles
Fixes failure when Haddocking Data.Monoid in libraries/base

13 years agoInclude runghc and unlit in bindists
Ian Lynagh [Sat, 13 Jun 2009 16:17:07 +0000 (16:17 +0000)]
Include runghc and unlit in bindists

13 years agoImprove bindist testing
Ian Lynagh [Sat, 13 Jun 2009 16:15:16 +0000 (16:15 +0000)]
Improve bindist testing
We now also test runghc and unlit

13 years agoRemove the haskeline-specific hacks from ghc-cabal
Ian Lynagh [Fri, 12 Jun 2009 23:58:23 +0000 (23:58 +0000)]
Remove the haskeline-specific hacks from ghc-cabal
Now that base does -liconv when it is necessary, it is no longer
necessary for haskeline to do it as well, as haskeline depends on base.
Thus we don't need the haskeline-specific hacks in ghc-cabal any more.

13 years agoRemove library buildinfo files when cleaning
Ian Lynagh [Fri, 12 Jun 2009 23:38:18 +0000 (23:38 +0000)]
Remove library buildinfo files when cleaning

13 years agoUpdate symbol names; fixes the build on OSX
Ian Lynagh [Fri, 12 Jun 2009 19:40:29 +0000 (19:40 +0000)]
Update symbol names; fixes the build on OSX

13 years agodon't check for stack underflow if we just had an overflow
Simon Marlow [Wed, 10 Jun 2009 10:47:48 +0000 (10:47 +0000)]
don't check for stack underflow if we just had an overflow

13 years agopprExpr: don't add extra parens around [a..b] in an argument position
Simon Marlow [Mon, 8 Jun 2009 08:27:05 +0000 (08:27 +0000)]
pprExpr: don't add extra parens around [a..b] in an argument position
test is tcfail205

13 years agoChanges for the new IO library, mainly base-package modules moving around
Simon Marlow [Fri, 29 May 2009 13:18:22 +0000 (13:18 +0000)]
Changes for the new IO library, mainly base-package modules moving around

13 years agoFix the compiler-hs-dependency's
Ian Lynagh [Fri, 12 Jun 2009 10:48:27 +0000 (10:48 +0000)]
Fix the compiler-hs-dependency's
We needed some more $s to delay evaluation until the values are
available, and the calls needed to be later in the ghc.mk so that
compiler_stage2_WAYS etc are defined.

13 years agoDoc building is now controlled by sensible variables
Ian Lynagh [Thu, 11 Jun 2009 16:28:58 +0000 (16:28 +0000)]
Doc building is now controlled by sensible variables

13 years agoHC bootstrapping now works
Ian Lynagh [Thu, 11 Jun 2009 16:27:56 +0000 (16:27 +0000)]
HC bootstrapping now works

13 years agobindists are now done
Ian Lynagh [Thu, 11 Jun 2009 16:27:30 +0000 (16:27 +0000)]
bindists are now done

13 years agoAdd some $s to rules/build-package.mk for consistency
Ian Lynagh [Thu, 11 Jun 2009 13:01:44 +0000 (13:01 +0000)]
Add some $s to rules/build-package.mk for consistency

13 years agoDeprecate the threadsafe kind of foreign import
Duncan Coutts [Thu, 11 Jun 2009 12:34:41 +0000 (12:34 +0000)]
Deprecate the threadsafe kind of foreign import

13 years agoRemove __encodeDouble and __encodeFloat from the rts
Duncan Coutts [Thu, 11 Jun 2009 15:48:52 +0000 (15:48 +0000)]
Remove __encodeDouble and __encodeFloat from the rts
They now live in the integer-gmp package.

13 years agoAdd recently added lib dirs to the darcs boring file
Duncan Coutts [Thu, 11 Jun 2009 11:28:24 +0000 (11:28 +0000)]
Add recently added lib dirs to the darcs boring file

13 years agoFix the flag used to force linking when we are making a shared library
Duncan Coutts [Thu, 4 Jun 2009 12:16:52 +0000 (12:16 +0000)]
Fix the flag used to force linking when we are making a shared library
This is a correction to the patch:
* When linking a shared library with --make, always do the link step
which used the wrong flag in making the decision. It used -dynamic
whereas the correct flag is -shared.

13 years agoCheck we're not using stdcall in foreign export on unsupported platforms
Duncan Coutts [Mon, 8 Jun 2009 14:55:09 +0000 (14:55 +0000)]
Check we're not using stdcall in foreign export on unsupported platforms
It's already checked for foreign import, but was missing for export.

13 years agoRemove the various mp registers from the StgRegTable
Duncan Coutts [Wed, 10 Jun 2009 17:36:09 +0000 (17:36 +0000)]
Remove the various mp registers from the StgRegTable
No longer need them as temp vars in the cmm primop implementations.

13 years agoConvert the gmp cmm primops to use local stack allocation
Duncan Coutts [Wed, 10 Jun 2009 17:30:26 +0000 (17:30 +0000)]
Convert the gmp cmm primops to use local stack allocation
Using global temp vars is really ugly and in the threaded case it
needs slots in the StgRegTable. It'd also be pretty silly once we
move the cmm primops out of the rts, into the integer-gmp package.

13 years agoMake killThread# cmm primop use local stack allocation
Duncan Coutts [Wed, 10 Jun 2009 17:22:15 +0000 (17:22 +0000)]
Make killThread# cmm primop use local stack allocation
It using the mp_tmp_w register/global as a convenient temporary
variable. This is naughty because those vars are supposed to be
for gmp. Also, we want to remove the gmp temp vars so we must
now use a local stack slot instead.

13 years agoMake Windows bindists and installers work in the new build system
Ian Lynagh [Wed, 10 Jun 2009 18:18:25 +0000 (18:18 +0000)]
Make Windows bindists and installers work in the new build system

13 years agoChange GHC_OPTIONS to OPTIONS_GHC
Ian Lynagh [Wed, 10 Jun 2009 12:46:11 +0000 (12:46 +0000)]
Change GHC_OPTIONS to OPTIONS_GHC

13 years agoDefine _BSD_SOURCE in Stg.h
Ian Lynagh [Tue, 9 Jun 2009 12:17:05 +0000 (12:17 +0000)]
Define _BSD_SOURCE in Stg.h
This means that, on Linux, we get functions like gamma defined when we
#include math.h

13 years agoPut "%expect 0" directives in the .y files
Ian Lynagh [Mon, 8 Jun 2009 20:39:35 +0000 (20:39 +0000)]
Put "%expect 0" directives in the .y files
With the exception of GHC's main Parser.y(.pp), which has 2
reduce/reduce conflicts

13 years agoUpdate to libffi 3.0.8; fixes trac #3119
Ian Lynagh [Fri, 5 Jun 2009 17:17:04 +0000 (17:17 +0000)]
Update to libffi 3.0.8; fixes trac #3119

13 years agoFix the libffi Makefile
Ian Lynagh [Fri, 5 Jun 2009 16:05:38 +0000 (16:05 +0000)]
Fix the libffi Makefile

13 years agoAdd a README saying where libffi tarballs come from
Ian Lynagh [Fri, 5 Jun 2009 16:04:31 +0000 (16:04 +0000)]
Add a README saying where libffi tarballs come from

13 years agoghc-pkg now takes a verbosity argument
Ian Lynagh [Fri, 5 Jun 2009 15:15:44 +0000 (15:15 +0000)]
ghc-pkg now takes a verbosity argument

13 years agoFollow Cabal changes
Ian Lynagh [Fri, 5 Jun 2009 13:13:24 +0000 (13:13 +0000)]
Follow Cabal changes

13 years agoUpdate the docs on how you bind unlifted types in let/where clauses
Ian Lynagh [Fri, 5 Jun 2009 12:29:29 +0000 (12:29 +0000)]
Update the docs on how you bind unlifted types in let/where clauses

13 years agoDocument -fwarn-lazy-unlifted-bindings
Ian Lynagh [Fri, 5 Jun 2009 12:23:48 +0000 (12:23 +0000)]
Document -fwarn-lazy-unlifted-bindings

13 years agoFix typo
Ian Lynagh [Fri, 5 Jun 2009 12:20:48 +0000 (12:20 +0000)]
Fix typo

13 years agoMention that generalised list comprehensions are enabled with -XTransformListComp
simonpj@microsoft.com [Fri, 5 Jun 2009 14:00:09 +0000 (14:00 +0000)]
Mention that generalised list comprehensions are enabled with -XTransformListComp

13 years agoMake a proper Opt_WarnLazyUnliftedBindings warning, with a flag etc
Ian Lynagh [Fri, 5 Jun 2009 11:43:16 +0000 (11:43 +0000)]
Make a proper Opt_WarnLazyUnliftedBindings warning, with a flag etc

13 years agoFix ghc-cabal, so that GHC.Prim gets registered when we install
Ian Lynagh [Thu, 4 Jun 2009 12:45:01 +0000 (12:45 +0000)]
Fix ghc-cabal, so that GHC.Prim gets registered when we install

13 years agofix a warning
Simon Marlow [Thu, 4 Jun 2009 09:35:39 +0000 (09:35 +0000)]
fix a warning

13 years agoLock the StablePtr table during GC
Simon Marlow [Thu, 4 Jun 2009 09:05:53 +0000 (09:05 +0000)]
Lock the StablePtr table during GC
Allows hs_free_fun_ptr() to be called by a separate thread

13 years agofix $(TOP)
Simon Marlow [Thu, 4 Jun 2009 08:48:24 +0000 (08:48 +0000)]
fix $(TOP)

13 years agoremove a prototype that shouldn't be here
Simon Marlow [Thu, 4 Jun 2009 08:47:49 +0000 (08:47 +0000)]
remove a prototype that shouldn't be here

13 years agoMerge the TODO lists in ghc.mk
Ian Lynagh [Wed, 3 Jun 2009 12:12:09 +0000 (12:12 +0000)]
Merge the TODO lists in ghc.mk

13 years agoTighten up the DocBook XSL stylesheet test
Simon Marlow [Wed, 3 Jun 2009 10:12:44 +0000 (10:12 +0000)]
Tighten up the DocBook XSL stylesheet test
It wasn't failing even when the DTD was not found.

13 years agofix logic for BUID_DOCBOOK_HTML
Simon Marlow [Wed, 3 Jun 2009 09:23:13 +0000 (09:23 +0000)]
fix logic for BUID_DOCBOOK_HTML

13 years agoAllow RULES for seq, and exploit them
simonpj@microsoft.com [Wed, 3 Jun 2009 09:29:56 +0000 (09:29 +0000)]
Allow RULES for seq, and exploit them

Roman found situations where he had
      case (f n) of _ -> e
where he knew that f (which was strict in n) would terminate if n did.
Notice that the result of (f n) is discarded. So it makes sense to
transform to
      case n of _ -> e

Rather than attempt some general analysis to support this, I've added
enough support that you can do this using a rewrite rule:

  RULE "f/seq" forall n.  seq (f n) e = seq n e

You write that rule.  When GHC sees a case expression that discards
its result, it mentally transforms it to a call to 'seq' and looks for
a RULE.  (This is done in Simplify.rebuildCase.)  As usual, the
correctness of the rule is up to you.

This patch implements the extra stuff.  I have not documented it explicitly
in the user manual yet... let's see how useful it is first.

The patch looks bigger than it is, because
  a) Comments; see esp MkId Note [seqId magic]

  b) Some refactoring.  Notably, I moved the special desugaring for
     seq from MkCore back into DsUtils where it properly belongs.
     (It's really a desugaring thing, not a CoreSyn invariant.)

  c) Annoyingly, in a RULE left-hand side we need to be careful that
     the magical desugaring done in MkId Note [seqId magic] item (c)
     is *not* done on the LHS of a rule. Or rather, we arrange to
     un-do it, in DsBinds.decomposeRuleLhs.

13 years agoRemove the unused remains of __decodeFloat
Ian Lynagh [Tue, 2 Jun 2009 18:22:11 +0000 (18:22 +0000)]
Remove the unused remains of __decodeFloat

13 years agoRemove old GUM/GranSim code
Simon Marlow [Tue, 2 Jun 2009 14:02:33 +0000 (14:02 +0000)]
Remove old GUM/GranSim code

13 years agotidy up autoconfiguration of docbook stuff
Simon Marlow [Tue, 2 Jun 2009 13:49:43 +0000 (13:49 +0000)]
tidy up autoconfiguration of docbook stuff

 * use --nonet, so xmllint and co don't go off trying to download
   stuff from the web

 * use the http:// reference for the stylesheet, so we don't have to
   search the filesystem for it (should speedup ./configure)

13 years agofix 'make sdist'
Simon Marlow [Tue, 2 Jun 2009 12:16:18 +0000 (12:16 +0000)]
fix 'make sdist'

13 years agoAdd a comment about why RM and RM_OPTS are not in config.mk
Ian Lynagh [Tue, 2 Jun 2009 12:47:00 +0000 (12:47 +0000)]
Add a comment about why RM and RM_OPTS are not in config.mk

13 years agoFollow the change in RM's definition in distrib/Makefile-bin-vars.in
Ian Lynagh [Tue, 2 Jun 2009 12:46:44 +0000 (12:46 +0000)]
Follow the change in RM's definition in distrib/Makefile-bin-vars.in

13 years agoFix Trac #3265: type operators in type/class declarations
simonpj@microsoft.com [Tue, 2 Jun 2009 13:37:06 +0000 (13:37 +0000)]
Fix Trac #3265: type operators in type/class declarations

We should accept these:

   data a :*: b = ....
or
   data (:*:) a b = ...

only if -XTypeOperators is in force.  And similarly class decls.

This patch fixes the problem.  It uses the slightly-nasty OccName.isSymOcc,
but the only way to avoid that is to cach the result in OccNames which seems
overkill to us.

13 years agoUse -w when compiling libffi, to stop -Werror failures
Ian Lynagh [Tue, 2 Jun 2009 11:34:08 +0000 (11:34 +0000)]
Use -w when compiling libffi, to stop -Werror failures

13 years agoAdd a section "Multi-threading and the FFI"
Simon Marlow [Tue, 2 Jun 2009 10:23:52 +0000 (10:23 +0000)]
Add a section "Multi-threading and the FFI"
and collect all the information about multi-threaded FFI use into it.

13 years agoemit a helpful message if you say 'make html' and BUILD_DOCBOOK_HTML=NO
Simon Marlow [Tue, 2 Jun 2009 09:59:36 +0000 (09:59 +0000)]
emit a helpful message if you say 'make html' and BUILD_DOCBOOK_HTML=NO

13 years agomention documentation tools in the summary; tidy up formatting
Simon Marlow [Tue, 2 Jun 2009 09:03:45 +0000 (09:03 +0000)]
mention documentation tools in the summary; tidy up formatting

13 years agodepend on mk/project.mk appropriately
Simon Marlow [Fri, 29 May 2009 15:19:34 +0000 (15:19 +0000)]
depend on mk/project.mk appropriately

13 years agofix comment
Simon Marlow [Fri, 29 May 2009 11:30:28 +0000 (11:30 +0000)]
fix comment

13 years agoUnquote a $(LN_S) in ghc/ghc.mk
Ian Lynagh [Sat, 30 May 2009 23:33:56 +0000 (23:33 +0000)]
Unquote a $(LN_S) in ghc/ghc.mk

13 years ago$(XARGS) might include arguments, so don't quote it in makefiles
Ian Lynagh [Sat, 30 May 2009 23:31:33 +0000 (23:31 +0000)]
$(XARGS) might include arguments, so don't quote it in makefiles

13 years agoQuote commands that we run, so they work if there are space in their paths
Ian Lynagh [Sat, 30 May 2009 22:00:21 +0000 (22:00 +0000)]
Quote commands that we run, so they work if there are space in their paths
I've also added some missing $s to some makefiles. These aren't
technically necessary, but it's nice to be consistent.

13 years agoRemove some redundant code from hi-rule.mk
Ian Lynagh [Sat, 30 May 2009 19:37:29 +0000 (19:37 +0000)]
Remove some redundant code from hi-rule.mk

13 years agomake the clean_libraries target work, so you can "make clean" in libraries/
Ian Lynagh [Sat, 30 May 2009 18:47:50 +0000 (18:47 +0000)]
make the clean_libraries target work, so you can "make clean" in libraries/

13 years agofix pprDynamicLinkerAsmLabel for Mac OS X x86_64
Austin Seipp [Sat, 23 May 2009 09:09:01 +0000 (09:09 +0000)]
fix pprDynamicLinkerAsmLabel for Mac OS X x86_64

13 years agoMake clean_libraries in the same way that we make all_libraries
Ian Lynagh [Fri, 29 May 2009 18:01:50 +0000 (18:01 +0000)]
Make clean_libraries in the same way that we make all_libraries

13 years agoTweak mk/sub-makefile.mk
Ian Lynagh [Fri, 29 May 2009 17:57:48 +0000 (17:57 +0000)]
Tweak mk/sub-makefile.mk

13 years agoImplement -XMonoLocalBinds: a radical new flag
simonpj@microsoft.com [Fri, 29 May 2009 13:11:37 +0000 (13:11 +0000)]
Implement -XMonoLocalBinds: a radical new flag

The new flag -XMonoLocalBinds tells GHC not to generalise nested
bindings in let or where clauses, unless there is a type signature,
in which case we use it.

I'm thinking about whether this might actually be a good direction for
Haskell go to in, although it seems pretty radical.  Anyway, the flag
is easy to implement (look at how few lines change), and having it
will allow us to experiement with and without.

Just for the record, below are the changes required in the boot
libraries -- ie the places where.  Not quite as minimal as I'd hoped,
but the changes fall into a few standard patterns, and most represent
(in my opinion) sytlistic improvements.  I will not push these patches,
however.

== running darcs what -s --repodir libraries/base
M ./Control/Arrow.hs -2 +4
M ./Data/Data.hs -7 +22
M ./System/IO/Error.hs +1
M ./Text/ParserCombinators/ReadP.hs +1
== running darcs what -s --repodir libraries/bytestring
M ./Data/ByteString/Char8.hs -1 +2
M ./Data/ByteString/Unsafe.hs +1
== running darcs what -s --repodir libraries/Cabal
M ./Distribution/PackageDescription.hs -2 +6
M ./Distribution/PackageDescription/Check.hs +3
M ./Distribution/PackageDescription/Configuration.hs -1 +3
M ./Distribution/ParseUtils.hs -2 +4
M ./Distribution/Simple/Command.hs -1 +4
M ./Distribution/Simple/Setup.hs -12 +24
M ./Distribution/Simple/UserHooks.hs -1 +5
== running darcs what -s --repodir libraries/containers
M ./Data/IntMap.hs -2 +2
== running darcs what -s --repodir libraries/dph
M ./dph-base/Data/Array/Parallel/Arr/BBArr.hs -1 +3
M ./dph-base/Data/Array/Parallel/Arr/BUArr.hs -2 +4
M ./dph-prim-par/Data/Array/Parallel/Unlifted/Distributed/Arrays.hs -6 +10
M ./dph-prim-par/Data/Array/Parallel/Unlifted/Distributed/Combinators.hs -3 +6
M ./dph-prim-seq/Data/Array/Parallel/Unlifted/Sequential/Flat/Permute.hs -2 +4
== running darcs what -s --repodir libraries/syb
M ./Data/Generics/Twins.hs -5 +18

13 years agodon't shrink the stack smaller than the value set by +RTS -k<size>
Simon Marlow [Fri, 29 May 2009 09:08:27 +0000 (09:08 +0000)]
don't shrink the stack smaller than the value set by +RTS -k<size>

13 years agoFix bug in previous change: allocate the correct size
Simon Marlow [Fri, 29 May 2009 09:07:58 +0000 (09:07 +0000)]
Fix bug in previous change: allocate the correct size

13 years agoMake haddocking depend on the library .a file
simonpj@microsoft.com [Fri, 29 May 2009 08:45:14 +0000 (08:45 +0000)]
Make haddocking depend on the library .a file

You can't Haddock a library until it's built. Previously that happened
automatically because
  Haddock itself was built with stage2
  And all the libraries were built with stage1
But now DPH is built with stage2, so Haddock can get to work too
early.

This patch adds the missing dependency (thanks to Simon M)

13 years agoFix Trac #3259: expose 'lazy' only after generating interface files
simonpj@microsoft.com [Fri, 29 May 2009 07:20:20 +0000 (07:20 +0000)]
Fix Trac #3259: expose 'lazy' only after generating interface files

This patch fixes an insidious and long-standing bug in the way that
parallelism is handled in GHC.  See Note [lazyId magic] in MkId.

Here's the diagnosis, copied from the Trac ticket.  par is defined
in GHC.Conc thus:

    {-# INLINE par  #-}
    par :: a -> b -> b
    par  x y = case (par# x) of { _ -> lazy y }

    -- The reason for the strange "lazy" call is that it fools the
    -- compiler into thinking that pseq and par are non-strict in
    -- their second argument (even if it inlines pseq/par at the call
    -- site).  If it thinks par is strict in "y", then it often
    -- evaluates "y" before "x", which is totally wrong.

The function lazy is the identity function, but it is inlined only
after strictness analysis, and (via some magic) pretends to be
lazy. Hence par pretends to be lazy too.

The trouble is that both par and lazy are inlined into your definition
of parallelise, so that the unfolding for parallelise (exposed in
Parallelise.hi) does not use lazy at all. Then when compiling Main,
parallelise is in turn inlined (before strictness analysis), and so
the strictness analyser sees too much.

This was all sloppy thinking on my part. Inlining lazy after
strictness analysis works fine for the current module, but not for
importing modules.

The fix implemented by this patch is to inline 'lazy' in CorePrep,
not in WorkWrap. That way interface files never see the inlined version.

The downside is that a little less optimisation may happen on programs
that use 'lazy'.  And you'll only see this in the results -ddump-prep
not in -ddump-simpl.  So KEEP AN EYE OUT (Simon and Satnam especially).
Still, it should work properly now.  Certainly fixes #3259.

13 years agoFix Trac #3262: suppress name-shadow warning for _names
simonpj@microsoft.com [Thu, 28 May 2009 15:23:59 +0000 (15:23 +0000)]
Fix Trac #3262: suppress name-shadow warning for _names

Adopt Max's suggestion for name shadowing, by suppressing shadowing
warnings for variables starting with "_".  A tiny bit of refactoring
along the way.

13 years agodon't call Haskeline to read input when stdin is not a terminal
Simon Marlow [Thu, 28 May 2009 15:26:51 +0000 (15:26 +0000)]
don't call Haskeline to read input when stdin is not a terminal

13 years agoFix handling of R_SPARC_UA32 relocations in linker
Ben.Lippmeier@anu.edu.au [Thu, 28 May 2009 08:05:09 +0000 (08:05 +0000)]
Fix handling of R_SPARC_UA32 relocations in linker
  These refer to unaligned locations that need to be written
  byte-at-a-time. This fixes the SPARC ghci failures in
  the current head.

13 years agoDocument the fact that Template Haskell type splices work
simonpj@microsoft.com [Thu, 28 May 2009 16:54:43 +0000 (16:54 +0000)]
Document the fact that Template Haskell type splices work

13 years agoImprove printing of Orig RdrNames
simonpj@microsoft.com [Thu, 28 May 2009 16:52:15 +0000 (16:52 +0000)]
Improve printing of Orig RdrNames

In Tempate Haskell -ddump-splices, the "after" expression is populated
with RdrNames, many of which are Orig things.  We used to print these
fully-qualified, but that's a bit heavy.

This patch refactors the code a bit so that the same print-unqualified
mechanism we use for Names also works for RdrNames.  Lots of comments
too, because it took me a while to figure out how it all worked again.

13 years agoPrint more nicely in -ddump-splices
simonpj@microsoft.com [Thu, 28 May 2009 16:50:39 +0000 (16:50 +0000)]
Print more nicely in -ddump-splices

When you say -ddump-splices, the "before" expression is now

        *renamed* but not *typechecked"

Reason (a) less typechecking crap
       (b) data constructors after type checking have been
   changed to their *wrappers*, and that makes them
   print always fully qualified

13 years agoFix Trac #3261: make default types play nice with -Werror
simonpj@microsoft.com [Thu, 28 May 2009 16:49:00 +0000 (16:49 +0000)]
Fix Trac #3261: make default types play nice with -Werror

The trial-and-error for type defaults was not playing nicely with
-Werror. The fix is simple.

13 years agoAdjust error message slightly
simonpj@microsoft.com [Thu, 28 May 2009 16:48:02 +0000 (16:48 +0000)]
Adjust error message slightly