ghc.git
5 years agoSpeculative evaluate thunks known to Converge wip/cbv-conv-thunk
Joachim Breitner [Mon, 6 Jan 2014 14:12:57 +0000 (14:12 +0000)] 
Speculative evaluate thunks known to Converge

This is an attempt to use the by-products of nested cpr analysis.

5 years agoLoop breakers are not allowed to have a Converges DmdResult
Joachim Breitner [Tue, 26 Nov 2013 10:18:35 +0000 (10:18 +0000)] 
Loop breakers are not allowed to have a Converges DmdResult

5 years agoTry to make "<S>t" meaningful
Joachim Breitner [Thu, 9 Jan 2014 10:37:29 +0000 (10:37 +0000)] 
Try to make "<S>t" meaningful

by giving it the meaning: "Assuming my first argument is terminating,
then I am terminating".

In pictures: This is the lattice, which is not a simple product lattice any more:

       ------ <L><L>------
     /          | \       \
    /           | <L><L>t  \
<S><L>          |           <S><L>
 |  \ \         |           |  |  \
 |   \ <S><L>t  |          /   |   <S><L>t
 |    \         |         /    |
 \     \        |        /     |
  \     ----- <S><S>-----      |
   \           |    \          |
    \          |     <S><S>t   /
     \         |              /
      ---------⊥-------------/

This means that we need to be careful when lub’ing: If one branch is lazy, but
not absent in an argument or free variable, and the other branch is strict,
then even if both branches claim to terminate, we need to remove the
termination flag (as one had the termination under a stronger hypothesis as the
hole result) (Feels inelegant.)

There is no unit for lubDmdType any more. So for case, use we use botDmdType
for no alternatives, and foldr1 if there are multiple.

