summaryrefslogtreecommitdiff
path: root/compiler/utils
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant importsimonpj@microsoft.com2010-02-081-1/+0
|
* fix warning on WindowsSimon Marlow2010-01-271-2/+1
|
* catch SIGHUP and SIGTERM and raise an exception (#3656)Simon Marlow2010-01-271-3/+18
|
* locateOneObj: don't look for dynamic libs in static modeSimon Marlow2010-01-031-5/+5
| | | | | also replace picIsOn with isDynamicGhcLib, as __PIC__ is not the correct test for whether the GHC library is dynamically linked.
* Substantial improvements to coercion optimisationsimonpj@microsoft.com2010-01-041-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | The main purpose of this patch is to add a bunch of new rules to the coercion optimiser. They are documented in the (revised) Appendix of the System FC paper. Some code has moved about: - OptCoercion is now a separate module, mainly because it now uses tcMatchTy, which is defined in Unify, so OptCoercion must live higehr up in the hierarchy - Functions that manipulate Kinds has moved from Type.lhs to Coercion.lhs. Reason: the function typeKind now needs to call coercionKind. And in any case, a Kind is a flavour of Type, so it builds on top of Type; indeed Coercions and Kinds are both flavours of Type. This change required fiddling with a number of imports, hence the one-line changes to otherwise-unrelated modules - The representation of CoTyCons in TyCon has changed. Instead of an extensional representation (a kind checker) there is now an intensional representation (namely TyCon.CoTyConDesc). This was needed for one of the new coercion optimisations.
* Rolling back: Make FastString thread-safe.Simon Marlow2009-12-311-45/+84
| | | | | | | | | | This patch was the cause of the compile-time performance regression in #3796. My guess is that it is due to the use of unsafePerformIO which traverses the stack up to the first update frame, and perhaps we have a deep stack when reading the dictionary from a .hi file. In any case, since we're not relying on thread safety for FastStrings, I think the safest thing to do is back this out until we can investigate further.
* Make warning printing a bit less noisysimonpj@microsoft.com2009-12-181-1/+1
| | | | Use -dppr-debug to make it noisy again
* Add splitUFM to UniqFM (used in a forthcoming patch)simonpj@microsoft.com2009-12-041-3/+23
| | | | | splitUFM :: Uniquable key => UniqFM elt -> key -> (UniqFM elt, Maybe elt, UniqFM elt) -- Splits a UFM into things less than, equal to, and greater than the key
* Add lengthBag to Bag (using in forthcoming patch)simonpj@microsoft.com2009-12-041-1/+7
|
* Add an ID monad to MonadUtils (used in kind checking)simonpj@microsoft.com2009-11-121-0/+18
|
* Make `consBag` infixr, and `snocBag` infixlsimonpj@microsoft.com2009-10-291-0/+3
|
* Add Outputable.blankLine and use itsimonpj@microsoft.com2009-10-291-19/+21
|
* Use braces rather than angle-brackets in debug-printing for Bagssimonpj@microsoft.com2009-10-231-1/+1
|
* Use the standard library versions of elem and notElemIan Lynagh2009-10-051-21/+12
| | | | rather than our own copies
* Fix part of #3398: pretty-printing always goes via the I/O library encodingSimon Marlow2009-08-261-5/+3
| | | | | | | | | That is, unless we're printing in LeftMode, where we bypass encoding for speed. This is safe, because LeftMode is used for outputting C or asm, where everyting is Z-encoded and hence ASCII. Error messages and other compiler output containing Unicode will now appear correctly according to the locale settings.
* Make FastString thread-safe.Thomas Schilling2009-08-241-84/+45
| | | | | | | | | This is needed both for per-session parallelism and for allowing multiple concurrent sessions in the same process. With the help of atomicModifyIORef and unsafePerformIO it is also quite fast--an MVar would most likely be slower. On a full compilation of Cabal's head branch it was about 1-2 percent slower, but then overall compilation times varied by about 4 percent, so I think it's worth it.
* Use explicit Word32/Int32 in place of Int in the on-disk .hi fileSimon Marlow2009-08-211-3/+3
| | | | | For: FastStrings, Names, and Bin values. This makes .hi files smaller on 64-bit platforms, while also making the format a bit more robust.
* Make consIORef atomic.Thomas Schilling2009-08-221-4/+2
|
* Make -dppr-debug print locations in HsSynsimonpj@microsoft.com2009-08-201-1/+8
| | | | | | | | | | Show SrcSpans for Located things might be overkill, but it's sometimes useful. I also added ppWhen, ppUnless :: Bool -> SDoc -> SDoc to Outputable
* generalise the type of "on"Simon Marlow2009-08-201-1/+1
|
* Make the dynamic linker thread-safe.Thomas Schilling2009-08-171-1/+10
| | | | | | | | | | | | The current implementation is rather pessimistic. The persistent linker state is now an MVar and all exported Linker functions are wrapped in modifyMVar calls. This is serves as a big lock around all linker functions. There might be a chance for more concurrency in a few places. E.g., extending the closure environment and loading packages might be independent in some cases. But for now it's better to be on the safe side.
* Make updates to the external package state atomic.Thomas Schilling2009-08-161-2/+15
|
* RTS tidyup sweep, first phaseSimon Marlow2009-08-022-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first phase of this tidyup is focussed on the header files, and in particular making sure we are exposinng publicly exactly what we need to, and no more. - Rts.h now includes everything that the RTS exposes publicly, rather than a random subset of it. - Most of the public header files have moved into subdirectories, and many of them have been renamed. But clients should not need to include any of the other headers directly, just #include the main public headers: Rts.h, HsFFI.h, RtsAPI.h. - All the headers needed for via-C compilation have moved into the stg subdirectory, which is self-contained. Most of the headers for the rest of the RTS APIs have moved into the rts subdirectory. - I left MachDeps.h where it is, because it is so widely used in Haskell code. - I left a deprecated stub for RtsFlags.h in place. The flag structures are now exposed by Rts.h. - Various internal APIs are no longer exposed by public header files. - Various bits of dead code and declarations have been removed - More gcc warnings are turned on, and the RTS code is more warning-clean. - More source files #include "PosixSource.h", and hence only use standard POSIX (1003.1c-1995) interfaces. There is a lot more tidying up still to do, this is just the first pass. I also intend to standardise the names for external RTS APIs (e.g use the rts_ prefix consistently), and declare the internal APIs as hidden for shared libraries.
* Make the types we use when creating GHCi bytecode better match realityIan Lynagh2009-07-291-0/+3
| | | | | We were keeping things as Int, and then converting them to Word16 at the last minute, when really they ought to have been Word16 all along.
* Add an (Outputable Word16) instanceIan Lynagh2009-07-281-1/+4
|
* Remove GHC's haskell98 dependencyIan Lynagh2009-07-241-2/+1
|
* Fix Trac #3012: allow more free-wheeling in standalone derivingsimonpj@microsoft.com2009-07-231-3/+3
| | | | | | | | | | | | | | | | | | In standalone deriving, we now do *not* check side conditions. We simply generate the code and typecheck it. If there's a type error, it's the programmer's problem. This means that you can do 'deriving instance Show (T a)', where T is a GADT, for example, provided of course that the boilerplate code does in fact typecheck. I put some work into getting a decent error message. In particular if there's a type error in a method, GHC will show the entire code for that method (since, after all, the user did not write it). Most of the changes are to achieve that goal. Still to come: changes in the documentation.
* Add fmapM_maybe :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)simonpj@microsoft.com2009-07-231-0/+9
| | | | | | This function isn't used at the moment, but Max added it, and it looks useful.
* Always serialise Int as 64bit values; fixes trac #3041Ian Lynagh2009-07-171-9/+0
| | | | | | This means that, provided the values are small enough, files serialized are portable between architectures. In particular, .haddock files are portable.
* Remove some code that has always been commented outIan Lynagh2009-07-171-4/+0
|
* Remove maybePrefixMatch, using stripPrefix insteadIan Lynagh2009-07-091-10/+1
| | | | | We already require GHC 6.8 to build, and that included stripPrefix in Data.List.
* Fix ignored-monadic-result warningsIan Lynagh2009-07-071-1/+1
|
* Fix an unused import warningIan Lynagh2009-07-071-1/+0
|
* Remove unused importsIan Lynagh2009-07-071-1/+0
|
* Trim unused imports detected by new unused-import codesimonpj@microsoft.com2009-07-065-11/+5
|
* Support for -fwarn-unused-do-bind and -fwarn-wrong-do-bind, as per #3263Max Bolingbroke2009-07-015-9/+13
|
* Changes for the new IO library, mainly base-package modules moving aroundSimon Marlow2009-05-294-4/+30
|
* Improve printing of Orig RdrNamessimonpj@microsoft.com2009-05-281-0/+1
| | | | | | | | | | | 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.
* Split Reg into vreg/hreg and add register pairsBen.Lippmeier@anu.edu.au2009-05-183-10/+23
| | | | | | | | | | | | | * 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.
* Remove legacy code that isn't used now that we require GHC >= 6.8Ian Lynagh2009-05-242-14/+0
|
* Require a bang pattern when unlifted types are where/let bound; #3182Ian Lynagh2009-04-246-20/+20
| | | | | 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 #3170: Allow coalescing of the same node during register allocation.Ben.Lippmeier@anu.edu.au2009-04-181-3/+3
| | | | | | The x86 code generator sometimes generates nop moves like movl %vI_a %vI_a, but we'll just ignore them for coalescing purposes instead of emitting an error. It shouldn't hurt anything.
* Tweak a Show instanceIan Lynagh2009-04-071-1/+1
|
* Make some showSDoc's use OneLineMode rather than PageModeIan Lynagh2009-03-311-2/+13
|
* Make the showSDoc definition more explicitIan Lynagh2009-03-311-1/+1
|
* Template Haskell: support for type family declarationsManuel M T Chakravarty2009-03-191-0/+6
|
* Ensure the orientation of var-var equalities is correct for instatiationManuel M T Chakravarty2009-03-151-1/+12
| | | | | | | - During fianlisation we use to occasionally swivel variable-variable equalities - Now, normalisation ensures that they are always oriented as appropriate for instantation. - Also fixed #1899 properly; the previous fix fixed a symptom, not the cause.
* add final newlinesSimon Marlow2009-03-051-1/+1
| | | | | My Windows build has started complaining about lacking final newlines, I'm not entirely sure why.
* z-encode digits at the start of a symbol name; fixes trac #2997Ian Lynagh2009-02-271-9/+16
| | | | | | | | Digits already have a couple of meanings in z-encoding (Z3T is a tuple, and z123U is a unicode character), so we encode digits as unicode characters to avoid trying to squeeze in another meaning. Also removed a little GHC < 6.2 compatibility hack.
* Whitespace onlyIan Lynagh2009-02-271-143/+143
|