summaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* rename: Eliminate usage of mkVarOccUniquewip/T17061Ben Gamari2020-01-251-6/+4
| | | | Replacing it with `newSysName`. Fixes #17061.
* Add missing Note [Improvement from Ground Wanteds]Ben Gamari2020-01-201-0/+13
| | | | Closes #17659.
* Remove deprecated -smp flagÖmer Sinan Ağacan2020-01-201-2/+0
| | | | It was deprecated in 2012 with 46258b40
* llvmGen: Fix #14251Ben Gamari2020-01-202-23/+115
| | | | | | | | | | | | | | Fixes the calling convention for functions passing raw SSE-register values by adding padding as needed to get the values in the right registers. This problem cropped up when some args were unused an dropped from the live list. This folds together 2e23e1c7de01c92b038e55ce53d11bf9db993dd4 and 73273be476a8cc6c13368660b042b3b0614fd928 previously from @kavon. Metric Increase: T12707 ManyConstructors
* llvmGen: Fix typo in readnone attributeBen Gamari2020-01-201-1/+1
|
* llvmGen: Don't trash STG registersBen Gamari2020-01-201-38/+2
| | | | Fixes #13904.
* Document Stg.FVs moduleÖmer Sinan Ağacan2020-01-201-1/+39
| | | | | | Fixes #17662 [ci skip]
* Revert "`exprOkForSpeculation` for Note [IO hack in the demand analyser]"Sebastian Graf2020-01-161-11/+11
| | | | | | | | | | | | | This reverts commit ce64b397777408731c6dd3f5c55ea8415f9f565b on the grounds of the regression it would introduce in a couple of packages. Fixes #17653. Also undoes a slight metric increase in #13701 introduced by that commit that we didn't see prior to !1983. Metric Decrease: T13701
* replace dead html link (fixes #17661)Adam Wespiser2020-01-161-1/+1
|
* Remove special case case of bool during STG -> C--John Ericson2020-01-162-86/+1
| | | | | | | | | Allow removing the no longer needed cgPrimOp, getting rid of a small a small layer violation too. Change which made the special case no longer needed was #6135 / 6579a6c73082387f82b994305011f011d9d8382b, which dates back to 2013, making me feel better.
* Get rid of OpDestJohn Ericson2020-01-161-598/+583
| | | | | `OpDest` was basically a defunctionalization. Just turn the code that cased on it into those functions, and call them directly.
* Handle TagToEnum in the same big case as the other primopsJohn Ericson2020-01-161-35/+50
| | | | | | | | | | | | | Before, it was a panic because it was handled above. But there must have been an error in my reasoning (another caller?) because #17442 reported the panic was hit. But, rather than figuring out what happened, I can just make it impossible by construction. By adding just a bit more bureaucracy in the return types, I can handle TagToEnum in the same case as all the others, so the big case is is now total, and the panic is removed. Fixes #17442
* Better documentation for mkEtaWW [skip ci]Sebastian Graf2020-01-161-11/+24
| | | | | | So that hopefully I understand it faster next time. Also got rid of the confusing `orig_expr`, which makes the call site in `etaExpand` look out of sync with the passed `n` (which is not the original `n`).
* Comments in TcHsTypeSimon Peyton Jones2020-01-121-2/+2
|
* Minor refactor around quantified constraintsSimon Peyton Jones2020-01-122-13/+41
| | | | | | | | | | This patch clarifies a dark corner of quantified constraints. * See Note [Yukky eq_sel for a HoleDest] in TcSMonad * Minor refactor, breaking out new function TcInteract.doTopReactEqPred
* Comments about constraint floatingSimon Peyton Jones2020-01-121-0/+5
|
* Add comments about TH levelsSimon Peyton Jones2020-01-123-6/+12
|
* Fix more typos, via an improved Levenshtein-style correctorBrian Wignall2020-01-1297-293/+293
|
* Don't zap to Any; error insteadRichard Eisenberg2020-01-128-50/+119
| | | | | | | | | This changes GHC's treatment of so-called Naughty Quantification Candidates to issue errors, instead of zapping to Any. Close #16775. No new test cases, because existing ones cover this well.
* Overloaded Quotation Brackets (#246)Matthew Pickering2020-01-1215-556/+917
| | | | | | | | | | | | | | | | | | This patch implements overloaded quotation brackets which generalise the desugaring of all quotation forms in terms of a new minimal interface. The main change is that a quotation, for example, [e| 5 |], will now have type `Quote m => m Exp` rather than `Q Exp`. The `Quote` typeclass contains a single method for generating new names which is used when desugaring binding structures. The return type of functions from the `Lift` type class, `lift` and `liftTyped` have been restricted to `forall m . Quote m => m Exp` rather than returning a result in a Q monad. More details about the feature can be read in the GHC proposal. https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0246-overloaded-bracket.rst
* improve docs for HeaderInfo.getImportsAdam Sandberg Eriksson2020-01-121-1/+2
| | | | [skip ci]
* Print Core type applications with no whitespace after @ (#17643)Ryan Scott2020-01-086-11/+11
| | | | | | | | | | | This brings the pretty-printer for Core in line with how visible type applications are normally printed: namely, with no whitespace after the `@` character (i.e., `f @a` instead of `f @ a`). While I'm in town, I also give the same treatment to type abstractions (i.e., `\(@a)` instead of `\(@ a)`) and coercion applications (i.e., `f @~x` instead of `f @~ x`). Fixes #17643.
* Module hierarchy: Renamer (cf #13009)Sylvain Henry2020-01-0846-239/+230
|
* Monomorphize HsModule to GhcPs (#17642)Ryan Scott2020-01-077-19/+17
| | | | | | | | Analyzing the call sites for `HsModule` reveals that it is only ever used with parsed code (i.e., `GhcPs`). This simplifies `HsModule` by concretizing its `pass` parameter to always be `GhcPs`. Fixes #17642.
* Use non-empty lists to remove partiality in matching codeJohn Ericson2020-01-075-103/+105
|
* Module hierarchy: Iface (cf #13009)Sylvain Henry2020-01-0692-324/+342
|
* Add lexerDbg to dump the tokens fed to the parserVladislav Zavialov2020-01-042-2/+10
| | | | | This a small utility function that comes in handy when debugging the lexer and the parser.
* Add Cmm related hooksSylvain Henry2020-01-042-4/+20
| | | | | | | | | | | | | * stgToCmm hook * cmmToRawCmm hook These hooks are used by Asterius and could be useful to other clients of the GHC API. It increases the Parser dependencies (test CountParserDeps) to 184. It's still less than 200 which was the initial request (cf https://mail.haskell.org/pipermail/ghc-devs/2019-September/018122.html) so I think it's ok to merge this.
* Fix typos, via a Levenshtein-style correctorBrian Wignall2020-01-0464-249/+249
|
* Simplify mrStrGabor Greif2020-01-033-10/+3
|
* Tweak Cmm dumps to avoid generating sections for empty groupsÖmer Sinan Ağacan2019-12-311-15/+20
| | | | | | | | | | When dumping Cmm groups check if the group is empty, to avoid generating empty sections in dump files like ==================== Output Cmm ==================== [] Also fixes a few bad indentation in the code around changes.
* Module hierarchy (#13009): StgSylvain Henry2019-12-3144-226/+224
|
* TcIface: Fix inverted logic in typechecking of source ticksBen Gamari2019-12-301-1/+1
| | | | | | | | | | | | | Previously we would throw away source ticks when the debug level was non-zero. This is precisely the opposite of what was intended. Fixes #17616. Metric Decrease: T13056 T9020 T9961 T12425
* llvmGen: Drop old fix for #11649Ben Gamari2019-12-301-36/+1
| | | | | This was a hack which is no longer necessary now since we introduce a dedicated entry block for each procedure.
* llvmGen: Ensure that entry labels don't have predecessorsBen Gamari2019-12-301-7/+14
| | | | | | | | | | The LLVM IR forbids the entry label of a procedure from having any predecessors. In the case of a simple looping function the LLVM code generator broke this invariant, as noted in #17589. Fix this by moving the function prologue to its own basic block, as suggested by @kavon in #11649. Fixes #11649 and #17589.
* driver: Include debug level in the recompilation check hashBen Gamari2019-12-301-1/+1
| | | | Fixes #17586.
* while at it rename XCode to the official XcodeGabor Greif2019-12-271-3/+3
|
* Replace panic/notHandled with noExtCon in DsMetaRyan Scott2019-12-261-35/+42
| | | | | | | There are many spots in `DsMeta` where `panic` or `notHandled` is used after pattern-matching on a TTG extension constructor. This is overkill, however, as using `noExtCon` would work just as well. This patch switches out these panics for `noExtCon`.
* Minor refactor in ghc.cabal.in:Ömer Sinan Ağacan2019-12-263-15/+3
| | | | | | - Remove outdated comments - Move cutils.c from parser to cbits - Remove unused cutils.h
* lookupBindGroupOcc: recommend names in the same namespace (#17593)Ryan Scott2019-12-203-9/+18
| | | | | | | | | | | Previously, `lookupBindGroupOcc`'s error message would recommend all similar names in scope, regardless of whether they were type constructors, data constructors, or functions, leading to the confusion witnessed in #17593. This is easily fixed by only recommending names in the same namespace, using the `nameSpacesRelated` function. Fixes #17593.
* Deduplicate copied monad failure handler codeJohn Ericson2019-12-203-26/+12
|
* Add GHC-API logging hooksSylvain Henry2019-12-1836-192/+322
| | | | | | | | | | | | | | | | | | | | | | | * Add 'dumpAction' hook to DynFlags. It allows GHC API users to catch dumped intermediate codes and information. The format of the dump (Core, Stg, raw text, etc.) is now reported allowing easier automatic handling. * Add 'traceAction' hook to DynFlags. Some dumps go through the trace mechanism (for instance unfoldings that have been considered for inlining). This is problematic because: 1) dumps aren't written into files even with -ddump-to-file on 2) dumps are written on stdout even with GHC API 3) in this specific case, dumping depends on unsafe globally stored DynFlags which is bad for GHC API users We introduce 'traceAction' hook which allows GHC API to catch those traces and to avoid using globally stored DynFlags. * Avoid dumping empty logs via dumpAction/traceAction (but still write empty files to keep the existing behavior)
* Do more validity checks for quantified constraintsRichard Eisenberg2019-12-166-21/+33
| | | | | | Close #17583. Test case: typecheck/should_fail/T17563
* Use "OrCoVar" functions lessKrzysztof Gogolewski2019-12-1620-51/+52
| | | | | | | | | | | As described in #17291, we'd like to separate coercions and expressions in a more robust fashion. This is a small step in this direction. - `mkLocalId` now panicks on a covar. Calls where this was not the case were changed to `mkLocalIdOrCoVar`. - Don't use "OrCoVar" functions in places where we know the type is not a coercion.
* Remove dataConSigKrzysztof Gogolewski2019-12-163-20/+4
| | | | As suggested in #17291
* Warn on inferred polymorphic recursionRichard Eisenberg2019-12-113-38/+100
| | | | | | | | | | | Silly users sometimes try to use visible dependent quantification and polymorphic recursion without a CUSK or SAK. This causes unexpected errors. So we now adjust expectations with a bit of helpful messaging. Closes #17541 and closes #17131. test cases: dependent/should_fail/T{17541{,b},17131}
* Move Int64# and Word64# sections of primops.txt.ppJohn Ericson2019-12-101-22/+21
| | | | This way it is next to the other fixed-sized ones.
* Move Int# section of primops.txt.ppJohn Ericson2019-12-101-153/+153
| | | | | This matches the organization of the fixed-sized ones, and keeps each Int* next to its corresponding Word*.
* Ignore unary constraint tuples during typechecking (#17511)Ryan Scott2019-12-103-25/+76
| | | | | | | | | | | | | | We deliberately avoid defining a magical `Unit%` class, for reasons that I have expounded upon in the newly added `Note [Ignore unary constraint tuples]` in `TcHsType`. However, a sneaky user could try to insert `Unit%` into their program by way of Template Haskell, leading to the interface-file error observed in #17511. To avoid this, any time we encounter a unary constraint tuple during typechecking, we drop the surrounding constraint tuple application. This is safe to do since `Unit% a` and `a` would be semantically equivalent (unlike other forms of unary tuples). Fixes #17511.
* Fix comment typosGabor Greif2019-12-091-1/+1
| | | | | | | | | | | | | | | | The below is only necessary to fix the CI perf fluke that happened in 9897e8c8ef0b19a9571ef97a1d9bb050c1ee9121: ------------------------- Metric Decrease: T5837 T6048 T9020 T12425 T12234 T13035 T12150 Naperian -------------------------