ghc.git
8 years agoRefactor the implementation.
Jose Pedro Magalhaes [Tue, 4 Oct 2011 13:43:42 +0000 (14:43 +0100)] 
Refactor the implementation.

8 years agoComments and refactoring (probably breaks the branch)
Simon Peyton Jones [Mon, 3 Oct 2011 15:51:12 +0000 (16:51 +0100)] 
Comments and refactoring (probably breaks the branch)

8 years agoCode cleanup.
Jose Pedro Magalhaes [Mon, 26 Sep 2011 13:26:29 +0000 (15:26 +0200)] 
Code cleanup.

8 years agoRemove unnecessary import.
Jose Pedro Magalhaes [Mon, 26 Sep 2011 11:30:29 +0000 (13:30 +0200)] 
Remove unnecessary import.

8 years agoMerge branch 'fix#5464' of http://darcs.haskell.org/ghc into fix#5464
Jose Pedro Magalhaes [Mon, 26 Sep 2011 09:14:52 +0000 (11:14 +0200)] 
Merge branch 'fix#5464' of darcs.haskell.org/ghc into fix#5464

Solved conflicts:
compiler/typecheck/TcGenDeriv.lhs

8 years agoFix #5464: Change the way the extra bindings for the generic
Jose Pedro Magalhaes [Thu, 8 Sep 2011 06:07:14 +0000 (08:07 +0200)] 
Fix #5464: Change the way the extra bindings for the generic
representation are generated.

This is an initial commit; things seem to work but some
clean up is still necessary (renaming functions, adding
comments, etc.)

8 years agoUpdate to time 1.4
Ian Lynagh [Sun, 25 Sep 2011 13:22:07 +0000 (14:22 +0100)] 
Update to time 1.4

8 years agoAdd a comment to CorePrep that it does the Integer conversion
Ian Lynagh [Sun, 25 Sep 2011 13:17:54 +0000 (14:17 +0100)] 
Add a comment to CorePrep that it does the Integer conversion

8 years agoAdd some more Integer rules
Ian Lynagh [Sat, 24 Sep 2011 20:35:06 +0000 (21:35 +0100)] 
Add some more Integer rules

Also renumbered the IDs and alined some things properly

8 years agoMake a new type synonym CoreProgram = [CoreBind]
Simon Peyton Jones [Fri, 23 Sep 2011 08:57:42 +0000 (09:57 +0100)] 
Make a new type synonym CoreProgram = [CoreBind]
and comment its invariants in Note [CoreProgram] in CoreSyn

I'm not totally convinced that CoreProgram is the right name
(perhaps CoreTopBinds might better), but it is useful to have
a clue that you are looking at the top-level bindings.

This is only a matter of a type synonym change; no deep
refactoring here.

8 years agoImplement GHCi command :kind! which normalises its type
Simon Peyton Jones [Fri, 23 Sep 2011 06:45:20 +0000 (07:45 +0100)] 
Implement GHCi command :kind! which normalises its type

   type family F a
   type instance F Int = Bool
   type instance F Bool = Char

In GHCi
   *TF> :kind (F Int, F Bool)
   (F Int, F Bool) :: *
   *TF> :kind! F Int
   (F Int, F Bool) :: *
   = (Bool, Char)

We could call it ":normalise" but it seemed quite nice to have an
eager version of :kind

8 years agoMove tcLookupFamInst, tcLookupDataFamInst from TcEnv to FamInst
Simon Peyton Jones [Fri, 23 Sep 2011 05:59:52 +0000 (06:59 +0100)] 
Move tcLookupFamInst, tcLookupDataFamInst from TcEnv to FamInst

This is just a refactoring

8 years agoA little refactoring of TcIface on LitInteger
Simon Peyton Jones [Fri, 23 Sep 2011 05:49:41 +0000 (06:49 +0100)] 
A little refactoring of TcIface on LitInteger

