summaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Detab DataConEdward Z. Yang2014-09-251-353/+347
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Remove a few redundant `-fno-warn-tabs`sHerbert Valerio Riedel2014-09-253-18/+0
|
* `M-x delete-trailing-whitespace` & `M-x untabify`Herbert Valerio Riedel2014-09-249-125/+125
|
* Update Cabal submodule & ghc-pkg to use new module re-export typesEdward Z. Yang2014-09-241-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The main change is that Cabal changed the representation of module re-exports to distinguish reexports in source .cabal files versus re-exports in installed package registraion files. Cabal now also does the resolution of re-exports to specific installed packages itself, so ghc-pkg no longer has to do this. This is a cleaner design overall because re-export resolution can fail so it is better to do it during package configuration rather than package registration. It also simplifies the re-export representation that ghc-pkg has to use. Add extra ghc-pkg sanity check for module re-exports and duplicates For re-exports, check that the defining package exists and that it exposes the defining module (or for self-rexport exposed or hidden modules). Also check that the defining package is actually a direct or indirect dependency of the package doing the re-exporting. Also add a check for duplicate modules in a package, including re-exported modules. Test Plan: So far the sanity checks are totally untested. Should add some test case to make sure the sanity checks do catch things correctly, and don't ban legal things. Reviewers: austin, duncan Subscribers: angerman, simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D183 GHC Trac Issues:
* Change all hashbangs to /usr/bin/env (#9057)Thomas Miedema2014-09-231-1/+1
| | | | | | | | | | | | | | | | | | Summary: ``` git grep -l '#!' | xargs sed -i 's|#!.*/bin/\([^ ]*\)$|#!/usr/bin/env \1|' ``` and some manual tweaking Test Plan: harbormaster Reviewers: austin Subscribers: hvr, simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D237 GHC Trac Issues: #9057
* Delete all /* ! __GLASGOW_HASKELL__ */ codeThomas Miedema2014-09-2310-197/+2
| | | | | | | | | | | | | | | | | Summary: ``` git grep -l '\(#ifdef \|#if defined\)(\?__GLASGOW_HASKELL__)\?' ``` Test Plan: validate Reviewers: rwbarton, hvr, austin Reviewed By: rwbarton, hvr, austin Subscribers: rwbarton, simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D218
* Delete hack when takeDirectory returns ""Thomas Miedema2014-09-231-5/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: Since commits 8fe1f8 and bb6731 in the filepath packages (ticket #2034, closed in 2010), takeDirectory "foo" returns ".", and not "", so this check is no longer needed. Other commits: * Remove trailing whitespace * Update comments for #2278 Test Plan: harbormaster Reviewers: austin Reviewed By: austin Subscribers: simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D213 GHC Trac Issues: #2034
* Ensure that loop breakers are computed when glommingSimon Peyton Jones2014-09-231-12/+30
| | | | | | | | | | | | | | | | | This patch fixes Trac #9583, a loop in the simplifier. I thought this was going to be very complicated but it turned out to be very simple! The occurrence analyser does something called "glomming" if the application of imported RULES means that something that didn't look recursive becomes recursive. See `Note [Glomming]` in `OccurAnal`. Under these circumstances we group all the top-level bindings into a single massive `Rec`. But, crucially, I failed to repeat the occurrence analysis on this glommed set of bindings. That means that we weren't establishing the right loop breakers (indeed there were no loop breakers whatsoever), and that led immediately to the loop. The only surprising this is that it didn't happen before.
* Export `Monoid(..)`/`Foldable(..)`/`Traversable(..)` from PreludeHerbert Valerio Riedel2014-09-2113-4/+32
| | | | | | | | | | | | | | | This finally exposes also the methods of these 3 classes in the Prelude in order to allow to define basic class instances w/o needing imports. This almost completes the primary goal of #9586 NOTE: `fold`, `foldl'`, `foldr'`, and `toList` are not exposed yet, as they require upstream fixes for at least `containers` and `bytestring`, and are not required for defining basic instances. Reviewed By: ekmett, austin Differential Revision: https://phabricator.haskell.org/D236
* Change linker message verbosity to `-v2` (re #7863)Herbert Valerio Riedel2014-09-201-1/+1
| | | | | | | | | | | | | | | | With this change, the linker status logging output such as Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. is suppressed unless verbosity level is `-v2` or higher. This is done to reduce the compiler message noise when TH is involved, which can reduce the visibiliy of compile warnings. Reviewed By: ekmett, austin Differential Revision: https://phabricator.haskell.org/D232
* TyposKrzysztof Gogolewski2014-09-192-3/+3
|
* Clean up Coercible handling, and interaction of data families with newtypesSimon Peyton Jones2014-09-1912-217/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes Trac #9580, in which the Coercible machinery succeeded even though the relevant data constructor was not in scope. As usual I got dragged into a raft of refactoring changes, all for the better. * Delete TcEvidence.coercionToTcCoercion (now unused) * Move instNewTyConTF_maybe, instNewTyCon_maybe to FamInst, and rename them to tcInstNewTyConTF_maybe, tcInstNewTyCon (They both return TcCoercions.) * tcInstNewTyConTF_maybe also gets more convenient type, which improves TcInteract.getCoercibleInst * Define FamInst.tcLookupDataFamInst, and use it in TcDeriv, (as well as in tcInstNewTyConTF_maybe) * Improve error report for Coercible errors, when data familes are involved Another use of tcLookupDataFamInst * In TcExpr.tcTagToEnum, use tcLookupDataFamInst to replace local hacky code * Fix Coercion.instNewTyCon_maybe and Type.newTyConInstRhs to deal with eta-reduced newtypes, using (new) Type.unwrapNewTyConEtad_maybe and (new) Type.applyTysX Some small refactoring of TcSMonad.matchFam.
* White space onlySimon Peyton Jones2014-09-191-2/+2
|
* Define Util.leLength :: [a] -> [b] -> BoolSimon Peyton Jones2014-09-191-1/+9
|
* Fix garbled comment wordingSimon Peyton Jones2014-09-191-2/+3
| | | | Thanks to Gabor for pointing this out
* Use mapAccumL (refactoring only)Simon Peyton Jones2014-09-191-8/+1
| | | | Fixes Trac #9529
* Increase -fcontext-stack=N default to 100Simon Peyton Jones2014-09-191-1/+2
| | | | This addresses Trac #5395
* Revert accidental wip/generics-propeq-conservative mergeHerbert Valerio Riedel2014-09-191-18/+16
| | | | | | | | | | | | | | | | This commit reverts the commits e12a6a8 Propositional equality for Datatype meta-information 0a8e6fc Make constructor metadata parametrized (with intended parameter <- datatype) f097b77 Implement sameConstructor cc618e6 get roles right and fix a FIXME 79c7125 Actually parametrize the Constructor with the Datatype 7bd4bab Supply a reasonable name (should be derived from d_name tho) 09fcd70 Use 'd_name' as the name (should be derived from d_name tho) 4d90e44 Add default case (fixes -Werror) and effectively resets ghc.git to the state it was at commit 8c79dcb4dc2c6b8b663fa0c2e61d40d0ac0e9996