| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit expands the old Note [Type variable cycles in Givens] to apply
as well to Deriveds. See the Note for details and examples. This fixes a
regression introduced by my earlier commit that killed off the flattener in
favor of the rewriter.
A few other things happened along the way:
* unifyTest was renamed to touchabilityTest, because that's what it does.
* isInsolubleOccursCheck was folded into checkTypeEq, which does much of the
same work. To get this to work out, though, we need to keep more careful
track of what errors we spot in checkTypeEq, and so CheckTyEqResult has
become rather more glorious.
* A redundant Note or two was eliminated.
* Kill off occCheckForErrors; due to Note [Rewriting synonyms], the
extra occCheckExpand here is always redundant.
* Store blocked equalities separately from other inerts; less stuff
to look through when kicking out.
Close #19682.
test case: typecheck/should_compile/T19682{,b}
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ensure that division wrappers are INLINE
* make div/mod/divMod call quot/rem/quotRem (same code)
* this ensures that the quotRemWordN# primitive is used to implement
divMod (it wasn't the case for sized Words)
* make first argument strict for Natural and Integer (similarly to other
numeric types)
|
|
|
|
| |
Fixes #17817
|
|
|
|
|
|
|
|
|
|
|
| |
This commit replaces the PsUnknownMessage diagnostics over at
`GHC.Parser.Header` with a new `PsHeaderMessage` type (part of
the more general `PsMessage`), so that we can throw parser header's
errors which can be correctly caught by `GHC.Driver.Pipeline.preprocess`
and rewrapped (correctly) as Driver messages (using the
`DriverPsHeaderMessage`).
This gets rid of the nasty compiler crash as part of #19923.
|
|
|
|
|
| |
This patch adds OverloadedRecordDot and OverloadedRecordUpdate in
9.2.1's release note.
|
|
|
|
|
|
|
|
| |
The flag is called `-Wprepositive-qualified-module`, not
`-Wprepositive-qualified-syntax`.
Use the `:ghc-flag:` syntax, which would have caught the mistake in the first
place.
|
|
|
|
|
|
|
|
|
| |
* Add a Note to clarify RttiTypes.
* Don't call `quantifyType` at all the call sites of `check2`.
* Simplyfy arguments of functions `Inspect.hs:check1` and `Inspect.hs:check2`.
- `check1` only uses the two lists of type variables, but not the types.
- `check2` only uses the two types, but not the lists of type variables.
* In `Inspect.hs:check2` send only the tau part of the type to `tcSplitTyConApp_maybe`.
|
|
|
|
|
|
|
|
|
|
|
| |
This commit converts a bunch of HsToCore (Ds) messages to use the new
GHC's diagnostic message infrastructure. In particular the DsMessage
type has been expanded with a lot of type constructors, each
encapsulating a particular error and warning emitted during desugaring.
Due to the fact that levity polymorphism checking can happen both at the
Ds and at the TcRn level, a new `TcLevityCheckDsMessage` constructor has
been added to the `TcRnMessage` type.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch comprises of four different but closely related ideas. The
net result is fixing a large number of open issues with the driver
whilst making it simpler to understand.
1. Use the hash of the source file to determine whether the source file
has changed or not. This makes the recompilation checking more robust to
modern build systems which are liable to copy files around changing
their modification times.
2. Remove the concept of a "stable module", a stable module was one
where the object file was older than the source file, and all transitive
dependencies were also stable. Now we don't rely on the modification
time of the source file, the notion of stability is moot.
3. Fix TH/plugin recompilation after the removal of stable modules. The
TH recompilation check used to rely on stable modules. Now there is a
uniform and simple way, we directly track the linkables which were
loaded into the interpreter whilst compiling a module. This is an
over-approximation but more robust wrt package dependencies changing.
4. Fix recompilation checking for dynamic object files. Now we actually
check if the dynamic object file exists when compiling with -dynamic-too
Fixes #19774 #19771 #19758 #17434 #11556 #9121 #8211 #16495 #7277 #16093
|
|
|
|
|
|
|
|
| |
The tests `CountParserDeps.hs` and `CountAstDeps.hs` are implemented
by calling `CountDeps`. In this MR, `CountDeps.printDeps` is updated
such tat by uncommenting a line, you can print a module's dependency
graph showing what includes what. The output is in a format suitable
for use with graphviz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As the now historic part of `NOTE [aBSENT_ERROR_ID]` explains, we used to have
`exprIsHNF` respond True to `absentError` and give it a non-bottoming demand
signature, in order to perform case-to-let on certain `case`s we used to emit
that scrutinised `absentError` (Urgh).
What changed, why don't we emit these questionable absent errors anymore?
The absent errors in question filled in for binders that would end up in
strict fields after being seq'd. Apparently, the old strictness analyser would
give these binders an absent demand, but today we give them head-strict demand
`1A` and thus don't replace with absent errors at all.
This fixes items (1) and (2) of #19853.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When compiling Agda we entered into an infinite loop as the stopping
condition was a bit wrong in hptSomeModulesBelow.
The bad situation was something like
* We would see module A (NotBoot) and follow it dependencies
* Later on we would encounter A (Boot) and follow it's dependencies,
because the lookup would not match A (NotBoot) and A (IsBoot)
* Somewhere in A (Boot)s dependencies, A (Boot) would appear again and
lead us into an infinite loop.
Now the state marks whether we have been both variants (IsBoot and
NotBoot) so we don't follow dependencies for A (Boot) many times.
|
|
|
|
|
| |
This causes hadrian to be built twice because the second time uses a
different index state.
|
| |
|
|
|
|
|
|
|
|
|
| |
The rule before decided to build the whole stage1 compiler, but this was
unecessary as we were just missing one header file which can be
generated directly by calling configure.
Before: 18 minutes
After: 54s
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this patch, GHC used to silently accept programs such as the
following:
data R where
D1 :: { d1 :: Int } %1 -> R
The %1 annotation was completely ignored. Now it is a proper error.
One remaining issue is that in the error message (⊸) turns
into (%1 ->). This is to be corrected with upcoming exactprint updates.
|
| |
|
| |
|
|
|
|
|
|
|
| |
* For primops from `GHC.Prim` lookup the HValues in `GHC.PrimopWrappers`.
* Add short error messages if a user tries to use a *Non-Id* value or a
`pseudoop` in a `:print`, `:sprint` or `force`command.
* Add additional test cases for `Magic Ids`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The sequencing of monadic effects in foldlM and foldrM was described as
respectively right-associative and left-associative, but this could be
confusing, as in essence we're just composing Kleisli arrows, whose
composition is simply associative.
What matters therefore is the order of sequencing of effects, which
can be described more clearly without dragging in associativity as
such.
This avoids describing these folds as being both left-to-right and
right-to-left depending on whether we're tracking effects or operator
application. The new text should be easier to understand.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GHC's internal State monad benefits from oneShot annotations on its
state, allowing for more aggressive eta expansion.
We currently don't have monad transformers with the same optimisation,
so we only change uses of the pure State monad here.
See #19657 and 19380.
Metric Decrease:
hie002
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This creates new modules GHC.Tc.Solver.InertSet and
GHC.Tc.Solver.Types. The Monad module is still pretty
big, but this is an improvement. Moreover, it means
that GHC.HsToCore.Pmc.Solver.Types no longer depends
on the constraint solver (it now depends on GHC.Tc.Solver.InertSet),
making the error-messages work easier.
This patch thus contributes to #18516.
|
| |
|
|
|
|
|
|
|
|
|
| |
We need to match on DataCon workers for the rules to be triggered.
T13701 ghc/alloc decreases by ~2.5% on some archs
Metric Decrease:
T13701
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This also demotes the error message about -fkeep-going to a trace
message which matches the behaviour of other build systems (such as
cabal-install and nix) which don't print any message like this on a
failure.
We want to remove the stable module check in a future patch, which is an
approximation of `-fkeep-going`. At the moment this change shouldn't do
very much.
|
| |
|
| |
|
| |
|
|
|
|
| |
isInstance
|
|
|
|
|
|
|
|
| |
The stg_ctoi_t and stg_ret_t procedures which convert unboxed
tuples between the bytecode an native calling convention were
causing a panic when using the LLVM backend.
Fixes #19591
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After !4741, it was no longer possible to silence a warning about a missing
pattern synonym signature if the `-Wmissing-signatures` flag was on.
Restore the previous semantics while still adhering to the principle "enabling
an additional warning flag should never make prior warnings disappear".
For more symmetry and granularity, introduce
`-Wmissing-exported-pattern-synonym-signatures`.
See Note [Missing signatures] for an overview of all flags involved.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using the following high-quality benchmark (with -O2):
main :: IO ()
main = do
let
go 0 = ""
go n@(W# n#) = showWord n# (go (n -1))
print $ length (go 10000000)
I get the following performance results:
- remWord+quotRem: 0,76s user 0,00s system 99% cpu 0,762 total
- quotRemWord: 0,45s user 0,01s system 99% cpu 0,456 total
Note that showSignedInt already uses quotRemInt.
|
| |
|
|
|
|
|
|
|
|
| |
Closes #19903
Note: the normal ppr does not reproduce unicode linear arrows, so that
part of the normal printing test is ommented out in the Makefile for
this test. See #18846
|
|
|
|
| |
This fixes #19823
|
|
|
|
|
| |
Another change in a series improving record syntax in the AST. The key
change in this commit is the renaming of `HsFieldLabel` to `DotFieldOcc`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the common case this is a straight performance win
at a compile time cost so we enable it at -O2.
In rare cases it can lead to compile time regressions
because of changed inlining behaviour. Which can very
rarely also affect runtime performance.
Increasing the inlining threshold can help to avoid this
which is documented in the user guide.
In terms of measured results this reduced instructions executed
for nofib by 1%.
However for some cases (e.g. Cabal) enabling this
by default increases compile time by 2-3% so we enable it only
at -O2 where it's clear that a user is willing to trade compile
time for runtime.
Most of the testsuite runs without -O2 so there are few
perf changes.
Increases:
T12545/T18698: We perform more WW work because dicts are now treated strict.
T9198: Also some more work because functions are now subject to W/W
Decreases:
T14697: Compiling empty modules. Probably because of changes inside ghc.
T9203: I can't reproduce this improvement locally. Might be spurious.
-------------------------
Metric Decrease:
T12227
T14697
T9203
Metric Increase:
T9198
T12545
T18698a
T18698b
-------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change aims to make source files relocatable w.r.t. to the interface files produced by the compiler.
This is so that we can download interface files produced by a cloud build system and then reuse them in a local ghcide session
catch another case of implicit includes
actually use the implicit quote includes
add another missing case
recomp020
test that .hi files are reused even if .hs files are moved to a new location
Added recomp021 to record behaviour with non implicit includes
add a note
additional pointer to the note
Mention #16956 in Note
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit converts the lexers and all the parser machinery to use the
new parser types and diagnostics infrastructure. Furthermore, it cleans
up the way the parser code was emitting hints.
As a result of this systematic approach, the test output of the
`InfixAppPatErr` and `T984` tests have been changed. Previously they
would emit a `SuggestMissingDo` hint, but this was not at all helpful in
resolving the error, and it was even confusing by just looking at the
original program that triggered the errors.
Update haddock submodule
|
|
|
|
|
|
| |
This is part of #18738
[skip ci]
|
|
|
|
| |
This reverts commit 673ff667c98eafc89e6746d1ac69d33b8330d755.
|
| |
|
| |
|
|
|
|
|
|
| |
This prohuibits CC=clang to work generically and will always bake
in the clang that is found on the build machine in PATH, what ever
clang that might be. It might not even be on the final host.
|
|
|
|
| |
This should prevent some other `bash` to leak into the binary distributions.
|
|
|
|
| |
Also while we are at it, run shellcheck on ci.sh
|
|
|
|
| |
Also make sure to be able to build with non-apple-clang, while using apple's SDK on macOS
|