summaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* Support for -fwarn-unused-do-bind and -fwarn-wrong-do-bind, as per #3263Max Bolingbroke2009-07-0142-117/+171
|
* Improved infrastructure for fast-rebuilding of parts of the treeSimon Marlow2009-07-031-3/+5
| | | | | | | | | | | | e.g. cd compiler make FAST=YES stage1/build/HscTypes.o builds just the specified .o file, without rebuilding dependencies, and omitting some of the makefile phases. FAST=YES works anywhere, to omit depenencies and phases. 'make fast' is shorthand for 'make all FAST=YES'.
* Fix Trac #3342: missed zonking in TcHsSynsimonpj@microsoft.com2009-07-021-1/+2
| | | | | The type in a ViewPat wasn't being zonked. Easily fixed.
* Type synonym families may be nullaryManuel M T Chakravarty2009-07-022-20/+1
|
* New syntax for GADT-style record declarations, and associated refactoringsimonpj@microsoft.com2009-07-0213-491/+469
| | | | | | | | | | | | | | | | | | | | | | | The main purpose of this patch is to fix Trac #3306, by fleshing out the syntax for GADT-style record declraations so that you have a context in the type. The new form is data T a where MkT :: forall a. Eq a => { x,y :: !a } -> T a See discussion on the Trac ticket. The old form is still allowed, but give a deprecation warning. When we remove the old form we'll also get rid of the one reduce/reduce error in the grammar. Hurrah! While I was at it, I failed as usual to resist the temptation to do lots of refactoring. The parsing of data/type declarations is now much simpler and more uniform. Less code, less chance of errors, and more functionality. Took longer than I planned, though. ConDecl has record syntax, but it was not being used consistently, so I pushed that through the compiler.
* White space onlysimonpj@microsoft.com2009-07-021-3/+3
|
* Comments onlysimonpj@microsoft.com2009-07-021-1/+1
|
* Look through Notes when matchingsimonpj@microsoft.com2009-07-021-8/+9
|
* FIX #3197Manuel M T Chakravarty2009-07-022-35/+79
|
* Fix #3319, and do various tidyups at the same timeSimon Marlow2009-06-266-64/+68
| | | | | | - converting a THSyn FFI declaration to HsDecl was broken; fixed - pretty-printing of FFI declarations was variously bogus; fixed - there was an unused "library" field in CImport; removed
* Fix Trac #3323: naughty record selectors againsimonpj@microsoft.com2009-06-256-24/+33
| | | | | | | | | | | I boobed when I decoupled record selectors from their data types. The most straightforward and robust fix means attaching the TyCon of a record selector to its IfaceIdInfo, so you'll need to rebuild all .hi files That said, the fix is easy.
* fix commentSimon Marlow2009-06-221-1/+1
|
* Fix the GHCi debugger so that it can recognise Integers againIan Lynagh2009-06-232-11/+11
|
* Follow Integer changesIan Lynagh2009-06-221-3/+2
|
* Remove the gmp/Integer primops from the compilerDuncan Coutts2009-06-132-156/+1
| | | | The implementations are still in the rts.
* Require GHCForeignImportPrim for "foreign import prim"Duncan Coutts2009-06-112-1/+5
| | | | | In practise currently you also need UnliftedFFITypes, however the restriction to just unlifted types may be lifted in future.
* Add missing StgPrimCallOp case in repCCallConvDuncan Coutts2009-06-111-1/+1
| | | | We don't handle "foreign import prim" in TH stuff.
* Add missing StgPrimCallOp case to isSimpleOpIan Lynagh2009-06-111-0/+1
|
* Reverse the safe/unsafe requirement on foreign import primDuncan Coutts2009-06-111-2/+2
| | | | | | | The safe/unsafe annotation doesn't currently mean anything for prim. Just in case we decide it means something later it's better to stick to using one or the other consistently. We decided that using safe is the better one to require (and it's also the default).
* Add PrimCall to the STG layer and update Core -> STG translationDuncan Coutts2009-06-097-4/+55
| | | | | | | | | | It adds a third case to StgOp which already hold StgPrimOp and StgFCallOp. The code generation for the new StgPrimCallOp case is almost exactly the same as for out-of-line primops. They now share the tailCallPrim function. In the Core -> STG translation we map foreign calls using the "prim" calling convention to the StgPrimCallOp case. This is because in Core we represent prim calls using the ForeignCall stuff. At the STG level however the prim calls are really much more like primops than foreign calls.
* Desugaring for "foreign import prim"Duncan Coutts2009-06-091-1/+36
| | | | | | | | | | | | | Unlike normal foreign imports which desugar into a separate worker and wrapper, we use just a single wrapper decleration. The representation in Core of the call is currently as a foreign call. This means the args are all treated as fully strict. This is ok at the moment because we restrict the types for foreign import prim to be of unboxed types, however in future we may want to make prim imports be the normal cmm calling convention for Haskell functions, in which case we would not be able to assume all args are strict. At that point it may make more sense to represent cmm/prim calls distinct from foreign calls, and more like the we the existing PrimOp calls are handled.
* Typechecking for "foreign import prim"Duncan Coutts2009-06-092-0/+45
| | | | | | | | | | | | The main restriction is that all args and results must be unboxed types. In particular we allow unboxed tuple results (which is a primary motivation for the whole feature). The normal rules apply about "void rep" result types like State#. We only allow "prim" calling convention for import, not export. The other forms of import, "dynamic", "wrapper" and data label are banned as a conseqence of checking that the imported name is a valid C string. We currently require prim imports to be marked unsafe, though this is essentially arbitrary as the safety information is unused.
* Lexing and parsing for "foreign import prim"Duncan Coutts2009-06-093-1/+12
| | | | | We only allow simple function label imports, not the normal complicated business with "wrapper" "dynamic" or data label "&var" imports.
* Add new FFI calling convention "prim"Duncan Coutts2009-06-091-2/+6
| | | | | First in a series of patches to add the feature. This patch just adds PrimCallConv to the CCallConv type.
* The IO type has moved to GHC.Types in ghc-primIan Lynagh2009-06-201-2/+2
|
* Fix #3132: a case of bogus code generationSimon Marlow2009-06-181-2/+28
|
* Add support for 'make help' in subdirectoriesSimon Marlow2009-06-161-0/+9
| | | | Including help for directory-specific targets, such as 'make 1' in ghc
* copyFileWithHeader: use binary HandlesSimon Marlow2009-06-151-6/+7
| | | | Fixes failure when Haddocking Data.Monoid in libraries/base
* pprExpr: don't add extra parens around [a..b] in an argument positionSimon Marlow2009-06-081-0/+2
| | | | test is tcfail205
* Changes for the new IO library, mainly base-package modules moving aroundSimon Marlow2009-05-299-17/+62
|
* Fix the compiler-hs-dependency'sIan Lynagh2009-06-121-7/+7
| | | | | | We needed some more $s to delay evaluation until the values are available, and the calls needed to be later in the ghc.mk so that compiler_stage2_WAYS etc are defined.
* Deprecate the threadsafe kind of foreign importDuncan Coutts2009-06-114-15/+26
|
* Fix the flag used to force linking when we are making a shared libraryDuncan Coutts2009-06-041-1/+1
| | | | | | | This is a correction to the patch: * When linking a shared library with --make, always do the link step which used the wrong flag in making the decision. It used -dynamic whereas the correct flag is -shared.
* Check we're not using stdcall in foreign export on unsupported platformsDuncan Coutts2009-06-081-2/+3
| | | | It's already checked for foreign import, but was missing for export.
* Change GHC_OPTIONS to OPTIONS_GHCIan Lynagh2009-06-101-1/+1
|
* Put "%expect 0" directives in the .y filesIan Lynagh2009-06-084-0/+7
| | | | | With the exception of GHC's main Parser.y(.pp), which has 2 reduce/reduce conflicts
* Make a proper Opt_WarnLazyUnliftedBindings warning, with a flag etcIan Lynagh2009-06-052-1/+7
|
* Allow RULES for seq, and exploit themsimonpj@microsoft.com2009-06-038-131/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Roman found situations where he had case (f n) of _ -> e where he knew that f (which was strict in n) would terminate if n did. Notice that the result of (f n) is discarded. So it makes sense to transform to case n of _ -> e Rather than attempt some general analysis to support this, I've added enough support that you can do this using a rewrite rule: RULE "f/seq" forall n. seq (f n) e = seq n e You write that rule. When GHC sees a case expression that discards its result, it mentally transforms it to a call to 'seq' and looks for a RULE. (This is done in Simplify.rebuildCase.) As usual, the correctness of the rule is up to you. This patch implements the extra stuff. I have not documented it explicitly in the user manual yet... let's see how useful it is first. The patch looks bigger than it is, because a) Comments; see esp MkId Note [seqId magic] b) Some refactoring. Notably, I moved the special desugaring for seq from MkCore back into DsUtils where it properly belongs. (It's really a desugaring thing, not a CoreSyn invariant.) c) Annoyingly, in a RULE left-hand side we need to be careful that the magical desugaring done in MkId Note [seqId magic] item (c) is *not* done on the LHS of a rule. Or rather, we arrange to un-do it, in DsBinds.decomposeRuleLhs.
* Remove the unused remains of __decodeFloatIan Lynagh2009-06-021-8/+1
|
* Remove old GUM/GranSim codeSimon Marlow2009-06-022-8/+1
|
* Fix Trac #3265: type operators in type/class declarationssimonpj@microsoft.com2009-06-021-1/+25
| | | | | | | | | | | | | | | We should accept these: data a :*: b = .... or data (:*:) a b = ... only if -XTypeOperators is in force. And similarly class decls. This patch fixes the problem. It uses the slightly-nasty OccName.isSymOcc, but the only way to avoid that is to cach the result in OccNames which seems overkill to us.
* depend on mk/project.mk appropriatelySimon Marlow2009-05-291-3/+3
|
* Quote commands that we run, so they work if there are space in their pathsIan Lynagh2009-05-301-18/+18
| | | | | I've also added some missing $s to some makefiles. These aren't technically necessary, but it's nice to be consistent.
* fix pprDynamicLinkerAsmLabel for Mac OS X x86_64Austin Seipp2009-05-231-0/+4
|
* Implement -XMonoLocalBinds: a radical new flagsimonpj@microsoft.com2009-05-292-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new flag -XMonoLocalBinds tells GHC not to generalise nested bindings in let or where clauses, unless there is a type signature, in which case we use it. I'm thinking about whether this might actually be a good direction for Haskell go to in, although it seems pretty radical. Anyway, the flag is easy to implement (look at how few lines change), and having it will allow us to experiement with and without. Just for the record, below are the changes required in the boot libraries -- ie the places where. Not quite as minimal as I'd hoped, but the changes fall into a few standard patterns, and most represent (in my opinion) sytlistic improvements. I will not push these patches, however. == running darcs what -s --repodir libraries/base M ./Control/Arrow.hs -2 +4 M ./Data/Data.hs -7 +22 M ./System/IO/Error.hs +1 M ./Text/ParserCombinators/ReadP.hs +1 == running darcs what -s --repodir libraries/bytestring M ./Data/ByteString/Char8.hs -1 +2 M ./Data/ByteString/Unsafe.hs +1 == running darcs what -s --repodir libraries/Cabal M ./Distribution/PackageDescription.hs -2 +6 M ./Distribution/PackageDescription/Check.hs +3 M ./Distribution/PackageDescription/Configuration.hs -1 +3 M ./Distribution/ParseUtils.hs -2 +4 M ./Distribution/Simple/Command.hs -1 +4 M ./Distribution/Simple/Setup.hs -12 +24 M ./Distribution/Simple/UserHooks.hs -1 +5 == running darcs what -s --repodir libraries/containers M ./Data/IntMap.hs -2 +2 == running darcs what -s --repodir libraries/dph M ./dph-base/Data/Array/Parallel/Arr/BBArr.hs -1 +3 M ./dph-base/Data/Array/Parallel/Arr/BUArr.hs -2 +4 M ./dph-prim-par/Data/Array/Parallel/Unlifted/Distributed/Arrays.hs -6 +10 M ./dph-prim-par/Data/Array/Parallel/Unlifted/Distributed/Combinators.hs -3 +6 M ./dph-prim-seq/Data/Array/Parallel/Unlifted/Sequential/Flat/Permute.hs -2 +4 == running darcs what -s --repodir libraries/syb M ./Data/Generics/Twins.hs -5 +18
* Fix Trac #3259: expose 'lazy' only after generating interface filessimonpj@microsoft.com2009-05-293-30/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes an insidious and long-standing bug in the way that parallelism is handled in GHC. See Note [lazyId magic] in MkId. Here's the diagnosis, copied from the Trac ticket. par is defined in GHC.Conc thus: {-# INLINE par #-} par :: a -> b -> b par x y = case (par# x) of { _ -> lazy y } -- The reason for the strange "lazy" call is that it fools the -- compiler into thinking that pseq and par are non-strict in -- their second argument (even if it inlines pseq/par at the call -- site). If it thinks par is strict in "y", then it often -- evaluates "y" before "x", which is totally wrong. The function lazy is the identity function, but it is inlined only after strictness analysis, and (via some magic) pretends to be lazy. Hence par pretends to be lazy too. The trouble is that both par and lazy are inlined into your definition of parallelise, so that the unfolding for parallelise (exposed in Parallelise.hi) does not use lazy at all. Then when compiling Main, parallelise is in turn inlined (before strictness analysis), and so the strictness analyser sees too much. This was all sloppy thinking on my part. Inlining lazy after strictness analysis works fine for the current module, but not for importing modules. The fix implemented by this patch is to inline 'lazy' in CorePrep, not in WorkWrap. That way interface files never see the inlined version. The downside is that a little less optimisation may happen on programs that use 'lazy'. And you'll only see this in the results -ddump-prep not in -ddump-simpl. So KEEP AN EYE OUT (Simon and Satnam especially). Still, it should work properly now. Certainly fixes #3259.
* Fix Trac #3262: suppress name-shadow warning for _namessimonpj@microsoft.com2009-05-284-11/+12
| | | | | | | Adopt Max's suggestion for name shadowing, by suppressing shadowing warnings for variables starting with "_". A tiny bit of refactoring along the way.
* Improve printing of Orig RdrNamessimonpj@microsoft.com2009-05-284-30/+44
| | | | | | | | | | | In Tempate Haskell -ddump-splices, the "after" expression is populated with RdrNames, many of which are Orig things. We used to print these fully-qualified, but that's a bit heavy. This patch refactors the code a bit so that the same print-unqualified mechanism we use for Names also works for RdrNames. Lots of comments too, because it took me a while to figure out how it all worked again.
* Print more nicely in -ddump-splicessimonpj@microsoft.com2009-05-281-12/+16
| | | | | | | | | | | | When you say -ddump-splices, the "before" expression is now *renamed* but not *typechecked" Reason (a) less typechecking crap (b) data constructors after type checking have been changed to their *wrappers*, and that makes them print always fully qualified
* Fix Trac #3261: make default types play nice with -Werrorsimonpj@microsoft.com2009-05-281-6/+7
| | | | | | The trial-and-error for type defaults was not playing nicely with -Werror. The fix is simple.