summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* configure: Accept *-msys as a Windows OS in a tripleBen Gamari2017-10-041-1/+1
|
* rts: Print newline after "Stack trace:" on barfBen Gamari2017-10-031-1/+1
| | | | [skip ci]
* user-guide: Mention COMPLETE pragma in release notesBen Gamari2017-10-031-0/+4
| | | | | | | | | | Reviewers: austin Subscribers: rwbarton, thomie GHC Trac Issues: #14305 Differential Revision: https://phabricator.haskell.org/D4059
* base: Remove deprecated Chan combinatorsBen Gamari2017-10-032-23/+5
| | | | | | | | | | | | | | | Removes isEmptyChan and unGetChan, which have been deprecated for a very long time. See #13561. Test Plan: Validate Reviewers: austin, hvr Subscribers: rwbarton, thomie GHC Trac Issues: #13561 Differential Revision: https://phabricator.haskell.org/D4060
* Don't pass HscEnv to functions in the Hsc monadDouglas Wilson2017-10-031-45/+53
| | | | | | | | | | | | | | | | | | | | `Hsc` is a reader monad in `HscEnv`. Several functions in HscMain were taking parameters of type `HscEnv` or `DynFlags`, and returning values of type `Hsc a`. This patch removes those parameters in favour of asking them from the context. This removes a source of confusion and should make refactoring a bit easier. Test Plan: ./validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4061
* Include libraries which fill holes as deps when linking.Edward Z. Yang2017-10-0312-1/+93
| | | | | | | | | | | | | | | | | | | Fixes the issue reported at https://github.com/haskell/cabal/issues/4755 and fixes #14304 in the GHC tracker. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: bgamari, austin, goldfire Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #14304 Differential Revision: https://phabricator.haskell.org/D4057
* genapply: Explicitly specify argumentsMoritz Angermann2017-10-031-1/+1
| | | | | | | | | | | | | | | | | We seem to not be feeding either live registers or the arguments when generating the fast call in genapply. This results in strange signature missmatches between the callee (expecting no registers) and the call site, expecting to pass registers. Test Plan: validate Reviewers: bgamari, simonmar, austin Reviewed By: simonmar Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4029
* base: Add missing @since annotations in GHC.TypeNatsBen Gamari2017-10-031-0/+14
| | | | [skip ci]
* Implement Div, Mod, and Log for type-level nats.Iavor Diatchki2017-10-037-15/+206
| | | | | | | | | | Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: RyanGlScott, dfeuer, adamgundry, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4002
* Track the order of user-written tyvars in DataConRyan Scott2017-10-0323-203/+493
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After typechecking a data constructor's type signature, its type variables are partitioned into two distinct groups: the universally quantified type variables and the existentially quantified type variables. Then, when prompted for the type of the data constructor, GHC gives this: ```lang=haskell MkT :: forall <univs> <exis>. (...) ``` For H98-style datatypes, this is a fine thing to do. But for GADTs, this can sometimes produce undesired results with respect to `TypeApplications`. For instance, consider this datatype: ```lang=haskell data T a where MkT :: forall b a. b -> T a ``` Here, the user clearly intended to have `b` be available for visible type application before `a`. That is, the user would expect `MkT @Int @Char` to be of type `Int -> T Char`, //not// `Char -> T Int`. But alas, up until now that was not how GHC operated—regardless of the order in which the user actually wrote the tyvars, GHC would give `MkT` the type: ```lang=haskell MkT :: forall a b. b -> T a ``` Since `a` is universal and `b` is existential. This makes predicting what order to use for `TypeApplications` quite annoying, as demonstrated in #11721 and #13848. This patch cures the problem by tracking more carefully the order in which a user writes type variables in data constructor type signatures, either explicitly (with a `forall`) or implicitly (without a `forall`, in which case the order is inferred). This is accomplished by adding a new field `dcUserTyVars` to `DataCon`, which is a subset of `dcUnivTyVars` and `dcExTyVars` that is permuted to the order in which the user wrote them. For more details, refer to `Note [DataCon user type variables]` in `DataCon.hs`. An interesting consequence of this design is that more data constructors require wrappers. This is because the workers always expect the first arguments to be the universal tyvars followed by the existential tyvars, so when the user writes the tyvars in a different order, a wrapper type is needed to swizzle the tyvars around to match the order that the worker expects. For more details, refer to `Note [Data con wrappers and GADT syntax]` in `MkId.hs`. Test Plan: ./validate Reviewers: austin, goldfire, bgamari, simonpj Reviewed By: goldfire, simonpj Subscribers: ezyang, goldfire, rwbarton, thomie GHC Trac Issues: #11721, #13848 Differential Revision: https://phabricator.haskell.org/D3687
* Optimize linker by minimizing calls to tryGCC to avoid fork/exec overhead.Tamar Christina2017-10-032-26/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows process creations are fairly expensive. As such calling them in what's essentially a hot loop is also fairly expensive. Each time we make a call to `tryGCC` the following fork/exec/wait happen ``` gcc -> realgcc -> cc1 ``` This is very problematic, because according to the profiler about 20% of the time is spent on just process creation and spin time. The goal of the patch is to mitigate this by asking GCC once for it's search directories, caching these (because it's very hard to change these at all after the process started since GCC's base dirs don't change unless with extra supplied `-B` flags.). We also do the same for the `findSysDll` function, since this computes the search path every time by registery accesses etc. These changes and D3909 drop GHC on Windows startup time from 2-3s to 0.5s. The remaining issue is a 1.5s wait lock on `CONIN$` which can be addressed with the new I/O manager code. But this makes GHCi as responsive on Windows as GHC 7.8 was. Test Plan: ./validate Reviewers: austin, hvr, bgamari, erikd Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3910
* Add ability to produce crash dumps on WindowsTamar Christina2017-10-039-1/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's often hard to debug things like segfaults on Windows, mostly because gdb isn't always of use and users don't know how to effectively use it. This patch provides a way to create a crash drump by passing `+RTS --generate-crash-dumps` as an option. If any unhandled exception is triggered a dump is made that contains enough information to be able to diagnose things successfully. Currently the created dumps are a bit big because I include all registers, code and threads information. This looks like ``` $ testsuite/tests/rts/derefnull.run/derefnull.exe +RTS --generate-crash-dumps Access violation in generated code when reading 0000000000000000 Crash dump created. Dump written to: E:\msys64\tmp\ghc-20170901-220250-11216-16628.dmp ``` Test Plan: ./validate Reviewers: austin, hvr, bgamari, erikd, simonmar Reviewed By: bgamari, simonmar Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3912
* Sync base/changelog.mdHerbert Valerio Riedel2017-10-031-3/+3
| | | | | | | | | | | This updates the base-4.10.0.0 entry heading which has diverged from http://hackage.haskell.org/package/base-4.10.0.0/src/changelog.md and while at it also sets the GHC version for the base-4.11 entry to avoid confusion about what GHC 8.2.2's base is going to include. [skip ci]
* Revert installing texinfo in CI systemsJoachim Breitner2017-10-032-2/+1
| | | | | This reverts commit 00ff02352f07bff7d422e4e48e4e5df9a0b63d83. This reverts commit 11a59de25d49f999eed0ea55df29d916a66ecd91.
* Add regression test for #9725Ryan Scott2017-10-032-0/+52
| | | | Kind equalities saves the day!
* Suppress error cascade in record fieldsSimon Peyton Jones2017-10-036-19/+34
| | | | | | | | | | | | | | | When a record contruction or pattern uses a data constructor that isn't in scope, we may produce spurious ambiguous-field errors (Trac #14307). E.g. f (A { fld = x }) = e where 'A' is not in scope. We want to draw attention to the out-of-scope data constructor first; once that is fixed we can think about the fields. This patch suppresses the field errors if the data con is out of scope.
* Fix nasty bug in w/w for absence analysisSimon Peyton Jones2017-10-039-96/+245
| | | | | | | | | | | | | | | | | | | | This dark corner was exposed by Trac #14285. It involves the interaction between absence analysis and INLINABLE pragmas. There is a full explanation in Note [aBSENT_ERROR_ID] in MkCore, which you can read there. The changes in this patch are * Make exprIsHNF return True for absentError, treating absentError like an honorary data constructor. * Make absentError /not/ be diverging, unlike other error Ids. This is all a bit horrible. * While doing this I found that exprOkForSpeculation didn't have a case for value lambdas so I added one. It's not really called on lifted types much, but it seems like the right thing
* Make GHC.IO.Buffer.summaryBuffer strictSimon Peyton Jones2017-10-031-2/+3
| | | | | I came across this when debugging something else. Making it strict improves the code slightly without affecting behaviour.
* Fix bug in the short-cut solverSimon Peyton Jones2017-10-035-58/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trac #13943 showed that the relatively-new short-cut solver for class constraints (aka -fsolve-constant-dicts) was wrong. In particular, see "Type families" under Note [Shortcut solving] in TcInteract. The short-cut solver recursively solves sub-goals, but it doesn't flatten type-family applications, and as a result it erroneously thought that C (F a) cannot possibly match (C 0), which is simply untrue. That led to an inifinte loop in the short-cut solver. The significant change is the one line + , all isTyFamFree preds -- See "Type families" in + -- Note [Shortcut solving] but, as ever, I do some other refactoring. (E.g. I changed the name of the function to shortCutSolver rather than the more generic trySolveFromInstance.) I also made the short-cut solver respect the solver-depth limit, so that if this happens again it won't just produce an infinite loop. A bit of other refactoring, notably moving isTyFamFree from TcValidity to TcType
* Comments onlySimon Peyton Jones2017-10-033-10/+11
|
* Adds x86 NONE relocation typeMoritz Angermann2017-10-031-0/+4
| | | | | | | | | | | | | | | Summary: As reported by Alex Lang, R_X86_64_NONE relocations appear in per-package object files, not per-module object files. This diff adds _NONE relocations for x86. Reviewers: bgamari, geekosaur, austin, erikd, simonmar Reviewed By: geekosaur Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4062
* No libffi docsMoritz Angermann2017-10-031-0/+1
| | | | | | | | | | | | | | Summary: building libffi docs with our intree-libffi seems rather pointless. Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4054
* user-guide: Fix :since: annotation of -pie and add documentation for -fPIEBen Gamari2017-10-021-2/+12
| | | | [skip ci]
* Bump libffi-tarballs submoduleBen Gamari2017-10-021-0/+0
|
* rel-notes: Mention libffi packaging changeBen Gamari2017-10-021-0/+6
| | | | [skip ci]
* Rewrite boot in PythonBen Gamari2017-10-025-236/+178
| | | | | | | | | | | | | | | | | | One step closer to being able to drop the Windows Perl tarball. We previously attempted to do this in D3567 but were forced to revert due to Windows problems. Acknowledgements: * @Phyx kindly contributed the codepath allowing this to work on Windows. Test Plan: Validate Reviewers: hvr, austin, Phyx Subscribers: erikd, thomie, rwbarton Differential Revision: https://phabricator.haskell.org/D3918
* Pretty-printer missing parens for infix class declarationAlan Zimmerman2017-10-024-0/+19
| | | | | | | | | | class (a `C` b) c Is pretty printed as class a `C` b c Fixes #14306
* CircleCI: Install texinfoJoachim Breitner2017-10-021-1/+1
|
* Travis: Install texinfoJoachim Breitner2017-10-021-0/+1
|
* Bump submodule nofib again (Semigroup now required)Joachim Breitner2017-10-021-0/+0
| | | | | | Commit 063e0b4e5ea53a02713eb48555bbd99d934a3de5 accidentially undid 7b8827ab24a3af8555f1adf250b7b541e41d8f5d where I bumped nofib previously.
* Allow libffi snapshotsMoritz Angermann2017-09-302-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This is rather annoying. I'd prefer to have a stable release to use. However libffi-3.2.1 has been released November 12, 2014, and libffi-4 is TBD. See also https://github.com/libffi/libffi/issues/296 The core reason for this change is that llvm changed the supported assembly to unified syntax, which libffi-3.2.1 does not use, and hence fails to compile for arm with llvm. For refence, see the following issue: https://github.com/libffi/libffi/issues/191. This diff contains a script to generate a tarball for the `libffi-tarballs` repository from the libffi GitHub repository; as well as the necessary changes to the build system. Updates libffi-tarballs submodule. Reviewers: austin, bgamari, hvr Subscribers: hvr, erikd, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3574
* iserv: Don't build vanilla iserv unless vanilla libraries are builtBen Gamari2017-09-301-2/+11
| | | | | | | | | | Test Plan: Validate Reviewers: austin, snowleopard Subscribers: angerman, rwbarton, thomie, int-e Differential Revision: https://phabricator.haskell.org/D4042
* Don't use "character" in haddocks of CharBen Gamari2017-09-301-1/+1
| | | | | | | | | | | | | | | Character is a terribly overloaded term and may refer to graphemes or code points. Specifically say that Char represents Unicode code points. [skip ci] Test Plan: Read it. Reviewers: hvr, austin Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4051
* Document a law for TH's Lift classRyan Scott2017-09-301-0/+3
| | | | | | | | | | | | | | | | | | | Inspired by the discussion in #14296, I've decided to document a law which is usually in the back of my mind when I'm using Template Haskell's `Lift` class, but isn't formally stated anywhere. That is, every `Lift` instance should satisfy (for all `x`): ```lang=haskell $(lift x) == x ``` Test Plan: Read it Reviewers: austin, goldfire, bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4050
* user-guide: Document -WeverythingBen Gamari2017-09-301-0/+7
| | | | | | | | | | | | | | [skip ci] Reviewers: hvr, austin, dfeuer Reviewed By: dfeuer Subscribers: rwbarton, thomie GHC Trac Issues: #14284 Differential Revision: https://phabricator.haskell.org/D4043
* Fix Raspberry Pi target nameMoritz Angermann2017-09-291-1/+1
| | | | | | | | | | | | | | Summary: For some reson, the `*`, that was supposed to be in D4031 got lost in the diff. Reviewers: bgamari, austin, hvr, dfeuer Reviewed By: dfeuer Subscribers: rwbarton, thomie, erikd Differential Revision: https://phabricator.haskell.org/D4044
* Fix #13391 by checking for kind-GADTsRichard Eisenberg2017-09-2811-9/+71
| | | | | | | The check is a bit gnarly, but I couldn't think of a better way. See the new code in TcTyClsDecls. test case: polykinds/T13391
* mkDataConRep: fix bug in strictness signature (#14290)Simon Marlow2017-09-283-1/+23
| | | | | | | | | | | | | | | | | | | | | The strictness signature for a data con wrapper wasn't including any dictionary arguments, which meant that bangs on the fields of a constructor with an existential context would be moved to the wrong fields. See T14290 for an example. Test Plan: * New test T14290 * validate Reviewers: simonpj, niteria, austin, bgamari, erikd Reviewed By: simonpj, bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #14290 Differential Revision: https://phabricator.haskell.org/D4040
* configure: Make sure we try all possible linkersBen Gamari2017-09-271-18/+41
| | | | | | | | | | | | | | | | | | | | Previously if we had both ld.lld and ld.gold installed but a gcc which didn't support -fuse-ld=lld we would fail when trying ld.lld and fall immediately back to plain ld. Now we will try ld.gold as well. This was brought to light by #14280, where using ld.bfd resulted in a broken stage2 compiler. Test Plan: Configure Reviewers: angerman, hvr, austin Reviewed By: angerman Subscribers: rwbarton, thomie, erikd GHC Trac Issues: #14280 Differential Revision: https://phabricator.haskell.org/D4038
* base: fdReady(): Ensure and doc that return values are always -1/0/1Niklas Hambüchen2017-09-271-2/+5
| | | | | | | | | | Reviewers: bgamari, austin, hvr, Phyx Reviewed By: Phyx Subscribers: Phyx, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4010
* fdReady(): Fix some C -Wconversion warnings.Niklas Hambüchen2017-09-271-7/+8
| | | | | | | | | | | | | Btw, -Wconversion is off by default and not included in -Wall, -Wextra or -pedantic, so I used it temporarily with -optc-Wconversion. Reviewers: bgamari, austin, hvr Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3965
* Add TODO about getMonotonicNSec() wrapping that can no longer happen.Niklas Hambüchen2017-09-271-0/+5
| | | | | | | | | | | | | | | | Knowing this is important for followup commits, where we will subtract getProcessElapsedTime() values from each other, in a way that assumes that there is no wrapping every 49 days. Reviewers: bgamari, austin, erikd, simonmar, NicolasT Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #14233 Differential Revision: https://phabricator.haskell.org/D3964
* Move check-ppr and check-api-annotations to testsuite/utilsBen Gamari2017-09-2713-45/+76
| | | | | | | | | | | | | | | | | These are needed by the testsuite and consequently must be shipped in the testsuite tarball to ensure that we can test binary distributions. See #13897. Test Plan: Validate Reviewers: austin Subscribers: snowleopard, rwbarton, thomie GHC Trac Issues: #13897 Differential Revision: https://phabricator.haskell.org/D4039
* TypofixesGabor Greif2017-09-2711-19/+19
|
* llvm-targets: drop soft-floatMoritz Angermann2017-09-272-5/+18
| | | | | | | | | | | | | | | | | | Summary: The llvm-targets file records `mattr` values, and while interrogating `clang` for the target, we might stumble upon `+soft-float-abi`, however ghc does not support full soft-float, and as such passing `+soft-float` to `llc` will result in segfaults for any function passing float registers F1, ... in the ARM Instruction Selection Pass. Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4030
* GHC_LLVM_TARGET: Keep android OSMoritz Angermann2017-09-271-0/+8
| | | | | | | | | | | | | | | Summary: Our usual GHC_CONVERT_OS macro, will turn any andoird* into android. This however drops the essential androideabi part. As such for the GHC_LLVM_TARGET we only convert the VENDOR, not the OS. Reviewers: bgamari, austin, hvr Reviewed By: bgamari Subscribers: rwbarton, thomie, erikd Differential Revision: https://phabricator.haskell.org/D4031
* Switch VEH to VCH and allow disabling of SEH completely.Tamar Christina2017-09-269-12/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exception handling on Windows is unfortunately a bit complicated. But essentially the VEH Handlers we currently have are running too early. This was a problem as it ran so early it also swallowed C++ exceptions and other software exceptions which the system could have very well recovered from. So instead we use a sequence of chains to for the exception handlers to run as late as possible. You really can't get any later than this. Please read the comment in the patch for more details. I'm also providing a switch to allow people to turn off the exception handling entirely. In case it does present a problem with their code. (Reverted and recommitted to fix authorship information) Test Plan: ./validate Reviewers: austin, hvr, bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13911, #12110 Differential Revision: https://phabricator.haskell.org/D3911
* Revert "Switch VEH to VCH and allow disabling of SEH completely."Ben Gamari2017-09-269-127/+12
| | | | | | Reverting to fix authorship of commit. This reverts commit 1825cbdbdf08ed4bd6fd6794852596078953298a.
* rts: Throw proper HeapOverflow exception on allocating large arrayBen Gamari2017-09-263-36/+79
| | | | | | | | | | | | Test Plan: Validate, add tests Reviewers: simonmar, austin, erikd Reviewed By: simonmar Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4021
* desugar: Catch levity polymorphism in unboxed sum expressionsBen Gamari2017-09-263-6/+18
| | | | Fixes #13929.