| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| | |
Just a simple refactoring. There was only one caller, and the
intermediate data type was not helping.
|
|/
|
|
|
| |
Don't use the zonked-in-the-knot types to create a name for the axiom
in a closed type family.
|
|\ |
|
| |
| |
| |
| |
| | |
Slightly more documentation, removed unused label map (huh),
removed MonadIO instance on LlvmM to improve encapsulation.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This combined patch reworks the LLVM backend in a number of ways:
1. Most prominently, we introduce a LlvmM monad carrying the contents of
the old LlvmEnv around. This patch completely removes LlvmEnv and
refactors towards standard library monad combinators wherever possible.
2. Support for streaming - we can now generate chunks of Llvm for Cmm as
it comes in. This might improve our speed.
3. To allow streaming, we need a more flexible way to handle forward
references. The solution (getGlobalPtr) unifies LlvmCodeGen.Data
and getHsFunc as well.
4. Skip alloca-allocation for registers that are actually never written.
LLVM will automatically eliminate these, but output is smaller and
friendlier to human eyes this way.
5. We use LlvmM to collect references for llvm.used. This allows places
other than cmmProcLlvmGens to generate entries.
|
| |
| |
| |
| |
| |
| | |
I am not quite sure at what point it makes sense to look at arrays as
pointers, but I ran into at least one use case that strongly suggested
doing it this way (calculating the actual size of structures, to be exact).
|
| | |
|
| |
| |
| |
| |
| | |
Also give them a proper constructor - getGlobalVar and getGlobalValue
map directly to the accessors.
|
| |
| |
| |
| |
| |
| |
| | |
This patch reworks some parts of the LLVM pretty-printing code that were
still using Show and String. Now we should be using SDoc and Outputable
throughout. Note that many get*Name functions become pp*Name
here as a side-effect.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- MetaArgs is not needed, as variables are already meta data
- Same goes for MetaVal - its only reason for existing seems to be to
support LLVM's strange pretty-printing for meta-data annotations, and
I feel that is better to keep the data structure clean and handle it in
the pretty-printing instead.
- Rename "MetaData" to "MetaAnnot". Meta-data is still meta-data when it
is not associated with an expression or statement - for example compile
unit data for debugging. I feel the old name was a bit misleading.
- Make the renamed MetaAnnot a proper data type instead of a type alias
for a pair.
- Rename "MetaExpr" constructor to "MetaStruct". As the data is much more
like a LLVM structure (not array, as it can contain values).
- Fix a warning
|
| |
| |
| |
| | |
backend.
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now, all open type families have result kinds that default to
*. Top-level type families have all arguments default to *,
and associated type families have all arguments that are not
mentioned in the class header default to *. Closed type
families perform kind inference, but generalize only over
those kind variables that are parametric in their use.
This is all a little fiddly and specific, but it seems to follow
use cases. This commit also includes a large
Note [Kind-checking strategies] in TcHsType that helps keep all
of this straight.
|
| |
|
| |
|
| |
|
|
|
|
| |
See Note [GC recovery]. To come: clean-up of StgCmmBind.cgRhs.
|
|
|
|
|
|
|
|
|
|
|
| |
You ought to be able to say
module M( C( T, foo ) where
class C a where
type T a
foo :: a -> T a
i.e. with T in C's sub-item list. This makes it so.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
so that RULE text/str gets a chance to fire (Trac #7995).
And make sure that Outputable.text is inlined, so that the underlying
Pretty.text rule can fire.
The thing is that literal strings only turn into unpackCString#
in phase 1.
|
|
|
|
|
|
|
|
| |
When we changed 'rec' to *not* do segmentation of any kind,
I did it by meddling with the inner loop of grab in glomSegments.
But that is really hard to understand!
This patch lifts the test out to the top where is is clear.
|
| |
|
| |
|
|
|
|
|
|
|
| |
They now go through log_action. The existing severities all used
printDoc, which always adds a trailing newline, which we don't
want for the GHCi messages. I therefore added a new severity
SevInteractive, which doesn't add a newline.
|
|
|
|
|
| |
This patch fixes profiling at the cost of losing cost centre accounting in a
very small number of cases. I am working on a better fix.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit changes the syntax and story around overlapping type
family instances. Before, we had "unbranched" instances and
"branched" instances. Now, we have closed type families and
open ones.
The behavior of open families is completely unchanged. In particular,
coincident overlap of open type family instances still works, despite
emails to the contrary.
A closed type family is declared like this:
> type family F a where
> F Int = Bool
> F a = Char
The equations are tried in order, from top to bottom, subject to
certain constraints, as described in the user manual. It is not
allowed to declare an instance of a closed family.
|
| |
|
|
|
|
| |
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
|
| |
Clang doesn't like whitespace between macro and arguments.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is needed because Clang is very strict about C99 macro rules, which
dictate that '#' in a body must have a token immediately following it for
string-ification. In practice we break this all the time, because we do
very weird stuff like:
#define FOOBAR(xyz) \
{-# SOME PRAGMA #-} \
baz :: (xyz) \
baz = ...
where the leading '#' in in the macro body clearly breaks this rule.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
| |
|
| |
|
|
|
|
|
| |
The ideclImplicit flag didn't exist before, but it does now,
and it makes this code simpler and makes it easy to fix Trac #7963.
|
|
|
|
|
|
|
|
|
|
| |
I really wish this were a joke, but alas...
This gets me a working stage1 compiler on Linux with Clang with no
modifications. Unfortunately it won't get much farther than that for
various other reasons.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we did ./configure time checks to see if 'GNU ld' supported
certain options. If it does, we bake those options into the link step.
See Trac #5240.
Unfortunately, the linker we use at runtime can change for several
reasons. One is that the user specifies -pgml 'foo'. The other is if
/usr/bin/ld or whatnot changes from when GHC was built. Those options
mentioned earlier are specific to GNU ld, but many systems support GNU
gold too. This is Trac #6063.
So we need to check at runtime what linker we're using. This is actually
a little bit complicated because we normally use the C compiler as our
linker. Windows and OS X are also special here.
Finally, this patch also unconditionally gives '--hash-size=31' and
'--reduce-memory-overheads' to the system linker if it's GNU ld. These
options have been supported for 8+ years from what I can see, and there
are probably a lot of other reasons why GHC would not work with such an
ancient binutils, all things considered.
See Note [Run-time linker info] in SysTools for details. There are
plenty of comments as well in the surrounding code.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The commit replaces mkWeakForeignEnv# with addCFinalizerToWeak#.
This new primop mutates an existing Weak# object and adds a new
C finalizer to it.
This change removes an invariant in MarkWeak.c, namely that the relative
order of Weak# objects in the list needs to be preserved across GC. This
makes it easier to split the list into per-generation structures.
The patch also removes a race condition between two threads calling
finalizeWeak# on the same WEAK object at that same time.
|
|
|
|
|
| |
LLVM 3.3rc3 complains when the llvm.used global is an empty array, so don't
define llvm.used at all when it would be empty.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Richard's bug report showed up a couple of subtleties in the constraint solver
* We can strengthen the kind invariants on CTyEqCan and CFunEqCan
See Note [Kind orientation for CTyEqCan]
and Note [Kind orientation for CFunEqCan] in TcRnTypes
There are some changes to reOrient and checkKind in TcCanonical
to support these stronger invarants.
* In TcSimplify we must make sure that we re-simplify if defaultTyVar
does anything. See Note [Must simplify after defaulting] in TcSimplify.
The usual round of refactoring follows!
|
| |
|
|
|
|
| |
This reverts commit 1c5b0511a89488f5280523569d45ee61c0d09ffa.
|
| |
|
|
|
|
|
| |
I reverted it to try something else and forgot to put it back!
Fixes Trac #7272 (again!).
|
| |
|
|
|
|
| |
This was exposed by Trac #7974. A stupid bug!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reported in Trac #7272. "tv1" should be "tv2"!
However, things weren't as simple as they sound, because
treating (x:Open) as different from (x:*) gave rise to
new failures; see Note [Comparison with OpenTypeKind] in Type.
My hacky solution is to treat OpenKind as equal to * and #,
at least in Core etc. Hence the faff in Type.cmpTc.
I do not like this. But it seems like another messy consequence
of including sub-kinding. Sigh.
|