ghc.git
10 years agoUse _ rather than : for the builtin package filenames
Ian Lynagh [Sun, 13 Sep 2009 20:40:16 +0000 (20:40 +0000)] 
Use _ rather than : for the builtin package filenames
Using "builtin:foo" creates a file called "builtin" on Windows

10 years agoDon't register the non-munged stage1 ghc package
Ian Lynagh [Sun, 13 Sep 2009 16:19:45 +0000 (16:19 +0000)] 
Don't register the non-munged stage1 ghc package
It confuses the build system.

10 years agoFixes for compiling the HEAD with iteslf
Ian Lynagh [Sun, 13 Sep 2009 14:21:22 +0000 (14:21 +0000)] 
Fixes for compiling the HEAD with iteslf

10 years agoDon't try and put HaddockLex and HaddockParse into src dists
Ian Lynagh [Sat, 12 Sep 2009 17:50:50 +0000 (17:50 +0000)] 
Don't try and put HaddockLex and HaddockParse into src dists
They no longer exist.

10 years agoParsePkgConf no longer exists, so don't try to put it in source dists
Ian Lynagh [Sat, 12 Sep 2009 17:32:53 +0000 (17:32 +0000)] 
ParsePkgConf no longer exists, so don't try to put it in source dists

10 years agoTweak an error message
Ian Lynagh [Sat, 12 Sep 2009 17:32:23 +0000 (17:32 +0000)] 
Tweak an error message

10 years agoRefactor sdist so that we can see which command is being run
Ian Lynagh [Sat, 12 Sep 2009 17:16:27 +0000 (17:16 +0000)] 
Refactor sdist so that we can see which command is being run

10 years agoFix the location of the package database in the installed ghc-pkg
Ian Lynagh [Sat, 12 Sep 2009 14:40:46 +0000 (14:40 +0000)] 
Fix the location of the package database in the installed ghc-pkg
It was using the old filename, rather than the new directory name.

10 years agoMore bindist fixes
Ian Lynagh [Sat, 12 Sep 2009 14:32:48 +0000 (14:32 +0000)] 
More bindist fixes

10 years agoAdd includes/ghcautoconf.h and includes/ghcplatform.h to bindists
Ian Lynagh [Sat, 12 Sep 2009 13:28:42 +0000 (13:28 +0000)] 
Add includes/ghcautoconf.h and includes/ghcplatform.h to bindists

10 years agoUpdate the URL in the usage info to point to the current docs location
Ian Lynagh [Fri, 11 Sep 2009 22:07:35 +0000 (22:07 +0000)] 
Update the URL in the usage info to point to the current docs location

10 years agomove hschooks.c to ghc/, and enable it
Simon Marlow [Fri, 11 Sep 2009 14:07:02 +0000 (14:07 +0000)] 
move hschooks.c to ghc/, and enable it

10 years agoFix #3408: lengthen the idle GC time to 5s for GHC/GHCi.
Simon Marlow [Fri, 11 Sep 2009 12:45:47 +0000 (12:45 +0000)] 
Fix #3408: lengthen the idle GC time to 5s for GHC/GHCi.

10 years agoComments and Cmm notes
simonpj@microsoft.com [Fri, 11 Sep 2009 13:35:13 +0000 (13:35 +0000)] 
Comments and Cmm notes

