summaryrefslogtreecommitdiff
path: root/ghc/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
* [project @ 2005-06-02 08:51:17 by simonmar]simonmar2005-06-021-6/+7
| | | | | Make GHC.depanal store the module graph in the session again. Fixes ghc -M.
* [project @ 2005-05-31 14:14:26 by simonmar]simonmar2005-05-311-9/+7
| | | | Make more error messages from the downsweep into ErrMsg exceptions.
* [project @ 2005-05-31 13:10:39 by simonmar]simonmar2005-05-311-4/+5
| | | | oops, fix updating the module graph
* [project @ 2005-05-31 12:45:03 by simonmar]simonmar2005-05-314-52/+85
| | | | | | | | | | | | | | Fix some reporting of errors in the GHC API: errors during the downsweep were thrown as exceptions; now they're reported via the (Messages->IO ()) callback in the same way as other errors. getModuleInfo no longer prints anything on stdout. It does ignore error messages and return Nothing, however - we should fix this and return the error messages at some point. The ErrMsg type can now be thrown as an exception. This can be a convenient alternative if collecting multiple error messages isn't required. We do this in the downsweep now.
* [project @ 2005-05-26 21:37:13 by simonpj]simonpj2005-05-261-0/+20
| | | | | | | | | | | | | | | | | | MERGE TO STABLE Put back in a missing case for higher-rank types. When the definition is a) non-recursive b) a function binding c) lacks a type signature we want to *infer* a perhaps-higher-rank type for the RHS, before making a monomorphically-typed Id for the LHS. E.g. f = \(x :: forall a. a->a) -> (x True, x 'c') This case got lost in the transition to 6.4 tc194 tests it
* [project @ 2005-05-24 14:52:08 by simonmar]simonmar2005-05-241-1/+6
| | | | isObjectLinkable: don't return True for an empty linkable
* [project @ 2005-05-24 14:19:09 by simonmar]simonmar2005-05-241-0/+3
| | | | If hsc_lang is HscNothing, produce an empty linkable.
* [project @ 2005-05-24 14:18:34 by simonmar]simonmar2005-05-241-3/+5
| | | | Don't write the interface in JustTypecheck mode
* [project @ 2005-05-24 09:38:29 by simonpj]simonpj2005-05-241-1/+4
| | | | Yet another wibble to the GHCi top-level interaction story; avoid dup error messages
* [project @ 2005-05-23 13:00:46 by simonpj]simonpj2005-05-231-6/+8
| | | | rename exportsFromAvail
* [project @ 2005-05-23 13:00:30 by simonpj]simonpj2005-05-231-13/+25
| | | | | | | Further GHCi wibbles a) Don't print the value of a 'let' b) Only one error message for 'print id'
* [project @ 2005-05-23 10:17:45 by simonpj]simonpj2005-05-231-6/+1
| | | | Dead code (HEAD only)
* [project @ 2005-05-23 10:17:22 by simonpj]simonpj2005-05-231-6/+25
| | | | | | | | | | | | | | | | Fix what "standard class" means MERGE to STABLE The Report's definition of defaulting (Section 4.3.4) defines a "standard class" to be one defined by the Prelude or a standard library. GHC was omitting the "..or a standard library" part; and it even omitted the Prelude classes Monad and Functor. This commit fixes the bug by adding Random, RandomGen, Monad, MonadPlus, Functor to the classes defined as "standard".
* [project @ 2005-05-23 09:56:17 by simonpj]simonpj2005-05-231-5/+2
| | | | Comments and type sig only
* [project @ 2005-05-23 09:56:03 by simonpj]simonpj2005-05-231-6/+5
| | | | Track new semantics of splitLongestPrefix; fixes -main-is bug
* [project @ 2005-05-23 09:50:26 by simonpj]simonpj2005-05-231-5/+6
| | | | Clarify code for splitLongestPrefix; no effect on behaviour
* [project @ 2005-05-23 08:22:06 by simonmar]simonmar2005-05-231-1/+0
| | | | | needsCDecl: remove extra equation for CaseLabel, which was overlapped (and wrong!).
* [project @ 2005-05-21 15:39:00 by panne]panne2005-05-213-9/+3
| | | | | | | | Warning police: Removed overlapped patterns. In general, taking compiler warnings about unmatched patterns seriously when they come up later might be better than writing catch-all patterns right from the start. Otherwise readers are confused and wonder which patterns might be missing when there are none.
* [project @ 2005-05-21 15:20:43 by panne]panne2005-05-211-1/+0
| | | | | Warning police: Removed an overlapped catch-all pattern (which could really never match due to genprimopcode)
* [project @ 2005-05-21 15:12:00 by panne]panne2005-05-211-1/+1
| | | | Warning police: Use non-deprecated form of "foreign import"
* [project @ 2005-05-20 12:06:00 by simonpj]simonpj2005-05-201-3/+1
| | | | Further wibble to preceding GHCi commit
* [project @ 2005-05-20 11:58:01 by simonpj]simonpj2005-05-201-2/+2
| | | | Wibble to preceding GHCi commit
* [project @ 2005-05-20 11:42:57 by simonpj]simonpj2005-05-204-125/+161
| | | | | | | | | | | | | | | | | | | | | | | Improve the GHCi interaction Merge to STABLE? This fix addresses Sourceforge #1156554 "GHCi: No instance for (Show (IO ()))", and simultaneously improves the top-level interaction in two other ways: - Only one error can show up (previously there could be two) - If an I/O action gives a Showable result, the result is printed (provided it isn't ()). So prompt> return 4 prints 4, rather than nothing - For command-line 'let' and 'x<-e' forms, if exactly one variable is bound, we print its value if it is Showable and not () prompt> let x = 4 4 prompt> x <- return 5 5
* [project @ 2005-05-20 11:32:03 by simonpj]simonpj2005-05-201-28/+27
| | | | | | | | | | | | | | | | | | | | | | | | Liberalise the defaulting rules for GHCi Merge to STABLE? The H98 defaulting rules are these. Group constraints of the form (C v), for some particular type variable v. Then default v if a) v appears only in this group (no implicit params or D [v]) b) at least one of the C's is numeric c) all the C's are standard GHCi changed rules (b) to (b') at least one of the C's is numeric, or Eq,Ord,Show This commit further liberalises GHCi to change (c): (c') any of the C's are standard Otherwise the existence of a non-standard class (e.g. Random) is enough to kill defaulting altogether.
* [project @ 2005-05-20 11:31:46 by simonpj]simonpj2005-05-201-1/+1
| | | | Comments only
* [project @ 2005-05-19 11:17:20 by simonmar]simonmar2005-05-191-1/+3
| | | | SMP: omit the -pthread flag on Windows
* [project @ 2005-05-19 11:15:40 by simonpj]simonpj2005-05-1917-101/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Tune up the reporting of unused imports Merge to STABLE (I think the earlier change made it across) (PS: the commit also does some trimming of redundant imports. If they don't merge, just discard them.) My earlier fixes to the reporting of unused imports still missed some obscure cases, some of which are now fixed by this commit. I had to make the import-provenance data type yet richer, but in fact it has more sharing now, so it may be cheaper on space. There's still one infelicity. Consider import M( x ) imoprt N( x ) where the same underlying 'x' is involved in both cases. Currently we don't report a redundant import, because dropping either import would change the qualified names in scope (M.x, N.x). But if the qualified names aren't used, the import is indeed redundant. Sadly we don't know that, because we only know what Names are used. Left for the future! There's a comment in RnNames.warnDuplicateImports This commit also trims quite a few redundant imports disovered by the new setup.
* [project @ 2005-05-19 07:58:35 by simonpj]simonpj2005-05-196-43/+66
| | | | | | | | | | | | | | | | Catch an exception in Template Haskell code Merge to STABLE If the code run by a Template Haskell splice fails with, say, a pattern-match failure, we should not report it as a GHC panic. It's a bug in the user's program. This commit fixes up the exception handling to do the right thing. Fixes SourceForge item #1201666 TH_fail tests it.
* [project @ 2005-05-19 07:56:58 by simonpj]simonpj2005-05-192-8/+9
| | | | | | | | | | | | | | Make sure the default methods are in scope in a Template Haskell splice Merge to STABLE This was just a typo really; in TcRnDriver.tcTopSrcDecls there were two tcl_envs, but one had a different name so we got the less up-to-date one. Fixes SourceForge item #1194808 TH_spliceInst tests it.
* [project @ 2005-05-18 12:14:03 by simonmar]simonmar2005-05-181-0/+7
| | | | | We should be using ASSIGN_DBL/PK_DBL for stores/loads respectively of doubles. Hopefully fixes SIGBUS on HPPA, and possible Sparc too.
* [project @ 2005-05-18 12:06:51 by simonmar]simonmar2005-05-181-15/+6
| | | | revert rev. 1.71
* [project @ 2005-05-18 04:02:39 by wolfgang]wolfgang2005-05-183-41/+17
| | | | | Use constructor functions instead of stginit functions on Win32, too. (stginit functions are still used for profiling)
* [project @ 2005-05-17 15:03:38 by simonmar]simonmar2005-05-171-2/+1
| | | | more import fixing
* [project @ 2005-05-17 14:55:46 by simonmar]simonmar2005-05-171-1/+1
| | | | import fix
* [project @ 2005-05-17 13:47:39 by simonmar]simonmar2005-05-171-4/+8
| | | | | | closureDescription: remove duplicate module name for external names, and include the unique for local names. This makes profiling with -hd more uesful.
* [project @ 2005-05-17 13:06:15 by simonmar]simonmar2005-05-171-1/+1
| | | | remove duplicate export
* [project @ 2005-05-17 13:05:45 by simonmar]simonmar2005-05-171-4/+4
| | | | Add showSDocDump
* [project @ 2005-05-17 12:22:37 by simonmar]simonmar2005-05-171-1/+1
| | | | | | Profiling: the type_descr and closure_descr were the wrong way around, so +RTS -hy behaves like +RTS -hd, and vice-versa. How on earth that happened I have no idea.
* [project @ 2005-05-17 12:00:04 by simonmar]simonmar2005-05-175-53/+49
| | | | | | | | | | Improve source locations on error messages from the downsweep. We now keep track of SrcSpans from import declarations, so we can report a proper source location for unknown imports (this improves on the previous hacky solution of keeping track of the filename that contained the original import declaration). ModSummary now contains (Located Module) for each import instead of Module.
* [project @ 2005-05-17 11:01:59 by simonmar]simonmar2005-05-173-31/+20
| | | | Further tweaks to the filename handling.
* [project @ 2005-05-17 10:51:04 by simonmar]simonmar2005-05-175-38/+43
| | | | | | Rationalise the filename handling in a few places, taking some bits from the defunct System.FilePath library. Also fixes a bug I recently introduced in replaceFilenameDirectory.
* [project @ 2005-05-17 09:46:22 by simonmar]simonmar2005-05-171-1/+1
| | | | replaceFilenameSuffix: fix
* [project @ 2005-05-17 09:40:51 by simonmar]simonmar2005-05-171-13/+32
| | | | Add modInfoInstances
* [project @ 2005-05-17 09:21:53 by simonmar]simonmar2005-05-171-0/+7
| | | | More commentary
* [project @ 2005-05-17 08:48:28 by simonmar]simonmar2005-05-171-3/+10
| | | | expand comment
* [project @ 2005-05-17 07:49:47 by simonmar]simonmar2005-05-171-1/+2
| | | | | | Bugfix to previous commit: filenames without an extension are assumed to be a haskell source filenames with the extension removed (eg. ghc --make hello should compile hello.hs).
* [project @ 2005-05-17 07:48:20 by simonmar]simonmar2005-05-171-2/+2
| | | | small cleanup: use joinFileExt
* [project @ 2005-05-16 13:47:57 by simonmar]simonmar2005-05-169-125/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | Implement -x <suffix> flag to override the suffix of a filename for the purposes of determinig how it should be compiled. The usage is similar to gcc, except that we just use a suffix rather than a name for the language. eg. ghc -c -x hs hello.blah will pretend hello.blah is a .hs file. Another possible use is -x hspp, which skips preprocessing. This works for one-shot compilation, --make, GHCi, and ghc -e. The original idea was to make it possible to use runghc on a file that doesn't end in .hs, so changes to runghc will follow. Also, I made it possible to specify .c files and other kinds of files on the --make command line; these will be compiled to objects as normal and linked into the final executable. GHC API change: I had to extend the Target type to include an optional start phase, and also GHC.guessTarget now takes a (Maybe Phase) argument. I thought this would be half an hour, in fact it took half a day, and I still haven't documented it. Sigh.
* [project @ 2005-05-16 13:21:11 by krasimir]krasimir2005-05-161-1/+14
| | | | added modInfoIsExportedName & modInfoLookupName functions
* [project @ 2005-05-16 12:40:14 by simonpj]simonpj2005-05-162-4/+8
| | | | Better debug-printing for -ddump-inlinings