summaryrefslogtreecommitdiff
path: root/compiler/main
Commit message (Collapse)AuthorAgeFilesLines
* Remove old GUM/GranSim codeSimon Marlow2009-06-021-3/+0
|
* Implement -XMonoLocalBinds: a radical new flagsimonpj@microsoft.com2009-05-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Improve printing of Orig RdrNamessimonpj@microsoft.com2009-05-281-14/+22
| | | | | | | | | | | 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.
* Move getMainFun to TcRnDriver, trim DynFlags importssimonpj@microsoft.com2009-05-281-11/+1
|
* Separate flags -XDeriveFunctor, -XDeriveFoldable, -XDeriveTraversablesimonpj@microsoft.com2009-05-281-0/+8
| | | | | | | See Trac #2953. This patch implements a distinct flag for each extended class that may be automatically derived. And I updated the user manual to reflect the fact that we can now derive Functor, Foldable, Traversable.
* Split Reg into vreg/hreg and add register pairsBen.Lippmeier@anu.edu.au2009-05-181-0/+3
| | | | | | | | | | | | | * The old Reg type is now split into VirtualReg and RealReg. * For the graph coloring allocator, the type of the register graph is now (Graph VirtualReg RegClass RealReg), which shows that it colors in nodes representing virtual regs with colors representing real regs. (as was intended) * RealReg contains two contructors, RealRegSingle and RealRegPair, where RealRegPair is used to represent a SPARC double reg constructed from two single precision FP regs. * On SPARC we can now allocate double regs into an arbitrary register pair, instead of reserving some reg ranges to only hold float/double values.
* Need to pass gcc -m64 on amd64 OSXIan Lynagh2009-05-201-2/+0
|
* When linking a shared library with --make, always do the link stepDuncan Coutts2009-05-191-1/+1
| | | | | | | | Without -shared, the default target is a binary and in that case it makes sense for --make to not try and link a binary when there is no Main module. But for a shared library the user already has to specify -shared and there's no reason a shared lib should contain any Main module or main function.
* Make -dynload sysdep mean to embed rpaths in shared libs as well as binariesDuncan Coutts2009-05-191-1/+7
| | | | | | | | Previously it only did it for binaries. This was presumably on the theory that the binary could specify the rpath for all the libs. However when it is the shared lib that is the final product (ie to link into a bigger project) then we need the rpaths for the shared lib to be self-contianed.
* Switch the default -dynload mode to SystemDependentDuncan Coutts2009-05-171-1/+1
| | | | | The previous default was Deployable though it was being overridden to Wrapper in the ghc shell script wrapper.
* Set the soname when creating a shared libDuncan Coutts2009-05-151-0/+1
| | | | | It's still possible to override it, just use -optl-Wl,-soname, eg: ghc -shared -dynamic foo.o -o libfoo.so -optl-Wl,-soname,libbar.so
* Keep C main separate from rts lib and link it in for standalone progsDuncan Coutts2009-05-151-0/+8
| | | | | | | | | | | | Previously the object code for the C main function lived in the rts lib, however this is a problem when the rts is built as a shared lib. With Windows DLLs it always causes problems while on ELF systems it's a problem when the user decides to use their own C main function rather than a Haskell Main.main. So instead we now put main in it's own tiny little static lib libHSrtsmain.a which we install next to the rts libs. Whenever ghc links a program (without -no-hs-main) then it also links in -lHSrtsmain. For consistency we always do it this way now rather than trying to do it differently for static vs shared libraries.
* Remove old Windows-only implementation of keeping main outside the rtsDuncan Coutts2009-05-141-9/+0
| | | | | | | | We now do it for all ways and for all platforms. This was a Windows-only version that only kept a separate Main.dyn_o for the dynamic linking case. It had to do that because Windows DLLs are stricter about unresolved symbols where as for ELF platforms we only run into the problem when we're not using a Haskell main function.
* Need to pass gcc -m64 on amd64 OSXIan Lynagh2009-05-201-1/+7
|
* Fix the unregisterised buildIan Lynagh2009-05-201-1/+2
|
* Build fix for amd64/OSXIan Lynagh2009-05-201-1/+1
|
* Need to pass gcc -m64 on amd64 OSXIan Lynagh2009-05-201-0/+2
|
* Use machdepCCOpts when running "as"Ian Lynagh2009-05-201-3/+9
|
* Make -Odph imply -fsimplifier-phases=3Roman Leshchinskiy2009-05-191-0/+3
|
* Make ghc -dynamic imply -fPIC for C codeDuncan Coutts2009-05-011-2/+2
| | | | | | | | | | | As is already the case for ghc -fPIC. This is needed because ghc -dynamic means to generate code that is capable of being linked to Haskell shared libs and for C code the equivalent is -fPIC. Normally C code does not need -fPIC merely to link to shared libs however Haskell shared libs do not follow common conventions. In particular the static data cannot be referenced statically because it cannot be copied by the static linker. The linker cannot copy them because we do not specify a .size for the _closure entries (in the .data section) though in principle we could.
* fix warningSimon Marlow2009-05-131-0/+2
|
* enable LinkDynLib in compilier phasey.zhuang5@lse.ac.uk2009-04-221-7/+18
|
* Fix error handlingIan Lynagh2009-04-281-1/+2
| | | | | After the fix to #2500, we could get "Failing due to -Werror." but no warnings printed. Now we don't fail in that case.
* Improve the error message when we find a module in 2 places; trac #3183Ian Lynagh2009-04-261-4/+7
|
* GHC new build system megapatchIan Lynagh2009-04-262-152/+76
|
* Require a bang pattern when unlifted types are where/let bound; #3182Ian Lynagh2009-04-241-1/+1
| | | | | For now we only get a warning, rather than an error, because the alex and happy templates don't follow the new rules yet.
* FIX #2682: banish silly cases of the "module Foo is not loaded" errorSimon Marlow2009-04-212-17/+54
| | | | | | | | | | | | | | | | | | | | | | In GHCi if you say 'import Foo' meaning to load a package module Foo, and Foo.hs is found on the search path, then GHCi replies "module Foo is not loaded", because it knows Foo refers to the source file rather than the package module, and you haven't loaded that module with :load. This is consistent with the usual module-finding semantics. However, it isn't particularly useful. And it leads to silly problems like not being able to start GHCi when you happen to be sitting in libraries/base, because GHCi thinks the Prelude hasn't been loaded. So now I've made a slight change to the way that 'import M' works: if M is loaded, then it refers to the loaded module, otherwise it looks for a package module M. This does what the reporter of #2682 wanted, and since it turns an error condition into meaningful behaviour it can't break anything. The only undesirable consequence is that 'import M' might refer to a different M than ':load M'. Hopefully that won't lead to confusion.
* FIX #2500: Don't log warnings in getHeaderSimon Marlow2009-04-211-2/+4
|
* FIX #3153: we lost an EOF sentinel in the event of a lexical errorSimon Marlow2009-04-211-2/+3
|
* FIX #2845: Allow breakpoints on expressions with unlifted typeSimon Marlow2009-04-201-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | It turns out we can easily support breakpoints on expressions with unlifted types, by translating case tick# of _ -> e into let f = \s . case tick# of _ -> e in f realWorld# instead of just a plain let-binding. This is the same trick that GHC uses for abstracting join points of unlifted type. In #2845, GHC has eta-expanded the tick expression, changing the result type from IO a to (# State#, a #), which was the reason the tick was suddenly being ignored. By supporting ticks on unlifted expressions we can make it work again, although some confusion might arise because _result will no longer be available (it now has unboxed-tuple type, so we can't bind it in the environment). The underlying problem here is that GHC does transformations like eta-expanding the tick expressions, and there's nothing we can do to prevent that.
* Fix Trac #3155: better error message when -XRankNTypes is omittedsimonpj@microsoft.com2009-04-091-0/+2
| | | | | | | | | | | | | | | | | | | | | This patch sligtly re-adjusts the way in which the syntax of types is handled: * In the lexer, '.' and '*' are always accepted in types (previously it was conditional). This things can't mean anything else in H98, which is the only reason for doing things conditionally in the lexer. * As a result '.' in types is never treated as an operator. Instead, lacking a 'forall' keyword, it turns into a plain parse error. * Test for -XKindSignatures in the renamer when processing a) type variable bindings b) types with sigs (ty :: kind-sig) * Make -XKindSignatures be implied by -XTypeFamilies Previously this was buried in the conditonal lexing of '*'
* Adjust inlining heursiticssimonpj@microsoft.com2009-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This patch is the result of a long series of nofib-based experiments to improve GHC's inlining heuristics. In the end, I'm not sure how worthwhile it all was: I only got a 1% decrease in code size 1% decrease in allocation and I don't trust the runtime statistics enough to quote. Still, in doing all this I tidied up the code quite a bit, and I understand it much better now, so I'm going to commit it. The main changes are in CoreUnfold, which has lots of new comments. Other changes: - litSize moves from Literal to CoreUnfold - interestingArg moves from SimplUtils to CoreUnfold - the default unfolding threshold (in StaticFlags) reduces from 8 to 6 (since the size calculation has changed a bit)
* Float constants to top-level even in first full laziness passsimonpj@microsoft.com2009-04-021-3/+10
| | | | | | | | | This patch changes the compilation pipeline flags so that constants are floated to the top level even in the first full laziness pass. For some reason this was not done before. Fixing this makes a big improvement in 'spectral/rewrite', and has zero effect on any other nofib benchmark.
* syb no longer needs to be wired inIan Lynagh2009-03-261-1/+0
|
* FIX unregisterised target by #ifdefing targetPlatform stuffSimon Marlow2009-03-181-0/+6
| | | | | | I'm not sure if this is the correct fix. If targetPlatform is really NCG-specific, then maybe we should call it asmTargetPlatform or something.
* Add the notion of "constructor-like" Ids for rule-matchingsimonpj@microsoft.com2009-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds an optional CONLIKE modifier to INLINE/NOINLINE pragmas, {-# NOINLINE CONLIKE [1] f #-} The effect is to allow applications of 'f' to be expanded in a potential rule match. Example {-# RULE "r/f" forall v. r (f v) = f (v+1) #-} Consider the term let x = f v in ..x...x...(r x)... Normally the (r x) would not match the rule, because GHC would be scared about duplicating the redex (f v). However the CONLIKE modifier says to treat 'f' like a constructor in this situation, and "look through" the unfolding for x. So (r x) fires, yielding (f (v+1)). The main changes are: - Syntax - The inlinePragInfo field of an IdInfo has a RuleMatchInfo component, which records whether or not the Id is CONLIKE. Of course, this needs to be serialised in interface files too. - The occurrence analyser (OccAnal) and simplifier (Simplify) treat CONLIKE thing like constructors, by ANF-ing them - New function coreUtils.exprIsExpandable is like exprIsCheap, but additionally spots applications of CONLIKE functions - A CoreUnfolding has a field that caches exprIsExpandable - The rule matcher consults this field. See Note [Expanding variables] in Rules.lhs. On the way I fixed a lurking variable bug in the way variables are expanded. See Note [Do not expand locally-bound variables] in Rule.lhs. I also did a bit of reformatting and refactoring in Rules.lhs, so the module has more lines changed than are really different.
* Add fast event loggingSimon Marlow2009-03-172-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Generate binary log files from the RTS containing a log of runtime events with timestamps. The log file can be visualised in various ways, for investigating runtime behaviour and debugging performance problems. See for example the forthcoming ThreadScope viewer. New GHC option: -eventlog (link-time option) Enables event logging. +RTS -l (runtime option) Generates <prog>.eventlog with the binary event information. This replaces some of the tracing machinery we already had in the RTS: e.g. +RTS -vg for GC tracing (we should do this using the new event logging instead). Event logging has almost no runtime cost when it isn't enabled, though in the future we might add more fine-grained events and this might change; hence having a link-time option and compiling a separate version of the RTS for event logging. There's a small runtime cost for enabling event-logging, for most programs it shouldn't make much difference. (Todo: docs)
* FIX #3093: stub filenames when using -osufSimon Marlow2009-03-162-18/+8
| | | | Also remove some unused cruft
* just comment formattingSimon Marlow2009-03-131-5/+4
|
* FIX #3079, dodgy parsing of LANGUAGE pragmas2009-03-13Simon Marlow2009-03-121-57/+71
| | | | | | | | | I ended up rewriting this horrible bit of code, using (yikes) lazy I/O to slurp in the source file a chunk at a time. The old code tried to read the file a chunk at a time, but failed with LANGUAGE pragmas because the parser for LANGUAGE has state and the state wasn't being saved between chunks. We're still closing the Handle eagerly, so there shouldn't be any problems here.
* FIX #2976: fix buggy implementation of shadowing in GHC.getBindingsSimon Marlow2009-03-111-9/+3
|
* Don't put a trailing / on the mingw include pathIan Lynagh2009-03-101-1/+1
|
* remove foo.exe.manifest when --embed-manifest is onSimon Marlow2009-03-051-0/+2
|
* On OS X/x86, tell gcc to generate instructions for i686. Fixes trac #2983.Ian Lynagh2009-03-051-0/+7
| | | | | | By default, gcc on OS X will generate SSE instructions, which need things 16-byte aligned, but we don't 16-byte align things. Thus drop back to generic i686 compatibility.
* A few bug fixes; some improvements spurred by paper writingdias@eecs.harvard.edu2009-03-031-5/+3
| | | | | | | | | | | | Among others: - Fixed Stg->C-- translation of let-no-escapes -- it's important to use the right continuation... - Fixed infinite recursion in X86 backend (shortcutJump mishandled infinite loops) - Fixed yet another wrong calling convention -- primops take args only in vanilla regs, but they may return results on the stack! - Removed StackInfo from LGraph and Block -- now in LastCall and CmmZ - Updated avail-variable and liveness code
* If we are given -Werror, then pass -Werror to cppIan Lynagh2009-02-261-2/+5
|
* :steplocal and :stepmodule should not polute trace historyPeter Hercek2009-02-221-7/+9
|
* NCG: Split up the native code generator into arch specific modulesBen.Lippmeier@anu.edu.au2009-02-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | - nativeGen/Instruction defines a type class for a generic instruction set. Each of the instruction sets we have, X86, PPC and SPARC are instances of it. - The register alloctors use this type class when they need info about a certain register or instruction, such as regUsage, mkSpillInstr, mkJumpInstr, patchRegs.. - nativeGen/Platform defines some data types enumerating the architectures and operating systems supported by the native code generator. - DynFlags now keeps track of the current build platform, and the PositionIndependentCode module uses this to decide what to do instead of relying of #ifdefs. - It's not totally retargetable yet. Some info info about the build target is still hardwired, but I've tried to contain most of it to a single module, TargetRegs. - Moved the SPILL and RELOAD instructions into LiveInstr. - Reg and RegClass now have their own modules, and are shared across all architectures.
* On sparc, pass -mcpu=v9 when assembling with object splitting enabledIan Lynagh2009-02-111-0/+10
| | | | Fixes trac #2872.
* Improvements to the "can't find module" error message (#2980)Simon Marlow2009-02-062-59/+63
| | | | | | | | | If the module was found in multiple hidden packages, we list them all. Could not find module `Data.Generics': it is a member of the hidden package `base-3.0.3.0' it is a member of the hidden package `syb' Use -v to see a list of the files searched for.