| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This fixes most of Trac #3990. Consider
data family D a
data instance D Double = CD Int Int
data T = T {-# UNPACK #-} !(D Double)
Then we want the (D Double unpacked).
To do this we need to construct a suitable coercion, and it's much
safer to record that coercion in the interface file, lest the in-scope
instances differ somehow. That in turn means elaborating the HsBang
type to include a coercion.
To do that I moved HsBang from BasicTypes to DataCon, which caused
quite a few minor knock-on changes.
Interface-file format has changed!
Still to do: need to do knot-tying to allow instances to take effect
within the same module.
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
Note [Use expectP] in TcGenDeriv
~~~~~~~~~~~~~~~~~~
Note that we use
expectP (Ident "T1")
rather than
Ident "T1" <- lexP
The latter desugares to inline code for matching the Ident and the
string, and this can be very voluminous. The former is much more
compact. Cf Trac #7258, although that also concerned non-linearity in
the occurrence analyser, a separate issue.
|
|
|
|
|
|
|
|
|
| |
They properly belong in TysWiredIn, since they are defined in Haskell
in GHC.TypeLits.
Moveover, make them WiredIn (again as they should be) and use
checkWiredInTyCon when encountering them in TcHsType.tc_hs_type,
so that the interface file is loaded. This fixes Trac #7502.
|
|\ |
|
| |
| |
| |
| | |
Working towards removing FastBytes
|
|\ \
| |/
| |
| |
| | |
Conflicts:
compiler/typecheck/TcTyClsDecls.lhs
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The situation was pretty dire. The way in which data constructors
were handled, notably the mapping between their *source* argument types
and their *representation* argument types (after seq'ing and unpacking)
was scattered in three different places, and hard to keep in sync.
Now it is all in one place:
* The dcRep field of a DataCon gives its representation,
specified by a DataConRep
* As well as having the wrapper, the DataConRep has a "boxer"
of type DataConBoxer (defined in MkId for loopy reasons).
The boxer used at a pattern match to reconstruct the source-level
arguments from the rep-level bindings in the pattern match.
* The unboxing in the wrapper and the boxing in the boxer are dual,
and are now constructed together, by MkId.mkDataConRep. This is
the key function of this change.
* All the computeBoxingStrategy code in TcTyClsDcls disappears.
Much nicer.
There is a little bit of refactoring left to do; the strange
deepSplitProductType functions are now called only in WwLib, so
I moved them there, and I think they could be tidied up further.
|
|
|
|
|
|
|
|
|
| |
As per a request from Simon PJ, I wrote up a formalism of the core
language in GHC, System FC. The writeup lives in docs/core-spec.
I also added comments to a number of files dealing with the core
language reminding authors to update the formalism when updating the
code. In the next commit will be a README file in docs/core-spec
with more details of how to do this.
|
|
|
|
|
|
|
| |
This reverts commit eb5196c48480c7dbec25aa175e43b9c20277f29c.
For some reason it didn't work, and I don't have time to look into it
right now.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
It's not really a primop, and GHC.Prim doesn't export it. It has a
definition in GHC.Magic.
|
|\ |
|
| |
| |
| |
| |
| | |
This makes it easier to be confident that the optimisation gives the
right answer.
|
| |
| |
| |
| |
| |
| | |
Adds better support for constant folding of Float/Double literals.
- add rationalToFloat, rationalToDouble with associated Name/Id's in PrelNames.
- add a matching rule in PrelRules for rationalTo* functions.
|
|\ \
| |/ |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
As well as the rules mentioned in the ticket, I've also gone through
and added some more rules that might be useful in other cases.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| | |
Mostly d -> g (matching DynFlag -> GeneralFlag).
Also renamed if* to when*, matching the Haskell if/when names
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In time-based profiling visualisations (e.g. heap profiles and ThreadScope)
it would be useful to be able to mark particular points in the execution and
have those points in time marked in the visualisation.
The traceMarker# primop currently emits an event into the eventlog. In
principle it could be extended to do something in the heap profiling too.
|
| |
| |
| |
| |
| |
| |
| |
| | |
I don't konw how this was left out before; Trac #7347.
In fixing this I did the usual round of refactoring. In particular, I
cached the fact that a DataCon can be promoted in the DataCon
itself (the dcPromoted field).
|
|/
|
|
|
| |
We agreed that it's not worth the bother of trying to maintain all
these distinct flags; RankNTypes will do the job fine. Trac #6032.
|
|
|
|
| |
We shouldn't be generating files in the source directories
|
|
|
|
| |
It used to be part-dynamic, part-static.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main change here is that the Cmm parser now allows high-level cmm
code with argument-passing and function calls. For example:
foo ( gcptr a, bits32 b )
{
if (b > 0) {
// we can make tail calls passing arguments:
jump stg_ap_0_fast(a);
}
return (x,y);
}
More details on the new cmm syntax are in Note [Syntax of .cmm files]
in CmmParse.y.
The old syntax is still more-or-less supported for those occasional
code fragments that really need to explicitly manipulate the stack.
However there are a couple of differences: it is now obligatory to
give a list of live GlobalRegs on every jump, e.g.
jump %ENTRY_CODE(Sp(0)) [R1];
Again, more details in Note [Syntax of .cmm files].
I have rewritten most of the .cmm files in the RTS into the new
syntax, except for AutoApply.cmm which is generated by the genapply
program: this file could be generated in the new syntax instead and
would probably be better off for it, but I ran out of enthusiasm.
Some other changes in this batch:
- The PrimOp calling convention is gone, primops now use the ordinary
NativeNodeCall convention. This means that primops and "foreign
import prim" code must be written in high-level cmm, but they can
now take more than 10 arguments.
- CmmSink now does constant-folding (should fix #7219)
- .cmm files now go through the cmmPipeline, and as a result we
generate better code in many cases. All the object files generated
for the RTS .cmm files are now smaller. Performance should be
better too, but I haven't measured it yet.
- RET_DYN frames are removed from the RTS, lots of code goes away
- we now have some more canned GC points to cover unboxed-tuples with
2-4 pointers, which will reduce code size a little.
|
|\ |
|
| | |
|
|\ \
| |/ |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Making Any a type family is the right thing to do, but it messes up
the proxy kind arguments in TypeLits and Singletons, so I'm backing it
out for now.
More thought required!
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Make Any into a type family (which it should always have been)
This is to support the future introduction of eta rules for
product types (see email on ghc-users title "PolyKind issue"
early Sept 2012)
* Add the *internal* data type support for
(a) closed type families [so that you can't give
type instance for 'Any']
(b) injective type families [because Any is really
injective]
This amounts to two boolean flags on the SynFamilyTyCon
constructor of TyCon.SynTyConRhs.
There is some knock-on effect, but all of a routine nature.
It remains to offer source syntax for either closed or
injective families.
|
|
|
|
|
|
| |
Now the StableName#s don't need to have the same type parameters:
eqStableName# :: StableName# a -> StableName# b -> Int#
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Move the following primop rules from GHC.Base to PrelRules:
"narrow32Int#" forall x#. narrow32Int# x# = x#
"narrow32Word#" forall x#. narrow32Word# x# = x#
"int2Word2Int" forall x#. int2Word# (word2Int# x#) = x#
"word2Int2Word" forall x#. word2Int# (int2Word# x#) = x#
|
| |
|
|
|
|
|
| |
Ported various rules for numeric types from GHC.Base. Added new rules
for bitwise operations, shifts and word comparisons.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a first step on the way to refactoring the FastString type.
FastBytes currently has no unique, mainly because there isn't currently
a nice way to produce them in Binary.
Also, we don't currently do the "Dictionary" thing with FastBytes in
Binary. I'm not sure whether this is important.
We can change both decisions later, but in the meantime this gets the
refactoring underway.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This completes the support for generic programming introduced
in GHC 7.2. Generic1 allows defining generic functions that
operate on type containers, such as `fmap`, for instance.
Along the way we have fixed #5936 and #5939, allowing
deriving Generic/Generic1 for data families, and disallowing
deriving Generic/Generic1 for instantiated types.
Most of this patch is Nicolas Frisby's work.
|