10 years agoRemove the old package.conf parser, use read instead (fixed #3410)
Simon Marlow [Fri, 11 Sep 2009 11:49:28 +0000 (11:49 +0000)] 
Remove the old package.conf parser, use read instead (fixed #3410)
Performance isn't an issue for reading the old-style package.conf
files, so we might as well revert to using read and fix a bug at the
same time.

10 years agoFix some makefile logic, and remove the now unused *_USE_BOOT_LIBS vars
Ian Lynagh [Fri, 11 Sep 2009 12:31:35 +0000 (12:31 +0000)] 
Fix some makefile logic, and remove the now unused *_USE_BOOT_LIBS vars

10 years agoChange a sed separator character to make it easier to read
Ian Lynagh [Fri, 11 Sep 2009 12:18:27 +0000 (12:18 +0000)] 
Change a sed separator character to make it easier to read

10 years agoUse -fno-warn-name-shadowing when compiling Binary.hs
Ian Lynagh [Fri, 11 Sep 2009 11:47:56 +0000 (11:47 +0000)] 
Use -fno-warn-name-shadowing when compiling Binary.hs

10 years agoImprove optimisation of cost centres
simonpj@microsoft.com [Fri, 11 Sep 2009 11:56:30 +0000 (11:56 +0000)] 
Improve optimisation of cost centres

This patch fixes test failures for the profiling way for drv001.
The problem was that the arity of a function was decreasing during
"optimisation" because of interaction with SCC annotations.
In particular
      f = /\a. scc "f" (h x)    -- where h had arity 2
and h gets inlined, led to
      f = /\a. scc "f" let v = scc "f" x in \y. <blah>

Two main changes:

1.  exprIsTrivial now says True for (scc "f" x)
    See Note [SCCs are trivial] in CoreUtils

2.  The simplifier eliminates nested pushing of the same cost centre:
   scc "f" (...(scc "f" e)...)
   ==>  scc "f" (...e...)

10 years agoFix build with GHC <= 6.10.1
Simon Marlow [Fri, 11 Sep 2009 10:31:42 +0000 (10:31 +0000)] 
Fix build with GHC <= 6.10.1

10 years agoloosen base dependency to allow base-3
Simon Marlow [Fri, 11 Sep 2009 09:31:39 +0000 (09:31 +0000)] 
loosen base dependency to allow base-3

10 years agoremove superfluous trailing backslash
Simon Marlow [Fri, 11 Sep 2009 09:31:24 +0000 (09:31 +0000)] 
remove superfluous trailing backslash

10 years agoWork around bug in old bytestring versions by reading the package DB strictly
Simon Marlow [Fri, 11 Sep 2009 09:31:03 +0000 (09:31 +0000)] 
Work around bug in old bytestring versions by reading the package DB strictly

10 years agoAdd cmm-notes, describing Simon and John's work on Cmm pipeline
simonpj@microsoft.com [Fri, 11 Sep 2009 10:53:16 +0000 (10:53 +0000)] 
Add cmm-notes, describing Simon and John's work on Cmm pipeline

10 years agoWibble to error message
simonpj@microsoft.com [Fri, 11 Sep 2009 09:08:19 +0000 (09:08 +0000)] 
Wibble to error message

10 years agoadd comment: __thread is not supported by gcc on OS X yet
Simon Marlow [Thu, 10 Sep 2009 15:21:46 +0000 (15:21 +0000)] 
add comment: __thread is not supported by gcc on OS X yet

10 years agoFix #3320: we forgot to save/restore the GC register variable
Simon Marlow [Thu, 10 Sep 2009 15:16:23 +0000 (15:16 +0000)] 
Fix #3320: we forgot to save/restore the GC register variable

10 years agoput back F_, just in case the via-C codegen uses it
Simon Marlow [Thu, 10 Sep 2009 12:40:37 +0000 (12:40 +0000)] 
put back F_, just in case the via-C codegen uses it

10 years agoremove debugging/testing code that got here by mistake
Simon Marlow [Thu, 10 Sep 2009 12:26:07 +0000 (12:26 +0000)] 
remove debugging/testing code that got here by mistake

10 years agofix installation of header files (#3451)
Simon Marlow [Thu, 10 Sep 2009 12:18:31 +0000 (12:18 +0000)] 
fix installation of header files (#3451)

10 years agoThree improvements to Template Haskell (fixes #3467)
simonpj@microsoft.com [Thu, 10 Sep 2009 12:58:48 +0000 (12:58 +0000)] 
Three improvements to Template Haskell (fixes #3467)

This patch implements three significant improvements to Template Haskell.

Declaration-level splices with no "$"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This change simply allows you to omit the "$(...)" wrapper for
declaration-level TH splices.  An expression all by itself is
not legal, so we now treat it as a TH splice.  Thus you can now
say
data T = T1 | T2
  deriveMyStuff ''T

where deriveMyStuff :: Name -> Q [Dec]
This makes a much nicer interface for clients of libraries that use
TH: no scary $(deriveMyStuff ''T).

Nested top-level splices
~~~~~~~~~~~~~~~~~~~~~~~~
Previously TH would reject this, saying that splices cannot be nested:
f x = $(g $(h 'x))
But there is no reason for this not to work.  First $(h 'x) is run,
yielding code <blah> that is spliced instead of the $(h 'x). Then (g
<blah>) is typechecked and run, yielding code that replaces the
$(g ...) splice.

So this simply lifts the restriction.

Fix Trac #3467: non-top-level type splices
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It appears that when I added the ability to splice types in TH
programs, I failed to pay attention to non-top-level splices -- that
is, splices inside quotatation brackets.

This patch fixes the problem.  I had to modify HsType, so there's a
knock-on change to Haddock.

Its seems that a lot of lines of code has changed, but almost all the
new lines are comments!

General tidying up
~~~~~~~~~~~~~~~~~~
As a result of thinking all this out I re-jigged the data type ThStage,
which had far too many values before.  And I wrote a nice state transition
diagram to make it all precise;
   see Note [Template Haskell state diagram] in TcSplice

Lots more refactoring in TcSplice, resulting in significantly less code.
(A few more lines, but actually less code -- the rest is comments.)

I think the result is significantly cleaner.

10 years agoRefactor the parsing of data type declarations
simonpj@microsoft.com [Tue, 8 Sep 2009 19:23:27 +0000 (19:23 +0000)] 
Refactor the parsing of data type declarations

This is a minor change to the parser that tidies it up a bit,
and allows us to parse

data T :: *
        data S :: * -> *

just like

data T
data S a

10 years agoRemove unused data constructor ITpragma in type Lexer.Token
simonpj@microsoft.com [Sat, 5 Sep 2009 17:15:11 +0000 (17:15 +0000)] 
Remove unused data constructor ITpragma in type Lexer.Token

10 years agoComments in Cmm
simonpj@microsoft.com [Thu, 10 Sep 2009 12:29:28 +0000 (12:29 +0000)] 
Comments in Cmm

10 years agofix warnings
Simon Marlow [Thu, 10 Sep 2009 11:11:56 +0000 (11:11 +0000)] 
fix warnings

10 years agobinary has unused-import warnings
Simon Marlow [Thu, 10 Sep 2009 11:11:15 +0000 (11:11 +0000)] 
binary has unused-import warnings

10 years agoChange the representation of the package database
Simon Marlow [Thu, 10 Sep 2009 10:27:03 +0000 (10:27 +0000)] 
Change the representation of the package database

 - the package DB is a directory containing one file per package
   instance (#723)

 - there is a binary cache of the database (#593, #2089)

 - the binary package is now a boot package

 - there is a new package, bin-package-db, containing the Binary
   instance of InstalledPackageInfo for the binary cache.

Also included in this patch

 - Use colour in 'ghc-pkg list' to indicate broken or hidden packages

   Broken packages are red, hidden packages are

   Colour support comes from the terminfo package, and is only used when
    - not --simple-output
    - stdout is a TTY
    - the terminal type has colour capability

 - Fix the bug that 'ghc-pkg list --user' shows everything as broken

10 years agoImprove the user guide section on shared libs
Duncan Coutts [Tue, 8 Sep 2009 18:32:41 +0000 (18:32 +0000)] 
Improve the user guide section on shared libs
Make it clear that Haskell code to be used by other Haskell code
must be built as a package.

10 years agoFIX #711 implement osFreeAllMBlocks for unix
Austin Seipp [Thu, 10 Sep 2009 08:46:30 +0000 (08:46 +0000)] 
FIX #711 implement osFreeAllMBlocks for unix

10 years agoNO_CLEAN_GMP fixes
Simon Marlow [Wed, 9 Sep 2009 09:34:43 +0000 (09:34 +0000)] 
NO_CLEAN_GMP fixes

10 years agoOmit visibility pragmas on Windows (fixes warnings/validate failures)
Simon Marlow [Wed, 9 Sep 2009 09:32:17 +0000 (09:32 +0000)] 
Omit visibility pragmas on Windows (fixes warnings/validate failures)

10 years agoComments only, on Cmm data types
simonpj@microsoft.com [Thu, 10 Sep 2009 09:17:03 +0000 (09:17 +0000)] 
Comments only, on Cmm data types

10 years agoFix up logic to decide whether shared libs are being built or not
Simon Marlow [Wed, 9 Sep 2009 11:57:57 +0000 (11:57 +0000)] 
Fix up logic to decide whether shared libs are being built or not

Now, adding dyn to $(GhcLibWays) is how shared libs are enabled.
Everything else keys off that, rather than testing
$(BuildSharedLibs).

10 years agoremove a ToDo that is Done
Simon Marlow [Tue, 8 Sep 2009 15:44:11 +0000 (15:44 +0000)] 
remove a ToDo that is Done

10 years agocomment fix
Simon Marlow [Tue, 8 Sep 2009 15:03:51 +0000 (15:03 +0000)] 
comment fix

10 years agorefactor *_OPTS settings in the build system; no functional changes
Simon Marlow [Wed, 9 Sep 2009 09:44:08 +0000 (09:44 +0000)] 
refactor *_OPTS settings in the build system; no functional changes

10 years agoadd $(CONF_*_OPTS) for options that come from ./configure (fixes #3426)
Simon Marlow [Tue, 8 Sep 2009 15:19:08 +0000 (15:19 +0000)] 
add $(CONF_*_OPTS) for options that come from ./configure (fixes #3426)

10 years agoAdd -package-id, improve package shadowing behaviour and error messages
Simon Marlow [Tue, 8 Sep 2009 14:09:06 +0000 (14:09 +0000)] 
Add -package-id, improve package shadowing behaviour and error messages
A few changes bundled together here:

 - Add -package-id flag, like -package but takes an
   InstalledPackageId as an argument (mainly for Cabal)
   (docs to follow)

 - Fix the shadowing behaviour: if we end up with
   two packages with the same name/version that came from
   different package databases, then one will shadow the
   other.  This may mean we have to disable other packages
   that depended on the now-shadowed package.  Lots of
   refactoring to ensure that we can get reasonable diagnostics when
   this happens

<command line>: cannot satisfy -package shadowdep:
    shadowdep-1-XXX is unusable due to missing or recursive dependencies:
      shadow-1-XXX
    (use -v for more information)

10 years agoremove --enable-hc-boot-unregisterised (implied by --enable-hc-boot now)
Simon Marlow [Tue, 8 Sep 2009 14:19:19 +0000 (14:19 +0000)] 
remove --enable-hc-boot-unregisterised (implied by --enable-hc-boot now)
and fix up related cruft

10 years agofix a warning
Simon Marlow [Tue, 8 Sep 2009 13:15:51 +0000 (13:15 +0000)] 
fix a warning

10 years agofix warnings
Simon Marlow [Tue, 8 Sep 2009 13:08:54 +0000 (13:08 +0000)] 
fix warnings

10 years agofix warnings
Simon Marlow [Tue, 8 Sep 2009 11:42:00 +0000 (11:42 +0000)] 
fix warnings

10 years agoremove Haddock-lexing/parsing/renaming from GHC
Isaac Dupree [Wed, 26 Aug 2009 14:59:24 +0000 (14:59 +0000)] 
remove Haddock-lexing/parsing/renaming from GHC

10 years agoFix Trac #3403: interaction of CPR and pattern-match failure
simonpj@microsoft.com [Tue, 8 Sep 2009 13:14:00 +0000 (13:14 +0000)] 
Fix Trac #3403: interaction of CPR and pattern-match failure

A fine bug report (#3403) demonstrated that we were losing the tail
call property when a complicated pattern match was involved.  After
a bit of investigation I discovered that the culprit was the failure
join-point introduced by the pattern matcher.  It was a zero-argument
thunk, which is not very CPR-friendly, and that interacted badly with
CPR worker/wrapper.

It's easy to fix, the same way that we fix other join points, by supplying
a dummy argument (that is not really passed at runtime.

10 years agoFix Trac #3468: improve checking for hs-boot interfaces
simonpj@microsoft.com [Tue, 8 Sep 2009 13:03:50 +0000 (13:03 +0000)] 
Fix Trac #3468: improve checking for hs-boot interfaces

When checking the interface exported by a hs-boot file against the
Real Thing, I'd failed to check the kind of a type constructor.  If you
get it wrong, the inconsistency leads to all manner of mischief, as
'wkahl' reports in #3468.

This patch should do the job.

10 years agoAllow TH/annotations to be used with -dynamic
Simon Marlow [Tue, 8 Sep 2009 10:16:44 +0000 (10:16 +0000)] 
Allow TH/annotations to be used with -dynamic

10 years agoFix warnings on 64-bit platforms; fixes validate on x86-64
Simon Marlow [Tue, 8 Sep 2009 09:26:39 +0000 (09:26 +0000)] 
Fix warnings on 64-bit platforms; fixes validate on x86-64

10 years agofix -u flags (after changes for #3310)
Simon Marlow [Thu, 3 Sep 2009 07:23:18 +0000 (07:23 +0000)] 
fix -u flags (after changes for #3310)

10 years agoUnify event logging and debug tracing.
Simon Marlow [Sat, 29 Aug 2009 09:47:27 +0000 (09:47 +0000)] 
Unify event logging and debug tracing.

  - tracing facilities are now enabled with -DTRACING, and -DDEBUG
    additionally enables debug-tracing.  -DEVENTLOG has been
    removed.

  - -debug now implies -eventlog

  - events can be printed to stderr instead of being sent to the
    binary .eventlog file by adding +RTS -v (which is implied by the
    +RTS -Dx options).

  - -Dx debug messages can be sent to the binary .eventlog file
    by adding +RTS -l.  This should help debugging by reducing
    the impact of debug tracing on execution time.

  - Various debug messages that duplicated the information in events
    have been removed.

10 years agowaitForReturnCapability: fix logic bug
Simon Marlow [Mon, 31 Aug 2009 06:49:08 +0000 (06:49 +0000)] 
waitForReturnCapability: fix logic bug
The check for whether a Capability was free was inverted, which harmed
performance for callbacks.

10 years agoHandle renames from #3310
Simon Marlow [Sun, 30 Aug 2009 15:31:23 +0000 (15:31 +0000)] 
Handle renames from #3310

Also add a panic for resurrecting a thread blocked on an exception,
since it should never happen.

10 years agoadd RTS_PRIVATE attribute
Simon Marlow [Sat, 29 Aug 2009 17:17:52 +0000 (17:17 +0000)] 
add RTS_PRIVATE attribute

10 years agoFix incorrectly hidden RTS symbols
Simon Marlow [Sat, 29 Aug 2009 13:28:14 +0000 (13:28 +0000)] 
Fix incorrectly hidden RTS symbols

10 years agoMaintain Task/Capability invariants in performPendingThrowTos
Simon Marlow [Sat, 29 Aug 2009 09:26:07 +0000 (09:26 +0000)] 
Maintain Task/Capability invariants in performPendingThrowTos
Fixes an ASSERTION failure with concprog001, -threaded -debug, +RTS -N2

10 years agoDeclare RTS-private prototypes with __attribute__((visibility("hidden")))
Simon Marlow [Wed, 5 Aug 2009 10:21:59 +0000 (10:21 +0000)] 
Declare RTS-private prototypes with __attribute__((visibility("hidden")))
This has no effect with static libraries, but when the RTS is in a
shared library it does two things:

 - it prevents the function from being exposed by the shared library

 - internal calls to the function can use the faster non-PLT calls,
   because the function cannot be overriden at link time.

10 years agoConfigurable iconv header and library locations
Matthias Kilian [Wed, 26 Aug 2009 15:59:13 +0000 (15:59 +0000)] 
Configurable iconv header and library locations
Should help to fix the build on OpenBSD (together with a corresponding
patch to libraries/base).

10 years agoUse -W, not -Werror, for gcc older than 3.4
Matthias Kilian [Wed, 26 Aug 2009 21:00:44 +0000 (21:00 +0000)] 
Use -W, not -Werror, for gcc older than 3.4

10 years agoDon't mess up absolute INCLUDE_DIRS
Matthias Kilian [Wed, 26 Aug 2009 15:33:40 +0000 (15:33 +0000)] 
Don't mess up absolute INCLUDE_DIRS
When there are some absolute include dirs, don't create arguments
like -Ilibraries/base//usr/local/include.

I need this fix for injecting the iconv include dir (which is
/usr/local/include on OpenBSD) into the build of libraries/base.

10 years agoFix #3461: protect the use of keepCAFs with #ifdef DYNAMIC
Simon Marlow [Fri, 28 Aug 2009 12:58:02 +0000 (12:58 +0000)] 
Fix #3461: protect the use of keepCAFs with #ifdef DYNAMIC

10 years agofix 'darcs-all rec' (amongst other things)
Simon Marlow [Thu, 27 Aug 2009 14:15:54 +0000 (14:15 +0000)] 
fix 'darcs-all rec' (amongst other things)

10 years agoREDO: Add -r option to darcs-all, and remove push-all (#3375)
Simon Marlow [Thu, 27 Aug 2009 13:57:17 +0000 (13:57 +0000)] 
REDO: Add -r option to darcs-all, and remove push-all (#3375)

rolling back:

Mon Aug  3 11:44:13 BST 2009  Simon Marlow <marlowsd@gmail.com>
  UNDO: Add -r option to darcs-all, and remove push-all (#3375)
  Contributed by: seliopou@gmail.com

  This patch modifies darcs-all to have feature parity with push-all by
  recognizing two new options.

      * -i, equivalent to --ignore-failure in push-all
      * -r <repo>, specifies the remote repository darcs commands will use

  Some example commands:

  Get the libraries from a repository of your choosing. This is useful
  when working with a git mirror:

      $ ./darcs-all -r http://darcs.haskell.org get

  Pull changes. Used to be:

      $ ./push-all --pull http://darcs.haskell.org

  Is now:

      $ ./darcs-all -r http://darcs.haskell.org pull

  Or to use the default remote of the ghc repository:

      $ ./darcs-all pull

    M ./darcs-all -79 +33
    A ./push-all

10 years agoAdd a link to hp2any from the profiling section.
Simon Marlow [Thu, 27 Aug 2009 11:40:50 +0000 (11:40 +0000)] 
Add a link to hp2any from the profiling section.

10 years agoFix "make install"
Ian Lynagh [Wed, 26 Aug 2009 15:56:38 +0000 (15:56 +0000)] 
Fix "make install"
We need to change a dependency on
    pkg-inplace
to
    pkg-$abihash
when installing

10 years ago"ghc-cabal install" now needs to know where GHC is, to get the ABI hash
Ian Lynagh [Wed, 26 Aug 2009 13:33:59 +0000 (13:33 +0000)] 
"ghc-cabal install" now needs to know where GHC is, to get the ABI hash

10 years agoFix bindist creation
Ian Lynagh [Wed, 26 Aug 2009 12:29:53 +0000 (12:29 +0000)] 
Fix bindist creation
We were running into problems like:
    for f in  LICENSE configure config.sub config.guess [...]
    make[2]: execvp: /bin/sh: Argument list too long
This patch moves the loop into make, rather than the shell.

10 years agoUNDO: fix the inplace runghc (it broke the installed runghc)
Simon Marlow [Wed, 26 Aug 2009 10:49:37 +0000 (10:49 +0000)] 
UNDO: fix the inplace runghc (it broke the installed runghc)

10 years agoFix part of #3398: pretty-printing always goes via the I/O library encoding
Simon Marlow [Wed, 26 Aug 2009 10:40:52 +0000 (10:40 +0000)] 
Fix part of #3398: pretty-printing always goes via the I/O library encoding
That is, unless we're printing in LeftMode, where we bypass encoding
for speed.  This is safe, because LeftMode is used for outputting C or
asm, where everyting is Z-encoded and hence ASCII.

Error messages and other compiler output containing Unicode will now
appear correctly according to the locale settings.

10 years agoTidy up file headers and copyrights; point to the wiki for docs
Simon Marlow [Tue, 25 Aug 2009 09:50:47 +0000 (09:50 +0000)] 
Tidy up file headers and copyrights; point to the wiki for docs

I've updated the wiki page about the RTS headers
  http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
to reflect the new layout and explain some of the rationale.  All the
header files now point to this page.

10 years agoFollow changes in Cabal: package -> sourcePackageId
Simon Marlow [Mon, 24 Aug 2009 16:00:20 +0000 (16:00 +0000)] 
Follow changes in Cabal: package -> sourcePackageId

10 years agofix an unused-import warning
Simon Marlow [Mon, 24 Aug 2009 15:36:57 +0000 (15:36 +0000)] 
fix an unused-import warning

10 years agoAdd unique package identifiers (InstalledPackageId) in the package DB
Simon Marlow [Thu, 20 Aug 2009 11:09:20 +0000 (11:09 +0000)] 
Add unique package identifiers (InstalledPackageId) in the package DB
See commentary at
http://hackage.haskell.org/trac/ghc/wiki/Commentary/Packages

10 years agoMove the standalone-deriving flag test from parser to renamer
simonpj@microsoft.com [Tue, 25 Aug 2009 07:33:24 +0000 (07:33 +0000)] 
Move the standalone-deriving flag test from parser to renamer

This is just a tiny refactoring.  In general, we're trying to
get rid of parser errors in favour of later, more civlised, errors.

10 years agoError message wibble
simonpj@microsoft.com [Tue, 25 Aug 2009 07:32:59 +0000 (07:32 +0000)] 
Error message wibble

10 years agoFix Trac #3406 (albeit not very satisfactorily): scoped type variables
simonpj@microsoft.com [Tue, 25 Aug 2009 07:30:59 +0000 (07:30 +0000)] 
Fix Trac #3406 (albeit not very satisfactorily): scoped type variables

The issue here is this:

  type ItemColID a b = Int  -- Discards a,b

  get :: ItemColID a b -> a -> ItemColID a b
  get (x :: ItemColID a b) = x :: ItemColID a b

The pattern signature for 'x' doesn't actually rigidly bind a,b.
This crashed GHC 6.10 with a 'readFilledBox' panic.  Now we fail
with an erroe message

With the new outside-in algorithm we'll be able to accept this program.

10 years agoMake FastString thread-safe.
Thomas Schilling [Mon, 24 Aug 2009 18:22:52 +0000 (18:22 +0000)] 
Make FastString thread-safe.

This is needed both for per-session parallelism and for allowing
multiple concurrent sessions in the same process.  With the help of
atomicModifyIORef and unsafePerformIO it is also quite fast--an MVar
would most likely be slower.  On a full compilation of Cabal's head
branch it was about 1-2 percent slower, but then overall compilation
times varied by about 4 percent, so I think it's worth it.

10 years agoImprove docs on -XFlexibleContexts
simonpj@microsoft.com [Mon, 24 Aug 2009 11:37:22 +0000 (11:37 +0000)] 
Improve docs on -XFlexibleContexts

10 years agofix do-notation warnings
Simon Marlow [Mon, 24 Aug 2009 08:04:00 +0000 (08:04 +0000)] 
fix do-notation warnings

10 years agoUse explicit Word32/Int32 in place of Int in the on-disk .hi file
Simon Marlow [Fri, 21 Aug 2009 15:50:28 +0000 (15:50 +0000)] 
Use explicit Word32/Int32 in place of Int in the on-disk .hi file
For: FastStrings, Names, and Bin values.  This makes .hi files smaller
on 64-bit platforms, while also making the format a bit more robust.

10 years agoFix the interface-file incompatibility crash (#3435)
Simon Marlow [Fri, 21 Aug 2009 15:47:37 +0000 (15:47 +0000)] 
Fix the interface-file incompatibility crash (#3435)

We now have a dummy 32/64-bit field near the beginning of a .hi file
for backward-compatibility reasons; see comments (Note [dummy iface
field]) in BinIface.hs.

10 years agotrim Data.Sequence import, in preparation for expanding its API
Ross Paterson [Mon, 24 Aug 2009 08:05:33 +0000 (08:05 +0000)] 
trim Data.Sequence import, in preparation for expanding its API

10 years agoRemove bitrotted IA64 code in Linker.c
Ian Lynagh [Sun, 23 Aug 2009 15:16:00 +0000 (15:16 +0000)] 
Remove bitrotted IA64 code in Linker.c
It breaks the unregisterised build on IA64.

10 years agoMake consIORef atomic.
Thomas Schilling [Sat, 22 Aug 2009 23:09:37 +0000 (23:09 +0000)] 
Make consIORef atomic.

10 years agoMake updates to external package state idempotent.
Thomas Schilling [Fri, 21 Aug 2009 23:53:55 +0000 (23:53 +0000)] 
Make updates to external package state idempotent.

Without this, concurrent updates to the EPS could introduce
overlapping instances (even though they came from the same module).

10 years agoFix Trac #3423: missed instantiation for newtype-derived instances
simonpj@microsoft.com [Fri, 21 Aug 2009 21:07:00 +0000 (21:07 +0000)] 
Fix Trac #3423: missed instantiation for newtype-derived instances

Somehow I'd forgotten to instantiate the coercion that is stored in a
'NewtypeDerived' constructor in an InstInfo.  The necessary code is
in TcInstDcls.tc_inst_decl2.

The result was ghc: panic! (the 'impossible' happened)
   (GHC version 6.10.3 for x86_64-unknown-linux):
   No match in record selector Var.tcTyVarDetails
because we were looking at an (uninstantiated) TyVar instead of
an (instantiated) TcTyVar.

10 years agoPut "dl" back in rts/package.conf if HAVE_DL is defined
Ian Lynagh [Fri, 21 Aug 2009 14:54:23 +0000 (14:54 +0000)] 
Put "dl" back in rts/package.conf if HAVE_DL is defined
Fixes linking with -dynamic

10 years agoLink CMM objects into dynamic libraries
Ian Lynagh [Fri, 21 Aug 2009 13:28:09 +0000 (13:28 +0000)] 
Link CMM objects into dynamic libraries
This fixes linking hello world with -dynamic. I've also added some more
variables, so there is less duplication between the different ways of
linking.

10 years ago-fPIC -fvia-C issues a warning and ignores -fvia-C
Simon Marlow [Fri, 21 Aug 2009 14:45:44 +0000 (14:45 +0000)] 
-fPIC -fvia-C issues a warning and ignores -fvia-C
Also, -fPIC causes an error if the target is registerised and has no
native code generator.

10 years agoUse allocateLocal() rather than allocate() in the interpreter
Simon Marlow [Thu, 20 Aug 2009 15:23:25 +0000 (15:23 +0000)] 
Use allocateLocal() rather than allocate() in the interpreter
This gives about a 15% performance boost in GHCi for me.  nice!

10 years agoAnother tiny tidy-up to RnPat
simonpj@microsoft.com [Fri, 21 Aug 2009 10:08:26 +0000 (10:08 +0000)] 
Another tiny tidy-up to RnPat

10 years agoFix Trac #3437: strictness of specialised functions
simonpj@microsoft.com [Fri, 21 Aug 2009 09:52:51 +0000 (09:52 +0000)] 
Fix Trac #3437: strictness of specialised functions

'lilac' helpful pin-pointed a space leak that was due to a specialised
function being insufficiently strict.  Here's the new comment in SpecConstr:

Note [Transfer strictness]
~~~~~~~~~~~~~~~~~~~~~~~~~~
We must transfer strictness information from the original function to
the specialised one.  Suppose, for example

  f has strictness     SS
        and a RULE     f (a:as) b = f_spec a as b

Now we want f_spec to have strictess  LLS, otherwise we'll use call-by-need
when calling f_spec instead of call-by-value.  And that can result in
unbounded worsening in space (cf the classic foldl vs foldl')

See Trac #3437 for a good example.

The function calcSpecStrictness performs the calculation.