8 years agoComments and functions renaming only
Simon Peyton Jones [Fri, 23 Sep 2011 05:47:03 +0000 (06:47 +0100)] 
Comments and functions renaming only

8 years agoAdd a transformation limit to the simplifier (Trac #5448)
Simon Peyton Jones [Fri, 23 Sep 2011 05:46:30 +0000 (06:46 +0100)] 
Add a transformation limit to the simplifier (Trac #5448)

This addresses the rare cases where the simplifier diverges
(see the above ticket).  We were already counting how many simplifier
steps were taking place, but with no limit.  This patch adds a limit;
at which point we halt compilation, and print out useful stats. The
stats show what is begin inlined, and how often, which points you
directly to the problem.  The limit is set based on the size of the
program.

Instead of halting compilation, we could instead just inhibit
inlining, which would let compilation of the module complete. This is
a bit harder to implement, and it's likely to mean that you unrolled
the function 1143 times and then ran out of ticks; you probably don't
want to complete parsing on this highly-unrolled program.

Flags: -dsimpl-tick-factor=N.  Default is 100 (percent).
       A bigger number increases the allowed maximum tick count.

8 years agoTake account of the mk_integer in a LitInteger when computing CAF-hood
Simon Peyton Jones [Fri, 23 Sep 2011 05:13:30 +0000 (06:13 +0100)] 
Take account of the mk_integer in a LitInteger when computing CAF-hood

This is a follow-on to Ian's Integer-literal patch.
In effect the mk_integer Id is a free variable of a LitInteger literal.

I've also added some comments (Note [Integer literals]) in Literal.

8 years agoadd a ToDo
Simon Marlow [Wed, 21 Sep 2011 08:51:25 +0000 (09:51 +0100)] 
add a ToDo

8 years agoshow bindings in the order they were defined
Simon Marlow [Wed, 21 Sep 2011 08:51:13 +0000 (09:51 +0100)] 
show bindings in the order they were defined

8 years agofix warnings
Simon Marlow [Wed, 21 Sep 2011 08:50:48 +0000 (09:50 +0100)] 
fix warnings

8 years agomove AvailInfo and related things into its own module
Simon Marlow [Sat, 17 Sep 2011 18:05:43 +0000 (19:05 +0100)] 
move AvailInfo and related things into its own module

8 years agofix bug in :show bindings when a variable is bound to an exception
Simon Marlow [Sat, 17 Sep 2011 12:06:36 +0000 (13:06 +0100)] 
fix bug in :show bindings when a variable is bound to an exception

8 years agoAdd support for all top-level declarations to GHCi
Simon Marlow [Fri, 16 Sep 2011 12:40:53 +0000 (13:40 +0100)] 
Add support for all top-level declarations to GHCi

  This is work mostly done by Daniel Winograd-Cort during his
  internship at MSR Cambridge, with some further refactoring by me.

This commit adds support to GHCi for most top-level declarations that
can be used in Haskell source files.  Class, data, newtype, type,
instance are all supported, as are Type Family-related declarations.

The current set of declarations are shown by :show bindings.  As with
variable bindings, entities bound by newer declarations shadow earlier
ones.

Tests are in testsuite/tests/ghci/scripts/ghci039--ghci054.
Documentation to follow.

8 years agoIn :load, call GHC.guessTarget on the new targets before unloading
Simon Marlow [Tue, 13 Sep 2011 09:33:41 +0000 (10:33 +0100)] 
In :load, call GHC.guessTarget on the new targets before unloading

Fixes this problem:

Prelude> :l foo
target `foo' is not a module name or a source file
>

8 years agoParenthesise type operators in -ddump-minimal-imports output; trac #4239
Ian Lynagh [Sat, 17 Sep 2011 21:32:11 +0000 (22:32 +0100)] 
Parenthesise type operators in -ddump-minimal-imports output; trac #4239

8 years agoWhitespace only in hsSyn/HsImpExp.lhs
Ian Lynagh [Sat, 17 Sep 2011 21:11:39 +0000 (22:11 +0100)] 
Whitespace only in hsSyn/HsImpExp.lhs

8 years agoImprove the handling of Integer literals
Ian Lynagh [Sat, 17 Sep 2011 17:29:12 +0000 (18:29 +0100)] 
Improve the handling of Integer literals

LitInteger now carries around the id of mkInteger, which it uses
to construct the core to build Integer literals. This way we don't
have to build in info about lots of Ids.

We also no longer have any special-casing for integer-simple, so
there is less code involved.

8 years agoFix etags output; trac #4256
Ian Lynagh [Sat, 17 Sep 2011 12:10:58 +0000 (13:10 +0100)] 
Fix etags output; trac #4256

We had an off-by-one bug in column numbers, causing first characters
of identifiers to be duplicated.

8 years agoGentoo's scanelf program found executable stack in many resulting binaries:
Sergei Trofimovich [Sat, 17 Sep 2011 10:29:44 +0000 (11:29 +0100)] 
Gentoo's scanelf program found executable stack in many resulting binaries:
* RWX --- --- home/prefix/gentoo/usr/lib/ghc-7.2.1/ghc
* !WX --- --- home/prefix/gentoo/usr/lib/ghc-7.2.1/libHSrts.a:AdjustorAsm.o

More info can be found here: http://www.gentoo.org/proj/en/hardened/gnu-stack.xml

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
8 years agoFix typo
Ian Lynagh [Fri, 16 Sep 2011 16:06:31 +0000 (17:06 +0100)] 
Fix typo

8 years agoAdd some missing dependencies; should fix make after re-configure
Simon Marlow [Tue, 13 Sep 2011 12:49:15 +0000 (13:49 +0100)] 
Add some missing dependencies; should fix make after re-configure

Every Haskell compilation in a package should depend on the
package-data.mk file for that package.  Then, if a package's version
number is bumped, we will recompile all the modules in the package so
that their interface files get the new version number.

This should mean that a simple 'make' will succeed in a couple of
scenarios where it didn't before:

  1. re-configuring bumps the version number of GHC, so everything
     in the ghc package (stages 1 & 2) must be recompiled.

  2. bumping the version of one of the boot packages does not require
     a make clean any more.

I have tested (1) but not (2).

LAX_DEPENDENCIES=YES disabled these new dependencies too.

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 16 Sep 2011 10:34:05 +0000 (11:34 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoCorrect a back-to-front coercion (fixes Trac #5490)
Simon Peyton Jones [Fri, 16 Sep 2011 08:59:37 +0000 (09:59 +0100)] 
Correct a back-to-front coercion (fixes Trac #5490)

This bug has been present for ages, but it only shows up in view
patterns where coercions are also involved.  Easy to fix!

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Ian Lynagh [Thu, 15 Sep 2011 13:45:37 +0000 (14:45 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoHack: add noCafIdInfo to shiftIntegerL and friends
Simon Peyton Jones [Thu, 15 Sep 2011 08:11:18 +0000 (09:11 +0100)] 
Hack: add noCafIdInfo to shiftIntegerL and friends

It's a hack becuase we have no good reason to be sure that
these functions don't have any CAFs.  We're working on
something better, but this should fix the build (Trac #5485)

8 years agoLLVM pre-mangler files should be considered cish
David Terei [Thu, 15 Sep 2011 01:37:03 +0000 (18:37 -0700)] 
LLVM pre-mangler files should be considered cish

8 years agoTighten up the side-condition testing for deriving (again)
Simon Peyton Jones [Wed, 14 Sep 2011 14:28:25 +0000 (15:28 +0100)] 
Tighten up the side-condition testing for deriving (again)

Fixes Trac #5478

8 years agoFix integer stuff (fixes Trac #5485)
Simon Peyton Jones [Wed, 14 Sep 2011 11:03:17 +0000 (12:03 +0100)] 
Fix integer stuff (fixes Trac #5485)

In particular, use mkConApp when building the (S# i)
constructors in CorePrep

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Wed, 14 Sep 2011 08:38:27 +0000 (09:38 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoRemove some (probably bit-rotted) .NET cases
Ian Lynagh [Tue, 13 Sep 2011 21:18:00 +0000 (22:18 +0100)] 
Remove some (probably bit-rotted) .NET cases

8 years agoRemove an old "ToDo" comment
Ian Lynagh [Tue, 13 Sep 2011 18:47:28 +0000 (19:47 +0100)] 
Remove an old "ToDo" comment

8 years agochange how Integer's are handled in Core
Ian Lynagh [Mon, 12 Sep 2011 22:24:53 +0000 (23:24 +0100)] 
change how Integer's are handled in Core

We now treat them as literals until CorePrep, when we finally
convert them into the real Core representation. This makes it a lot
simpler to implement built-in rules on them.

8 years agoGHC does build with Alex 3 now - remove the configure trap
Simon Marlow [Tue, 13 Sep 2011 09:59:59 +0000 (10:59 +0100)] 
GHC does build with Alex 3 now - remove the configure trap

However, one perf test fails (parsing001) due to extra allocation.  I
want to look into this so I'm not bumping it just yet.

8 years agoWhen checking FFI types are IO, don't look through abstract newtypes; #3008
Ian Lynagh [Sun, 11 Sep 2011 19:53:18 +0000 (20:53 +0100)] 
When checking FFI types are IO, don't look through abstract newtypes; #3008

8 years agoFix associated type default instantiation check (#5481)
Max Bolingbroke [Sun, 11 Sep 2011 16:09:31 +0000 (17:09 +0100)] 
Fix associated type default instantiation check (#5481)

8 years agoFix warnings in codeGen/CgUtils.hs
Ian Lynagh [Fri, 9 Sep 2011 00:49:54 +0000 (01:49 +0100)] 
Fix warnings in codeGen/CgUtils.hs

8 years agoWhitespace only in codeGen/CgUtils.hs
Ian Lynagh [Thu, 8 Sep 2011 23:02:04 +0000 (00:02 +0100)] 
Whitespace only in codeGen/CgUtils.hs

8 years agoFix warnings in basicTypes/Literal.lhs
Ian Lynagh [Thu, 8 Sep 2011 22:11:37 +0000 (23:11 +0100)] 
Fix warnings in basicTypes/Literal.lhs

8 years agoWhitespace only in basicTypes/Literal.lhs
Ian Lynagh [Thu, 8 Sep 2011 21:59:21 +0000 (22:59 +0100)] 
Whitespace only in basicTypes/Literal.lhs

8 years agoSolve irreducible evidence from itself
Max Bolingbroke [Sat, 10 Sep 2011 13:31:08 +0000 (14:31 +0100)] 
Solve irreducible evidence from itself

8 years agoAdapt vectoriser to disappearing PredTy
Manuel M T Chakravarty [Sat, 10 Sep 2011 07:53:30 +0000 (17:53 +1000)] 
Adapt vectoriser to disappearing PredTy

8 years agoReport bindings that cannot be vectorised
Manuel M T Chakravarty [Sat, 10 Sep 2011 06:55:21 +0000 (16:55 +1000)] 
Report bindings that cannot be vectorised

- Toplevel bindings that cannot be vectorised are reported as a warning
- '-ddump-vt-trace' has even more information about unvectorised code
- Fixed some documentation

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 9 Sep 2011 15:57:10 +0000 (16:57 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoMerge branch 'no-pred-ty'
Max Bolingbroke [Fri, 9 Sep 2011 12:45:41 +0000 (13:45 +0100)] 
Merge branch 'no-pred-ty'

Conflicts:
compiler/iface/BuildTyCl.lhs
compiler/iface/MkIface.lhs
compiler/iface/TcIface.lhs
compiler/typecheck/TcTyClsDecls.lhs
compiler/types/Class.lhs
compiler/utils/Util.lhs

8 years agoMove exprIsConApp_maybe to CoreSubst so we can use it in VSO. Fix VSO bug with unlift...
Max Bolingbroke [Fri, 9 Sep 2011 12:31:43 +0000 (13:31 +0100)] 
Move exprIsConApp_maybe to CoreSubst so we can use it in VSO. Fix VSO bug with unlifted let bindings.

8 years agoRecord selectors should be Exported Ids
Simon Peyton Jones [Fri, 9 Sep 2011 11:50:07 +0000 (12:50 +0100)] 
Record selectors should be Exported Ids

We don't want to drop record selectors as dead code, even if they
aren't exported in the module header.  The data type decl in the
inteface file advertises their presenece, and we may get at them via
Template Haskell.

   module M( f ) where
     data T = MkT { boo :: Int }
     f :: T -> T
     f = <blah>

We don't want to drop the record selector for 'boo'.

See Trac #4946

8 years agoComments, and rename FactTuple to ConstraintTuple
Simon Peyton Jones [Fri, 9 Sep 2011 09:54:32 +0000 (10:54 +0100)] 
Comments, and rename FactTuple to ConstraintTuple

8 years agoRefactoring and code moving-around, following Max's AT-default patch
Simon Peyton Jones [Fri, 9 Sep 2011 09:52:13 +0000 (10:52 +0100)] 
Refactoring and code moving-around, following Max's AT-default patch

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 9 Sep 2011 09:18:02 +0000 (10:18 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 9 Sep 2011 09:07:46 +0000 (10:07 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoObey the exprArity invariants! Fixes Trac #5441
Simon Peyton Jones [Fri, 9 Sep 2011 09:04:55 +0000 (10:04 +0100)] 
Obey the exprArity invariants!  Fixes Trac #5441

We were giving arity 2 to a function whose type was
    Int -> Any
That contradicts the exprArity invariant
(see Note [exprArity invariant] in CoreArity), and
in turn led to function whose actually code-generated arity
was different that advertised in the interface file.
Result: seg-fault city.

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 9 Sep 2011 08:12:48 +0000 (09:12 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoDocumentation for associated type instance defaults
Max Bolingbroke [Tue, 6 Sep 2011 14:14:06 +0000 (15:14 +0100)] 
Documentation for associated type instance defaults

8 years agoImplement associated type defaults
Max Bolingbroke [Tue, 6 Sep 2011 08:04:37 +0000 (09:04 +0100)] 
Implement associated type defaults

Basically, now you can write:

  class Cls a where
    type Typ a
    type Typ a = Just a

And now if an instance does not specify an explicit associated type
instance, one will be generated afresh based on that default. So for
example this instance:

  instance Cls Int where

Will be equivalent to this one:

  instance Cls Int where
    type Typ Int = Just Int

8 years agoRevert "Get rid of associated-type default declarations"
Max Bolingbroke [Sun, 4 Sep 2011 18:09:01 +0000 (19:09 +0100)] 
Revert "Get rid of associated-type default declarations"

This reverts commit 5e102e64d6e581e3ea1f290547fc4be6fce20a00.

8 years agoAdd deepseq as a core package; part of #5468
Ian Lynagh [Thu, 8 Sep 2011 11:09:42 +0000 (12:09 +0100)] 
Add deepseq as a core package; part of #5468

8 years agoAdd deepseq as a core package
Ian Lynagh [Wed, 7 Sep 2011 18:49:24 +0000 (19:49 +0100)] 
Add deepseq as a core package

8 years agoFix typos in comments
Ian Lynagh [Tue, 6 Sep 2011 22:12:56 +0000 (23:12 +0100)] 
Fix typos in comments

8 years agoFix #5464: Change the way the extra bindings for the generic
Jose Pedro Magalhaes [Thu, 8 Sep 2011 06:07:14 +0000 (08:07 +0200)] 
Fix #5464: Change the way the extra bindings for the generic
representation are generated.

This is an initial commit; things seem to work but some
clean up is still necessary (renaming functions, adding
comments, etc.)

8 years agoCorrect a few typos
Daniel Fischer [Wed, 7 Sep 2011 22:48:18 +0000 (00:48 +0200)] 
Correct a few typos

8 years agoAdded repack command to sync-all
Daniel Fischer [Wed, 7 Sep 2011 17:56:59 +0000 (19:56 +0200)] 
Added repack command to sync-all

8 years agoWhitespace only
Daniel Fischer [Wed, 7 Sep 2011 17:52:00 +0000 (19:52 +0200)] 
Whitespace only

8 years agoNuke isCertainlyPredReprTy
Simon Peyton Jones [Wed, 7 Sep 2011 16:44:52 +0000 (17:44 +0100)] 
Nuke isCertainlyPredReprTy

8 years agoComments and layout
Simon Peyton Jones [Wed, 7 Sep 2011 16:44:35 +0000 (17:44 +0100)] 
Comments and layout

8 years agoAdd Constraint as a legitmiate tycon in Kinds
Simon Peyton Jones [Wed, 7 Sep 2011 15:23:00 +0000 (16:23 +0100)] 
Add Constraint as a legitmiate tycon in Kinds

8 years agoConstraintKind -> ConstraintKinds
Simon Peyton Jones [Wed, 7 Sep 2011 15:22:46 +0000 (16:22 +0100)] 
ConstraintKind -> ConstraintKinds

8 years agoMinor refactoring of dsLCoercion, plus comments
Simon Peyton Jones [Wed, 7 Sep 2011 15:19:22 +0000 (16:19 +0100)] 
Minor refactoring of dsLCoercion, plus comments

8 years agoRemove dead code
Simon Peyton Jones [Wed, 7 Sep 2011 08:33:21 +0000 (09:33 +0100)] 
Remove dead code

8 years agoWibble in tickyDynAlloc (only affects -ticky)
Simon Peyton Jones [Wed, 7 Sep 2011 08:33:08 +0000 (09:33 +0100)] 
Wibble in tickyDynAlloc (only affects -ticky)

Fall-out from codegen refactoring, undiscovered because
we don't usually build with -ticky

8 years agoImplement -XConstraintKind
Max Bolingbroke [Tue, 6 Sep 2011 16:22:47 +0000 (17:22 +0100)] 
Implement -XConstraintKind

Basically as documented in http://hackage.haskell.org/trac/ghc/wiki/KindFact,
this patch adds a new kind Constraint such that:

  Show :: * -> Constraint
  (?x::Int) :: Constraint
  (Int ~ a) :: Constraint

And you can write *any* type with kind Constraint to the left of (=>):
even if that type is a type synonym, type variable, indexed type or so on.

The following (somewhat related) changes are also made:
 1. We now box equality evidence. This is required because we want
    to give (Int ~ a) the *lifted* kind Constraint
 2. For similar reasons, implicit parameters can now only be of
    a lifted kind. (?x::Int#) => ty is now ruled out
 3. Implicit parameter constraints are now allowed in superclasses
    and instance contexts (this just falls out as OK with the new
    constraint solver)

Internally the following major changes were made:
 1. There is now no PredTy in the Type data type. Instead
    GHC checks the kind of a type to figure out if it is a predicate
 2. There is now no AClass TyThing: we represent classes as TyThings
    just as a ATyCon (classes had TyCons anyway)
 3. What used to be (~) is now pretty-printed as (~#). The box
    constructor EqBox :: (a ~# b) -> (a ~ b)
 4. The type LCoercion is used internally in the constraint solver
    and type checker to represent coercions with free variables
    of type (a ~ b) rather than (a ~# b)

8 years agoMake an import unconditional
Ian Lynagh [Tue, 6 Sep 2011 16:25:01 +0000 (17:25 +0100)] 
Make an import unconditional

Fixes build on non-Intel/PPC platforms

8 years agoRemove the "Ghastly special case" from dataTcOccs
Max Bolingbroke [Fri, 2 Sep 2011 18:23:56 +0000 (19:23 +0100)] 
Remove the "Ghastly special case" from dataTcOccs

This special case was introduced in 228c4743 to
'Fix problem with :i for (:)' but the associated Note
doesn't explain why (:) deserves this treatment but not
e.g. Left and Right.

Removing the special case does not break anything
(including :i (:)) so I guess this is no longer necessary.

Conflicts:

compiler/rename/RnEnv.lhs

8 years agoZap demand information if the simplifier reduces the arity: fixes CoreLint failure
Max Bolingbroke [Mon, 22 Aug 2011 19:24:30 +0000 (20:24 +0100)] 
Zap demand information if the simplifier reduces the arity: fixes CoreLint failure

8 years agoFix handing of CoVars in SetLevels: it wasn't renaming occurrences of case-bound...
Max Bolingbroke [Wed, 17 Aug 2011 21:53:47 +0000 (22:53 +0100)] 
Fix handing of CoVars in SetLevels: it wasn't renaming occurrences of case-bound coercion variabes

Conflicts:

compiler/simplCore/SetLevels.lhs

8 years agoThere are no predicate kinds in external core: remove Keq
Max Bolingbroke [Sun, 14 Aug 2011 07:14:10 +0000 (08:14 +0100)] 
There are no predicate kinds in external core: remove Keq

8 years agoRemove bogus isCoercionKind function and its sole use
Max Bolingbroke [Sun, 14 Aug 2011 07:06:17 +0000 (08:06 +0100)] 
Remove bogus isCoercionKind function and its sole use

8 years agoAdd missing import (fixes #5460).
Erik de Castro Lopo [Mon, 5 Sep 2011 10:24:51 +0000 (20:24 +1000)] 
Add missing import (fixes #5460).

8 years agoAdd s390x to list of supported architectures
Joachim Breitner [Mon, 5 Sep 2011 07:37:24 +0000 (09:37 +0200)] 
Add s390x to list of supported architectures

8 years agofix GhcUnregisterised default, and add kfreebsdgnu to OsSupportsGhci
Simon Marlow [Tue, 6 Sep 2011 13:00:51 +0000 (14:00 +0100)] 
fix GhcUnregisterised default, and add kfreebsdgnu to OsSupportsGhci
(#5441)

8 years agofix the eager-blackholing check, which I inadvertently broke in
Simon Marlow [Tue, 6 Sep 2011 11:57:26 +0000 (12:57 +0100)] 
fix the eager-blackholing check, which I inadvertently broke in
1c2f89535394958f75cfb15c8c5e0433a20953ed (symptom was broken
biographical profiling, see #5451).

8 years agoMinor wording change
Simon Peyton Jones [Mon, 5 Sep 2011 16:33:14 +0000 (17:33 +0100)] 
Minor wording change

8 years agoFix Trac #5455: be a bit more selective in mkSelectorBinds
Simon Peyton Jones [Mon, 5 Sep 2011 16:33:04 +0000 (17:33 +0100)] 
Fix Trac #5455: be a bit more selective in mkSelectorBinds

See Note [mkSelectorBinds]

8 years agoEliminate isHiBootTyCon in favour of isAbstractTyCon
Simon Peyton Jones [Mon, 5 Sep 2011 08:38:50 +0000 (09:38 +0100)] 
Eliminate isHiBootTyCon in favour of isAbstractTyCon

Fixes Trac #5456, which was a buglet arising from

  commit de9b85fa3fb6d4cd593366e1f2383cd0b492c056
  Author: Simon Peyton Jones <simonpj@microsoft.com>
  Date:   Fri Sep 2 17:43:53 2011 +0100

    Export a tiny bit more info with AbstractTyCon (fixes #5424)

It only shows up when compiling with -O0!

8 years agoLink the de-synonym change to ticket Trac #5458
Simon Peyton Jones [Mon, 5 Sep 2011 07:32:07 +0000 (08:32 +0100)] 
Link the de-synonym change to ticket Trac #5458

8 years agoFix two bugs in caes-floating (fixes Trac #5453)
Simon Peyton Jones [Mon, 5 Sep 2011 07:21:23 +0000 (08:21 +0100)] 
Fix two bugs in caes-floating (fixes Trac #5453)

The problem is documented in the ticket.  The patch
does two things

1. Make exprOkForSpeculation return False for a non-exhaustive case

2. In SetLevels.lvlExpr, look at the *result* scrutinee, not the
   *input* scrutinee, when testing for evaluated-ness

8 years agoComments only
Simon Peyton Jones [Mon, 5 Sep 2011 07:18:10 +0000 (08:18 +0100)] 
Comments only

8 years agoDe-synonym the types of the abtracted term variables in SpecConstr
Simon Peyton Jones [Mon, 5 Sep 2011 07:16:58 +0000 (08:16 +0100)] 
De-synonym the types of the abtracted term variables in SpecConstr

This was making Text.PrettyPrint.HughesPJ give a lint-bug
when the libraries were compiled with -O2.

It's all caused by phantom type synonyms (which are, generally
speaking, a royal pain).  The fix is simple, but a bit brutal.

See Note [Free type variables of the qvar types].

8 years agoExport a tiny bit more info with AbstractTyCon (fixes #5424)
Simon Peyton Jones [Fri, 2 Sep 2011 16:43:53 +0000 (17:43 +0100)] 
Export a tiny bit more info with AbstractTyCon (fixes #5424)

When we compile -O0 we put type constructors in the interface file
without their data constructors -- an AbstractTyCon.  But in a
client module, to give good pattern-match exhaustiveness warnings,
we need to know the difference between a data type and a newtype.
(The latter can be coerced to another type, but a data type can't.)
See Note [Pruning dead case alternatives] in Unify.

Because we weren't conveying this info, we were getting bogus
warnings about inexhaustive patterm matches with GADTs, and
(confusingly) these warnings woudl come and go depending on
whether you were compiling with -O.

This patch makes AbstractTyCon carry a flag indicating whether
the type constructor is "distinct"; two distinct TyCons cannot
be coerced into eachother (except by unsafeCoerce, in which case
all bets are off).

HEADS UP: interface file format changes slightly, so you need
to make clean.

8 years agoBacktrack on the wierd special case of data family exports
Simon Peyton Jones [Fri, 2 Sep 2011 16:34:00 +0000 (17:34 +0100)] 
Backtrack on the wierd special case of data family exports

I had second thoughts on the "data family export" question.
Rather than add a wierd special case it seems better to be
simple and consistent.  So this patch

 * Reverts to the simple behaviour:
     module M where { ... }
   exports only what is defined in M, ie NOT any
   imported data families.
   See Note [Exports of data families] in RnNames

* Documents this behaviour in the user manual, and clarifies
  what was there before.

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 2 Sep 2011 08:29:56 +0000 (09:29 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoSome minor wibbling in printing source locations
Simon Peyton Jones [Fri, 2 Sep 2011 08:25:25 +0000 (09:25 +0100)] 
Some minor wibbling in printing source locations

I found that an imported instance was getting printed with <no
location info>.  Fixing this pushed me into a bit more refactoring
than I intended, but it's all small aesthetic stuff, nothing
fundamental.  Caused some error message to change as a result.

I removed pprDefnLoc from the GHC API because it doesn't seem to be
used.  Name.pprNamedefnLoc and pprDefinedAt are probably more useful
anyway.