ghc.git
7 years agoOnly parse type literals when using `DataKinds`.
Iavor S. Diatchki [Sun, 18 Mar 2012 21:42:06 +0000 (14:42 -0700)] 
Only parse type literals when using `DataKinds`.

7 years agoAdd an `Outputable` instance for `HsTyLit`
Iavor S. Diatchki [Sun, 18 Mar 2012 21:41:26 +0000 (14:41 -0700)] 
Add an `Outputable` instance for `HsTyLit`

7 years agoFix the printing of * (the kind).
Iavor S. Diatchki [Sun, 18 Mar 2012 17:18:24 +0000 (10:18 -0700)] 
Fix the printing of * (the kind).

Type and kinds use the same printing code, but the kind * is not
an infix operator and so it should not be wrapped in parens.

As is, 'parenSymOcc', can't get this right because it does not know
if it is looking at *, the type, or *, the kind.   This is why I
added a special case in 'ppr_tc'.

7 years agoAdd TH support for type-level literals.
Iavor S. Diatchki [Thu, 15 Mar 2012 07:05:55 +0000 (00:05 -0700)] 
Add TH support for type-level literals.

7 years agoMerge remote-tracking branch 'origin/master' into type-nats
Iavor S. Diatchki [Wed, 14 Mar 2012 05:15:11 +0000 (22:15 -0700)] 
Merge remote-tracking branch 'origin/master' into type-nats

Conflicts:
compiler/coreSyn/CoreLint.lhs
compiler/deSugar/DsBinds.lhs
compiler/hsSyn/HsTypes.lhs
compiler/iface/IfaceType.lhs
compiler/rename/RnHsSyn.lhs
compiler/rename/RnTypes.lhs
compiler/stgSyn/StgLint.lhs
compiler/typecheck/TcHsType.lhs
compiler/utils/ListSetOps.lhs

