summaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
| * Merge TcSMonad.matchClass into TcInteract.matchClassInstSimon Peyton Jones2013-06-282-75/+52
| | | | | | | | | | Just a simple refactoring. There was only one caller, and the intermediate data type was not helping.
* | Fix Trac #8018.Richard Eisenberg2013-06-281-4/+12
|/ | | | | Don't use the zonked-in-the-knot types to create a name for the axiom in a closed type family.
* Merge branch 'master' of ssh://darcs.haskell.org/srv/darcs/ghcRichard Eisenberg2013-06-2814-1322/+1566
|\
| * LLVM refactor cleanupsPeter Wortmann2013-06-273-28/+34
| | | | | | | | | | Slightly more documentation, removed unused label map (huh), removed MonadIO instance on LlvmM to improve encapsulation.
| * Major Llvm refactoringPeter Wortmann2013-06-278-945/+1104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Use full contents size for arraysPeter Wortmann2013-06-271-1/+3
| | | | | | | | | | | | 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).
| * Rewrite ppLlvmBlock to use standard library "break"Peter Wortmann2013-06-271-13/+8
| |
| * Extend globals to aliasesPeter Wortmann2013-06-278-37/+43
| | | | | | | | | | Also give them a proper constructor - getGlobalVar and getGlobalValue map directly to the accessors.
| * Use SDoc for all LLVM pretty-printingPeter Wortmann2013-06-277-284/+291
| | | | | | | | | | | | | | 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.
| * Iteration on dterei's metadata designPeter Wortmann2013-06-277-98/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
| * Add ability to call functions with metadata as arguments to LLVMDavid Terei2013-06-275-16/+51
| | | | | | | | backend.
| * Rework LLVM metadata representation to be more accurate.David Terei2013-06-278-85/+168
| |
* | Fix stale comments around closed type families.Richard Eisenberg2013-06-282-3/+2
| |
* | Fix Trac #7939, and add kind inference to closed type families.Richard Eisenberg2013-06-284-112/+345
|/ | | | | | | | | | | | | | 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.
* Comments for Trac #7989Simon Peyton Jones2013-06-251-1/+27
|
* Improve "No data constructor has all these fields" message (#7989)Takano Akio2013-06-251-4/+51
|
* Fix typosGabor Greif2013-06-251-2/+2
|
* Make noteMustPointToIt true of all non-top-level thunksSimon Peyton Jones2013-06-251-23/+44
| | | | See Note [GC recovery]. To come: clean-up of StgCmmBind.cgRhs.
* Further fixes in RnNames, to make associated type exports workSimon Peyton Jones2013-06-251-39/+27
| | | | | | | | | | | 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.
* White space and ordering onlySimon Peyton Jones2013-06-241-3/+7
|
* Allow associated types as sub-names in an import list (Trac #8011)Simon Peyton Jones2013-06-242-14/+20
|
* Make sure that Pretty.text is inlined in stage 0,Simon Peyton Jones2013-06-242-1/+6
| | | | | | | | | | 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.
* Tidy up the segmentation of mdo expressionsSimon Peyton Jones2013-06-242-74/+94
| | | | | | | | 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.
* Break loop in interface typechecking (fixes Trac #8002)Simon Peyton Jones2013-06-241-2/+7
|
* Re-adjust whitespaceIan Lynagh2013-06-231-9/+10
|
* Allow the GHCi messages to be overridden via the GHC API; fixes #7456Ian Lynagh2013-06-234-6/+18
| | | | | | | 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.
* Add a work-around for #7978.Geoffrey Mainland2013-06-221-2/+7
| | | | | 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.
* Whitespace only in HeaderInfoIan Lynagh2013-06-221-34/+27
|
* Revise implementation of overlapping type family instances.Richard Eisenberg2013-06-2151-1072/+1254
| | | | | | | | | | | | | | | | | | | 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.
* Typo in noteGabor Greif2013-06-211-1/+1
|
* Support QNXNTO for arm under LLVMStephen Paul Weber2013-06-201-0/+3
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fix many ASSERT uses under Clang.Austin Seipp2013-06-1823-47/+46
| | | | | | Clang doesn't like whitespace between macro and arguments. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Use assembler-with-cpp mode when running CPP.Austin Seipp2013-06-181-4/+8
| | | | | | | | | | | | | | | | 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>
* Remove redundant import, revealed by the fix to #7963Simon Peyton Jones2013-06-181-1/+0
|
* Emit addUsedRdrNames for the datacons in a standalone deriving (Trac #7969)Simon Peyton Jones2013-06-171-3/+15
|
* Use ideclImplicit to filter out only *implict* Prelude imports (Trac #7963)Simon Peyton Jones2013-06-171-4/+1
| | | | | 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.
* Work-around clang weirdness by adding a newline.Austin Seipp2013-06-171-1/+9
| | | | | | | | | | 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>
* Detect linker information at runtime. Fixes Trac #6063Austin Seipp2013-06-162-6/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Allow multiple C finalizers to be attached to a Weak#Takano Akio2013-06-151-2/+9
| | | | | | | | | | | | | 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.
* Avoid generating empty llvm.used definitions.Geoffrey Mainland2013-06-121-12/+12
| | | | | 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.
* Remove dead codeSimon Peyton Jones2013-06-123-36/+2
|
* Remove trace that sometimes causes a loopSimon Peyton Jones2013-06-121-2/+0
|
* Fix the constraint simplifier (Trac #7967)Simon Peyton Jones2013-06-125-169/+194
| | | | | | | | | | | | | | | 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!
* Comment out function; consequence of reverting a553f18Simon Peyton Jones2013-06-111-2/+2
|
* Revert "Add support for byte endian swapping for Word 16/32/64."Simon Peyton Jones2013-06-1111-88/+24
| | | | This reverts commit 1c5b0511a89488f5280523569d45ee61c0d09ffa.
* Typo in commentGabor Greif2013-06-111-1/+1
|
* Actually make the change described in 'Fix egregious typo in cmpTypeX'Simon Peyton Jones2013-06-112-24/+20
| | | | | I reverted it to try something else and forgot to put it back! Fixes Trac #7272 (again!).
* Trace statements onlySimon Peyton Jones2013-06-101-0/+1
|
* Make sure we quantify over the context in data constructorsSimon Peyton Jones2013-06-101-19/+18
| | | | This was exposed by Trac #7974. A stupid bug!
* Fix egregious typo in cmpTypeXSimon Peyton Jones2013-06-103-13/+35
| | | | | | | | | | | | | | 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.