summaryrefslogtreecommitdiff
path: root/ghc/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
* [project @ 2006-01-18 10:49:32 by simonmar]simonmar2006-01-181-8/+15
| | | | | | | | | | | | Implement :main (see ticket #662) Patch from Volker Stolz, minor mods by me When matching commands, we now look for (a) an exact match, and (b) the first prefix match we find in the list. This is so that :module can still be abbreviated by :m, to avoid surprise. Docs still to do.
* [project @ 2006-01-18 10:06:36 by simonmar]simonmar2006-01-181-1/+7
| | | | Fix build on 5.04.x again
* [project @ 2006-01-17 16:13:18 by simonmar]simonmar2006-01-172-2/+13
| | | | | | | | | | | | | | | | | | | | | | | Improve the GC behaviour of IORefs (see Ticket #650). This is a small change to the way IORefs interact with the GC, which should improve GC performance for programs with plenty of IORefs. Previously we had a single closure type for mutable variables, MUT_VAR. Mutable variables were *always* on the mutable list in older generations, and always traversed on every GC. Now, we have two closure types: MUT_VAR_CLEAN and MUT_VAR_DIRTY. The latter is on the mutable list, but the former is not. (NB. this differs from MUT_ARR_PTRS_CLEAN and MUT_ARR_PTRS_DIRTY, both of which are on the mutable list). writeMutVar# now implements a write barrier, by calling dirty_MUT_VAR() in the runtime, that does the necessary modification of MUT_VAR_CLEAN into MUT_VAR_DIRY, and adding to the mutable list if necessary. This results in some pretty dramatic speedups for GHC itself. I've just measureed a 30% overall speedup compiling a 31-module program (anna) with the default heap settings :-D
* [project @ 2006-01-17 16:03:47 by simonmar]simonmar2006-01-172-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Improve the GC behaviour of IOArrays/STArrays See Ticket #650 This is a small change to the way mutable arrays interact with the GC, that can have a dramatic effect on performance, and make tricks with unsafeThaw/unsafeFreeze redundant. Data.HashTable should be faster now (I haven't measured it yet). We now have two mutable array closure types, MUT_ARR_PTRS_CLEAN and MUT_ARR_PTRS_DIRTY. Both are on the mutable list if the array is in an old generation. writeArray# sets the type to MUT_ARR_PTRS_DIRTY. The garbage collector can set the type to MUT_ARR_PTRS_CLEAN if it finds that no element of the array points into a younger generation (discovering this required a small addition to evacuate(), but rough tests indicate that it doesn't measurably affect performance). NOTE: none of this affects unboxed arrays (IOUArray/STUArray), only boxed arrays (IOArray/STArray). We could go further and extend the DIRTY bit to be per-block rather than for the whole array, but for now this is an easy improvement.
* [project @ 2006-01-12 16:16:28 by simonmar]simonmar2006-01-123-30/+50
| | | | | | | | | | | | | GHC.runStmt: run the statement in a new thread to insulate the environment from bad things that the user code might do, such as fork a thread to send an exception back at a later time. In order to do this, we had to keep track of which thread the ^C exception should go to in a global variable. Also, bullet-proof the top-level exception handler in GHCi a bit; there was a small window where an exception could get through, so if you lean on ^C for a while then press enter you could cause GHCi to exit.
* [project @ 2006-01-12 09:33:16 by simonmar]simonmar2006-01-121-5/+5
| | | | put unicode keywords under -fglasgow-exts, they aren't Hasell98
* [project @ 2006-01-11 13:12:09 by simonmar]simonmar2006-01-111-1/+1
| | | | | | | fix string desugaring: we can only use the ASCII unpackCString# if all the chars are <= 0x7F, not <= 0xFF. (fixes recent breakage in nofib/real/compress2)
* [project @ 2006-01-11 12:20:30 by simonmar]simonmar2006-01-111-1/+1
| | | | Add -threaded when building stage2+ again
* [project @ 2006-01-11 12:17:41 by simonmar]simonmar2006-01-111-0/+1
| | | | understand Unicode lambda as a synonym for \
* [project @ 2006-01-10 14:47:23 by simonmar]simonmar2006-01-101-1/+1
| | | | Fix a comment
* [project @ 2006-01-10 14:46:50 by simonmar]simonmar2006-01-101-6/+6
| | | | | Char primops: the Char# rep is wordRep, not I32 (fixed -dcmm-lint problems on x86_64)
* [project @ 2006-01-10 14:39:38 by simonmar]simonmar2006-01-101-1/+1
| | | | prevChar: don't back up over decoding errors
* [project @ 2006-01-10 14:39:01 by simonmar]simonmar2006-01-101-0/+4
| | | | Add a TODO
* [project @ 2006-01-10 14:37:53 by simonmar]simonmar2006-01-101-6/+5
| | | | | reportLexError: don't back up one character, the buffer returned by Alex is the one *before* the erroneous lexeme started.
* [project @ 2006-01-10 13:35:04 by simonmar]simonmar2006-01-101-5/+6
| | | | Z-encode cost centre symbols when printing them out.
* [project @ 2006-01-10 09:47:51 by simonmar]simonmar2006-01-101-0/+6
| | | | Fix compilation with GHC 6.2.x, hopefully
* [project @ 2006-01-09 14:33:50 by simonmar]simonmar2006-01-091-1/+1
| | | | Remove duplicate imports
* [project @ 2006-01-09 14:33:21 by simonmar]simonmar2006-01-091-1/+0
| | | | Remove dead panic
* [project @ 2006-01-09 14:32:57 by simonmar]simonmar2006-01-091-1/+2
| | | | Put a dummy record initialisation in to fix a warning
* [project @ 2006-01-09 13:29:02 by simonmar]simonmar2006-01-091-2/+2
| | | | Avoid desugaring bug in HEAD (see test ds057).
* [project @ 2006-01-09 13:25:50 by simonmar]simonmar2006-01-095-41/+59
| | | | | | | | Fix up to compile with GHC 5.04.x again. Also includes a fix for a memory error I discovered along the way: should fix the "scavenge_one" crash in the stage2 build of recent HEADs.
* [project @ 2006-01-09 10:31:14 by simonmar]simonmar2006-01-091-3/+2
| | | | ord# and chr# should be no-ops, not conversions between wordRep and I32.
* [project @ 2006-01-06 16:30:17 by simonmar]simonmar2006-01-0671-1720/+1528
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for UTF-8 source files GHC finally has support for full Unicode in source files. Source files are now assumed to be UTF-8 encoded, and the full range of Unicode characters can be used, with classifications recognised using the implementation from Data.Char. This incedentally means that only the stage2 compiler will recognise Unicode in source files, because I was too lazy to port the unicode classifier code into libcompat. Additionally, the following synonyms for keywords are now recognised: forall symbol (U+2200) forall right arrow (U+2192) -> left arrow (U+2190) <- horizontal ellipsis (U+22EF) .. there are probably more things we could add here. This will break some source files if Latin-1 characters are being used. In most cases this should result in a UTF-8 decoding error. Later on if we want to support more encodings (perhaps with a pragma to specify the encoding), I plan to do it by recoding into UTF-8 before parsing. Internally, there were some pretty big changes: - FastStrings are now stored in UTF-8 - Z-encoding has been moved right to the back end. Previously we used to Z-encode every identifier on the way in for simplicity, and only decode when we needed to show something to the user. Instead, we now keep every string in its UTF-8 encoding, and Z-encode right before printing it out. To avoid Z-encoding the same string multiple times, the Z-encoding is cached inside the FastString the first time it is requested. This speeds up the compiler - I've measured some definite improvement in parsing at least, and I expect compilations overall to be faster too. It also cleans up a lot of cruft from the OccName interface. Z-encoding is nicely hidden inside the Outputable instance for Names & OccNames now. - StringBuffers are UTF-8 too, and are now represented as ForeignPtrs. - I've put together some test cases, not by any means exhaustive, but there are some interesting UTF-8 decoding error cases that aren't obvious. Also, take a look at unicode001.hs for a demo.
* [project @ 2006-01-05 13:10:55 by simonpj]simonpj2006-01-051-5/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MERGE TO STABLE This commit fixes a nasty problem discovered by Volker Stolz. The problem is described in Note [Multiple instantiation] in TcExpr, which is reproduced below. (Core Lint identifies the problem, incidentally.) tc200 is a test case. Note [Multiple instantiation] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We are careful never to make a MethodInst that has, as its meth_id, another MethodInst. For example, consider f :: forall a. Eq a => forall b. Ord b => a -> b At a call to f, at say [Int, Bool], it's tempting to translate the call to f_m1 where f_m1 :: forall b. Ord b => Int -> b f_m1 = f Int dEqInt f_m2 :: Int -> Bool f_m2 = f_m1 Bool dOrdBool But notice that f_m2 has f_m1 as its meth_id. Now the danger is that if we do a tcSimplCheck with a Given f_mx :: f Int dEqInt, we may make a binding f_m1 = f_mx But it's entirely possible that f_m2 will continue to float out, because it mentions no type variables. Result, f_m1 isn't in scope. Here's a concrete example that does this (test tc200): class C a where f :: Eq b => b -> a -> Int baz :: Eq a => Int -> a -> Int instance C Int where baz = f Current solution: only do the "method sharing" thing for the first type/dict application, not for the iterated ones. A horribly subtle point.
* [project @ 2006-01-05 10:02:58 by simonpj]simonpj2006-01-051-5/+13
| | | | | | | | | 'newtype' declarations are now parsed exactly like data type declarations, so that you can declare newtypes using GADT syntax. But that means we must check all the newtype restrictions separately, and I mised one. This commit checks that there is no existential context on the newtype. Test is tcfail156
* [project @ 2006-01-04 11:52:54 by simonpj]simonpj2006-01-041-8/+17
| | | | Resolve ticket 644; crash when data con returns wrong type
* [project @ 2006-01-03 16:15:37 by simonmar]simonmar2006-01-031-13/+35
| | | | | | | | | setContextAfterLoad: try to load a target if possible, otherwise load the topmost module in the graph. Previously we were loading the first module in the list, which happened to be right a lot of the time, but not always. Fixes ticket #642
* [project @ 2006-01-03 16:14:20 by simonmar]simonmar2006-01-031-1/+1
| | | | export ModLocation(..)
* [project @ 2005-12-29 12:06:13 by simonpj]simonpj2005-12-293-7/+4
| | | | Trim imports
* [project @ 2005-12-21 11:43:29 by simonpj]simonpj2005-12-211-0/+1
| | | | Missing Show instance for FreeRegs on PowerPC
* [project @ 2005-12-19 13:08:19 by simonpj]simonpj2005-12-192-7/+6
| | | | Wibble to printing FunTyCon in GHCi that makes :b GHC.Base work
* [project @ 2005-12-19 11:00:59 by simonpj]simonpj2005-12-191-1/+1
| | | | Marginally improve the error message on a failure in DsMeta
* [project @ 2005-12-19 11:00:40 by simonpj]simonpj2005-12-191-1/+1
| | | | Tiny fix to patterns with type sigs
* [project @ 2005-12-19 09:48:14 by simonpj]simonpj2005-12-191-1/+4
| | | | Allow trailing parens in GADT signatures
* [project @ 2005-12-19 09:32:33 by simonpj]simonpj2005-12-191-4/+3
| | | | | | | | | | | | | | | ** Wibble to Friday's commit (fixes HEAD build) ** ----------------------------------------- Make deriving work for infix constructors ----------------------------------------- Merge to stable branch Back quotes were not being done correctly in deriving Read and Show. Now they are. I think. Test is drvrun018
* [project @ 2005-12-16 16:04:03 by simonpj]simonpj2005-12-161-29/+35
| | | | | | | | | | | | | ----------------------------------------- Make deriving work for infix constructors ----------------------------------------- Merge to stable branch Back quotes were not being done correctly in deriving Read and Show. Now they are. I think. Test is drvrun018
* [project @ 2005-12-16 15:15:08 by simonpj]simonpj2005-12-161-4/+9
| | | | | | | | | ----------------------------------------- Test for repated type variables in an instance decl context; this should require -fallow-undecidable-instances' ----------------------------------------- Merge to stable branch
* [project @ 2005-12-13 12:18:51 by simonmar]simonmar2005-12-131-1/+1
| | | | | | | | | Update the bug reporting instructions, I've now installed a redirect from http://www.haskel.org/ghc/reportabug to the bug reporting instructions, just in case we want to move that page in the future.
* [project @ 2005-12-13 12:09:42 by simonmar]simonmar2005-12-131-3/+2
| | | | | | | In the panic message, point to the bug reporting page in the User's Guide rather than directly to the bug reporting page. That way people will see the bug reporting instructions as well as the direct link (which has now changed).
* [project @ 2005-12-12 15:06:11 by simonmar]simonmar2005-12-121-0/+3
| | | | Add -threaded for stage[23]
* [project @ 2005-12-12 14:22:30 by simonmar]simonmar2005-12-121-1/+1
| | | | Prevent --: from being interpreted as a comment
* [project @ 2005-11-30 14:20:06 by simonpj]simonpj2005-11-303-31/+85
| | | | | | | | | | | | | | | | ----------------------------------------- Fix 'mkName' operator in Template Haskell so that it handles built-in syntax ----------------------------------------- Merge to stable branch The 'mkName' function in Template Haskell wasn't dealing correctly with built-in syntax. The parser generates Exact RdrNames for built-in syntax operators, such as ':' and '[]'; and hence so should Convert. At the same time I'm now generating a better error message in TH when you use a constructor as a variable or vice versa.
* [project @ 2005-11-28 14:50:57 by simonmar]Initial_conversion_from_CVS_completesimonmar2005-11-281-1/+1
| | | | | small tidyup for printing bindings with long identifiers: allow the binder and its definition to go on separate lines
* [project @ 2005-11-28 11:45:38 by simonpj]simonpj2005-11-281-2/+5
| | | | Dont try to output code for "naughty" record selectors
* [project @ 2005-11-25 13:04:41 by simonmar]simonmar2005-11-251-1/+1
| | | | -ddump-minimal-imports shouldn't turn off recompilation checking
* [project @ 2005-11-25 09:46:19 by simonmar]simonmar2005-11-251-3/+3
| | | | fix comment
* [project @ 2005-11-24 09:46:01 by simonpj]simonpj2005-11-241-4/+19
| | | | | | | | | | | | A patch to the already-somewhat-delicate machinery that deals with pattern-matching on unboxed tuples. This patch deals with pattern matches that can fail, e.g. case f x of (# Just x, Nothing #) -> ... The fix is in desugaring of HsCase (DsExpr.lhs). The test is dsrun013
* [project @ 2005-11-23 12:27:43 by simonmar]simonmar2005-11-231-0/+5
| | | | | report the correct version number in the "compiled by GHC version.." message in a bootstrapped compiler.
* [project @ 2005-11-23 11:32:53 by simonmar]simonmar2005-11-231-1/+4
| | | | | | make --mk-dll work with --make Submitted by: Esa Ilari Vuokko <eivuokko@gmail.com>, thanks!
* [project @ 2005-11-21 10:51:36 by simonpj]simonpj2005-11-211-8/+16
| | | | Wibble to typerep (fixes crash I hope)