summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ApiAnnotations : AST version of nested forall loses forall annotationAlan Zimmerman2015-05-2114-77/+477
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When parsing {-# LANGUAGE ScopedTypeVariables #-} extremumNewton :: forall tag. forall tag1. tag -> tag1 -> Int extremumNewton = undefined the parser creates nested HsForAllTy's for the two forall statements. These get flattened into a single one in `HsTypes.mk_forall_ty` This patch removes the flattening, so that API Annotations are not lost in the process. Test Plan: ./validate Reviewers: goldfire, austin, simonpj Reviewed By: simonpj Subscribers: bgamari, mpickering, thomie, goldfire Differential Revision: https://phabricator.haskell.org/D836 GHC Trac Issues: #10278, #10315, #10354, #10363
* Fix binary instance for IfaceLitTySimon Peyton Jones2015-05-201-3/+1
| | | | Thanks to Christiaan Baaj for spotting this.
* Backpack docs: Clarifications from today's Skype call.Edward Z. Yang2015-05-192-16/+28
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Fix error messages from open(Binary)TempFileWithDefaultPermissionsReid Barton2015-05-191-2/+2
| | | | Fixes Trac #10430.
* Revert "compiler: make sure we reject -O + HscInterpreted" (again)Austin Seipp2015-05-1911-124/+12
| | | | | | Apparently my machine likes this commit, but Harbormaster does not? This reverts commit b199536be25ea046079587933cc73d0a948a0626.
* Test Trac #8799, #8555Simon Peyton Jones2015-05-193-0/+19
|
* Add a TODO FIXME w.r.t. D894Austin Seipp2015-05-191-0/+5
| | | | | | | | | | | | As Reid mentioned in a comment on D894, the case fixed by this revision likely isn't really correct, because old ARM binaries could run on newer machines, meaning we need to detect at runtime whether we need a proper barrier. But in the mean time, this actually stops the build from failing - which is better off. So we'll just remember this when we fix it in the future. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Revert "In ghci linker, link against all previous temp sos (#10322)"Austin Seipp2015-05-192-12/+11
| | | | | | This reverts commit b0b11ad93cf8470caed572dc16e5cf91304fa355. It apparently made Harbormaster sad.
* compiler: make sure we reject -O + HscInterpretedAustin Seipp2015-05-1911-12/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using GHCi, we explicitly reject optimization, because the compilers optimization passes can introduce unboxed tuples, which the interpreter is not able to handle. But this goes the other way too: using GHCi on optimized code may cause the optimizer to float out breakpoints that the interpreter introduces. This manifests itself in weird ways, particularly if you as an API client use custom DynFlags to introduce optimization in combination with HscInterpreted. It turns out we weren't checking for consistent DynFlag settings when doing `setSessionDynFlags`, as #10052 showed. While the main driver handled it in `DynFlags` via `parseDynamicFlags`, we didn't check this elsewhere. This does a little refactoring to split out some of the common code, and immunizes the various `DynFlags` utilities in the `GHC` module from this particular bug. We should probably be checking other general invariants too. This fixes #10052, and adds some notes about the behavior in `GHC` and `FloatOut` As a bonus, expose `warningMsg` from `ErrUtils` as a helper since it didn't exist (somehow). Signed-off-by: Austin Seipp <austin@well-typed.com> Reviewed By: edsko Differential Revision: https://phabricator.haskell.org/D727 GHC Trac Issues: #10052
* In ghci linker, link against all previous temp sos (#10322)Reid Barton2015-05-192-11/+12
| | | | | | | | | | | The OS X dlopen() appears to only resolve undefined symbols in the direct dependencies of the shared library it is loading. Reviewed By: trommler, austin Differential Revision: https://phabricator.haskell.org/D852 GHC Trac Issues: #10322
* ghci: Allow :back and :forward to take countsBen Gamari2015-05-194-28/+47
| | | | | | | | | These behave like the count arguments of the gdb `up` and `down` commands, allowing the user to quickly jump around in history. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D853
* Remove unneeded compatibility with LLVM < 3.6Michal Terepeta2015-05-191-35/+9
| | | | | | | | | | | Since GHC requires at least LLVM 3.6, some of the special cases (for, e.g., LLVM 2.8 or 2.9) in the LLVM CodeGen can be simply removed. Reviewed By: rwbarton, austin Differential Revision: https://phabricator.haskell.org/D884 GHC Trac Issues: #10074
* user guide: correct documentation for -Wall (fixes #10386)Alexander Eyers-Taylor2015-05-191-8/+9
| | | | | | | | | | | | | | | This fixes the documentation for -Wall. As was done previously it leaves out deprecated flags and also fwarn-safe and fwarn-unsafe. I don't know if that was intended or not. -fwarn-safe and fwarn-unsafe are not mentioned on the warnings page at all instead they are mentioned in the safe haskell section. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D889 GHC Trac Issues: #10386
* Add regression test for #10110.Peter Trommler2015-05-196-0/+21
| | | | | | | | | | | | | | | | | Module C imports a from Module A and b from module B. B does not import anything from A. So if ld is configured to drop DT_NEEDED tags for libraries it does not depend on no DT_NEEDED tag for the temporary shared object containing module A is recorded in the temp SO containing module B. This leads to an undefined symbol when linking the temp SO for module C. Fixes #10110. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D895 GHC Trac Issues: #10110
* includes/stg/SMP.h: implement simple load_/store_load_barrier on armv6 and olderSergei Trofimovich2015-05-181-0/+4
| | | | | | | | | | | | | | | | | | | | Assuming there is no real SMP systems on these CPUs I've added only compiler barrier (otherwise write_barrier and friends need to be fixed as well). Patch also fixes build breakage reported in #10244. Signed-off-by: Sergei Trofimovich <siarheit@google.com> Reviewers: rwbarton, nomeata, austin Reviewed By: nomeata, austin Subscribers: bgamari, thomie Differential Revision: https://phabricator.haskell.org/D894 GHC Trac Issues: #10244
* Make the "matchable-given" check happen firstSimon Peyton Jones2015-05-181-53/+60
| | | | | | | | | | This change makes the matchable-given check apply uniformly to - constraint tuples - natural numbers - Typeable as well as to vanilla class constraints. See Note [Instance and Given overlap] in TcInteract
* Refactor tuple constraintsSimon Peyton Jones2015-05-1886-1740/+2053
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make tuple constraints be handled by a perfectly ordinary type class, with the component constraints being the superclasses: class (c1, c2) => (c2, c2) This change was provoked by #10359 inability to re-use a given tuple constraint as a whole #9858 confusion between term tuples and constraint tuples but it's generally a very nice simplification. We get rid of - In Type, the TuplePred constructor of PredTree, and all the code that dealt with TuplePreds - In TcEvidence, the constructors EvTupleMk, EvTupleSel See Note [How tuples work] in TysWiredIn. Of course, nothing is ever entirely simple. This one proved quite fiddly. - I did quite a bit of renaming, which makes this patch touch a lot of modules. In partiuclar tupleCon -> tupleDataCon. - I made constraint tuples known-key rather than wired-in. This is different to boxed/unboxed tuples, but it proved awkward to have all the superclass selectors wired-in. Easier just to use the standard mechanims. - While I was fiddling with known-key names, I split the TH Name definitions out of DsMeta into a new module THNames. That meant that the known-key names can all be gathered in PrelInfo, without causing module loops. - I found that the parser was parsing an import item like T( .. ) as a *data constructor* T, and then using setRdrNameSpace to fix it. Stupid! So I changed the parser to parse a *type constructor* T, which means less use of setRdrNameSpace. I also improved setRdrNameSpace to behave better on Exact Names. Largely on priciple; I don't think it matters a lot. - When compiling a data type declaration for a wired-in thing like tuples (,), or lists, we don't really need to look at the declaration. We have the wired-in thing! And not doing so avoids having to line up the uniques for data constructor workers etc. See Note [Declarations for wired-in things] - I found that FunDeps.oclose wasn't taking superclasses into account; easily fixed. - Some error message refactoring for invalid constraints in TcValidity - Haddock needs to absorb the change too; so there is a submodule update
* Delete commented-out lineSimon Peyton Jones2015-05-181-1/+0
|
* Test Trac #10248Simon Peyton Jones2015-05-183-0/+21
|
* Test Trac #10403Simon Peyton Jones2015-05-183-0/+37
|
* Test Trac #10359Simon Peyton Jones2015-05-183-1/+135
|
* CmmCommonBlockElim: Improve hash functionJoachim Breitner2015-05-181-45/+26
| | | | | | | | | | | | | | | | Previously, the hash function used to cut down the number of block comparisons did not take local registers into account, causing far too many similar, but different bocks to be considered candidates for the (expensive!) comparision. Adding register to the hash takes CmmCommonBlockElim's share of the runtime of the example in #10397 from 17% to 2.5%, and eliminates all unwanted hash collisions. This patch also replaces the fancy trie by a plain Data.Map. It turned out to be not performance critical, so this simplifies the code. Differential Revision: https://phabricator.haskell.org/D896
* Greatly speed up nativeCodeGen/seqBlocksJoachim Breitner2015-05-162-19/+38
| | | | | | | | | When working on #10397, I noticed that "reorder" in nativeCodeGen/seqBlocks took more than 60% of the time. With this refactoring, it does not even show up in the profile any more. This fixes #10422. Differential Revision: https://phabricator.haskell.org/D893
* Speed up elimCommonBlocks by grouping blocks also by outgoing labelsJoachim Breitner2015-05-161-31/+112
| | | | | | | | | This is an attempt to improve the situation described in #10397, where the linear scan of possible candidates for commoning up is far too expensive. There is (ever) more room for improvement, but this is a start. Differential Revision: https://phabricator.haskell.org/D892
* Failing test for #10420 using plugins.Edward Z. Yang2015-05-1511-1/+79
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Backpack docs: Rewrite type checking section to have a more concrete plan.Edward Z. Yang2015-05-142-200/+225
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Do not check dir perms when .ghci doesn't existZejun Wu2015-05-142-6/+5
| | | | | | | | | | | | | | | | | | Do not check dir perms when .ghci doesn't exist, otherwise GHCi will print some confusing and useless warnings in some cases (e.g. in travis). This will fix test T8333 and T10408A in travis. T10408A will be a test case to cover this. And T8333 is changed to be not affected by this. Test Plan: chmod o+w ~/.ghc make TESTS="T8333 T10408A T10408B" chmod o-w ~/.ghc Reviewers: austin, nomeata Differential Revision: https://phabricator.haskell.org/D890
* Revert multiple commitsAustin Seipp2015-05-1496-2232/+1770
| | | | | | | | | | | | | | | | | | | | This reverts multiple commits from Simon: - 04a484eafc9eb9f8774b4bdd41a5dc6c9f640daf Test Trac #10359 - a9ccd37add8315e061c02e5bf26c08f05fad9ac9 Test Trac #10403 - c0aae6f699cbd222d826d0b8d78d6cb3f682079e Test Trac #10248 - eb6ca851f553262efe0824b8dcbe64952de4963d Make the "matchable-given" check happen first - ca173aa30467a0b1023682d573fcd94244d85c50 Add a case to checkValidTyCon - 51cbad15f86fca1d1b0e777199eb1079a1b64d74 Update haddock submodule - 6e1174da5b8e0b296f5bfc8b39904300d04eb5b7 Separate transCloVarSet from fixVarSet - a8493e03b89f3b3bfcdb6005795de050501f5c29 Fix imports in HscMain (stage2) - a154944bf07b2e13175519bafebd5a03926bf105 Two wibbles to fix the build - 5910a1bc8142b4e56a19abea104263d7bb5c5d3f Change in capitalisation of error msg - 130e93aab220bdf14d08028771f83df210da340b Refactor tuple constraints - 8da785d59f5989b9a9df06386d5bd13f65435bc0 Delete commented-out line These break the build by causing Haddock to fail mysteriously when trying to examine GHC.Prim it seems.
* Test Trac #10359Simon Peyton Jones2015-05-133-1/+135
|
* Test Trac #10403Simon Peyton Jones2015-05-133-0/+37
|
* Test Trac #10248Simon Peyton Jones2015-05-133-0/+21
|
* Make the "matchable-given" check happen firstSimon Peyton Jones2015-05-131-53/+60
| | | | | | | | | | This change makes the matchable-given check apply uniformly to - constraint tuples - natural numbers - Typeable as well as to vanilla class constraints. See Note [Instance and Given overlap] in TcInteract
* Add a case to checkValidTyConSimon Peyton Jones2015-05-131-0/+3
| | | | | | | | | Apparently when Haddock'ing, we check GHC.Prim. So checkValidTyCon must not crash when dealing with PrimTyCons; and it was doing so in dataConStupidTheta. The fix is easy, but I'm puzzled about why Haddock needs to typecheck GHC.Prim.
* Update haddock submoduleSimon Peyton Jones2015-05-131-0/+0
| | | | | | | | The location of setRdrNameSpace has changed in GHC. (Sadly, the build still fails with a tyConStupidTheta failure in a haddock invocation; I have no idea why. But at least Haddock itself builds.)
* Separate transCloVarSet from fixVarSetSimon Peyton Jones2015-05-132-7/+22
| | | | | | I wasn't clear about the distinction before, and that led to a bug when I refactored FunDeps.oclose to use transCloVarSet; it should use fixVarSet.
* Fix imports in HscMain (stage2)Simon Peyton Jones2015-05-131-3/+1
|
* Two wibbles to fix the buildSimon Peyton Jones2015-05-132-2/+8
| | | | | | | ...following the constraint-tuple patch. * There was interaction with the recent Safe Haskell change * Haddock comoplained about constraint tuples defined but not used
* Change in capitalisation of error msgSimon Peyton Jones2015-05-131-1/+1
| | | | | -outofmem.exe: Out of memory +outofmem.exe: out of memory
* Refactor tuple constraintsSimon Peyton Jones2015-05-1383-1705/+1947
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make tuple constraints be handled by a perfectly ordinary type class, with the component constraints being the superclasses: class (c1, c2) => (c2, c2) This change was provoked by #10359 inability to re-use a given tuple constraint as a whole #9858 confusion between term tuples and constraint tuples but it's generally a very nice simplification. We get rid of - In Type, the TuplePred constructor of PredTree, and all the code that dealt with TuplePreds - In TcEvidence, the constructors EvTupleMk, EvTupleSel See Note [How tuples work] in TysWiredIn. Of course, nothing is ever entirely simple. This one proved quite fiddly. - I did quite a bit of renaming, which makes this patch touch a lot of modules. In partiuclar tupleCon -> tupleDataCon. - I made constraint tuples known-key rather than wired-in. This is different to boxed/unboxed tuples, but it proved awkward to have all the superclass selectors wired-in. Easier just to use the standard mechanims. - While I was fiddling with known-key names, I split the TH Name definitions out of DsMeta into a new module THNames. That meant that the known-key names can all be gathered in PrelInfo, without causing module loops. - I found that the parser was parsing an import item like T( .. ) as a *data constructor* T, and then using setRdrNameSpace to fix it. Stupid! So I changed the parser to parse a *type constructor* T, which means less use of setRdrNameSpace. I also improved setRdrNameSpace to behave better on Exact Names. Largely on priciple; I don't think it matters a lot. - When compiling a data type declaration for a wired-in thing like tuples (,), or lists, we don't really need to look at the declaration. We have the wired-in thing! And not doing so avoids having to line up the uniques for data constructor workers etc. See Note [Declarations for wired-in things] - I found that FunDeps.oclose wasn't taking superclasses into account; easily fixed. - Some error message refactoring for invalid constraints in TcValidity
* Delete commented-out lineSimon Peyton Jones2015-05-131-1/+0
|
* Revert D727Austin Seipp2015-05-1211-124/+12
| | | | | | | | This caused print007 to fail, so I guess I botched this more than I thought. This is a combination of reverting: "Fix build breakage from 9736c042", commit f35d621. "compiler: make sure we reject -O + HscInterpreted", commit 9736c04.
* Fix fragile T9579 testsJavran Cheng2015-05-1310-73/+48
| | | | | | | | | | | | | | | | | | | | | | | | Fix fragile tests according to comment 13 of #9579 (by @bherzog) Done by capturing stderr and replace `xx bytes` with `NUM bytes` (literal). Some numbers like `(1 MB)` would still remain, but I think it's safe to assume the actual difference in bytes (on different architectures) is too small to have an effect on the rounded megabyte value. Test Plan: validate Reviewers: erikd, austin Reviewed By: erikd, austin Subscribers: erikd, bgamari, thomie, bherzog Differential Revision: https://phabricator.haskell.org/D882 GHC Trac Issues: #9579
* Update Safe Haskell documentation.David Terei2015-05-121-264/+398
| | | | | | Biggest change is to document new overlapping instances behavior. We also add back in the explanation of GND being restricted, and improve the docs across the board.
* Update some tests for recent Safe Haskell change.David Terei2015-05-125-13/+13
|
* Backpack docs: Consistently italicize metavariables.Edward Z. Yang2015-05-122-85/+85
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Turn off warnings when compiling boolFormulaAlan Zimmerman2015-05-124-66/+137
| | | | | | | | | | | | | | | | | | | | | | | Summary: There is a problem where harbourmaster builds complain about a bad boolFormula.stderr ghc-api/annotations boolFormula [bad stderr] (normal) The problem does not occur for a local build on my box This patch turns off warnings for this test, to get rid of the stderr issue. Test Plan: ./validate Reviewers: hvr, austin Reviewed By: austin Subscribers: bgamari, thomie, hvr Differential Revision: https://phabricator.haskell.org/D888
* Fix weird behavior of -ignore-dot-ghci and -ghci-sciptZejun Wu2015-05-128-40/+63
| | | | | | | | | | | | * Make `-ghci-script` be executed in the order they are specified; * Make `-ignore-dot-ghci` only ignores the default .ghci files but still execute the scripts passed by `-ghci-script`. Reviewed By: simonmar, austin Differential Revision: https://phabricator.haskell.org/D887 GHC Trac Issues: #10408
* We need an empty boolFormula.stderrAlan Zimmerman2015-05-121-0/+0
| | | | Otherwise the test sometimes fails.
* Use fmap instead of <$> (Fixes #10407)Erik de Castro Lopo2015-05-121-3/+3
| | | | | | | | | | | | | | | | | The <$> operator is only available in the standard Prelude in ghc 7.10 and later. Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com> Test Plan: build with ghc-7.6 Reviewers: dterei, ezyang, austin Subscribers: bgamari, thomie Differential Revision: https://phabricator.haskell.org/D886 GHC Trac Issues: #10407
* Make template-haskell build with GHC 7.6, fixes bootstrap build.Edward Z. Yang2015-05-113-7/+11
| | | | | | | | | | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate on 7.6 Reviewers: austin, goldfire Subscribers: bgamari, thomie Differential Revision: https://phabricator.haskell.org/D885