summaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
* Mark retry# as returning bottom.Austin Seipp2013-08-101-0/+15
| | | | | | | | | | This change helps the simplifier eliminate unreachable code, since retry# technically doesn't return. This closes ticket #8091. Authored-by: Patrick Palka <patrick@parcs.ath.cx> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Only use real XMM registers when assigning arguments.Geoffrey Mainland2013-08-061-5/+4
| | | | | | | | My original change to the calling convention mistakenly used all 6 XMM registers---which live in the global register table---on x86 (32 bit). This royally screwed up the floating point code generated for that platform because floating point arguments were passed in global registers instead of on the stack!
* Rename SSE -> XMM for consistency.Geoffrey Mainland2013-08-061-13/+13
| | | | | We were using SSE is some places and XMM in others. Better to keep a consistent naming scheme.
* Added support for writing and checking closed type families is hs-boot files.Richard Eisenberg2013-08-0511-42/+110
| | | | | | | | As documented in the users' guide, you can now write type family Foo a where .. in a hs-boot file to declare an abstract closed type family.
* Refactor checking for GADT-like datacons' return typesRichard Eisenberg2013-08-044-79/+98
| | | | | | | | | | | | | This check is somewhat subtle. See Note [Checking GADT return types] in TcTyClsDecls. The new plan is to check *before* desugaring the type from HsType to Type. This avoids problems with the pattern-match in rejigConRes. As a nice side benefit to this, I discovered that Template Haskell splices were a little conservative in their treatment of valid data constructors. (For example, a kind signature in the return type caused failure.) Now, the TH code uses exactly the same function as the "real" code, which is nice. See hsTyGetAppHead_maybe in HsTypes.
* Implement "roles" into GHC.Richard Eisenberg2013-08-0266-993/+2634
| | | | | | | | | | | | | | | | 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.
* Fix Trac #8020.Richard Eisenberg2013-08-025-119/+188
| | | | | | | The solution is to use a different notion of apartness. See http://research.microsoft.com/en-us/um/people/simonpj/papers/ext-f/axioms-extended.pdf for the gory details. Some comments are also in Notes [Compatibility] and [Apartness] in FamInstEnv.
* Add a warning for empty enumerations; fixes #7881Ian Lynagh2013-08-012-2/+58
| | | | We now give a warning about enumerations like [5 .. 3] :: Int8.
* Add NegativeLiterals extensionIan Lynagh2013-07-313-5/+16
| | | | | | | | | | | 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
* Add a warning for overflowing literals; fixes #7895Ian Lynagh2013-07-312-2/+40
|
* Whitespace only in deSugar/MatchLit.lhsIan Lynagh2013-07-311-120/+113
|
* Merge branch 'master' of ssh://darcs.haskell.org/srv/darcs/ghcJan Stolarek2013-07-311-1/+1
|\
| * Fix typosGabor Greif2013-07-311-1/+1
| |
* | Add strength reduction rules (Fixes #7116)Jan Stolarek2013-07-311-6/+27
|/ | | | | This patch adds rules for converting floating point multiplication of the form 2.0 * x and x * 2.0 into addition x + x.
* Rename doDynamicToo to dynamicTooMkDynamicDynFlagsIan Lynagh2013-07-304-15/+16
| | | | | Makes it look less likely that people will confuse what it is for (e.g. #8104).
* Remove an out-of-date comment (see #8101)Ian Lynagh2013-07-281-5/+0
|
* desugar code even when -fno-code is used; fixes #8101Ian Lynagh2013-07-282-8/+3
| | | | | We need to desugar the code, or we don't get the warnings from the desugarer.
* Whitespace only in deSugar/Match.lhsIan Lynagh2013-07-281-198/+191
|
* Whitespace only in basicTypes/RdrName.lhsIan Lynagh2013-07-281-215/+208
|
* Beautify a few Binary instancesIan Lynagh2013-07-272-11/+13
|
* De-orphan a load of Binary instancesIan Lynagh2013-07-279-1079/+1015
|
* Whitespace only in basicTypes/BasicTypes.lhsIan Lynagh2013-07-271-172/+165
|
* Whitespace only in basicTypes/Avail.hsIan Lynagh2013-07-271-19/+12
|
* Remove redundant parenthesesIan Lynagh2013-07-271-1/+1
|
* Use OrdLists when parsing export listsIan Lynagh2013-07-271-19/+19
| | | | No functional changes
* Remove an unnecessary-looking importIan Lynagh2013-07-251-2/+0
|
* Whitespace only in deSugar/Desugar.lhsIan Lynagh2013-07-251-80/+73
|
* Fix a bug in stack layout with safe foreign calls (#8083)Simon Marlow2013-07-247-21/+23
| | | | | | | We weren't properly tracking the number of stack arguments in the continuation of a foreign call. It happened to work when the continuation was not a join point, but when it was a join point we were using the wrong amount of stack fixup.
* Temporarily disable common block elimination; fixes #8083 for nowIan Lynagh2013-07-231-3/+5
|
* Add final remaining bits to fix #7978.Geoffrey Mainland2013-07-221-30/+1
|
* Sync the list of default warnings with reality; fixes #8060.Ian Lynagh2013-07-211-10/+9
|
* Add support for byte endian swapping for Word 16/32/64.Austin Seipp2013-07-1711-26/+97
| | | | | | | | | | | | | * Exposes bSwap{,16,32,64}# primops * Add a new machop: MO_BSwap * Use a Stg implementation (hs_bswap{16,32,64}) for other implementation in NCG. * Generate bswap in X86 NCG for 32 and 64 bits, and for 16 bits, bswap+shr instead of using xchg. * Generate llvm.bswap intrinsics in llvm codegen. Authored-by: Vincent Hanquez <tab@snarc.org> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* adding FastString.string_table to the sharedCAF/Globals.c mechanismNicolas Frisby2013-07-162-7/+68
|
* This reverts commit 163de25813d12764aa5ded1666af7c06fee0d67e and commit ↵Nicolas Frisby2013-07-163-70/+10
| | | | 279ac9f66a83203448b279ea478b2cc1dafbd35d.
* Rename atomicReadMVar and friends to readMVar.Edward Z. Yang2013-07-121-2/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Fix typo in descriptionGabor Greif2013-07-111-1/+1
|
* Implement tryAtomicReadMVar#.Edward Z. Yang2013-07-101-0/+8
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Implement atomicReadMVar, fixing #4001.Edward Z. Yang2013-07-091-0/+9
| | | | | | | | | We add the invariant to the MVar blocked threads queue that threads blocked on an atomic read are always at the front of the queue. This invariant is easy to maintain, since takers are only ever added to the end of the queue. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Disable executable stack for the linker note, fixing #703 (again)Edward Z. Yang2013-07-091-1/+11
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Avoid needlessly splitting a UniqSupply when extracting a Unique (#8041)Patrick Palka2013-07-066-9/+26
| | | | | | | | | | | | In many places, 'splitUniqSupply' + 'uniqFromSupply' is used to split a UniqSupply into a Unique and a new UniqSupply. In such places we should instead use the more efficient and more appropriate 'takeUniqFromSupply' (or equivalent). Not only is the former method slower, it also generates and throws away an extra Unique. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Remove spurious extra brace in LLVM metadataPeter Wortmann2013-07-051-1/+1
| | | | | | | This actually caused a segfault in the optimized stage 2 compiler due to wrong TBAA data. Signed-off-by: David Terei <davidterei@gmail.com>
* Always have LLVM optimize globalsPeter Wortmann2013-07-051-2/+2
| | | | | | | | This pass is pretty cheap and eliminates the aliases generated by the LLVM backend. This in turn is required for dynamic linking to work correctly, as LLVM fails to properly attribute calls to aliased addresses. Signed-off-by: David Terei <davidterei@gmail.com>
* Fix llvm.prefetch instrinct for old LLVM versionsPeter Wortmann2013-07-051-3/+6
| | | | | | Seems the last parameter to llvm.prefectch was added in LLVM 3.0. Signed-off-by: David Terei <davidterei@gmail.com>
* copy the plugin's FastStringTable changes back into the host compilerNicolas Frisby2013-07-043-5/+26
|
* include FastString.string_table in CoreMonad.reinitializeGlobalsNicolas Frisby2013-07-032-6/+45
|
* Comment out a leftover pprTraceGabor Greif2013-07-031-8/+8
|
* Merge branch 'master' of http://darcs.haskell.org/ghcIan Lynagh2013-07-031-0/+3
|\
| * Fix Trac #8028.Richard Eisenberg2013-07-021-0/+3
| | | | | | | | | | Check for an empty list of equations when converting a closed type family from TH to an HsDecl.
* | Fix bumpTickyLitBy[E] on Win64; fixes #7940Ian Lynagh2013-07-021-4/+2
|/ | | | | | A comment claimed that the ticky counters are unsigned longs, but as far as I can see that isn't the case: They're already word-sized values.
* Merge branch 'master' of ssh://darcs.haskell.org/srv/darcs/ghcRichard Eisenberg2013-06-282-75/+52
|\