summaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* CSE code cleanup and improvementwip/cse-code-desmellingSimon Peyton Jones2016-04-061-112/+189
| | | | | | | | | Triggered by an observation by Joachim, Simon felt the urge to clean up the CSE code a bit. This is the result. (Code by Simon, commit message and other leg-work by Joachim) Differential Revision: https://phabricator.haskell.org/D2074
* Revert "Demand Analyzer: Do not set OneShot information"Joachim Breitner2016-03-312-29/+59
| | | | | | | This reverts commit 28fe0eea4d161b707f67aae26fddaa2e60d8a901 due to various regressions. I’m not sure why my local ./validate --slow run did not catch this, though.
* Revert accidental change to collectTyAndValBindersSimon Peyton Jones2016-03-311-17/+22
| | | | | | | | Richard accidetally introduced this change in his big kind-equality patch. The code is wrong, and potentially could cause binders to be re-ordered. Worth merging to 8.0.
* Demand Analyzer: Do not set OneShot informationJoachim Breitner2016-03-312-59/+29
| | | | | | | | | as suggested in ticket:11770#comment:1. This code was buggy (#11770), and the occurrence analyzer does the same job anyways. This also elaborates the notes in the occurrence analyzer accordingly. Differential Revision: https://phabricator.haskell.org/D2070
* Refactor error generation for pattern synonymsSimon Peyton Jones2016-03-315-147/+170
| | | | | | The result of a series of patches on type-error messages for pattern synonyms had become a bit baroque. This tidies it up a bit. Still not fantastic, but better.
* Make SigSkol take TcType not ExpTypeSimon Peyton Jones2016-03-316-17/+11
| | | | | | | | | For some reason a SigSkol had an ExpType in it, and there were lots of places where we needed it to have a TcType. And was indeed always a Check. All a lot of fuss about nothing. Delete code, fewer failure points, types are more precise. All good.
* Small refactor of TcMType.tauifyExpTypeSimon Peyton Jones2016-03-311-4/+8
| | | | | Mainly to make it clearer that tauifyExpType is a no-op on (Check ty)
* Refactor in TcMatchesSimon Peyton Jones2016-03-3111-48/+39
| | | | | | | | | | * Move the several calls of tauifyMultipleMatches into tcMatches, so that it can be called only once, and the invariants are clearer * I discovered in doing this that HsLamCase had a redundant and tiresome argument, so I removed it. That in turn allowed some modest but nice code simplification
* Comments onlySimon Peyton Jones2016-03-311-2/+4
|
* Minor refactoring in mkExportSimon Peyton Jones2016-03-311-13/+15
| | | | No change in behaviour
* Comments onlySimon Peyton Jones2016-03-312-10/+8
|
* Kill the magic of AnyBen Gamari2016-03-305-136/+98
| | | | | | | | | | | | | | | | | | | | This turns `Any` into a standard wired-in type family defined in `GHC.Types`, instead its current incarnation as a magical creature provided by the `GHC.Prim`. Also kill `AnyK`. See #10886. Test Plan: Validate Reviewers: simonpj, goldfire, austin, hvr Reviewed By: simonpj Subscribers: goldfire, thomie Differential Revision: https://phabricator.haskell.org/D2049 GHC Trac Issues: #10886
* Add -f(no-)version-macro to explicitly control macros.Edward Z. Yang2016-03-302-2/+5
| | | | | | | | | | | | | | Test Plan: validate Reviewers: thomie, austin, bgamari Reviewed By: bgamari Subscribers: hvr Differential Revision: https://phabricator.haskell.org/D2058 GHC Trac Issues: #11763
* Don't require -hide-all-packages for MIN_VERSION_* macrosThomas Miedema2016-03-301-7/+8
| | | | | | | | | | | | | | | | | Define MIN_VERSION_pkgname and VERSION_pkgname macros for all exposed packages, without requiring -hide-all-packages. See #10970 comment 7-10 for discussion. Reviewers: duncan, ezyang, bgamari, austin Reviewed By: ezyang Subscribers: hvr, rwbarton Differential Revision: https://phabricator.haskell.org/D1869 GHC Trac Issues: #10970
* Comments only in Unify.hsSimon Peyton Jones2016-03-301-69/+81
| | | | | To clarify what the "pure unifier" does, compared to the "impure unifiers" in the type checker.
* Don't recompute some free vars in lintCoercionBartosz Nitka2016-03-303-12/+12
| | | | | | | | | | | | | | | | | | | | | | As pointed out by @simonpj on D2044 we don't need to compute the free vars of the range of the substitution as most of them are already carried by the monad. This should be a tiny performance improvement over the version from before D2044. Also removes an extra function that is now unnecessary. Test Plan: ./validate && ./validate --slow Reviewers: goldfire, simonpj, austin, bgamari Reviewed By: simonpj Subscribers: thomie, simonmar, simonpj Differential Revision: https://phabricator.haskell.org/D2060 GHC Trac Issues: #11371
* Typos in non-codeGabor Greif2016-03-3011-12/+12
|
* rename: Disallow type signatures in patterns in plain HaskellBen Gamari2016-03-291-1/+10
| | | | | | | | | | | | | | | | | | | | This should require -XScopedTypeVariables. It seems this was previously handled by RnTypes.rnHsBndrSig which called RnTypes.badKindSigErr but this was broken in Simon's refactor of wildcards, 1e041b7382b6aa329e4ad9625439f811e0f27232. Here we re-introduce a check in RnPat. See #11663. Test Plan: Validate with `T11663` Reviewers: austin, simonpj Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2054 GHC Trac Issues: #11663
* Do not print DmdType in Core outputJoachim Breitner2016-03-291-2/+1
| | | | too verbose, and usualy preceded by Str= anyways.
* Rename isNopSig to isTopSigJoachim Breitner2016-03-295-11/+12
| | | | | to be consistent with the other uses of nop vs. top in Demand.hs. Also, stop prettyprinting top strictness signatures in Core dumps.
* SpecConstr: Transport strictness data to specialization’s argument’s bindersJoachim Breitner2016-03-291-1/+25
| | | | This is a result of the discussion in ticket:11731#comment:9.
* Typo in Note nameJoachim Breitner2016-03-291-2/+2
|
* Ticky: Do not count every entry twiceJoachim Breitner2016-03-291-2/+1
| | | | | (likely introduced by 99d4e5b4a0bd32813ff8c74e91d2dcf6b3555176, possibly due to a merge mistake).
* Be more explicit about closure types in ticky-ticky-reportJoachim Breitner2016-03-293-45/+88
| | | | | | | | | | The report now distinguishes thunks (in the variants single-entry and standard thunks), constructors and functions (possibly single-entry). Forthermore, for standard thunks (AP and selector), do not count an entry when they are allocated. It is not possible to count their entries, as their code is shared, but better count nothing than count the wrong thing.
* Remove all mentions of IND_OLDGEN outside of docs/rtsJoachim Breitner2016-03-291-2/+1
|
* Use the correct substitution in lintCoercionBartosz Nitka2016-03-293-1/+12
| | | | | | | | | | | | | | | | | We need the free vars of `t2` to satisfy the substitution invariant. Luckily they are in the in-scope carried around. Test Plan: ./validate Reviewers: bgamari, austin, goldfire, simonpj Reviewed By: simonpj Subscribers: thomie, simonmar Differential Revision: https://phabricator.haskell.org/D2044 GHC Trac Issues: #11371
* Build correct substitution in instDFunTypeBartosz Nitka2016-03-291-2/+4
| | | | | | | | | | | | | | | | | | | We will use `ty` in the range of the substitution, hence the substitution needs `ty`'s free vars in-scope. They don't seem easily available by other means, so we just compute them. Test Plan: ./validate Reviewers: austin, goldfire, bgamari, simonpj Reviewed By: simonpj Subscribers: thomie, simonmar Differential Revision: https://phabricator.haskell.org/D2043 GHC Trac Issues: #11371
* Use a correct substitution in tcInstTypeBartosz Nitka2016-03-291-1/+1
| | | | | | | | | | | | | | | | | | `ty` doesn't have to be a closed type, so we need to add its free vars to the in-scope set. They don't seem to be available anywhere nearby, so we have to compute them. Test Plan: ./validate Reviewers: goldfire, austin, bgamari, simonpj Reviewed By: simonpj Subscribers: thomie, simonmar Differential Revision: https://phabricator.haskell.org/D2042 GHC Trac Issues: #11371
* Scrap DEC OSF/1 supportHerbert Valerio Riedel2016-03-282-6/+2
| | | | | | | | | | | | | DEC OSF/1 (aka Tru64 UNIX) has been discontinued a few years ago already[1]. This removes the undoubtedly bitrotten support for `OSOsf3 :: OS` from GHC's code-base. Support for `ArchAlpha :: Arch` may be removed at some later point, as there may still be users out there running a more or less recent Linux/alpha distribution on their more-than-a-decade old Alpha hardware... [1]: https://en.wikipedia.org/wiki/Tru64_UNIX
* Scrap IRIX supportHerbert Valerio Riedel2016-03-281-10/+0
| | | | | | | | | | | | | | | | Long time ago, IRIX was way ahead of its time in the last century with its SMP capabilities of scaling up to 1024 processors and other features such as XFS or OpenGL that originated in IRIX and live on to this day in other operating systems. However, IRIX's last software update was in 2006 and support ended around 2013 according to [1], so it's considered an extinct platform by now. So this commit message is effectively an obituary for GHC's IRIX support. R.I.P. IRIX [1]: https://en.wikipedia.org/wiki/IRIX
* Fix AIX/ppc codegen in `-prof` compilation modeHerbert Valerio Riedel2016-03-271-2/+8
| | | | | | | The implementation in df26b95559fd467abc0a3a4151127c95cb5011b9 wrongly assumed that all C-ABI subroutine calls would use a 'ForeignLabel' but it turns out that calls inserted via 'emitRtsCall' use 'CmmLabel's instead.
* Clarify Note [Kind coercions in Unify]Richard Eisenberg2016-03-261-1/+24
|
* Check for rep poly on wildcard binders.Richard Eisenberg2016-03-261-10/+73
| | | | | | | I had just missed this case when adding my test. This is relevant to ticket #11473. Also adds lots of comments.
* Fix #11754 by adding an additional check.Richard Eisenberg2016-03-261-3/+4
| | | | | | This was just plain wrong previously. Test case: typecheck/should_compile/T11754
* Panic: Try outputting SDocsBen Gamari2016-03-262-20/+34
| | | | | | | | | | | | | | | | | This works in conjunction with D2036 to allow useful debug output before DynFlags has been initializated. See #11755. Reviewers: austin Reviewed By: austin Subscribers: thomie, gridaphobe Differential Revision: https://phabricator.haskell.org/D2037 GHC Trac Issues: #11755
* DynFlags: Initialize unsafeGlobalDynFlags enough to be usefulBen Gamari2016-03-261-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | Previously unsafeGlobalDynFlags would bottom if used prior to initialization. This meant that any attempt to use the pretty-printer early in the initialization process of the compiler would fail. This is quite inconvenient. Here we initialize unsafeGlobalDynFlags with defaultDynFlags, bottoming only if settings is accessed. See #11755. Test Plan: Validate Reviewers: austin Reviewed By: austin Subscribers: thomie, gridaphobe Differential Revision: https://phabricator.haskell.org/D2036 GHC Trac Issues: #11755
* A raft of comments about TyBindersSimon Peyton Jones2016-03-256-274/+429
| | | | | | | | I had a conversation with Richard about TyBinders and VisibilityFlags. This patch adds a lot of comments to explain what is going on. I feel much more secure now. Richard please check.
* CorePrep: refactoring to reduce duplicationSimon Peyton Jones2016-03-251-28/+21
| | | | There's no functional change here, just tidying up
* Do not eta-reduce across Ticks in CorePrepSimon Peyton Jones2016-03-251-2/+7
| | | | | | | | The function tryEtaReducePrep was being over-ambitious. When Breakpoint ticks were involved (i.e. in GHCi), eta reduction left an out-of-scope variable in the Tick. Easily fixed. Fixes the original report in Trac #111728.
* An extra traceTc in tcExpr for ExprWithSigSimon Peyton Jones2016-03-251-0/+1
|
* Remove code-duplication in the PPC NCGHerbert Valerio Riedel2016-03-241-26/+19
| | | | | | Reviewed By: bgamari, trommler Differential Revision: https://phabricator.haskell.org/D2020
* Add NCG support for AIX/ppc32Herbert Valerio Riedel2016-03-247-28/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This extends the previous work to revive the unregisterised GHC build for AIX/ppc32. Strictly speaking, AIX runs on POWER4 (and later) hardware, but the PPC32 instructions implemented in the PPC NCG represent a compatible subset of the POWER4 ISA. IBM AIX follows the PowerOpen ABI (and shares many similiarites with the Linux PPC64 ELF V1 NCG backend) but uses the rather limited XCOFF format (compared to ELF). This doesn't support dynamic libraries yet. A major limiting factor is that the AIX assembler does not support the `@ha`/`@l` relocation types nor the ha16()/lo16() functions Darwin's assembler supports. Therefore we need to avoid emitting those. In case of numeric literals we simply compute the functions ourselves, while for labels we have to use local TOCs and hope everything fits into a 16bit offset (for ppc32 this gives us at most 16384 entries per TOC section, which is enough to compile GHC). Another issue is that XCOFF doesn't seem to have a relocation type for label-differences, and therefore the label-differences placed into tables-next-to-code can't be relocated, but the linker may rearrange different sections, so we need to place all read-only sections into the same `.text[PR]` section to workaround this. Finally, the PowerOpen ABI distinguishes between function-descriptors and actualy entry-point addresses. For AIX we need to be specific when emitting assembler code whether we want the address of the function descriptor `printf`) or for the entry-point (`.printf`). So we let the asm pretty-printer prefix a dot to all emitted subroutine calls (i.e. `BL`) on AIX only. For now, STG routines' entry-point labels are not prefixed by a label and don't have any associated function-descriptor. Reviewers: austin, trommler, erikd, bgamari Reviewed By: trommler, erikd, bgamari Differential Revision: https://phabricator.haskell.org/D2019
* Add option `no-keep-hi-files` and `no-keep-o-files` (fixes #4114)Kai Harries2016-03-242-0/+26
| | | | | | | | | | | | | | | | | Summary: Remove `.hi` and `.o` files if the flags `no-keep-hi-files` and `no-keep-o-files` are given. Test Plan: ./validate Reviewers: austin, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2021 GHC Trac Issues: #4114
* Tidy up handling of coercion variablesSimon Peyton Jones2016-03-248-47/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Comments to explain that a CoVar, whose IdInfo is CoVarId, is always unlifted (but may be nominal or representational role) And TyCoRep.isCoercionType picks out only those unlifted types, NOT the lifted versions * Introduce Var.NcId for non-co-var Ids with predicate isNonCoVarId * Add assertions in CoreSubst that the Id env is only used for NcIds * Fix lurking bug in CSE which extended the CoreSubst Id env with a CoVar * Fix two bugs in Specialise.spec_call, which wrongly treated CoVars like NcIds - needed a varToCoreExpr in one place - needed extendSubst not extendIdSubst in another This was the root cause of Trac #11644 Minor refactoring * Eliminate unused mkDerivedLocalCoVarM, mkUserLocalCoVar * Small refactor in mkSysLocalOrCoVar
* Comments onlySimon Peyton Jones2016-03-241-1/+1
|
* Default RuntimeRep variables unless -fprint-explicit-runtime-repsBen Gamari2016-03-243-3/+89
| | | | | | | | | | | | | | | | | | | | Summary: Addresses #11549 by defaulting `RuntimeRep` variables to `PtrRepLifted` and adding a new compiler flag `-fprint-explicit-runtime-reps` to disable this behavior. This is just a guess at the right way to go about this. If it's wrong-beyond-any-hope just say so. Test Plan: Working on a testcase Reviewers: goldfire, austin Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1961 GHC Trac Issues: #11549
* Show: Restore redundant parentheses around recordsBen Gamari2016-03-242-6/+2
| | | | | | | | | | | | | | | | | | | | As discussed in #2530 we are going to continue to produce parentheses here in order to preserve compatibility with previous GHC releases. It was found that dropped parentheses would break some testsuites which compared against output from Show. This has been documented in the users guide. This reverts commit 5692643c9d17e746327588cd6157a923642b7975. Test Plan: Validate Reviewers: hvr, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2027 GHC Trac Issues: #2350
* Revert "Various ticky-related work"Ben Gamari2016-03-243-54/+24
| | | | | This reverts commit 6c2c853b11fe25c106469da7b105e2be596c17de which was supposed to be merged as individual commits.
* DsExpr: Rip out static/dynamic check in list desugaringBen Gamari2016-03-242-69/+28
| | | | | | | | | | | | | | | | | | | | | | Previously we would try to break explicit lists into a dynamic prefix and static tail and desugar the former into a `build` expression. Unfortunately, this heuristic resulted in surprising behavior (see #11710) and wasn't pulling its weight. Here we drop it (along with the `-fsimple-list-literals` flag), leaving only the list length heuristic to determine whether `build` or cons list desugaring should be used. Test Plan: Validate Reviewers: simonpj, austin Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2023 GHC Trac Issues: #11710
* Create empty dump files (fixes #10320)Kai Harries2016-03-241-1/+13
| | | | | | | | | | | | | | Test Plan: ./validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2015 GHC Trac Issues: #10320