summaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "Rename _closure to _static_closure, apply naming consistently."Edward Z. Yang2014-10-204-9/+9
| | | | | | | This reverts commit 35672072b4091d6f0031417bc160c568f22d0469. Conflicts: compiler/main/DriverPipeline.hs
* Indentation and non-semantic changes only.Edward Z. Yang2014-10-195-103/+107
| | | | | | | | | | | | | | | Summary: Get these lines fitting in 80 columns, and replace ptext (sLit ...) with text Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonmar, austin Subscribers: thomie, carter, ezyang, simonmar Differential Revision: https://phabricator.haskell.org/D342
* Remove obsolete Data.OldTypeable (#9639)Michael Karg2014-10-184-178/+6
| | | | | | | | | | | | This finally removes the `Data.OldTypeable` module (which has been deprecated in 7.8), from `base`, compiler and testsuite. The deprecated `Typeable{1..7}` aliases in `Data.Typeable` are not removed yet in order to give existing code a bit more time to adapt. Reviewed By: hvr, dreixel Differential Revision: https://phabricator.haskell.org/D311
* Implement optimized NCG `MO_Ctz W64` op for i386 (#9340)Herbert Valerio Riedel2014-10-181-9/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is an optimization to the CTZ primops introduced for #9340 Previously we called out to `hs_ctz64`, but we can actually generate better hand-tuned code while avoiding the FFI ccall. With this patch, the code {-# LANGUAGE MagicHash #-} module TestClz0 where import GHC.Prim ctz64 :: Word64# -> Word# ctz64 x = ctz64# x results in the following assembler generated by NCG on i386: TestClz.ctz64_info: movl (%ebp),%eax movl 4(%ebp),%ecx movl %ecx,%edx orl %eax,%edx movl $64,%edx je _nAO bsf %ecx,%ecx addl $32,%ecx bsf %eax,%eax cmovne %eax,%ecx movl %ecx,%edx _nAO: movl %edx,%esi addl $8,%ebp jmp *(%ebp) For comparision, here's what LLVM 3.4 currently generates: 000000fc <TestClzz_ctzz64_info>: fc: 0f bc 45 04 bsf 0x4(%ebp),%eax 100: b9 20 00 00 00 mov $0x20,%ecx 105: 0f 45 c8 cmovne %eax,%ecx 108: 83 c1 20 add $0x20,%ecx 10b: 8b 45 00 mov 0x0(%ebp),%eax 10e: 8b 55 08 mov 0x8(%ebp),%edx 111: 0f bc f0 bsf %eax,%esi 114: 85 c0 test %eax,%eax 116: 0f 44 f1 cmove %ecx,%esi 119: 83 c5 08 add $0x8,%ebp 11c: ff e2 jmp *%edx Reviewed By: austin Auditors: simonmar Differential Revision: https://phabricator.haskell.org/D163
* Avoid printing uniques in specialization rulesJoachim Breitner2014-10-171-1/+5
| | | | | | | | | | Akio found an avoidable cause of non-determinisim: The names of RULES generated by Specialise had uniques in them: "SPEC $cshowsPrec_a2QX @ [GHC.Types.Char]" [ALWAYS] forall ... By using showSDocForUser instead of showSDocDump when building the rule name, this is avoided: "SPEC $cshowsPrec @ [Char]" [ALWAYS] forall ... See #4012, comments 61ff.
* Fix comment typos: lll -> ll, THe -> TheJan Stolarek2014-10-148-8/+8
|
* seqDmdType needs to seq the DmdEnv as wellJoachim Breitner2014-10-131-2/+6
| | | | | otherwise this can retain large lazy calculations. This fixed one space leak pointed out in #9675.
* Use Data.Map.mergeWithKeyJoachim Breitner2014-10-082-8/+1
| | | | | | | | | | Summary: now that we can rely on having containers > 0.5. Reviewers: austin Subscribers: thomie, carter, ezyang, simonmar Differential Revision: https://phabricator.haskell.org/D321
* Code size micro-optimizations in the X86 backendReid Barton2014-10-071-1/+34
| | | | | | | | | | | | | | | | | | | | | Summary: Carter Schonwald suggested looking for opportunities to replace instructions in GHC's output by equivalent ones that are shorter, as recommended by the Intel optimization manuals. This patch reduces the module sizes as reported by nofib by about 1.5% on x86_64. Test Plan: Built an i386 cross-compiler and ran the test suite; the same (rather large) set of tests failed before and after this commit. Will let Harbormaster validate on x86_64. Reviewers: austin Subscribers: thomie, carter, ezyang, simonmar Differential Revision: https://phabricator.haskell.org/D320
* Clean up and remove todo.Joel Burget2014-10-072-21/+24
| | | | | | | | | | | | | | | | Summary: The code is equivalent, just formatted nicely and without the enthusiastic message to clean it up. Test Plan: None Reviewers: austin Reviewed By: austin Subscribers: simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D307
* Add support for LINE pragma in template-haskellEric Mertens2014-10-071-39/+58
| | | | | | | | | | | | | | | | | | Summary: Provide a way to generate {-# LINE #-} pragmas when generating Decs in Template Haskell. This allows more meaningful line numbers to be reported in compile-time errors for dynamically generated code. Test Plan: Run test suite Reviewers: austin, hvr Reviewed By: austin Subscribers: hvr, simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D299
* Remove unused hashName declarationJack Henahan2014-10-071-6/+1
| | | | | | | | | | | | | | | | | | Summary: With the exception of the todo added in 2012, this function has been untouched since 2007. It is not used anywhere else in GHC, so it appears to be safe to remove. The accompanying comment refers to hashExpr, which I couldn't find anywhere in the sources, either. Test Plan: Removed declaration and export. Compiler built succesfully. No test cases exist to fail, and no other module appears to use it. Reviewers: thomie, austin Reviewed By: thomie, austin Subscribers: simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D261
* Remove RAWCPP_FLAGSThomas Miedema2014-10-071-2/+2
| | | | | | | | | | | | | | | | | | | | Summary: #9094 mentions to "remove the RAW_CPP bits from the ghc build system because they're not longer needed", "once the CPP settings ticket is merged #8683" #8683 was merged with 34f7e9a3c99850859901ca74370f55f1d4e2279a, Phab:D26. Test Plan: harbormaster Reviewers: carter, austin Reviewed By: austin Subscribers: simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D240 GHC Trac Issues: #9094
* Fix a typo in an error messageGabor Greif2014-10-071-1/+1
|
* Merge branch 'master' of http://git.haskell.org/ghcSimon Peyton Jones2014-10-072-48/+74
|\
| * Implement `MIN_VERSION_GLASGOW_HASKELL()` macroHerbert Valerio Riedel2014-10-052-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This exposes the `cProjectPatchLevel{1,2}` value at the CPP level to allow it to be used in CPP conditionals. Concretely, GHC 7.10.2.20150623 would result in #define __GLASGOW_HASKELL__ 710 #define __GLASGOW_HASKELL_PATCHLEVEL1__ 2 #define __GLASGOW_HASKELL_PATCHLEVEL2__ 20150623 while GHC 7.10.3 results in #define __GLASGOW_HASKELL__ 710 #define __GLASGOW_HASKELL_PATCHLEVEL1__ 3 and finally GHC 7.9.20141009 results in #define __GLASGOW_HASKELL__ 709 #define __GLASGOW_HASKELL_PATCHLEVEL1__ 20141009 As it's error-prone to properly express CPP conditionals for testing GHC multi-component versions, a new macro `MIN_VERSION_GLASGOW_HASKELL()` is provided (also via the new CPP include file `ghcversion.h`) Finally, in order to make it easier to define the new CPP macro `MIN_VERSION_GLASGOW_HASKELL()`, a new default-included `include/ghcversion.h` is used for the new CPP definitions. Reviewed By: ekmett, austin, #ghc Differential Revision: https://phabricator.haskell.org/D66
| * ghc.mk: fix list for dll-split on GHCi-less buildsSergei Trofimovich2014-10-041-42/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To reproduce build failure it's enough to try to build GHC on amd64 with the following setup: $ cat mk/build.mk # for #9552 GhcWithInterpreter = NO It gives: Reachable modules from DynFlags out of date Please fix compiler/ghc.mk, or building DLLs on Windows may break (#7780) Redundant modules: Bitmap BlockId ... <list of 42 modules> <make error> dll-split among other things makes sure all mentioned modules are used by DynFlags. '#ifdef GHCI' keeps is from happening. Patch moves those 42 modules under 'GhcWithInterpreter' guard. Fixes Issue #9552 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* | Use correct precedence when printing contexts with class operatorsSimon Peyton Jones2014-10-071-1/+4
|/ | | | Fixes Trac #9658
* Use dropWhileEndLE p instead of reverse . dropWhile p . reverseDavid Feuer2014-10-022-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Using `dropWhileEndLE` tends to be faster and easier to read than the `reverse . dropWhile p . reverse` idiom. This also cleans up some other, nearby, messes. Fix #9616 (incorrect number formatting potentially leading to incorrect numbers in output). Test Plan: Run validate Reviewers: thomie, rwbarton, nomeata, austin Reviewed By: nomeata, austin Subscribers: simonmar, ezyang, carter, thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D259 GHC Trac Issues: #9623, #9616 Conflicts: compiler/basicTypes/OccName.lhs
* Revert "Use dropWhileEndLE p instead of reverse . dropWhile p . reverse"Austin Seipp2014-10-022-16/+2
| | | | This reverts commit 2a8856884de7d476e26b4ffa829ccb3a14d6f63e.
* Rename _closure to _static_closure, apply naming consistently.Edward Z. Yang2014-10-014-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In preparation for indirecting all references to closures, we rename _closure to _static_closure to ensure any old code will get an undefined symbol error. In order to reference a closure foobar_closure (which is now undefined), you should instead use STATIC_CLOSURE(foobar). For convenience, a number of these old identifiers are macro'd. Across C-- and C (Windows and otherwise), there were differing conventions on whether or not foobar_closure or &foobar_closure was the address of the closure. Now, all foobar_closure references are addresses, and no & is necessary. CHARLIKE/INTLIKE were not changed, simply alpha-renamed. Part of remove HEAP_ALLOCED patch set (#8199) Depends on D265 Signed-off-by: Edward Z. Yang <ezyang@mit.edu> Test Plan: validate Reviewers: simonmar, austin Subscribers: simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D267 GHC Trac Issues: #8199
* Properly generate info tables for static closures in C--.Edward Z. Yang2014-10-012-3/+5
| | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, we assumed all objects declared in C-- were not-static, even ones which were CONSTR_NOCAF_STATIC. This used to be harmless, but now we need this information to be correct. Part of remove HEAP_ALLOCED patch set (#8199) Depends on D264 Signed-off-by: Edward Z. Yang <ezyang@mit.edu> Test Plan: validate Reviewers: simonmar, austin Subscribers: simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D265 GHC Trac Issues: #8199
* BC-breaking changes to C-- CLOSURE syntax.Edward Z. Yang2014-10-013-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, there were two variants of CLOSURE in C--: - Top-level CLOSURE(foo_closure, foo, lits...), which defines a new static closure and gives it a name, and - Array CLOSURE(foo, lits...), which was used for the static char and integer arrays. They used the same name, were confusing, and didn't even generate the correct internal label representation! So now, we have two new forms: - Top-level CLOSURE(foo, lits...) which automatically generates foo_closure (along with foo_info, which we were doing already) - Array ANONYMOUS_CLOSURE(foo, lits...) which doesn't generate a foo_closure identifier. Part of remove HEAP_ALLOCED patch set (#8199) Signed-off-by: Edward Z. Yang <ezyang@mit.edu> Test Plan: validate Reviewers: simonmar, austin Subscribers: simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D264 GHC Trac Issues: #8199
* Place static closures in their own section.Edward Z. Yang2014-10-0110-4/+19
| | | | | | | | | | | | | | | | | | | | | | | Summary: The primary reason for doing this is assisting debuggability: if static closures are all in the same section, they are guaranteed to be adjacent to one another. This will help later when we add some code that takes section start/end and uses this to sanity-check the sections. Part of remove HEAP_ALLOCED patch set (#8199) Signed-off-by: Edward Z. Yang <ezyang@mit.edu> Test Plan: validate Reviewers: simonmar, austin Subscribers: simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D263 GHC Trac Issues: #8199
* Use dropWhileEndLE p instead of reverse . dropWhile p . reverseDavid Feuer2014-10-012-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Using `dropWhileEndLE` tends to be faster and easier to read than the `reverse . dropWhile p . reverse` idiom. This also cleans up some other, nearby, messes. Fix #9616 (incorrect number formatting potentially leading to incorrect numbers in output). Test Plan: Run validate Reviewers: thomie, rwbarton, nomeata, austin Reviewed By: nomeata, austin Subscribers: simonmar, ezyang, carter, thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D259 GHC Trac Issues: #9623, #9616 Conflicts: compiler/basicTypes/OccName.lhs
* [ci skip] Kill unused count_bytes scriptAustin Seipp2014-10-011-43/+0
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* [ci skip] Kill tabs in md5.hAustin Seipp2014-10-011-3/+3
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* [ci skip] compiler: Kill last remaining tabs in CallArityAustin Seipp2014-10-011-2/+2
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Simplify mergeSATInfo by using zipWithDavid Feuer2014-10-011-9/+18
| | | | Closes #9561.
* Don't use newSysLocal etc for CoercibleSimon Peyton Jones2014-10-011-50/+38
| | | | | The code is smaller and simpler now. Thanks to Richard for raising the question.
* Comments about the let/app invariantSimon Peyton Jones2014-10-011-11/+18
|
* Fix bogus commentSimon Peyton Jones2014-10-011-2/+2
|
* Extend `Foldable` class with `length` and `null` methodsHerbert Valerio Riedel2014-09-281-1/+1
| | | | | | | | | | | | | This completes the `Foldable` class by two important operations which this way can be optimised for the underlying structure more easily. A minor fix for the `containers` submodule was needed to due name clash Addresses #9621 Reviewed By: ekmett, dfeuer, austin Differential Revision: https://phabricator.haskell.org/D250
* Stop exporting, and stop using, functions marked as deprecatedThomas Miedema2014-09-2711-16/+13
| | | | | | | | | | | | | | | | | | | | | | | | | Don't export `getUs` and `getUniqueUs`. `UniqSM` has a `MonadUnique` instance: instance MonadUnique UniqSM where getUniqueSupplyM = getUs getUniqueM = getUniqueUs getUniquesM = getUniquesUs Commandline-fu used: git grep -l 'getUs\>' | grep -v compiler/basicTypes/UniqSupply.lhs | xargs sed -i 's/getUs/getUniqueSupplyM/g git grep -l 'getUniqueUs\>' | grep -v combiler/basicTypes/UniqSupply.lhs | xargs sed -i 's/getUniqueUs/getUniqueM/g' Follow up on b522d3a3f970a043397a0d6556ca555648e7a9c3 Reviewed By: austin, hvr Differential Revision: https://phabricator.haskell.org/D220
* Don't re-export `Alternative(..)` from Control.Monad (re #9586)Herbert Valerio Riedel2014-09-265-15/+3
| | | | | | | | | | | | | | | | | This was done in d94de87252d0fe2ae97341d186b03a2fbe136b04 to avoid orphans but since a94dc4c3067c6a0925e2e39f35ef0930771535f1 moved `Alternative` into GHC.Base, this isn't needed anymore. This is important, as otherwise this would require a non-neglectable amount of `Control.Monad hiding ((<|>), empty)` imports in user code. The Haddock submodule is updated as well Test Plan: partial local ./validate --fast, let Harbormaster doublecheck it Reviewed By: ekmett, austin Differential Revision: https://phabricator.haskell.org/D248
* CommentsSimon Peyton Jones2014-09-262-2/+3
|
* De-tabify and remove trailing whitespaceSimon Peyton Jones2014-09-2626-3525/+3366
|
* Complain about illegal type literals in renamer, not parserSimon Peyton Jones2014-09-264-20/+4
| | | | | | A premature complaint was causing Trac #9634. Acutally this change also simplifies the lexer and eliminates duplication. (The renamer was already making the check, as it happens.)
* Improve error messages from functional dependenciesSimon Peyton Jones2014-09-265-99/+175
| | | | | | | | | | | | Reponding to Trac #9612: * Track the CtOrigin of a Derived equality, arising from a functional dependency * And report it clearly in the error stream This relies on a previous commit, in which I stop dropping Derived insolubles on the floor.
* Wibble to implicit-parameter error messageSimon Peyton Jones2014-09-261-1/+1
|
* Do not discard insoluble Derived constraintsSimon Peyton Jones2014-09-262-25/+37
| | | | | | | | | | | | | | | | | | This is preparing for a fix to Trac #9612. The idea is that insoluble constraints are nice solid errors that we should not discard before we have a chance to report them. So TcRnTypes.dropDerivedWC now keeps insoluble Derived constrains, and instead TcSimplify.solve_wanteds filters them out We get somewhat better error message for kind-equality failures too. A slight downside is that to avoid *duplicate* kind-equality failures when we float a kind-incompatible equality (e.g. alpha:* ~ Int#), I've disabled constraint-floating when there are insolubles. But that in turn makes a handful of error messages a little less informative; good examples are mc21, mc22, mc25. But I am re-jigging the constraint floating machinery in another branch, which will make this go back to the way it was before.
* Defer errors in derived instancesSimon Peyton Jones2014-09-264-31/+32
| | | | Fixes Trac #9576. Turned out to be pretty easy.
* Delete hack that was once needed to fix the buildThomas Miedema2014-09-253-3/+7
| | | | | | | | | | | | | | | | | Summary: Introduced in 6c7b41cc2b24f533697a62bf1843507ae043fc97. I checked the rest of that commit, and this is all that was left to revert. Test Plan: x Reviewers: ezyang, austin Reviewed By: ezyang, austin Subscribers: simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D241
* types: detabify/dewhitespace UnifyAustin Seipp2014-09-251-179/+172
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* [ci skip] typecheck: detabify/dewhitespace TcUnifyAustin Seipp2014-09-251-152/+146
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* [ci skip] typecheck: detabify/dewhitespace TcTyDeclsAustin Seipp2014-09-251-32/+26
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* [ci skip] typecheck: detabify/dewhitespace TcPatAustin Seipp2014-09-251-340/+334
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* [ci skip] typecheck: detabify/dewhitespace TcInstDeclsAustin Seipp2014-09-251-60/+54
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* [ci skip] simplCore: detabify/dewhitespace CoreMonadAustin Seipp2014-09-251-217/+211
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* [ci skip] iface: detabify/dewhitespace IfaceSynAustin Seipp2014-09-251-46/+40
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>