8 years agoadd support for STG floating-point regs using VFPv3
Karel Gardas [Wed, 6 Jul 2011 19:05:13 +0000 (21:05 +0200)] 
add support for STG floating-point regs using VFPv3

This patch adds mapping for STG floating point registers
using ARM VFPv3. Since I'm using just d8-d11 also processors
with just VFPv3-D16 implemented should work (e.g. NVidia Tegra2,
 Marvell Dove)

8 years agomake StgReturn and cas functions Thumb friendly
Karel Gardas [Tue, 5 Jul 2011 18:12:14 +0000 (20:12 +0200)] 
make StgReturn and cas functions Thumb friendly

8 years agoimplement ARMv6/7 specific xchg function
Karel Gardas [Tue, 5 Jul 2011 18:10:18 +0000 (20:10 +0200)] 
implement ARMv6/7 specific xchg function

8 years agoStephen Blackheath's GHC/ARM registerised port
Karel Gardas [Sun, 3 Jul 2011 21:24:14 +0000 (23:24 +0200)] 
Stephen Blackheath's GHC/ARM registerised port

This is the Stephen Blackheath's GHC/ARM registerised port
which is using modified version of LLVM and which provides
basic registerised build functionality

8 years agodefault to using @note for saving the linker opts (someone mentioned
Simon Marlow [Wed, 10 Aug 2011 09:02:55 +0000 (10:02 +0100)] 
default to using @note for saving the linker opts (someone mentioned
that it wasn't working on Alpha, because we had explicitly listed the
arches rather than having a sensible fallback).

8 years agoDisable saving the linker options in the binary on Solaris (#5382).
Simon Marlow [Wed, 10 Aug 2011 09:01:44 +0000 (10:01 +0100)] 
Disable saving the linker options in the binary on Solaris (#5382).
Also refactor the check into one place.

8 years agoFail configure if Alex 3 is found. Haddock doesn't build with Alex 3
Simon Marlow [Wed, 10 Aug 2011 08:10:24 +0000 (09:10 +0100)] 
Fail configure if Alex 3 is found.  Haddock doesn't build with Alex 3
yet, and fixing it is non-trivial (a change to Cabal is needed).  So
I'm making configure fail with an error suggesting to install an older
Alex for now.

8 years agoFix conditional pragma to work with 6.12
David Terei [Tue, 9 Aug 2011 17:24:15 +0000 (10:24 -0700)] 
Fix conditional pragma to work with 6.12

8 years agoMake the free variable finder in TidyPgm work properly
Simon Peyton Jones [Tue, 9 Aug 2011 16:45:27 +0000 (17:45 +0100)] 
Make the free variable finder in TidyPgm work properly

We were getting exponential behaviour by gathering free
variables *both* from the unfolding *and* the RHS of
a definition.  While unfoldings are of limited size this
is merely inefficient.  But with -fexpose-all-unfoldings
it becomes exponentially costly. Doh.

Fixes Trac #5352.

8 years agoFix an x86 code generation bug (#5393). In fact, there were two bugs
Simon Marlow [Tue, 9 Aug 2011 11:31:03 +0000 (12:31 +0100)] 
Fix an x86 code generation bug (#5393).  In fact, there were two bugs
in X86.CodeGen.getNonClobberedOperand: two code fragments were the
wrong way around, and we were using the wrong size on an
instruction (32 bits instead of the word size).  This bit of the code
generator must have never worked!

8 years agoAdd Trustworthy pragma to bin-package-db
David Terei [Tue, 2 Aug 2011 22:17:10 +0000 (15:17 -0700)] 
Add Trustworthy pragma to bin-package-db

8 years agoHave validate check for the "files written by multiple tests" error
Ian Lynagh [Mon, 8 Aug 2011 18:13:07 +0000 (19:13 +0100)] 
Have validate check for the "files written by multiple tests" error

We don't actually enable the test yet, but when we do validate will
check whether it fails.

8 years agocompatibility with Alex 3.0
Simon Marlow [Mon, 8 Aug 2011 08:24:09 +0000 (09:24 +0100)] 
compatibility with Alex 3.0

8 years agocomment wibble
Simon Marlow [Fri, 5 Aug 2011 09:14:44 +0000 (10:14 +0100)] 
comment wibble

8 years agofix #5381: the -debug RTS could crash with "internal error: MVAR_CLEAN
Simon Marlow [Mon, 8 Aug 2011 08:12:08 +0000 (09:12 +0100)] 
fix #5381: the -debug RTS could crash with "internal error: MVAR_CLEAN
on mutable list" after a call to tryPutMVar#.

I don't think this leads to any problems without -debug.

8 years agoUse the correct __GLASGOW_HASKELL__ value when invoking hsc2hs on
Simon Marlow [Fri, 5 Aug 2011 08:06:41 +0000 (09:06 +0100)] 
Use the correct __GLASGOW_HASKELL__ value when invoking hsc2hs on
source code to be compiled with the stage 0 compiler. (bug noticed by
David Terei - thanks!)

8 years agoUse parenSymOcc when displaying an export list in RnNames (fixes Trac #5385)
Simon Peyton Jones [Mon, 8 Aug 2011 11:29:40 +0000 (12:29 +0100)] 
Use parenSymOcc when displaying an export list in RnNames (fixes Trac #5385)

I also called parenSymOcc in two other places that begged for it.

8 years agoAdd a case for kfreebsdgnu in Platforms.hs
Ian Lynagh [Sun, 7 Aug 2011 12:57:08 +0000 (13:57 +0100)] 
Add a case for kfreebsdgnu in Platforms.hs

8 years agoMerge branch 'master' of mac:ghc/git/val64/.
Ian Lynagh [Sat, 6 Aug 2011 22:55:17 +0000 (23:55 +0100)] 
Merge branch 'master' of mac:ghc/git/val64/.

8 years agoWith -v, we now print the commandlines that get run by askCc
Ian Lynagh [Sat, 6 Aug 2011 21:20:28 +0000 (22:20 +0100)] 
With -v, we now print the commandlines that get run by askCc

8 years agoAlso include basic time statistics in GCStats.
Edward Z. Yang [Sat, 6 Aug 2011 15:18:36 +0000 (11:18 -0400)] 
Also include basic time statistics in GCStats.

Signed-off-by: Edward Z. Yang <>
8 years agoTeach GHC to compile objective-c++ files as well (trac #5150)
Peter Wortmann [Fri, 22 Apr 2011 09:35:35 +0000 (10:35 +0100)] 
Teach GHC to compile objective-c++ files as well (trac #5150)

8 years agoWibble to "Fix a long-standing bug in HsUtils.hsTyClDeclBinders"
Simon Peyton Jones [Fri, 5 Aug 2011 16:40:29 +0000 (17:40 +0100)] 
Wibble to "Fix a long-standing bug in HsUtils.hsTyClDeclBinders"

8 years agoA little extra tracing
Simon Peyton Jones [Fri, 5 Aug 2011 14:30:54 +0000 (15:30 +0100)] 
A little extra tracing

8 years agoAnother run at binders in Template Haskell (fixes Trac #5379)
Simon Peyton Jones [Fri, 5 Aug 2011 14:29:44 +0000 (15:29 +0100)] 
Another run at binders in Template Haskell (fixes Trac #5379)

TH quotation was using mkName rather than newName for
top-level definitions, which is plain wrong as #5379
points out.

8 years agoFix a long-standing bug in HsUtils.hsTyClDeclBinders
Simon Peyton Jones [Fri, 5 Aug 2011 14:26:31 +0000 (15:26 +0100)] 
Fix a long-standing bug in HsUtils.hsTyClDeclBinders

We were returning the tycon of a type family *instance*
as a binder, and it just isn't!

Consequential tidy-ups follow.  I tripped over this on
the way to something else.  I'm not sure it was causing
a problem, but it is Plainly Wrong.

8 years agoMerge branch 'master' of
Simon Peyton Jones [Fri, 5 Aug 2011 10:15:50 +0000 (11:15 +0100)] 
Merge branch 'master' of

8 years agoplusParent can see a non-parent and a parent (fixes Trac #5374)
Simon Peyton Jones [Fri, 5 Aug 2011 10:14:31 +0000 (11:14 +0100)] 
plusParent can see a non-parent and a parent (fixes Trac #5374)

See Note [Parents] in RdrName.

8 years agoUpdate to work with Alex 3.0: basically disabling Alex's new Unicode
Simon Marlow [Thu, 4 Aug 2011 14:54:08 +0000 (15:54 +0100)] 
Update to work with Alex 3.0: basically disabling Alex's new Unicode
support because we have our own, and defining alexGetByte instead of
alexGetChar (actually we also define alexGetChar, for backwards

8 years agocomment about using "stage = 2" in
Simon Marlow [Thu, 4 Aug 2011 11:08:26 +0000 (12:08 +0100)] 
comment about using "stage = 2" in

8 years agotypo
Simon Marlow [Thu, 4 Aug 2011 11:07:30 +0000 (12:07 +0100)] 

8 years agosanitise naming of package lists
Simon Marlow [Thu, 4 Aug 2011 11:06:49 +0000 (12:06 +0100)] 
sanitise naming of package lists

The *predicates* all start with "PKGS_THAT_...", e.g.:

  PKGS_THAT_USE_TH              (previously "TH_PACKAGES)
  etc. (there are a few more)

the lists of packages to build are now consistently named:

  PACKAGES_STAGE1  (previously just "PACKAGES")

8 years agosmall optimisation for the program in #5367: if the worker thread
Simon Marlow [Wed, 3 Aug 2011 12:41:33 +0000 (13:41 +0100)] 
small optimisation for the program in #5367: if the worker thread
being woken already has its wakeup flag set, don't bother signalling
its condition variable again.

8 years agoAdd plugin documentation for reinitializeGlobals
Austin Seipp [Sun, 31 Jul 2011 15:26:52 +0000 (10:26 -0500)] 
Add plugin documentation for reinitializeGlobals

8 years agoDon't duplicate files in bindists; trac #5356
Ian Lynagh [Thu, 4 Aug 2011 15:24:30 +0000 (16:24 +0100)] 
Don't duplicate files in bindists; trac #5356

We were putting
into bindists twice.

8 years agoMissing call to tcView, fixes naughty failure in tc208
Simon Peyton Jones [Thu, 4 Aug 2011 15:00:04 +0000 (16:00 +0100)] 
Missing call to tcView, fixes naughty failure in tc208

8 years agoMerge branch 'master' of
Simon Peyton Jones [Thu, 4 Aug 2011 13:03:18 +0000 (14:03 +0100)] 
Merge branch 'master' of

8 years agoTidy up handling of PredTys: remove dead code, move functions deconstructing them...
Max Bolingbroke [Wed, 3 Aug 2011 19:33:10 +0000 (20:33 +0100)] 
Tidy up handling of PredTys: remove dead code, move functions deconstructing them to TcType

8 years agoStop using -Wl,-no_pie on OS X
Ian Lynagh [Wed, 3 Aug 2011 19:25:52 +0000 (20:25 +0100)] 
Stop using -Wl,-no_pie on OS X

Now that the in-tree gmp has been upgraded, it should no longer be
necessary, according to #5293.

8 years agoPrint type contexts with fsep, not sep
Simon Peyton Jones [Wed, 3 Aug 2011 16:05:56 +0000 (17:05 +0100)] 
Print type contexts with fsep, not sep

This is a slightly experimental change. When pretty-printing
a type, instead of
      instance (Eq a,
                Eq b,
                Eq c,
                Eq d,
                Eq e,
                Eq f,
                Eq g,
                Eq h,
                Eq i,
                Eq j,
                Eq k,
                Eq l) =>
               Eq (a, b, c, d, e, f, g, h, i, j, k, l)
you'll get

      instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i,
                Eq j, Eq k, Eq l) =>
               Eq (a, b, c, d, e, f, g, h, i, j, k, l)

That is, if the context doesn't fit on one line, we break it only
where necessary rather that after each item.

The test suite comparison ignores white space, so the change
produces no failures; its a UI thing. It's a one-character
change in TypeRep, so easily reversed.

8 years agoDocument the (lack of) escape conventions in quasiquotes
Simon Peyton Jones [Wed, 3 Aug 2011 15:44:00 +0000 (16:44 +0100)] 
Document the (lack of) escape conventions in quasiquotes

See Trac #5348

8 years agoFix a grevious error in InstEnv: Trac #5095
Simon Peyton Jones [Wed, 3 Aug 2011 15:22:06 +0000 (16:22 +0100)] 
Fix a grevious error in InstEnv: Trac #5095

An claimed short-cut optimisation was actually an error.
The optimisation was this: when looking up (C a b), where
'a' and 'b' are type variables, we were returning [] immediately
if the instance environment had no instances of form (C a b).
Why? Because the thing being looked up definitely won't match
(C Int Bool), say.

BUT it will *unify* with (C Int Bool) and we care very much
about things it might unify with.  If we neglect them we may
silently allow incoherent instance selection, and that is
exactly what happened in #5095.

The fix is easy: remove the "optimisation".

8 years agoSimplify TcSMonad.matchFam's interface
Simon Peyton Jones [Wed, 3 Aug 2011 15:18:53 +0000 (16:18 +0100)] 
Simplify TcSMonad.matchFam's interface

8 years agoReplace use of 'asTypeOf' by type signatures
Simon Peyton Jones [Wed, 3 Aug 2011 15:17:41 +0000 (16:17 +0100)] 
Replace use of 'asTypeOf' by type signatures

The type signatures are much clearer, but need ScopedTypeVariables.
Happily that is now available in our bootstrap compilers.

8 years agoRemove all escape handling from quasiquotes; fixes Trac #5348
Simon Peyton Jones [Wed, 3 Aug 2011 15:16:50 +0000 (16:16 +0100)] 
Remove all escape handling from quasiquotes; fixes Trac #5348

There is a long discussion in the ticket.

8 years agoFix Trac #5372: a panic caused by over-eager error recovery
Simon Peyton Jones [Wed, 3 Aug 2011 15:16:09 +0000 (16:16 +0100)] 
Fix Trac #5372: a panic caused by over-eager error recovery

8 years agoisCoVarType should look at the *representation* type,
Simon Peyton Jones [Wed, 3 Aug 2011 15:15:29 +0000 (16:15 +0100)] 
isCoVarType should look at the *representation* type,
rather than using isPredTy!  In Core land, a PredTy
and its representation type are synonymous.

8 years agoAdd Type.tyConAppTyCon_maybe and tyConAppArgs_maybe, and use them
Simon Peyton Jones [Wed, 3 Aug 2011 15:14:26 +0000 (16:14 +0100)] 
Add Type.tyConAppTyCon_maybe and tyConAppArgs_maybe, and use them

These turn out to be a useful special case of splitTyConApp_maybe.

A refactoring only; no change in behaviour

8 years agoComments only
Simon Peyton Jones [Wed, 3 Aug 2011 15:12:10 +0000 (16:12 +0100)] 
Comments only

8 years agoRefactor to replace hscGetModuleExports by hscGetModuleInterface
Simon Peyton Jones [Wed, 3 Aug 2011 15:10:24 +0000 (16:10 +0100)] 
Refactor to replace hscGetModuleExports by hscGetModuleInterface

I also tidied up the interfaces for LoadIface to be a bit simpler

8 years agotiny cleanup
Simon Marlow [Wed, 3 Aug 2011 10:24:14 +0000 (11:24 +0100)] 
tiny cleanup

8 years agoFollowup to #5289 changes: fix searching for dynamic libraries and use
Simon Marlow [Wed, 3 Aug 2011 08:39:48 +0000 (09:39 +0100)] 
Followup to #5289 changes: fix searching for dynamic libraries and use
of the RTS addDLL() API on Windows.  When searching for DLLs we should
include the .dll extension, but addDLL() takes a filename without the

8 years agoFix #5289 (loading in GHCi), and also fix some other
Simon Marlow [Tue, 2 Aug 2011 13:17:18 +0000 (14:17 +0100)] 
Fix #5289 (loading in GHCi), and also fix some other
linking scenarios.  We weren't searching for .a archives to satisfy
-lfoo options on the GHCi command line, for example.

I've tidied up the code in this module so that dealing with -l options
on the command line is consistent with the handling of extra-libraries
for packages.

While I was here I moved some stuff out of Linker.hs that didn't seem
to belong here: dataConInfoPtrToName (now in new module DebuggerUtils)
and lessUnsafeCoerce (now in DynamicLoading, next to its only use)

8 years agoMerge branch 'master' of
Simon Peyton Jones [Wed, 3 Aug 2011 06:47:23 +0000 (07:47 +0100)] 
Merge branch 'master' of

8 years agoInclude the instances of associated types in the "extras" of a class
Simon Peyton Jones [Wed, 3 Aug 2011 06:46:50 +0000 (07:46 +0100)] 
Include the instances of associated types in the "extras" of a class

This fixes Trac #5147, which was going wrong because
the class ABI fingerprint wasn't changing when we added
or removed a Show instance to the associated type.

8 years agoRefactor's: Define FIND_GCC() in aclocal.m4
Ian Lynagh [Tue, 2 Aug 2011 23:53:57 +0000 (00:53 +0100)] 
Refactor's: Define FIND_GCC() in aclocal.m4

8 years agoRefactor's: Put XCODE_VERSION() in aclocal.m4
Ian Lynagh [Tue, 2 Aug 2011 23:49:10 +0000 (00:49 +0100)] 
Refactor's: Put XCODE_VERSION() in aclocal.m4

8 years agoSmall refactoring
Ian Lynagh [Tue, 2 Aug 2011 23:37:24 +0000 (00:37 +0100)] 
Small refactoring

8 years agoMerge branch 'master' of
Ian Lynagh [Tue, 2 Aug 2011 21:40:58 +0000 (22:40 +0100)] 
Merge branch 'master' of

8 years agoAvoid confusing Haddock in comment
Simon Peyton Jones [Tue, 2 Aug 2011 21:03:21 +0000 (22:03 +0100)] 
Avoid confusing Haddock in comment

8 years agoFix path to Cabal library, corrects documentation.
Lennart Kolmodin [Wed, 20 Jul 2011 13:14:03 +0000 (15:14 +0200)] 
Fix path to Cabal library, corrects documentation.

8 years agoMerge branch 'master' of
Simon Peyton Jones [Tue, 2 Aug 2011 17:04:22 +0000 (18:04 +0100)] 
Merge branch 'master' of

8 years agoFix reversed test in OccurAnal (introduced in recent commit 428f8c3d)
Simon Peyton Jones [Tue, 2 Aug 2011 17:03:46 +0000 (18:03 +0100)] 
Fix reversed test in OccurAnal (introduced in recent commit 428f8c3d)

8 years agoWibble to main "Refactor the imports of InteractiveContext" patch
Simon Peyton Jones [Tue, 2 Aug 2011 16:29:50 +0000 (17:29 +0100)] 
Wibble to main "Refactor the imports of InteractiveContext" patch

8 years agoImprove pretty-printing for ambiguous imports etc
Simon Peyton Jones [Tue, 2 Aug 2011 16:29:16 +0000 (17:29 +0100)] 
Improve pretty-printing for ambiguous imports etc

8 years agoAdd ListSetOps.removeRedundant
Simon Peyton Jones [Tue, 2 Aug 2011 12:35:13 +0000 (13:35 +0100)] 
Add ListSetOps.removeRedundant

It's needed in ghc/InteractiveUI, although not in the compiler itself

8 years agoComment wibble (hash at start of line confused CPP)
Simon Peyton Jones [Tue, 2 Aug 2011 13:27:44 +0000 (14:27 +0100)] 
Comment wibble (hash at start of line confused CPP)

8 years agoMerge branch 'master' of
Simon Peyton Jones [Tue, 2 Aug 2011 13:25:21 +0000 (14:25 +0100)] 
Merge branch 'master' of

8 years agoDon't bleat about non-External names in mkUsageInfo
Simon Peyton Jones [Tue, 2 Aug 2011 13:06:12 +0000 (14:06 +0100)] 
Don't bleat about non-External names in mkUsageInfo

See Note [Internal used_names].  Fixes Trac #5362.

8 years agoAdd a comment
Simon Peyton Jones [Tue, 2 Aug 2011 12:34:35 +0000 (13:34 +0100)] 
Add a comment

8 years agoFix import DEPRECATE failures for castSTUArray
Simon Peyton Jones [Tue, 2 Aug 2011 12:34:06 +0000 (13:34 +0100)] 
Fix import DEPRECATE failures for castSTUArray

8 years agoComments only
Simon Peyton Jones [Tue, 2 Aug 2011 09:44:31 +0000 (10:44 +0100)] 
Comments only

8 years agoChange the representation of export lists in .hi files
Simon Peyton Jones [Tue, 2 Aug 2011 09:43:57 +0000 (10:43 +0100)] 
Change the representation of export lists in .hi files

Currently export list in .hi files are partitioned by module
  export M T(C1,C2)
         N f,g
In each list we only have OccNames, all assumed to come from
the parent module M or N resp.

This patch changes the representatation so that export lists
have full Names:
  export M.T(M.C1,M.C2), N.f, N.g

Numerous advatages
  * AvailInfo no longer needs to be parameterised; it always
    contains Names

  * Fixes Trac #5306.  This was the main provocation

  * Less to-and-fro conversion when reading interface files

It's all generally simpler.  Interface files should not get bigger,
becuase they have a nice compact representation for Names.

8 years agoMerge branch 'master' of
Simon Peyton Jones [Tue, 2 Aug 2011 07:18:40 +0000 (08:18 +0100)] 
Merge branch 'master' of

8 years agoRefactor the imports of InteractiveContext
Simon Peyton Jones [Tue, 2 Aug 2011 07:18:03 +0000 (08:18 +0100)] 
Refactor the imports of InteractiveContext

Instead of two fields
   ic_toplev_scope :: [Module]
   ic_imports      :: [ImportDecl RdrName]

we now just have one
   ic_imports :: [InteractiveImport]
with the auxiliary data type
   data InteractiveImport
    = IIDecl (ImportDecl RdrName)  -- Bring the exports of a particular module
                    -- (filtered by an import decl) into scope

    | IIModule Module -- Bring into scope the entire top-level envt of
           -- of this module, including the things imported
-- into it.

This makes lots of code less confusing.  No change in behaviour.
It's preparatory to fixing Trac #5147.

While I was at I also
  * Cleaned up the handling of the "implicit" Prelude import
    by adding a ideclImplicit field to ImportDecl.  This
    significantly reduces plumbing in the handling of
    the implicit Prelude import

  * Used record notation consistently for ImportDecl

8 years agoMerge branch 'master' of ssh://
David Terei [Mon, 1 Aug 2011 20:37:13 +0000 (13:37 -0700)] 
Merge branch 'master' of ssh://

8 years agoSafeHaskell: Fix bug with safe import check
David Terei [Mon, 1 Aug 2011 20:36:30 +0000 (13:36 -0700)] 
SafeHaskell: Fix bug with safe import check

8 years agoFurther simplification to OccurAnal, concerning "weak loop breakers"
Simon Peyton Jones [Mon, 1 Aug 2011 14:27:39 +0000 (15:27 +0100)] 
Further simplification to OccurAnal, concerning "weak loop breakers"

Fixes Trac #5359.

8 years agoComments only
Simon Peyton Jones [Mon, 1 Aug 2011 14:23:34 +0000 (15:23 +0100)] 
Comments only

8 years agoDon't run a splice if there are preceding type errors
Simon Peyton Jones [Mon, 1 Aug 2011 14:23:02 +0000 (15:23 +0100)] 
Don't run a splice if there are preceding type errors

Fixes Trac #5358.

8 years agoOs X: With Xcode 4, check for gcc-4.2 also in the setup for binary distributions
Manuel M T Chakravarty [Mon, 1 Aug 2011 01:57:43 +0000 (11:57 +1000)] 
Os X: With Xcode 4, check for gcc-4.2 also in the setup for binary distributions

8 years agoRemove some antiquated C constructs
Ian Lynagh [Mon, 1 Aug 2011 00:07:12 +0000 (01:07 +0100)] 
Remove some antiquated C constructs

Fixes validate on amd64/Linux with:

SRC_CC_OPTS += -Wmissing-parameter-type
SRC_CC_OPTS += -Wold-style-declaration
SRC_CC_OPTS += -Wold-style-definition

8 years agoRevert "Don't build dph for now: it doesn't work (#5360)"
Manuel M T Chakravarty [Sun, 31 Jul 2011 07:37:38 +0000 (17:37 +1000)] 
Revert "Don't build dph for now: it doesn't work (#5360)"

This reverts commit e44c591cac5aba8c7718261275db925bc2db9753.

8 years agoRevert "Fix the workaround for #5360"
Manuel M T Chakravarty [Sun, 31 Jul 2011 07:37:23 +0000 (17:37 +1000)] 
Revert "Fix the workaround for #5360"

This reverts commit 2ad66b597b139ea73830f2aedf564df2b72960e9.

8 years agoFix the use of UniqueFM in the type checker (commit bf5af91ca597666641b8519abc85a3129...
Manuel M T Chakravarty [Sun, 31 Jul 2011 07:29:39 +0000 (17:29 +1000)] 
Fix the use of UniqueFM in the type checker (commit bf5af91ca597666641b8519abc85a31297b30823) to preserve the ordering of contexts

See also

8 years agoImplement public interface for GC statistics.
Edward Z. Yang [Sat, 30 Jul 2011 20:02:10 +0000 (16:02 -0400)] 
Implement public interface for GC statistics.

We add a new RTS flag -T for collecting statistics but not giving any
new inputs.  There is one new struct in rts/storage/GC.h: GCStats.  We
add two new global counters current_residency and current_slop, which
are useful for in-program GC statistics.

See GHC.Stats in base for a Haskell interface to this functionality.

Signed-off-by: Edward Z. Yang <>
8 years agoFix the workaround for #5360
Ian Lynagh [Sun, 31 Jul 2011 00:45:57 +0000 (01:45 +0100)] 
Fix the workaround for #5360

The build still wasn't going through if you had libraries/dph in your tree.

8 years agoFollow things moving in the integer libraries
Ian Lynagh [Sat, 30 Jul 2011 19:30:38 +0000 (20:30 +0100)] 
Follow things moving in the integer libraries

8 years agoDon't build dph for now: it doesn't work (#5360)
Ian Lynagh [Sat, 30 Jul 2011 15:56:26 +0000 (16:56 +0100)] 
Don't build dph for now: it doesn't work (#5360)

8 years agoMerge branch 'master' of
Simon Peyton Jones [Fri, 29 Jul 2011 15:20:33 +0000 (16:20 +0100)] 
Merge branch 'master' of

8 years agoComments, plus export TrieMap(..)
Simon Peyton Jones [Fri, 29 Jul 2011 15:09:15 +0000 (16:09 +0100)] 
Comments, plus export TrieMap(..)

8 years agoAdd CoreMonad.reinitializeGlobals so plugins can work around linker issues
Max Bolingbroke [Fri, 29 Jul 2011 11:05:46 +0000 (12:05 +0100)] 
Add CoreMonad.reinitializeGlobals so plugins can work around linker issues

When a plugin is loaded, it currently gets linked against a *newly loaded* copy
of the GHC package. This would not be a problem, except that the new copy has its
own mutable state that is not shared with that state that has already been initialized by
the original GHC package.

This leads to loaded plugins calling GHC code which pokes the static flags,
and then dying with a panic because the static flags *it* sees are uninitialized.

There are two possible solutions:
  1. Export the symbols from the GHC executable from the GHC library and link
     against this existing copy rather than a new copy of the GHC library
  2. Carefully ensure that the global state in the two copies of the GHC
     library matches

I tried 1. and it *almost* works (and speeds up plugin load times!) except
on Windows. On Windows the GHC library tends to export more than 65536 symbols
(see #5292) which overflows the limit of what we can export from the EXE and
causes breakage.

(Note that if the GHC exeecutable was dynamically linked this wouldn't be a problem,
because we could share the GHC library it links to.)

We are going to try 2. instead. Unfortunately, this means that every plugin
will have to say `reinitializeGlobals` before it does anything, but never mind.

I've threaded the cr_globals through CoreM rather than giving them as an
argument to the plugin function so that we can turn this function into
(return ()) without breaking any plugins when we eventually get 1. working.

8 years agoMerge branch 'master' of
Simon Peyton Jones [Fri, 29 Jul 2011 11:18:05 +0000 (12:18 +0100)] 
Merge branch 'master' of

8 years agoMake the constraint solver use UniqFMs (ultimately Data.IntMap)
Simon Peyton Jones [Fri, 29 Jul 2011 11:17:33 +0000 (12:17 +0100)] 
Make the constraint solver use UniqFMs (ultimately Data.IntMap)
rather than Data.Map.  It's more efficient that way!

8 years agoDon't make -dppr-debug nuke discardWarnings
Simon Peyton Jones [Fri, 29 Jul 2011 11:16:53 +0000 (12:16 +0100)] 
Don't make -dppr-debug nuke discardWarnings

8 years agoUse the new TrieMap to improve CSE
Simon Peyton Jones [Fri, 29 Jul 2011 11:15:15 +0000 (12:15 +0100)] 
Use the new TrieMap to improve CSE

For CSE it's obviously great to have a mapping whose
key is an expression.  This patch makes CSE use the
new CoreTrie data type.

I did some very simple performance comparisions. The
change in compile-time allocation is less than 1%,
but it does go down!  Slightly.

8 years agoAdd new TrieMap module
Simon Peyton Jones [Fri, 29 Jul 2011 11:10:12 +0000 (12:10 +0100)] 
Add new TrieMap module

This lets you make efficent finite mappings whose
keys are  CoreExpr

This is useful for CSE, and maybe elsewhere.  I've
been wanting to do this for some time, just for fun,
and it worked out quite nicely.  The code is fairly
boiler-plate-ish, so it's easy to add new key types.

8 years agoMerge branch 'master' of
Simon Peyton Jones [Fri, 29 Jul 2011 10:21:50 +0000 (11:21 +0100)] 
Merge branch 'master' of

8 years agoRemove unnecessary import (Windows only)
Simon Peyton Jones [Fri, 29 Jul 2011 10:19:00 +0000 (11:19 +0100)] 
Remove unnecessary import (Windows only)

8 years agoWe no longer need to mark Entry as local or not
Max Bolingbroke [Fri, 29 Jul 2011 09:08:33 +0000 (10:08 +0100)] 
We no longer need to mark Entry as local or not