| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Parsing of static and mode flags happens before any session is started,
i.e., before the first call to 'GHC.withGhc'. Therefore, to report
errors for invalid usage of these two types of flags, we can not call
any function that needs DynFlags, as there are no DynFlags available yet
(unsafeGlobalDynFlags is not set either). So we always print "on the
commandline" as the location, which is true except for Api users, which
is probably ok.
When reporting errors for invalid usage of dynamic flags we /can/ make
use of DynFlags, and we do so explicitly in
DynFlags.parseDynamicFlagsFull.
Before, we called unsafeGlobalDynFlags when an invalid (combination of)
flag(s) was given on the commandline, resulting in panics (#9963). This
regression was introduced in 1d6124de.
Also rename showSDocSimple to showSDocUnsafe, to hopefully prevent this
from happening again.
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D730
GHC Trac Issues: #9963
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some ELF link editors default to `--as-needed` and record only
those libraries in DT_NEEDED tags that are needed to resolve
undefined symbols in the shared object to be created.
In Template Haskell we rely on all symbols that were defined
in modules compiled so far to be available in the current
temporary shared object. To prevent the link editor from
dropping the DT_NEEDED tag for the previously linked temporary
shared object we need to override the link editors default and
specify `--no-as-needed` on the command line. This is for GNU ld
and GOLD ld.
This addresses #10110
TODO: regression test
Reviewed By: hvr
Differential Revision: https://phabricator.haskell.org/D731
|
| |
|
|
|
|
| |
This also needs to update a couple of other submodules
to update the upper bound on filepath to allow this major
version bump to 1.4.0.0
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the library file name format
NOTE: This patch originally updated to Cabal HEAD, but was reduced to
update to Cabal 1.22 HEAD by hvr as this is needed in order to
update the filepath submodule to version 1.4.0, and subsequently
to be cherry-picked into the ghc-7.10 branch
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D707
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
[skip-ci]
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D723
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This just rewrites the IntGraph data type.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D708
|
| |
|
|
|
|
|
| |
This breaks the build with GHC 7.6 bootstrapping, since the Functor SCC
instance is not available.
This reverts commit c439af5f5baa2c8af3434652554135230edbf5c3.
|
| |
|
|
|
|
|
|
|
| |
See Note [Don't normalise input filenames] in
`compiler/main/DriverPipeline.hs`. Fixes #2991.
Reviewers: austin
Differential Revision: https://phabricator.haskell.org/D701
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
as obviously, the code does _not_ adhere to the comment, and yet the
compiler does _not_ go into an infinite loop.
Test Plan: Run validate
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D719
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This just rewrites the IntGraph data type.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D708
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Rename `SysTools.readCreateProcess`.
Functions `readCreateProcess` and `readCreateProcessWithExitCode` were added
to `System.Process`, the former of which conflicts with
`SysTools.readCreateProcess`.
Reviewed by: austin
Differential Revision: https://phabricator.haskell.org/D713
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: austin, simonpj
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D710
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
As a result of fixing #8935 we needed to open shared libraries
with RTLD_LOCAL and so symbols from packages loaded earlier
cannot be found anymore. We need to include in the link all
packages loaded so far.
This fixes #10058
Test Plan: validate
Reviewers: hvr, simonmar, austin
Reviewed By: austin
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D676
GHC Trac Issues: #10058
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This is a draft of the patch that is sent for review.
In this patch required changes in linter were introduced
and actual check:
- new helper function: primRepSizeB
- primRep check for floating
- Add access to dynamic flags in linter.
- Implement additional lint rules.
Reviewers: austin, goldfire, simonpj
Reviewed By: simonpj
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D637
GHC Trac Issues: #9122
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This implements the new `Typeable` solver: when GHC sees `Typeable` constraints
it solves them on the spot.
The current implementation creates `TyCon` representations on the spot.
Pro: No overhead at all in code that does not use `Typeable`
Cons: Code that uses `Typeable` may create multipe `TyCon` represntations.
We have discussed an implementation where representations of `TyCons` are
computed once, in the module, where a datatype is declared. This would
lead to more code being generated: for a promotable datatype we need to
generate `2 + number_of_data_cons` type-constructro representations,
and we have to do that for all programs, even ones that do not intend to
use typeable.
I added code to emit warning whenevar `deriving Typeable` is encountered---
the idea being that this is not needed anymore, and shold be fixed.
Also, we allow `instance Typeable T` in .hs-boot files, but they result
in a warning, and are ignored. This last one was to avoid breaking exisitng
code, and should become an error, eventually.
Test Plan:
1. GHC can compile itself.
2. I compiled a number of large libraries, including `lens`.
- I had to make some small changes:
`unordered-containers` uses internals of `TypeReps`, so I had to do a 1 line fix
- `lens` needed one instance changed, due to a poly-kinded `Typeble` instance
3. I also run some code that uses `syb` to traverse a largish datastrucutre.
I didn't notice any signifiant performance difference between the 7.8.3 version,
and this implementation.
Reviewers: simonpj, simonmar, austin, hvr
Reviewed By: austin, hvr
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D652
GHC Trac Issues: #9858
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Whether to re-export the `<$>` non-method operator from `Prelude` wasn't
explicitly covered in the original AMP proposal[1], but it turns out that
not doing so forces most code that makes use of applicatives to import
`Data.Functor` or `Control.Applicative` just to get that operator into
scope. To this end, it was proposed to add `<$>` to Prelude as well[2].
The down-side is that this increases the amount of redundant-import
warnings triggered, as well as the relatively minor issue of stealing
the `<$>` operator from the default namespace for good (although at this
point `<$>` is supposed to be ubiquitous anyway due to `Applicative`
being implicitly required into the next Haskell Report)
[1]: https://wiki.haskell.org/Functor-Applicative-Monad_Proposal
[2]: http://thread.gmane.org/gmane.comp.lang.haskell.libraries/24161
Reviewed By: austin, ekmett
Differential Revision: https://phabricator.haskell.org/D680
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: none
Reviewers: austin, simonpj, simonmar
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D697
|
| |
|
|
|
|
|
|
|
| |
Added in 53a5d0b01. Perhaps accidentally? It didn't do anything back then
either.
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D700
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This one was a bit of a surprise. In fixing Trac #7854, I moved
the checkAmbiguity tests to checkValidType. That meant it happened
even for monotypes, and that turned out to be very expensive in
T9872a, for reasons described in this (new) Note in TcUnify:
Note [Check for equality before deferring]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Particularly in ambiguity checks we can get equalities like (ty ~ ty).
If ty involves a type function we may defer, which isn't very sensible.
An egregious example of this was in test T9872a, which has a type signature
Proxy :: Proxy (Solutions Cubes)
Doing the ambiguity check on this signature generates the equality
Solutions Cubes ~ Solutions Cubes
and currently the constraint solver normalises both sides at vast cost.
This little short-cut in 'defer' helps quite a bit.
I fixed the problem with a quick equality test, but it feels like an ad-hoc
solution; I think we might want to do something in the constraint solver too.
(The problem was there all along, just more hidden.)
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See Trac #7854. Specifically:
* Major clean up and simplification of check_op in checkValidClass;
specifically
- use checkValidType on the entire method-selector type to detect
ambiguity
- put a specific test for -XConstrainedClassMethods
* Make -XConstrainedClassMethods be implied by -XMultiParamTypeClasses
(a bit ad-hoc but see #7854), and document in the user manual.
* Do the checkAmbiguity test just once in TcValidity.checkValidType,
rather than repeatedly at every level. See Note [When to call checkAmbiguity]
* Add -XAllowAmbiguousTypes in GHC.IP, since 'ip' really is ambiguous.
(It's a rather magic function.)
* Improve location info for check_op in checkValidClass
* Update quite a few tests, which had genuinely-ambiguous class
method signatures. Some I fixed by making them unambiguous; some
by adding -XAllowAmbiguousTypes
|
| | |
|
| |
|
|
| |
(Triggered by investigating Trac #10102 etc.)
|
| |
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
| |
|
|
|
|
|
| |
Previously, we used deriveUnique and then uniqAway. This worked
doubly hard to avoid clashes. Doing just uniqAway is enough.
This commit also includes clarifying comments.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Ticket #10104 dealt with showing the '#'s on types with unboxed fields. This
commit pretty prints the '#'s on unboxed literals in core output.
Test Plan: simplCore/should_compile/T8274
Reviewers: jstolarek, simonpj, austin
Reviewed By: simonpj, austin
Subscribers: simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D678
GHC Trac Issues: #8274
|
| |
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
| |
|
|
|
| |
both use the same logic to divide, so put it in
divideBranches :: Ord a => [(a,b)] -> ([(a,b)], a, [(a,b)])
|
| |
|
|
|
|
|
|
|
| |
Previously, in the branch of the if-then-else tree, it would emit a
final check if the scrut matches the alternative, even if earlier
comparisons alread imply this equality. By keeping track of the bounds
we can skip this check. Of course this is only sound for integer types.
This closes #10129.
Differential Revision: https://phabricator.haskell.org/D693
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: fixed few typos in coreSyn, no trac number
Test Plan: validate
Reviewers: austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D682
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The 2010 report mentions:
"The result of `show` is a syntactically correct Haskell expression ...
Parenthesis are only added where needed, //ignoring associativity//".
Reviewers: austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D669
GHC Trac Issues: #2530
|
| |
|
|
|
|
|
|
|
| |
* The original fix was to improve the documentation, in
line with the suggestions on Trac #10122
* But in doing so I realised that the kind generalisation in
TcRnDriver.tcRnType was completely wrong. So I fixed that
and updated Note [Kind-generalise in tcRnType] to explain.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is minor stuff triggered by Trac #10103.
* Fix outdated comments on tcView/coreView (we should really combine
them with a new name, but I'll leave that slightly-disruptive change
for now)
* Combine tcExpandTyCon_maybe and coreExpandTyCon_maybe (which were identical)
into expandSynTyCon_maybe
* A few more comment fixups
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
FinderCache is now keyed by a module, ModuleNames in the home package are
turned into Modules using thisPackage in the dynamic flags. Simplifies some
code!
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D634
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: New flags:
-fwarn-unused-top-binds
-fwarn-unused-local-binds
-fwarn-unused-pattern-binds
Test Plan: `tests/rename/should_compile/T17` tests
Correct other tests
Reviewers: austin, rwbarton
Reviewed By: austin, rwbarton
Subscribers: rwbarton, carter, thomie
Differential Revision: https://phabricator.haskell.org/D591
GHC Trac Issues: #17
|
| |
|
|
| |
and reference to long-removed note in CallArity.hs
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: deriving/should_run/T10104
Reviewers: austin, jstolarek
Reviewed By: austin, jstolarek
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D672
GHC Trac Issues: #10104
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
type errors
Summary:
Remove unused variable that appeared through the fix for ticket #10078
Merge branch 'master' of git://git.haskell.org/ghc
Added comment with bug ID.
Reviewers: adamgundry, gridaphobe, austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D667
GHC Trac Issues: #10078
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
GHC does 2 validation checks for module `Main`:
* does `main` exist
* is `main` exported (#414)
The second check is done in ghc as well as in ghci (and runghc and ghc -e).
The first check however is currently not done in ghci, to prevent "'main' is
not in scope" errors when loading simple scripts. See commit d28ba8c8009 for
more information.
This commit tightens the special case for ghci. When the file does not contain
a main function, but does contain an explicit module header (i.e. "module Main
where"), then /do/ raise an error in ghci (and runghc and ghc -e) as well
Test Plan:
module/T7765: a module Main with an explicit module header but without a
main function should be an error for all Ways.
Additionaly: delete test module/mod174. It was added in commit 5a54c38, but it
is a duplicate of module/T414.
Reviewers: austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D649
GHC Trac Issues: #7765
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
David Feuer managed to tickle a corner case in the
code generator. See Note [Scrutinising VoidRep]
in StgCmmExpr.
I rejigged the comments in that area of the code generator
Note [Dodgy unsafeCoerce 1]
Note [Dodgy unsafeCoerce 2]
but I can't say I fully understand them, alas.
|
| |
|
|
|
|
|
| |
More subtlety due to functional dependencies.
Note [Redundant constraints in instance decls] in TcErrors.
Fixes Trac #10100.
|
| | |
|