7 years agoTweak to flag parsing (#5921)
Simon Marlow [Tue, 13 Mar 2012 11:30:13 +0000 (11:30 +0000)] 
Tweak to flag parsing (#5921)

-o2/Main.exe should be an invalid flag, not a linker input

7 years agodefine TABLES_NEXT_TO_CODE in ghcautoconf.h (#5933)
Simon Marlow [Tue, 13 Mar 2012 09:26:41 +0000 (09:26 +0000)] 
define TABLES_NEXT_TO_CODE in ghcautoconf.h (#5933)

7 years agoIn ghci, reload after :e. Patch from Paolo Capriotti. Fixes #5343
Ian Lynagh [Sun, 11 Mar 2012 17:52:48 +0000 (17:52 +0000)] 
In ghci, reload after :e. Patch from Paolo Capriotti. Fixes #5343

7 years agoTypo in comment
Ian Lynagh [Fri, 9 Mar 2012 18:34:31 +0000 (18:34 +0000)] 
Typo in comment

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 9 Mar 2012 17:19:22 +0000 (17:19 +0000)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoDocumentation update: Enumerations of Integers are subject to list fusion (#5670)
Joachim Breitner [Thu, 1 Dec 2011 21:31:05 +0000 (22:31 +0100)] 
Documentation update: Enumerations of Integers are subject to list fusion (#5670)

7 years agoWrap quotes in an error message
Simon Peyton Jones [Fri, 9 Mar 2012 15:26:19 +0000 (15:26 +0000)] 
Wrap quotes in an error message

7 years agoDon't defer type errors when evaluating a GHCi expression
Patrick Palka [Wed, 7 Mar 2012 00:27:40 +0000 (19:27 -0500)] 
Don't defer type errors when evaluating a GHCi expression

It is unhelpful here because the expression will get evaluated right
away anyway, thus emitting a redundant warning followed by an equivalent
runtime exception. If the expression were an ill-typed pure expression,
_three_ equivalent type errors would get emitted (due to the two-phase
typechecking done in 'Plan C')

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 9 Mar 2012 13:28:29 +0000 (13:28 +0000)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoImprove reporting of type-class errors
Simon Peyton Jones [Fri, 9 Mar 2012 13:27:52 +0000 (13:27 +0000)] 
Improve reporting of type-class errors

Inspired by suggestions on Trac #5858, the errors now
mention "potential instances".  Lots of refactoring
as usual, but localised.

7 years agoTweak the HADDOCK_DOCS regex in validate
Ian Lynagh [Fri, 9 Mar 2012 00:59:59 +0000 (00:59 +0000)] 
Tweak the HADDOCK_DOCS regex in validate

It's less precise now, but still good enough for what we need, and
this way we don't need to have literal tabs in the file.

7 years agoghc-pkg: make sure info messages go to stdout and errors to stderr (#3818)
Paolo Capriotti [Wed, 7 Mar 2012 18:40:44 +0000 (18:40 +0000)] 
ghc-pkg: make sure info messages go to stdout and errors to stderr (#3818)

7 years agoGive a unfolding argument discount proportional to the number of available arguments
Max Bolingbroke [Wed, 7 Mar 2012 19:44:31 +0000 (19:44 +0000)] 
Give a unfolding argument discount proportional to the number of available arguments

Ensures that h1 gets inlined into its use sites in cases like:

"""
h1 k = k undefined undefined undefined
        undefined undefined undefined
        undefined undefined undefined
        undefined undefined undefined
        undefined undefined undefined
        undefined undefined undefined

a = h1 (\x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ -> x)
b = h1 (\_ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ -> x)
"""

I've benchmarked this on nofib (albeit recompiling only the
benchmarks, not the library) and it hardly shifts the numbers - binary
size is up by 0.1% at most (average 0.0%) and the worst-case
allocation increase is 0.2% (best case -0.1%, 0.0% average).

If you also rebuild the libraries with this change, the only further
change is a +0.2% allocation increase in cacheprof. So this looks like
a pretty low-risk change that will considerably benefit certain
programs.

7 years agoAdd Haiku platform (#5828)
Paolo Capriotti [Wed, 7 Mar 2012 14:20:31 +0000 (14:20 +0000)] 
Add Haiku platform (#5828)

7 years agoGet correct options when calling 'clang' inplace of 'as' (#5903)
David Terei [Mon, 5 Mar 2012 04:53:37 +0000 (23:53 -0500)] 
Get correct options when calling 'clang' inplace of 'as' (#5903)

7 years agoDeal with promoted DataCons in interface files (fixes Trac #5881)
Simon Peyton Jones [Mon, 5 Mar 2012 09:27:28 +0000 (09:27 +0000)] 
Deal with promoted DataCons in interface files (fixes Trac #5881)

7 years agoFix Trac #5892: a coding errors
Simon Peyton Jones [Sun, 4 Mar 2012 09:41:52 +0000 (09:41 +0000)] 
Fix Trac #5892: a coding errors

We had a lazy pattern
  gres@(gre:_) = blah
and then a test for (null gres).  But I'd forgotten
that a demand for *any* of variables in the pattern
matches *all* of the variables in the entire pattern.
So the test for (null gres) was matching the cons,
which defeats the purpose.

7 years agoMake type trimming more conservative with -XDataKinds (fixes Trac #5912)
Simon Peyton Jones [Sun, 4 Mar 2012 09:05:34 +0000 (09:05 +0000)] 
Make type trimming more conservative with -XDataKinds (fixes Trac #5912)

See Note [When we can't trim types] in TidyPgm.  The real solution
is to do a full dependency analysis, but that seems rather overkill.

7 years agoTidy up the handling of kind generalisation
Simon Peyton Jones [Sun, 4 Mar 2012 08:25:05 +0000 (08:25 +0000)] 
Tidy up the handling of kind generalisation

In particular in forall abc. <blah> we should
kind generalise over <blah> as well as over the
kinds of a,b,c.

This fixes bug (in Trac #5862, caught by Lint) in the handling of
  data SMaybe a where
     SNothing :: SMaybe 'Nothing
where I didn't get a sufficiently general kind. And it's simpler.

7 years agoAttach INLINE pagmas in mutually recursive bindings
Simon Peyton Jones [Sun, 4 Mar 2012 08:18:09 +0000 (08:18 +0000)] 
Attach INLINE pagmas in mutually recursive bindings

This should fix #5895.  It seems that I was silently
ignoring INLINE pragmas in mutual recursion, which is
not the right thing at all.

7 years agoImproved debug printing with -dverbose-core2core
Simon Peyton Jones [Sun, 4 Mar 2012 08:08:46 +0000 (08:08 +0000)] 
Improved debug printing with -dverbose-core2core

(Roman wanted this.)

7 years agoWhite space only
Simon Peyton Jones [Fri, 2 Mar 2012 16:33:25 +0000 (16:33 +0000)] 
White space only

7 years agoHurrah! This major commit adds support for scoped kind variables,
Simon Peyton Jones [Fri, 2 Mar 2012 16:32:58 +0000 (16:32 +0000)] 
Hurrah!  This major commit adds support for scoped kind variables,
which (finally) fills out the functionality of polymorphic kinds.
It also fixes numerous bugs.

Main changes are:

Renaming stuff
~~~~~~~~~~~~~~
* New type in HsTypes:
     data HsBndrSig sig = HsBSig sig [Name]
  which is used for type signatures in patterns, and kind signatures
  in types.  So when you say
       f (x :: [a]) = x ++ x
  or
       data T (f :: k -> *) (x :: *) = MkT (f x)
  the signatures in both cases are a HsBndrSig.

* The [Name] in HsBndrSig records the variables bound by the
  pattern, that is 'a' in the first example, 'k' in the second,
  and nothing in the third.  The renamer initialises the field.

* As a result I was able to get rid of
     RnHsSyn.extractHsTyNames :: LHsType Name -> NameSet
  and its friends altogether.  Deleted the entire module!
  This led to some knock-on refactoring; in particular the
  type renamer now returns the free variables just like the
  term renamer.

Kind-checking types: mainly TcHsType
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A major change is that instead of kind-checking types in two
passes, we now do one. Under the old scheme, the first pass did
kind-checking and (hackily) annotated the HsType with the
inferred kinds; and the second pass desugared the HsType to a
Type.  But now that we have kind variables inside types, the
first pass (TcHsType.tc_hs_type) can go straight to Type, and
zonking will squeeze out any kind unification variables later.

This is much nicer, but it was much more fiddly than I had expected.

The nastiest corner is this: it's very important that tc_hs_type
uses lazy constructors to build the returned type. See
Note [Zonking inside the knot] in TcHsType.

Type-checking type and class declarations: mainly TcTyClsDecls
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I did tons of refactoring in TcTyClsDecls.  Simpler and nicer now.

Typechecking bindings: mainly TcBinds
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I rejigged (yet again) the handling of type signatures in TcBinds.
It's a bit simpler now.  The main change is that tcTySigs goes
right through to a TcSigInfo in one step; previously it was split
into two, part here and part later.

Unsafe coercions
~~~~~~~~~~~~~~~~
Usually equality coercions have exactly the same kind on both
sides.  But we do allow an *unsafe* coercion between Int# and Bool,
say, used in
    case error Bool "flah" of { True -> 3#; False -> 0# }
-->
    (error Bool "flah") |> unsafeCoerce Bool Int#

So what is the instantiation of (~#) here?
   unsafeCoerce Bool Int# :: (~#) ??? Bool Int#
I'm using OpenKind here for now, but it's un-satisfying that
the lhs and rhs of the ~ don't have precisely the same kind.

More minor
~~~~~~~~~~
* HsDecl.TySynonym has its free variables attached, which makes
  the cycle computation in TcTyDecls.mkSynEdges easier.

* Fixed a nasty reversed-comparison bug in FamInstEnv:
  @@ -490,7 +490,7 @@ lookup_fam_inst_env' match_fun one_sided ie fam tys
     n_tys = length tys
     extra_tys = drop arity tys
     (match_tys, add_extra_tys)
-       | arity > n_tys = (take arity tys, \res_tys -> res_tys ++ extra_tys)
+       | arity < n_tys = (take arity tys, \res_tys -> res_tys ++ extra_tys)
        | otherwise     = (tys,            \res_tys -> res_tys)

7 years agoFix crash caused by allowing duplicate *-modules in the context (#5904)
Simon Marlow [Fri, 2 Mar 2012 11:57:32 +0000 (11:57 +0000)] 
Fix crash caused by allowing duplicate *-modules in the context (#5904)

7 years agoDrop the per-task timing stats, give a summary only (#5897)
Simon Marlow [Fri, 2 Mar 2012 10:53:34 +0000 (10:53 +0000)] 
Drop the per-task timing stats, give a summary only (#5897)

We were keeping around the Task struct (216 bytes) for every worker we
ever created, even though we only keep a maximum of 6 workers per
Capability.  These Task structs accumulate and cause a space leak in
programs that do lots of safe FFI calls; this patch frees the Task
struct as soon as a worker exits.

One reason we were keeping the Task structs around is because we print
out per-Task timing stats in +RTS -s, but that isn't terribly useful.
What is sometimes useful is knowing how *many* Tasks there were.  So
now I'm printing a single-line summary, this is for the program in

  TASKS: 2001 (1 bound, 31 peak workers (2000 total), using -N1)

So although we created 2k tasks overall, there were only 31 workers
active at any one time (which is exactly what we expect: the program
makes 30 safe FFI calls concurrently).

This also gives an indication of how many capabilities were being
used, which is handy if you use +RTS -N without an explicit number.

7 years agoIn --make, give an indication of why a module is being recompiled
Simon Marlow [Thu, 1 Mar 2012 13:55:41 +0000 (13:55 +0000)] 
In --make, give an indication of why a module is being recompiled

e.g.

[3 of 5] Compiling C                (C.hs, C.o)
[4 of 5] Compiling D                (D.hs, D.o) [C changed]
[5 of 5] Compiling E                (E.hs, E.o) [D changed]

The main motivation for this is so that we can give the user a clue
when something is being recompiled because the flags changed:

[1 of 1] Compiling Test2            ( Test2.hs, Test2.o ) [flags changed]

7 years agoOmit -osuf/-odir -hisuf/-hidir and -stubdir from the flag checker
Simon Marlow [Tue, 28 Feb 2012 09:28:09 +0000 (09:28 +0000)] 
Omit -osuf/-odir -hisuf/-hidir and -stubdir from the flag checker

The reasoning is that GHC will only skip recompilation if it has found
a valid up-to-date object file and .hi file, so there is no need to
also check that these flags have not changed, and indeed there are
valid reasons to want to change them.

7 years agoGHCi: add :seti, for options that apply only at the prompt (#3217)
Simon Marlow [Wed, 29 Feb 2012 16:23:08 +0000 (16:23 +0000)] 
GHCi: add :seti, for options that apply only at the prompt (#3217)

GHCi now maintains two DynFlags: one that applies to whole modules
loaded with :load, and one that applies to things typed at the prompt
(expressions, statements, declarations, commands).

  The :set command modifies both DynFlags.  This is for backwards
  compatibility: users won't notice any difference.

  The :seti command applies only to the interactive DynFlags.

Additionally, I made a few changes to ":set" (with no arguments):

  * Now it only prints out options that differ from the defaults,
    rather than the whole list.

  * There is a new variant, ":set -a" to print out all options (the
    old behaviour).

  * It also prints out language options.

e.g.

Prelude> :set
options currently set: none.
base language is: Haskell2010
with the following modifiers:
  -XNoDatatypeContexts
  -XNondecreasingIndentation
GHCi-specific dynamic flag settings:
other dynamic, non-language, flag settings:
  -fimplicit-import-qualified
warning settings:

":seti" (with no arguments) does the same as ":set", but for the
interactive options.  It also has the "-a" option.

The interactive DynFlags are kept in the InteractiveContext, and
copied into the HscEnv at the appropriate points (all in HscMain).

There are some new GHC API operations:

-- | Set the 'DynFlags' used to evaluate interactive expressions.
setInteractiveDynFlags :: GhcMonad m => DynFlags -> m ()

-- | Get the 'DynFlags' used to evaluate interactive expressions.
getInteractiveDynFlags :: GhcMonad m => m DynFlags

-- | Sets the program 'DynFlags'.
setProgramDynFlags :: GhcMonad m => DynFlags -> m [PackageId]

-- | Returns the program 'DynFlags'.
getProgramDynFlags :: GhcMonad m => m DynFlags

Note I have not completed the whole of the plan outlined in #3217 yet:
when in the context of a loaded module we don't take the interactive
DynFlags from that module.  That needs some more refactoring and
thinking about, because we'll need to save and restore the original
interactive DynFlags.

This solves the immediate problem that people are having with the new
flag checking in 7.4.1, because now it is possible to set language
options in ~/.ghci that do not affect loaded modules and thereby cause
recompilation.

7 years agoFix validate with tables-next-to-code off
Ian Lynagh [Mon, 27 Feb 2012 23:12:11 +0000 (23:12 +0000)] 
Fix validate with tables-next-to-code off

7 years agoFix the unregisterised build; fixes #5901
Ian Lynagh [Mon, 27 Feb 2012 22:03:39 +0000 (22:03 +0000)] 
Fix the unregisterised build; fixes #5901

7 years agoWhitespace only in nativeGen/AsmCodeGen.lhs
Ian Lynagh [Mon, 27 Feb 2012 19:05:20 +0000 (19:05 +0000)] 
Whitespace only in nativeGen/AsmCodeGen.lhs

7 years agoFix copy/paste error in the docs
Ian Lynagh [Mon, 27 Feb 2012 12:35:34 +0000 (12:35 +0000)] 
Fix copy/paste error in the docs

7 years agoraiseAsync: cope with ATOMICALLY_FRAMES inside UPDATE_FRAMES (#5866)
Simon Marlow [Mon, 27 Feb 2012 14:32:44 +0000 (14:32 +0000)] 
raiseAsync: cope with ATOMICALLY_FRAMES inside UPDATE_FRAMES (#5866)

7 years agoslight tweak to help text (#5896)
Simon Marlow [Mon, 27 Feb 2012 13:39:50 +0000 (13:39 +0000)] 
slight tweak to help text (#5896)

7 years agoMention -threaded in the intro to Concurrent Haskell
Simon Marlow [Mon, 27 Feb 2012 13:33:11 +0000 (13:33 +0000)] 
Mention -threaded in the intro to Concurrent Haskell

And make the docs a bit more concrete.

7 years agoRemove documentation that a feature was missing, because it is not. (#5896)
Simon Marlow [Mon, 27 Feb 2012 13:17:40 +0000 (13:17 +0000)] 
Remove documentation that a feature was missing, because it is not. (#5896)

7 years agoAdd sync-all new-workdir
Johan Tibell [Fri, 17 Feb 2012 03:09:55 +0000 (19:09 -0800)] 
Add sync-all new-workdir

This command calls git-new-workdir (a separate script in git's contrib
directory) on all repos.  Useful to create multiple build trees, without
cloning the repos.

Usage:
  sync-all new-workdir <new_workdir> [<branch>]

7 years agoReplace createDirectoryHierarchy with createDirectoryIfMissing True
Takano Akio [Wed, 22 Feb 2012 02:18:29 +0000 (10:18 +0800)] 
Replace createDirectoryHierarchy with createDirectoryIfMissing True

createDirectoryHierarchy consisted of an existence test followed by
createDirectory, which failed if that directory was creted just after
the test. createDirectoryifMissing does not have this problem.

7 years agotyops
Gabor Greif [Sun, 22 Jan 2012 22:41:08 +0000 (23:41 +0100)] 
tyops

7 years agoformatting tweaks
Gabor Greif [Thu, 19 Jan 2012 14:02:34 +0000 (15:02 +0100)] 
formatting tweaks

7 years ago(some) tabs -> spaces
Gabor Greif [Wed, 18 Jan 2012 17:06:47 +0000 (18:06 +0100)] 
(some) tabs -> spaces

7 years agotabs -> spaces
Gabor Greif [Thu, 19 Jan 2012 13:54:02 +0000 (14:54 +0100)] 
tabs -> spaces

7 years ago(some) tabs -> spaces
Gabor Greif [Wed, 18 Jan 2012 17:05:32 +0000 (18:05 +0100)] 
(some) tabs -> spaces

7 years ago(some) tabs -> spaces
Gabor Greif [Wed, 18 Jan 2012 17:03:40 +0000 (18:03 +0100)] 
(some) tabs -> spaces

7 years agozap extra semi
Gabor Greif [Wed, 18 Jan 2012 17:02:51 +0000 (18:02 +0100)] 
zap extra semi

7 years agotypo
Gabor Greif [Wed, 18 Jan 2012 00:51:40 +0000 (01:51 +0100)] 
typo

7 years agocomments only
Gabor Greif [Wed, 18 Jan 2012 00:14:56 +0000 (01:14 +0100)] 
comments only

7 years agotypo
Gabor Greif [Mon, 16 Jan 2012 23:03:11 +0000 (00:03 +0100)] 
typo

7 years agotypo
Gabor Greif [Sun, 15 Jan 2012 00:20:05 +0000 (01:20 +0100)] 
typo

7 years agosome small corrections
Gabor Greif [Fri, 13 Jan 2012 00:32:45 +0000 (01:32 +0100)] 
some small corrections

7 years agotwo typos
Gabor Greif [Thu, 12 Jan 2012 19:13:44 +0000 (20:13 +0100)] 
two typos

7 years agominor tweak
Gabor Greif [Thu, 12 Jan 2012 17:35:52 +0000 (18:35 +0100)] 
minor tweak

7 years agotypo
Gabor Greif [Thu, 12 Jan 2012 00:43:49 +0000 (01:43 +0100)] 
typo

7 years agoremove legacy clean
Gabor Greif [Wed, 11 Jan 2012 17:06:56 +0000 (18:06 +0100)] 
remove legacy clean

7 years agouse idiomatic (GHC) types
Gabor Greif [Mon, 9 Jan 2012 22:06:58 +0000 (23:06 +0100)] 
use idiomatic (GHC) types

7 years agotidied this up, the macro definitions were causing duplicate semis in the source
Gabor Greif [Mon, 9 Jan 2012 21:00:39 +0000 (22:00 +0100)] 
tidied this up, the macro definitions were causing duplicate semis in the source

7 years agoremove unused function: printError
Simon Marlow [Mon, 27 Feb 2012 11:49:55 +0000 (11:49 +0000)] 
remove unused function: printError

7 years agoFix warnings in utils/GraphColor.hs
Ian Lynagh [Sun, 26 Feb 2012 17:54:04 +0000 (17:54 +0000)] 
Fix warnings in utils/GraphColor.hs

7 years agoWhitespace only in utils/GraphColor.hs
Ian Lynagh [Sun, 26 Feb 2012 17:51:29 +0000 (17:51 +0000)] 
Whitespace only in utils/GraphColor.hs

7 years agoChange -X flags into LANGUAGE pragmas
Ian Lynagh [Sun, 26 Feb 2012 17:37:38 +0000 (17:37 +0000)] 
Change -X flags into LANGUAGE pragmas

7 years agoFix warnings in utils/GraphOps.hs
Ian Lynagh [Sun, 26 Feb 2012 17:25:52 +0000 (17:25 +0000)] 
Fix warnings in utils/GraphOps.hs

7 years agoWhitespace only in utils/GraphOps.hs
Ian Lynagh [Sun, 26 Feb 2012 17:19:30 +0000 (17:19 +0000)] 
Whitespace only in utils/GraphOps.hs

7 years agoImplement "value" imports with the CAPI
Ian Lynagh [Sun, 26 Feb 2012 01:46:06 +0000 (01:46 +0000)] 
Implement "value" imports with the CAPI

This allows us to import values (i.e. non-functions) with the CAPI.
This means we can access values even if (on some or all platforms)
they are simple #defines.

7 years agoFix parsing of FFI import decls
Ian Lynagh [Sat, 25 Feb 2012 19:13:55 +0000 (19:13 +0000)] 
Fix parsing of FFI import decls

We no longer parse "staticfoo" as "static foo".

7 years agoAbstract out the hFlush calls in the GHC API
Ian Lynagh [Fri, 24 Feb 2012 22:49:14 +0000 (22:49 +0000)] 
Abstract out the hFlush calls in the GHC API

stdout/stderr might be closed, so we can't just hFlush them.
So we instead allow configuration in the same way that log_action
is configurable.

7 years agoAdd x86 implementations of the quotRem, Mul2 and Add2 primops
Ian Lynagh [Fri, 24 Feb 2012 14:09:09 +0000 (14:09 +0000)] 
Add x86 implementations of the quotRem, Mul2 and Add2 primops

7 years agoFix generic 2-word-multiply
Ian Lynagh [Fri, 24 Feb 2012 01:49:41 +0000 (01:49 +0000)] 
Fix generic 2-word-multiply

7 years agoImplement 2-word-multiply for x86_64
Ian Lynagh [Fri, 24 Feb 2012 00:56:26 +0000 (00:56 +0000)] 
Implement 2-word-multiply for x86_64

7 years agoAdd a 2-word-multiply operator
Ian Lynagh [Fri, 24 Feb 2012 00:34:46 +0000 (00:34 +0000)] 
Add a 2-word-multiply operator

Currently no NCGs support it

7 years agoAdd x86_64 support for the add-with-carry op
Ian Lynagh [Thu, 23 Feb 2012 21:36:10 +0000 (21:36 +0000)] 
Add x86_64 support for the add-with-carry op

7 years agoAdd a Word add-with-carry primop
Ian Lynagh [Thu, 23 Feb 2012 19:57:57 +0000 (19:57 +0000)] 
Add a Word add-with-carry primop

No special-casing in any NCGs yet

7 years agoCall expandCallishMachOp in the x86_64 codegen too
Ian Lynagh [Thu, 23 Feb 2012 15:25:51 +0000 (15:25 +0000)] 
Call expandCallishMachOp in the x86_64 codegen too

Currently it does nothing, as x86_64 supports all the callishMachOps
that expandCallishMachOp expands, but it might be needed in the future.

7 years agoUpdate dependencies
Ian Lynagh [Wed, 22 Feb 2012 22:30:20 +0000 (22:30 +0000)] 
Update dependencies

7 years agoUpdate dependencies
Ian Lynagh [Wed, 22 Feb 2012 19:10:24 +0000 (19:10 +0000)] 
Update dependencies

7 years agoSimplified serialization of IfaceTyCon, again
Max Bolingbroke [Wed, 22 Feb 2012 15:53:10 +0000 (15:53 +0000)] 
Simplified serialization of IfaceTyCon, again

Jose's patch implementing kind-polymorphic core (09015be8d580bc33f5f1960c8e31d00ba7a459a1) reverted many of the simplifying changes to interface file TyCon serialization I had made in a previous patch (5d7173f9ab8405511f75765e0541a04796d9bd07). Based on the diff I think this was an unintended consequence of how Jose did the merge rather than a real change he intended to make.

In fact, as a result of kind-polymorphic core we don't need to treat the Any TyCon specially any longer so my old simplifying changes can be made even simpler: IfaceTyCon is now just a newtype on IfaceExtName.

7 years agoFix validating with HADDOCK_DOCS=YES
Ian Lynagh [Wed, 22 Feb 2012 02:36:51 +0000 (02:36 +0000)] 
Fix validating with HADDOCK_DOCS=YES

7 years agoRemove support for CTYPE pragmas on type synonyms
Ian Lynagh [Tue, 21 Feb 2012 23:03:41 +0000 (23:03 +0000)] 
Remove support for CTYPE pragmas on type synonyms

It's not clear whether it's desirable or not, and it turns out that
the way we use coercions in GHC means we tend to lose information
about type synonyms.

7 years agoAdd a hack to make validating with HADDOCK_DOCS=NO work
Ian Lynagh [Tue, 21 Feb 2012 21:29:52 +0000 (21:29 +0000)] 
Add a hack to make validating with HADDOCK_DOCS=NO work

I've also renamed the bindisttest install directory to contain multiple
spaces, so we are also testing that multiple spaces aren't getting
collapsed into a single space.

7 years agoBe stricter about abstract newtypes in FFI declarations again.
Ian Lynagh [Tue, 21 Feb 2012 19:55:09 +0000 (19:55 +0000)] 
Be stricter about abstract newtypes in FFI declarations again.

This reverts the relaxation in c6b0fd62fc715aa6c666eb8afe09073ac7b87a83

7 years agoShow the CType in --show-iface output
Ian Lynagh [Tue, 21 Feb 2012 19:19:55 +0000 (19:19 +0000)] 
Show the CType in --show-iface output

7 years agoGHC trees no longer include the extensible-exceptions package
Ian Lynagh [Tue, 21 Feb 2012 14:58:33 +0000 (14:58 +0000)] 
GHC trees no longer include the extensible-exceptions package

7 years agoAdd a primop for unsigned quotRem; part of #5598
Ian Lynagh [Fri, 17 Feb 2012 22:46:27 +0000 (22:46 +0000)] 
Add a primop for unsigned quotRem; part of #5598

Only amd64 has an efficient implementation currently.

7 years agoSmall refactor
Ian Lynagh [Fri, 17 Feb 2012 21:15:23 +0000 (21:15 +0000)] 
Small refactor

Moved the default case of genCCall64 out into a separate function

7 years agoSmall refactoring: Use (Maybe Header) rather than FastString
Ian Lynagh [Fri, 17 Feb 2012 20:56:11 +0000 (20:56 +0000)] 
Small refactoring: Use (Maybe Header) rather than FastString

7 years agoAdd some docs for the CAPI extension
Ian Lynagh [Fri, 17 Feb 2012 18:39:11 +0000 (18:39 +0000)] 
Add some docs for the CAPI extension

7 years agoAllow a header to be specified in a CTYPE pragma
Ian Lynagh [Fri, 17 Feb 2012 15:50:59 +0000 (15:50 +0000)] 
Allow a header to be specified in a CTYPE pragma

You can now say
    data {-# CTYPE "some_header.h" "the C type" #-} Foo = ...

I think it's rare that this will actually be needed. If the
header for a CAPI FFI import includes a
    void f(ctype x);
prototype then ctype must already be defined.

However, if the header only has
    #define f(p) p->j
then the type need not be defined.

But either way, it seems good practice for us to specify the header that
we need.

7 years agoNow I understand why Constraint is a sub-kind of ArgKind!
Simon Peyton Jones [Fri, 17 Feb 2012 15:28:48 +0000 (15:28 +0000)] 
Now I understand why Constraint is a sub-kind of ArgKind!

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 17 Feb 2012 14:01:41 +0000 (14:01 +0000)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoWibble to sub-kinding
Simon Peyton Jones [Fri, 17 Feb 2012 14:00:53 +0000 (14:00 +0000)] 
Wibble to sub-kinding

7 years agoFix a missing defaultKind that resulted in lingering ArgKinds
Simon Peyton Jones [Fri, 17 Feb 2012 14:00:42 +0000 (14:00 +0000)] 
Fix a missing defaultKind that resulted in lingering ArgKinds

7 years agoFix a nasty bug in the canonicaliser which was failing
Simon Peyton Jones [Fri, 17 Feb 2012 14:00:08 +0000 (14:00 +0000)] 
Fix a nasty bug in the canonicaliser which was failing
to emit kind constraints when decomposing an application.
Resulting code is actually shorter!

7 years agoMore simplification of the sub-kinding story
Simon Peyton Jones [Fri, 17 Feb 2012 13:59:17 +0000 (13:59 +0000)] 
More simplification of the sub-kinding story

7 years agoImplement a typing rule for saturated seq, and document it
Simon Peyton Jones [Fri, 17 Feb 2012 13:57:47 +0000 (13:57 +0000)] 
Implement a typing rule for saturated seq, and document it
Also add notes about unsafeCoerce

The general thread here is to reduce use of ArgKind after
the type checker; it is so fragile!

7 years agoSubstantially nicer code in record updates
Simon Peyton Jones [Fri, 17 Feb 2012 13:56:03 +0000 (13:56 +0000)] 
Substantially nicer code in record updates

7 years agoMake the specialiser understand about polymorphic kinds
Simon Peyton Jones [Fri, 17 Feb 2012 13:55:23 +0000 (13:55 +0000)] 
Make the specialiser understand about polymorphic kinds