Unlifted variables (e.g. Int#) are tricky. Everything is strict in them, so for
an *unlifted* argument, <L>t implies <S>t and hence <S>t ⊔ <L>t = <S>t, and we
really want to make use of that stronger equation. But when lub’ing, we don’t
know any more if this is the demand for an unlifted type. So instead, the
demand type of x :: Int# itself is {x ↦ <L>} t, while x :: Int continues to
have type {x ↦ <S>} t.

It is important that functions (including primitive operations and constructors
like I#) have a strict demand on their unlifted argument. But it turned out to
be easier to enforce this in the demand analyser: So even if f claims to have a
lazy demand on a argument of unlifted type, we make this demand strict before
feeding it into the argument.

5 years agoIn deferType, return convRes = Converges NoCPR
Joachim Breitner [Wed, 4 Dec 2013 16:55:18 +0000 (16:55 +0000)] 
In deferType, return convRes = Converges NoCPR

because this is the right-identity to `bothDmdResult`, and this is the
right thing to do in a lazy context.

5 years agoAdd Converges to DmdResult
Joachim Breitner [Thu, 12 Dec 2013 15:45:19 +0000 (15:45 +0000)] 
Add Converges to DmdResult

to detect definite convergence (required for nested CPR).

5 years agoMake types of bothDmdType more precise
Joachim Breitner [Mon, 9 Dec 2013 18:40:09 +0000 (18:40 +0000)] 
Make types of bothDmdType more precise

by only passing the demand on the free variables, and whether the
argument (resp. scrunitee) may or will diverge.

5 years agoDisentangle postProcessDmdTypeM and postProcessUnsat
Joachim Breitner [Mon, 9 Dec 2013 18:40:09 +0000 (18:40 +0000)] 
Disentangle postProcessDmdTypeM and postProcessUnsat

Make different postProcess code paths for function arguments (which are
post-processed just to be both'ed) and unsaturated functions (which are
post-processed for other reasons.)

5 years agoRefactor peelManyCalls
Joachim Breitner [Sat, 14 Dec 2013 21:07:04 +0000 (22:07 +0100)] 
Refactor peelManyCalls

its first argument is just used for its length (the arity of the call).
So changing the type to Int to reflect that.

Also add a note [Demands from unsaturated function calls] that hopefully
comprehensively and comprehensibly explains what is going on here.

5 years agoRename postProcessDmdType to postProcessUnsat and use* to reuse*
Joachim Breitner [Thu, 12 Dec 2013 16:12:00 +0000 (16:12 +0000)] 
Rename postProcessDmdType to postProcessUnsat and use* to reuse*

5 years agoDo not export DmdResult constructors in Demand.lhs
Joachim Breitner [Mon, 9 Dec 2013 16:56:32 +0000 (16:56 +0000)] 
Do not export DmdResult constructors in Demand.lhs

5 years agoSplit DmdResult into DmdResult and CPRResult
Joachim Breitner [Thu, 12 Dec 2013 15:39:30 +0000 (15:39 +0000)] 
Split DmdResult into DmdResult and CPRResult

this is a small-step-refactoring patch and not very interesting on its
own.

5 years agoAdd Note [non-algebraic or open body type warning]
Joachim Breitner [Wed, 4 Dec 2013 17:12:07 +0000 (17:12 +0000)] 
Add Note [non-algebraic or open body type warning]

5 years agoRemove dmdAnalArg and replace by easier to understand code
Joachim Breitner [Wed, 4 Dec 2013 17:38:25 +0000 (17:38 +0000)] 
Remove dmdAnalArg and replace by easier to understand code

5 years agoClarify the default demand on demand environments
Joachim Breitner [Wed, 4 Dec 2013 17:59:09 +0000 (17:59 +0000)] 
Clarify the default demand on demand environments

by adding Notes and using easier to understand combinators.

5 years agoMove peelFV from DmdAnal to Demand
Joachim Breitner [Wed, 4 Dec 2013 16:09:34 +0000 (16:09 +0000)] 
Move peelFV from DmdAnal to Demand

5 years agoImprove the handling of used-once stuff
Simon Peyton Jones [Fri, 22 Nov 2013 17:13:05 +0000 (17:13 +0000)] 
Improve the handling of used-once stuff

Joachim and I are committing this onto a branch so that we can share it,
but we expect to do a bit more work before merging it onto head.

Nofib staus:
  - Most programs, no change
  - A few improve
  - A couple get worse (cacheprof, tak, rfib)
Investigating the "get worse" set is what's holding up putting this
on head.

The major issue is this.  Consider

    map (f g) ys

where f's demand signature looks like

   f :: <L,C1(C1(U))> -> <L,U> -> .

So 'f' is not saturated.  What demand do we place on g?
Answer
        C(C1(U))
That is, the inner C1 should stay, even though f is not saturated.

I found that this made a significant difference in the demand signatures
inferred in GHC.IO, which uses lots of higher-order exception handlers.

I also had to add used-once demand signatures for some of the
'catch' primops, so that we know their handlers are only called once.

5 years agoGuarding against silly shifts
Simon Peyton Jones [Wed, 11 Dec 2013 18:19:34 +0000 (18:19 +0000)] 
Guarding against silly shifts

This patch was authored by SPJ and extracted from "Improve the handling
of used-once stuff" by Joachim.

5 years agoAssign strictness signatures to primitive operations
Simon Peyton Jones [Wed, 11 Dec 2013 18:18:53 +0000 (18:18 +0000)] 
Assign strictness signatures to primitive operations

This patch was authored by SPJ, and extracted from "Improve the handling
of used-once stuff" by Joachim.

5 years agoDo not split void functions
Simon Peyton Jones [Wed, 11 Dec 2013 18:30:54 +0000 (18:30 +0000)] 
Do not split void functions

This is authored by SPJ, and split out out "Improve the handling of
used-once stuff" by Joachim.

5 years agoSome refactoring of Demand and DmdAnal
Simon Peyton Jones [Wed, 11 Dec 2013 18:17:04 +0000 (18:17 +0000)] 
Some refactoring of Demand and DmdAnal

This was authored by SPJ and extracted from the "Improve the handling of
used-once stuff" patch by Joachim.

5 years agoSpelling in comment
Simon Peyton Jones [Tue, 10 Dec 2013 17:49:58 +0000 (17:49 +0000)] 
Spelling in comment

5 years agoBetter debug printing
Simon Peyton Jones [Tue, 10 Dec 2013 17:49:48 +0000 (17:49 +0000)] 
Better debug printing

5 years agoDo not generate given kind-equalities (fix Trac #8566)
Simon Peyton Jones [Tue, 10 Dec 2013 17:49:18 +0000 (17:49 +0000)] 
Do not generate given kind-equalities (fix Trac #8566)

This is a long-standing bug.  We were generating a Given
equality between kind variables, and (at least until we support
kind coercions) we can't do that.

The fix is to drop such Given equalities entirely. That may
mean we can't prove some things, but that's fair enough -- the
current proof language can't express such proofs.

See Note [Do not create Given kind equalities] in TcSMonad

5 years agoAdd more .mailmap entries
Herbert Valerio Riedel [Tue, 10 Dec 2013 08:31:40 +0000 (09:31 +0100)] 
Add more .mailmap entries

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoSort the output of -dump-strsigs
Joachim Breitner [Mon, 9 Dec 2013 20:05:44 +0000 (20:05 +0000)] 
Sort the output of -dump-strsigs

5 years agoReplace mkTopDmdType by mkClosedStrictSig
Joachim Breitner [Mon, 9 Dec 2013 16:09:03 +0000 (16:09 +0000)] 
Replace mkTopDmdType by mkClosedStrictSig

because it is not a top deman (see previous commit), and it is only used
in an argument to mkStrictSig.

5 years agoRename topDmdType to nopDmdType
Joachim Breitner [Mon, 9 Dec 2013 14:36:25 +0000 (14:36 +0000)] 
Rename topDmdType to nopDmdType

because topDmdType is ''not'' the top of the lattice, as it puts an
implicit absent demand on free variables, but Abs is the bottom of the
Usage lattice.

Why nopDmdType? Becuase it is the demand of doing nothing: Everything
lazy, everything absent, no definite divergence.

5 years agoDo not forget CPR information after an IO action
Joachim Breitner [Fri, 6 Dec 2013 17:58:29 +0000 (17:58 +0000)] 
Do not forget CPR information after an IO action

but do forget about certain divergence, if required. Fixes one part of
ticket #8598.

The added function (deferAfterIO) can maybe be merged with existing
code, but given the ongoing work in the nested-cpr branch, I defer that
work.

5 years agoNew flag: -ddump-strsigs
Joachim Breitner [Mon, 9 Dec 2013 15:29:21 +0000 (15:29 +0000)] 
New flag: -ddump-strsigs

The existing flag -ddump-stranal dumps the full Core, which is very
verbose and not always helpful. This adds a more concise output (one
line per top-level bind) that is faster to read, and especially more
suitable to be used when writing test cases for the strictness analiser.

5 years agoFix windows x86_64 build.
Austin Seipp [Mon, 9 Dec 2013 12:08:31 +0000 (06:08 -0600)] 
Fix windows x86_64 build.

On win64 sizeof(long) != sizeof(void*), so debugTrace was casting a
value of incorrect size causing a validate failure.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoRemove the LFBlackHole constructor
Patrick Palka [Thu, 5 Dec 2013 16:19:25 +0000 (11:19 -0500)] 
Remove the LFBlackHole constructor

After commit 55c703b8fdb0, this code is no longer used anywhere.

5 years agoAdd `.mailmap` file
Herbert Valerio Riedel [Thu, 5 Dec 2013 12:54:47 +0000 (13:54 +0100)] 
Add `.mailmap` file

This improves the output of `git shortlog` and others, see

  http://git-scm.com/docs/git-shortlog

for more details.

The mapping is in part derived from the Darcs author-spelling file
which was removed some time ago via 47a018026aee9faef28ddc9b4550425dd0000ceb.

There's still a couple of unmapped `<unknown>` authors in the Git history which will
be hopefully mapped in the future as well to provide complete authorship information
throughout all of GHC's recorded development history.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoSuggest TemplateHaskell after encountering a parse error on '$' (#7396)
Patrick Palka [Sat, 30 Nov 2013 00:12:33 +0000 (19:12 -0500)] 
Suggest TemplateHaskell after encountering a parse error on '$' (#7396)

5 years agoClean up Lexer.srcParseErr
Patrick Palka [Sat, 30 Nov 2013 00:06:29 +0000 (19:06 -0500)] 
Clean up Lexer.srcParseErr

The lexer now uses unicode single quotation marks in its error messages
if possible.  This is due to the use of the 'quotes' combinator.

5 years agoSuggest TemplateHaskell after encountering a naked top-level expression
Patrick Palka [Fri, 15 Nov 2013 18:57:26 +0000 (13:57 -0500)] 
Suggest TemplateHaskell after encountering a naked top-level expression

Helps fix #7396

5 years agoTypecheck typed TH splices properly (fix Trac #8577)
Simon Peyton Jones [Wed, 4 Dec 2013 18:04:08 +0000 (18:04 +0000)] 
Typecheck typed TH splices properly (fix Trac #8577)

This was an egregious error.  If e :: T (Q ty1)
then when we have the splice

     $e :: ty2

we must ensure that ty1~ty2 before we even think about
running the splice!

I took the opportunity to remove the dead-code tcSpliceDecls
altogether.

5 years agoComments, and rename a variable
Simon Peyton Jones [Wed, 4 Dec 2013 17:57:59 +0000 (17:57 +0000)] 
Comments, and rename a variable

5 years agoFix compiler warnings due to integer size mismatch
Christopher Rodrigues [Sat, 30 Nov 2013 19:06:43 +0000 (13:06 -0600)] 
Fix compiler warnings due to integer size mismatch

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoRefactored by Simon Marlow's suggestion
Evan Hauck [Thu, 28 Nov 2013 16:58:50 +0000 (11:58 -0500)] 
Refactored by Simon Marlow's suggestion

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoMade ghc -e have a nonzero exit code upon failure (Trac #7962 )
khyperia [Thu, 28 Nov 2013 04:30:59 +0000 (23:30 -0500)] 
Made ghc -e have a nonzero exit code upon failure (Trac #7962 )

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoUse new flushExec implementation on all operating systems (#8562)
Christopher Rodrigues [Sat, 30 Nov 2013 05:05:50 +0000 (23:05 -0600)] 
Use new flushExec implementation on all operating systems (#8562)

An earlier patch fixes a bug in flushExec on linux only.  This
patch uses the fixed code on all operating systems.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoUpdate and deduplicate the comments on CAF management (#8590)
Patrick Palka [Wed, 4 Dec 2013 15:38:47 +0000 (10:38 -0500)] 
Update and deduplicate the comments on CAF management (#8590)

5 years agoMove the allocation of CAF blackholes into 'newCAF' (#8590)
Patrick Palka [Mon, 2 Dec 2013 02:17:43 +0000 (21:17 -0500)] 
Move the allocation of CAF blackholes into 'newCAF' (#8590)

We now do the allocation of the blackhole indirection closure inside the
RTS procedure 'newCAF' instead of generating the allocation code inline
in the closure body of each CAF.  This slightly decreases code size in
modules with a lot of CAFs.

As a result of this change, for example, the size of DynFlags.o drops by
~60KB and HsExpr.o by ~100KB.

5 years agoRemove code that generates FunDep error message context
Joachim Breitner [Wed, 4 Dec 2013 15:47:49 +0000 (15:47 +0000)] 
Remove code that generates FunDep error message context

as it seems that this code is now dead (due to
[Dropping derived constraints]) (See #8592)

5 years agoUntab ClosureTypes.h and ClosureFlags.c
Patrick Palka [Tue, 3 Dec 2013 15:27:14 +0000 (10:27 -0500)] 
Untab ClosureTypes.h and ClosureFlags.c

5 years agoComments only
Simon Peyton Jones [Wed, 4 Dec 2013 13:40:43 +0000 (13:40 +0000)] 
Comments only

5 years agoImprove ASSERT
Simon Peyton Jones [Mon, 2 Dec 2013 16:49:57 +0000 (16:49 +0000)] 
Improve ASSERT

5 years agoComments only
Simon Peyton Jones [Mon, 2 Dec 2013 16:49:22 +0000 (16:49 +0000)] 
Comments only

5 years agoFix note reference [WildCard binders]
Joachim Breitner [Wed, 4 Dec 2013 10:07:09 +0000 (10:07 +0000)] 
Fix note reference [WildCard binders]

5 years agoMore detailed error message when GND fails
Joachim Breitner [Wed, 4 Dec 2013 08:42:13 +0000 (08:42 +0000)] 
More detailed error message when GND fails

we now print the precise class method, with types, where the coercion
failed.

5 years agoExport getHscEnv from HscMain
Edsko de Vries [Sun, 1 Dec 2013 13:55:07 +0000 (13:55 +0000)] 
Export getHscEnv from HscMain

5 years agoMask async exceptions in forkM_
Edsko de Vries [Thu, 28 Nov 2013 16:38:26 +0000 (16:38 +0000)] 
Mask async exceptions in forkM_

See #8006 for the reason why. This is not a fix as such; more of a workaround.

5 years agoElaborate "deriving" error messages
Joachim Breitner [Tue, 3 Dec 2013 10:42:55 +0000 (10:42 +0000)] 
Elaborate "deriving" error messages

If "deriving (C)" fails, it will now, if possible, indicate which
particular field of which constructor has caused the failure. (This
fixes #8576)

5 years agoRefactor: Origin of inferred Thetas
Joachim Breitner [Mon, 2 Dec 2013 19:16:08 +0000 (19:16 +0000)] 
Refactor: Origin of inferred Thetas

When doing non-standalone deriving, annotate each individual
unsimplified constraint with its own CtOrigin. This is just the
refactoring, so the CtOrigin is still CtDeriv in each case.

5 years agoSome popular typos in comments
Gabor Greif [Mon, 2 Dec 2013 22:05:43 +0000 (23:05 +0100)] 
Some popular typos in comments

5 years agoNote [HyperStr and Use demands]
Joachim Breitner [Mon, 2 Dec 2013 18:03:52 +0000 (18:03 +0000)] 
Note [HyperStr and Use demands]

This note is a summary of an explanation by SPJ to me.

5 years agoMove FunDeps to typecheck
Joachim Breitner [Mon, 2 Dec 2013 17:53:23 +0000 (17:53 +0000)] 
Move FunDeps to typecheck

That’s where all its users are...

5 years agoFix location of spliced-in role annotations.
Richard Eisenberg [Mon, 2 Dec 2013 18:02:08 +0000 (13:02 -0500)] 
Fix location of spliced-in role annotations.

5 years agoRejig rejigConRes & friends, doing role checks in a second pass.
Richard Eisenberg [Sat, 30 Nov 2013 21:05:47 +0000 (16:05 -0500)] 
Rejig rejigConRes & friends, doing role checks in a second pass.

This commit is just a refactoring, intended to make the use of
rejigConRes (which sorts out the return types of GADT-like constructors)
less delicate. The idea is that, if we perform role checking in a
second top-level pass, we can use checkValidDataCon to check for
valid return types. Previously, checking roles would force the
rejigConRes thunk before we knew that rejigConRes was safe to call!

5 years agoRemove dead code orphaned by implementing GND with `coerce`.
Richard Eisenberg [Tue, 26 Nov 2013 14:52:12 +0000 (09:52 -0500)] 
Remove dead code orphaned by implementing GND with `coerce`.

5 years agoMore links to [Coercible Instances]
Joachim Breitner [Mon, 2 Dec 2013 11:05:31 +0000 (11:05 +0000)] 
More links to [Coercible Instances]

5 years agoHandle Coercible (forall a. t) (forall a. t2) in TcInteract
Joachim Breitner [Mon, 2 Dec 2013 11:01:36 +0000 (11:01 +0000)] 
Handle Coercible (forall a. t) (forall a. t2) in TcInteract

5 years agoBind monadic stuff in getCoercibleInst locally, not via parameters
Joachim Breitner [Mon, 2 Dec 2013 10:56:31 +0000 (10:56 +0000)] 
Bind monadic stuff in getCoercibleInst locally, not via parameters

5 years agoRefactor deferTcSForAllEq: Do not bind, but return EvTerm
Joachim Breitner [Mon, 2 Dec 2013 10:12:38 +0000 (10:12 +0000)] 
Refactor deferTcSForAllEq: Do not bind, but return EvTerm

5 years agoPrint nicer error message for Coercible errors
Joachim Breitner [Mon, 2 Dec 2013 10:01:56 +0000 (10:01 +0000)] 
Print nicer error message for Coercible errors

It now reads

   Could not coerce from ‛S a’ to ‛S (NT a)’

and does not mention Coercible any more (as discussed in #8567).

5 years agoWith GND, report Coercible errors earliy
Joachim Breitner [Mon, 2 Dec 2013 09:45:12 +0000 (09:45 +0000)] 
With GND, report Coercible errors earliy

just like other type errors occurring during deriving.

5 years agoTcDeriv: s/isomorphism/coercible
Joachim Breitner [Mon, 2 Dec 2013 09:22:23 +0000 (09:22 +0000)] 
TcDeriv: s/isomorphism/coercible

in comments and function names, to use less names for the same thing.

5 years agoRevert "Respect the ordering of -package directives"
Patrick Palka [Mon, 2 Dec 2013 02:37:32 +0000 (21:37 -0500)] 
Revert "Respect the ordering of -package directives"

This commit was accidentally pushed.

This reverts commit 574ccfa231ca05d03d1da9d31e5bc81e74cc5e1e.

5 years agoRespect the ordering of -package directives
Patrick Palka [Tue, 26 Nov 2013 16:46:59 +0000 (11:46 -0500)] 
Respect the ordering of -package directives

5 years agoMove the LDV code below the self-loop label (#8275)
Patrick Palka [Sun, 1 Dec 2013 17:47:33 +0000 (12:47 -0500)] 
Move the LDV code below the self-loop label (#8275)

5 years agoDon't explicitly refer to nodeReg in ldvEnterClosure
Patrick Palka [Sun, 1 Dec 2013 17:44:14 +0000 (12:44 -0500)] 
Don't explicitly refer to nodeReg in ldvEnterClosure

5 years agoDocument solution to #8275
Jan Stolarek [Sun, 1 Dec 2013 10:28:50 +0000 (11:28 +0100)] 
Document solution to #8275

5 years agoFix loopification with profiling and enable it by default (#8275)
Patrick Palka [Fri, 29 Nov 2013 18:40:42 +0000 (13:40 -0500)] 
Fix loopification with profiling and enable it by default (#8275)

5 years agoFix documentation of FlexibleContexts (#8574)
Krzysztof Gogolewski [Sat, 30 Nov 2013 15:50:40 +0000 (16:50 +0100)] 
Fix documentation of FlexibleContexts (#8574)

5 years agoUpdate "stolen syntax" section (#8575)
Krzysztof Gogolewski [Sat, 30 Nov 2013 12:51:43 +0000 (13:51 +0100)] 
Update "stolen syntax" section (#8575)

5 years agoCall busy_wait_nop() in the spin-wait loop in shutdown_gc_threads()
Patrick Palka [Sat, 30 Nov 2013 01:01:27 +0000 (20:01 -0500)] 
Call busy_wait_nop() in the spin-wait loop in shutdown_gc_threads()

5 years agoUpdate "stolen syntax" section (#8575)
Krzysztof Gogolewski [Fri, 29 Nov 2013 21:41:31 +0000 (22:41 +0100)] 
Update "stolen syntax" section (#8575)

Thanks to aavogt

5 years agoMinor fix to example GHC plugin in the documentation
Joachim Breitner [Fri, 29 Nov 2013 18:44:31 +0000 (18:44 +0000)] 
Minor fix to example GHC plugin in the documentation

5 years agoUpdate Notes for Coercible
Joachim Breitner [Fri, 29 Nov 2013 09:28:53 +0000 (09:28 +0000)] 
Update Notes for Coercible

5 years agoRemove whitespace between macro identifiers and `(`
Herbert Valerio Riedel [Fri, 29 Nov 2013 08:00:57 +0000 (09:00 +0100)] 
Remove whitespace between macro identifiers and `(`

This is a kludge to workaround Clang's CPP lacking traditional-mode CPP

(This was reported by Kazu Yamamoto)

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoFail (rather than addErr) if you use a bogus field in a pattern
Simon Peyton Jones [Thu, 28 Nov 2013 17:56:53 +0000 (17:56 +0000)] 
Fail (rather than addErr) if you use a bogus field in a pattern

This fixes Trac #8570

5 years agoMore faff to get GHCi's top-level environment right
Simon Peyton Jones [Tue, 26 Nov 2013 10:47:16 +0000 (10:47 +0000)] 
More faff to get GHCi's top-level environment right

This fixes #8540 (again), and simplifies matters a bit more. In
particular, I got rid of ic_sys_vars altogether.  Mostly they can just
go in ic_tythings, apart from dfuns, which are readily gettable from
the instances anyway.

See documentation in Note [Initialising the type environment for GHCi]
in TcEnv.

5 years agoFix the deugger (fixing Trac #8557)
Simon Peyton Jones [Mon, 25 Nov 2013 15:07:25 +0000 (15:07 +0000)] 
Fix the deugger (fixing Trac #8557)

The runtime debugger (which has not received any love from anyone
for many years) looks wrong to me; it was failing to instantiate the
outer foralls of a variable when called from :force, which calls
cvObtainTermFromId, which calls cvObtainTerm

I simplified the code too.  But I'm flaky on how this debugger stuff
is really supposed to work, so I'm partly guessing.  Tests pass though.

5 years agoRefactor handleRunStatus some more, add comments and tidy up formatting
Simon Marlow [Thu, 28 Nov 2013 12:03:26 +0000 (12:03 +0000)] 
Refactor handleRunStatus some more, add comments and tidy up formatting

I liked the idea of combining traceRunStatus and handleRunStatus, but
I think we lost a bit of clarity where traceRunStatus wants to fall
back to handleRunStatus when the breakpoint is enabled.  So I
refactored it a bit more.

5 years ago-ddump-cmm: don't dump the proc point stage if we didn't do anything
Simon Marlow [Thu, 28 Nov 2013 10:55:48 +0000 (10:55 +0000)] 
-ddump-cmm: don't dump the proc point stage if we didn't do anything

5 years agoComments on slow-call-shortcutting
Simon Marlow [Thu, 28 Nov 2013 10:55:26 +0000 (10:55 +0000)] 
Comments on slow-call-shortcutting

5 years agoFix up shortcut for slow calls
Patrick Palka [Wed, 27 Nov 2013 14:04:25 +0000 (09:04 -0500)] 
Fix up shortcut for slow calls

5 years agoImplement shortcuts for slow calls (#6084)
Simon Marlow [Thu, 28 Nov 2013 09:43:58 +0000 (09:43 +0000)] 
Implement shortcuts for slow calls (#6084)

5 years agoEvCast needs to take a representational coercion
Joachim Breitner [Thu, 28 Nov 2013 12:07:14 +0000 (12:07 +0000)] 
EvCast needs to take a representational coercion

as the coercions for type literals are of that role.

5 years agoComments only
Simon Peyton Jones [Thu, 28 Nov 2013 11:58:35 +0000 (11:58 +0000)] 
Comments only

5 years agoCoercible for impredicative types
Joachim Breitner [Wed, 27 Nov 2013 17:19:20 +0000 (17:19 +0000)] 
Coercible for impredicative types

using deferTcSForAllEq, just like for ~ types, during canonicalization

5 years agoGet rid of EvCoercible
Joachim Breitner [Wed, 27 Nov 2013 16:15:46 +0000 (16:15 +0000)] 
Get rid of EvCoercible

and use EvCoercion to describe the evidence for Coercible instances.

5 years agoBeginnings of removing EvCoercible
Joachim Breitner [Wed, 27 Nov 2013 14:21:43 +0000 (14:21 +0000)] 
Beginnings of removing EvCoercible

5 years agoRoleify TcCoercion
Joachim Breitner [Wed, 27 Nov 2013 14:21:39 +0000 (14:21 +0000)] 
Roleify TcCoercion

Previously, TcCoercion were only used to represent boxed Nominal
coercions. In order to also talk about boxed Representational coercions
in the type checker, we add Roles to TcCoercion. Again, we closely
mirror Coercion.

The roles are verified by a few assertions, and at the latest after
conversion to Coercion. I have put my trust in the comprehensiveness of
the testsuite here, but any role error after desugaring popping up now
might be caused by this refactoring.

5 years agoRemove unused liftTcCoSubstWith
Joachim Breitner [Wed, 27 Nov 2013 14:26:33 +0000 (14:26 +0000)] 
Remove unused liftTcCoSubstWith

5 years agoAdd role-checking ASSERT to mkCast
Joachim Breitner [Wed, 27 Nov 2013 10:33:56 +0000 (10:33 +0000)] 
Add role-checking ASSERT to mkCast

5 years agoComment only
Gabor Greif [Wed, 27 Nov 2013 12:43:35 +0000 (13:43 +0100)] 
Comment only

5 years agoComment only
Gabor Greif [Tue, 26 Nov 2013 14:11:39 +0000 (15:11 +0100)] 
Comment only

5 years agoRejigger flushExec implementation (#8562, #8561)
Austin Seipp [Tue, 26 Nov 2013 09:31:30 +0000 (03:31 -0600)] 
Rejigger flushExec implementation (#8562, #8561)

Instead, just don't do anything on x86/amd64, and on !x86, use either A)
__clear_cache from libgcc, or B) sys_icache_invalidate for OS X (and
iOS.)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoghc.mk: one module name per line
Dr. ERDI Gergo [Thu, 21 Nov 2013 05:20:53 +0000 (13:20 +0800)] 
ghc.mk: one module name per line

Signed-off-by: Austin Seipp <austin@well-typed.com>