summaryrefslogtreecommitdiff
path: root/compiler/utils
Commit message (Collapse)AuthorAgeFilesLines
* Add basic support for GHCJSAustin Seipp2013-09-061-0/+1
| | | | | | | | | | | | | | | | | | | This patch encompasses most of the basic infrastructure for GHCJS. It includes: * A new extension, -XJavaScriptFFI * A new architecture, ArchJavaScript * Parser and lexer support for 'foreign import javascript', only available under -XJavaScriptFFI, using ArchJavaScript. * As a knock-on, there is also a new 'WayCustom' constructor in DynFlags, so clients of the GHC API can add custom 'tags' to their built files. This should be useful for other users as well. The remaining changes are really just the resulting fallout, making sure all the cases are handled appropriately for DynFlags and Platform. Authored-by: Luite Stegeman <stegeman@gmail.com> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fix off-by-one error in FastString.getFastStringTable (#8110)Patrick Palka2013-08-301-1/+1
| | | | | The function was reading past the end of the FastString table, causing the -dfaststring-stats option to behave unpredictably.
* Fix validation failure in Fingerprint.hscAustin Seipp2013-08-231-1/+1
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fingerprint.getFileHash: Fix not reading file at all.Niklas Hambüchen2013-08-231-1/+8
| | | | | | This lead to the stage1 compiler calculating random iface hashes. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fingerprint: Fix comment typoNiklas Hambüchen2013-08-231-1/+1
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Remove trailing whitespace from Fingerprint.hscAustin Seipp2013-08-221-1/+1
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fix -Werror failure in Fingerprint.hscAustin Seipp2013-08-221-0/+3
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fix interface hashes including time stamp of dependent files.Niklas Hambüchen2013-08-221-2/+29
| | | | | | | | | | | | | | | | | | | | | | | Fixes #8144. Before, the modification time of e.g. #included files (and everything that ends up as a UsageFile, e.g. via addDependentFile) was taken as input for the interface hash of a module. This lead to different hashes for identical inputs on every compilation. We now use file content hashes instead. This changes the interface file format. You will get "Binary.get(Usage): 50" when you try to do an incremental using .hi files that were created with a GHC 7.7 (only) older than this commit. To calculate the md5 hash (`Fingerprint`) of a file in constant space, there now is GHC.Fingerprint.getFileHash, and a fallback version for older GHCs that needs to load the file into memory completely (only used when compiling stage1 with an older GHC). Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Add a better implementation of dropTail, and use itSimon Peyton Jones2013-08-191-1/+9
|
* Implement "roles" into GHC.Richard Eisenberg2013-08-023-2/+15
| | | | | | | | | | | | | | | | Roles are a solution to the GeneralizedNewtypeDeriving type-safety problem. Roles were first described in the "Generative type abstraction" paper, by Stephanie Weirich, Dimitrios Vytiniotis, Simon PJ, and Steve Zdancewic. The implementation is a little different than that paper. For a quick primer, check out Note [Roles] in Coercion. Also see http://ghc.haskell.org/trac/ghc/wiki/Roles and http://ghc.haskell.org/trac/ghc/wiki/RolesImplementation For a more formal treatment, check out docs/core-spec/core-spec.pdf. This fixes Trac #1496, #4846, #7148.
* Add NegativeLiterals extensionIan Lynagh2013-07-311-1/+1
| | | | | | | | | | | I'd been meaning to do this for some time, but finally got around to it due to the overflowing literals warning. With that enabled, we were getting a warning for -128 :: Int8 as that is parsed as negate (fromInteger 128) which just happens to do the right thing, as negate (fromInteger 128) = negate (-128) = -128
* De-orphan a load of Binary instancesIan Lynagh2013-07-271-0/+141
|
* adding FastString.string_table to the sharedCAF/Globals.c mechanismNicolas Frisby2013-07-161-7/+60
|
* This reverts commit 163de25813d12764aa5ded1666af7c06fee0d67e and commit ↵Nicolas Frisby2013-07-161-25/+2
| | | | 279ac9f66a83203448b279ea478b2cc1dafbd35d.
* copy the plugin's FastStringTable changes back into the host compilerNicolas Frisby2013-07-041-2/+12
|
* include FastString.string_table in CoreMonad.reinitializeGlobalsNicolas Frisby2013-07-031-1/+14
|
* Use SDoc for all LLVM pretty-printingPeter Wortmann2013-06-271-0/+7
| | | | | | | This patch reworks some parts of the LLVM pretty-printing code that were still using Show and String. Now we should be using SDoc and Outputable throughout. Note that many get*Name functions become pp*Name here as a side-effect.
* Make sure that Pretty.text is inlined in stage 0,Simon Peyton Jones2013-06-242-1/+6
| | | | | | | | | | so that RULE text/str gets a chance to fire (Trac #7995). And make sure that Outputable.text is inlined, so that the underlying Pretty.text rule can fire. The thing is that literal strings only turn into unpackCString# in phase 1.
* Define chkAppend, and use itSimon Peyton Jones2013-05-301-1/+8
| | | | | | Somtimes we need (xs ++ ys) in situations where ys is almost always empty. Utils.chkAppend checks for that case first.
* Simplify kind generalisation, and fix Trac #7916Simon Peyton Jones2013-05-211-0/+3
| | | | | | | | | | | | | | | | | | | A buglet that exposed an opportunity for some welcome refactoring and simplification. Main changes * TcMType.zonkQuantifiedTyVars is replaced by quantifyTyVars, which does a bit more zonking (so that its clients do not need to) * TcHsType.kindGeneralise becomes a bit simpler, and hands off to quantifyTyVars * A bit of simplification of the hacky code in TcTyClsDcls.tcConDecl, where we figure out how to generalise the data constructor's type * Improve the error message from badExistential when a constructor has an existential type, by printing the offending type * Some consequential simplification in simplifyInfer.
* Don't use getPackageLinkOpts on iOS; fixes #7720.Ian Lynagh2013-04-271-0/+8
| | | | | On iOS, binaries are really static libraries, so we don't want to use flags like -lm when linking them.
* Remove some __HADDOCK__ CPPIan Lynagh2013-04-091-2/+0
| | | | I think these are all redundant, now that haddock uses the GHC API
* Detab modules with tabs on 5 lines or fewerIan Lynagh2013-04-064-38/+9
|
* Fix typosGabor Greif2013-04-061-2/+2
|
* Fix stage2 build on ARM.Austin Seipp2013-03-181-0/+4
| | | | | | LLVM supports PIC on ARM from what I can see. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Set the way to 'dynamic' when running GHCi if GHCi is dynamically linkedIan Lynagh2013-03-151-0/+1
|
* By default, use the dynamic way for programs in the GHC treeIan Lynagh2013-03-151-8/+1
| | | | | In particular, this means that GHCi will use DLLs, rather than loading object files itself.
* Remove some commented out SPECIALIZE pragmasIan Lynagh2013-03-101-20/+0
| | | | As far as I can see, they've never been enabled
* Fix pretty printing of human-readable integers (#7750)Patrick Palka2013-03-091-1/+4
|
* Add OSiOS, and define and use platformUsesFrameworks; part of #7720Ian Lynagh2013-03-021-1/+12
|
* Use unicode quote characters in error messages etc; fixes #2507Ian Lynagh2013-02-241-1/+6
| | | | We only use the unicode characters if the locale supports them.
* Remove gblock and gunblockIan Lynagh2013-02-191-20/+4
|
* Add OverloadedLists, allowing list syntax to be overloadedSimon Peyton Jones2013-02-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | This work was all done by Achim Krause <achim.t.krause@gmail.com> George Giorgidze <giorgidze@gmail.com> Weijers Jeroen <jeroen.weijers@uni-tuebingen.de> It allows list syntax, such as [a,b], [a..b] and so on, to be overloaded so that it works for a variety of types. The design is described here: http://hackage.haskell.org/trac/ghc/wiki/OverloadedLists Eg. you can use it for maps, so that [(1,"foo"), (4,"bar")] :: Map Int String The main changes * The ExplicitList constructor of HsExpr gets witness field * Ditto ArithSeq constructor * Ditto the ListPat constructor of HsPat Everything else flows from this.
* Use throwIO rather than throwIan Lynagh2013-01-301-1/+1
|
* Make MonadIO a superclass of ExceptionMonadIan Lynagh2013-01-301-1/+2
|
* Add throwGhcExceptionIO and change a few uses of throwGhcException to use itIan Lynagh2013-01-301-1/+6
|
* StaticFlags code cleanup (fixes #7595)Jan Stolarek2013-01-281-2/+3
| | | | | | | | | Function responsible for parsing the static flags, that were spread across two modules (StaticFlags and StaticFlagParser), are now in one file. This is analogous to dynamic flags parsing, which is also contained within a single module. Signed-off-by: David Terei <davidterei@gmail.com>
* Added support to cross-compile to androidNathan2013-01-241-0/+2
| | | | Signed-off-by: David Terei <davidterei@gmail.com>
* Add support for nto-qnx (BlackBerry 10)Simon Marlow2013-01-231-0/+2
| | | | Submitted by: Stephen Paul Weber <singpolyma@singpolyma.net>
* Ship transformers with GHCIan Lynagh2013-01-021-22/+1
| | | | | This means that we can use the standard MonadIO class, rather than needing our own copy.
* Whitespace only in utils/MonadUtils.hsIan Lynagh2013-01-021-13/+6
|
* Define ListSetOps.getNth, and use itSimon Peyton Jones2013-01-021-0/+18
| | | | | | | | I was tracking down an error looking like Prelude.(!!): index too large which is very unhelpful. This patch replaces at least some uses of (!!) in GHC with getNth, which has a more helpful error message (with DEBUG anyway)
* Rename remaining FastBytes usages to ByteStringIan Lynagh2012-12-144-24/+19
|
* Remove the trivial mkFastStringFastBytes wrapperIan Lynagh2012-12-142-6/+3
|
* Use ByteString rather than FastBytes in BinaryIan Lynagh2012-12-142-32/+16
|
* Remove a couple more FastBytes functionsIan Lynagh2012-12-141-7/+4
|
* Use BS.pack instead of mkFastBytesByteListIan Lynagh2012-12-141-10/+0
|
* Inline some FastBytes/ByteString wrappersIan Lynagh2012-12-142-17/+5
| | | | Working towards removing FastBytes
* Make FastBytes a synonym for ByteStringIan Lynagh2012-12-133-96/+77
| | | | | | | | | | | A step on the way to getting rid of FastBytes slow nofib Compile times look like: -1 s.d. -2.4% +1 s.d. +3.4% Average +0.4% but looking at the times for the longer-running compilations I think the change is just noise.
* Use ByteString rather than FastBytes inside FastZStringIan Lynagh2012-12-122-21/+32
| | | | | | | Slow nofib Compile Times difference looks like just noise: -1 s.d. -2.9% +1 s.d. +2.9% Average -0.1%