summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* make: Fix make maintainer-clean deleting a file tracked by source controlwip/t21659Matthew Pickering2022-05-271-1/+0
| | | | Fixes #21659
* [base] Fix the links in the Data.Data moduleHécate Moonlight2022-05-261-4/+2
| | | | | | fix #21658 fix #21657 fix #21657
* Generalize breakTyVarCycle to work with TyFamLHSRichard Eisenberg2022-05-2611-73/+167
| | | | | | | | | | | | | | | | | The function breakTyVarCycle_maybe has been installed in a dark corner of GHC to catch some gremlins (a.k.a. occurs-check failures) who lurk there. But it previously only caught gremlins of the form (a ~ ... F a ...), where some of our intrepid users have spawned gremlins of the form (G a ~ ... F (G a) ...). This commit improves breakTyVarCycle_maybe (and renames it to breakTyEqCycle_maybe) to catch the new gremlins. Happily, the change is remarkably small. The gory details are in Note [Type equality cycles]. Test cases: typecheck/should_compile/{T21515,T21473}.
* Add tests for eta-expansion of data constructorssheaf2022-05-2610-0/+276
| | | | | This patch adds several tests relating to the eta-expansion of data constructors, including UnliftedNewtypes and DataTypeContexts.
* TTG: Move MatchGroup Origin field and MatchGroupTc to GHC.Hswip/romes/ttg-matchgroup-originromes2022-05-2628-151/+130
|
* Factor out `initArityOps` to `GHC.Driver.Config.*` moduleJohn Ericson2022-05-263-6/+18
| | | | We want `DynFlags` only mentioned in `GHC.Driver`.
* fix executablePath test for NetBSDFraser Tweedale2022-05-262-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | executablePath support for NetBSD was added in a172be07e3dce758a2325104a3a37fc8b1d20c9c, but the test was not updated. Update the test so that it works for NetBSD. This requires handling some quirks: - The result of getExecutablePath could include "./" segments. Therefore use System.FilePath.equalFilePath to compare paths. - The sysctl(2) call returns the original executable name even after it was deleted. Add `canQueryAfterDelete :: [FilePath]` and adjust expectations for the post-delete query accordingly. Also add a note to the `executablePath` haddock to advise that NetBSD behaves differently from other OSes when the file has been deleted. Also accept a decrease in memory usage for T16875. On Windows, the metric is -2.2% of baseline, just outside the allowed ±2%. I don't see how this commit could have influenced this metric, so I suppose it's something in the CI environment. Metric Decrease: T16875
* executablePath test: fix file extension treatmentFraser Tweedale2022-05-261-10/+11
| | | | | | | | | | | | | | | | The executablePath test strips the file extension (if any) when comparing the query result with the expected value. This is to handle platforms where GHC adds a file extension to the output program file (e.g. .exe on Windows). After the initial check, the file gets deleted (if supported). However, it tries to delete the *stripped* filename, which is incorrect. The test currently passes only because Windows does not allow deleting the program while any process created from it is alive. Make the test program correct in general by deleting the *non-stripped* executable filename.
* Optimiser: avoid introducing bad rep-polysheaf2022-05-262-17/+33
| | | | | | | | | | | | | | | | | | | | | | | | | The functions `pushCoValArg` and `pushCoercionIntoLambda` could introduce bad representation-polymorphism. Example: type RR :: RuntimeRep type family RR where { RR = IntRep } type F :: TYPE RR type family F where { F = Int# } co = GRefl F (TYPE RR[0]) :: (F :: TYPE RR) ~# (F |> TYPE RR[0] :: TYPE IntRep) f :: F -> () `pushCoValArg` would transform the unproblematic application (f |> (co -> <()>)) (arg :: F |> TYPE RR[0]) into an application in which the argument does not have a fixed `RuntimeRep`: f ((arg |> sym co) :: (F :: TYPE RR))
* Avoid global compiler state for `GHC.Core.Opt.WorkWrap`Dominik Peteler2022-05-265-23/+34
| | | | Progress towards #17957
* Add Haddocks for `WwOpts`John Ericson2022-05-261-5/+8
|
* Replace dead link in Haddock documentation of Control.Monad.Fail (fixes #21602)BinderDavid2022-05-261-1/+1
|
* update READMEEric Lindblad2022-05-261-2/+4
|
* Desugar RecordUpd in `tcExpr`wip/T18802CarrieMY2022-05-2546-762/+1015
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch typechecks record updates by desugaring them inside the typechecker using the HsExpansion mechanism, and then typechecking this desugared result. Example: data T p q = T1 { x :: Int, y :: Bool, z :: Char } | T2 { v :: Char } | T3 { x :: Int } | T4 { p :: Float, y :: Bool, x :: Int } | T5 The record update `e { x=e1, y=e2 }` desugars as follows e { x=e1, y=e2 } ===> let { x' = e1; y' = e2 } in case e of T1 _ _ z -> T1 x' y' z T4 p _ _ -> T4 p y' x' The desugared expression is put into an HsExpansion, and we typecheck that. The full details are given in Note [Record Updates] in GHC.Tc.Gen.Expr. Fixes #2595 #3632 #10808 #10856 #16501 #18311 #18802 #21158 #21289 Updates haddock submodule
* SimpleOpt: beta-reduce through castssheaf2022-05-251-21/+80
| | | | | | | | | | | | The simple optimiser would sometimes fail to beta-reduce a lambda when there were casts in between the lambda and its arguments. This can cause problems because we rely on representation-polymorphic lambdas getting beta-reduced away (for example, those that arise from newtype constructors with representation-polymorphic arguments, with UnliftedNewtypes).
* Remove HscEnv from GHC.HsToCore.Usage (related to #17957)Andre Marianiello2022-05-255-21/+54
| | | | | Metric Decrease: T16875
* Hadrian: don't add "lib" for relocatable buildssheaf2022-05-241-1/+1
| | | | | | | The conditional in hadrian/bindist/Makefile depended on the target OS, but it makes more sense to use whether we are using a relocatable build. (Currently this only gets set to true on Windows, but this ensures that the logic stays correctly coupled.)
* Fix compilation with -haddock on GHC <= 8.10Zubin Duggal2022-05-241-2/+2
| | | | | | | | | | | -haddock on GHC < 9.0 is quite fragile and can result in obtuse parse errors when it encounters invalid haddock syntax. This has started to affect users since 297156e0b8053a28a860e7a18e1816207a59547b enabled -haddock by default on many flavours. Furthermore, since we don't test bootstrapping with 8.10 on CI, this problem managed to slip throught the cracks.
* Fix #21563 by using Word64 for 64bit shift code.Andreas Klebinger2022-05-241-3/+4
| | | | | | We use the 64bit shifts only on 64bit platforms. But we compile the code always so compiling it on 32bit caused a lint error. So use Word64 instead.
* Use UnionListsOrd instead of UnionLists in most places.Andreas Klebinger2022-05-243-9/+25
| | | | This should get rid of most, if not all "Overlong lists" errors and fix #20016
* Remove -z wxneeded for OpenBSDGreg Steuck2022-05-241-7/+0
| | | | | | | With all the recent W^X fixes in the loader this workaround is not necessary any longer. I verified that the only tests failing for me on OpenBSD 7.1-current are the same (libc++ related) before and after this commit (with --fast).
* hadrian/bindist: Drop redundant include of install.mkBen Gamari2022-05-241-1/+0
| | | | | | `install.mk` is already included by `config.mk`. Moreover, `install.mk` depends upon `config.mk` to set `RelocatableBuild`, making this first include incorrect.
* Fix haddock_*_perf tests on non-GNU-grep systemsGreg Steuck2022-05-241-4/+4
| | | | | | | Using regexp pattern requires `egrep` and straight up `+`. The haddock_parser_perf and haddock_renamer_perf tests now pass on OpenBSD. They previously incorrectly parsed the files and awk complained about invalid syntax.
* Allow passing -po outside profiling wayTeo Camarasu2022-05-241-0/+17
| | | | Resolves #21455
* Add test for T21455Teo Camarasu2022-05-242-0/+6
|
* EPA: Comment Order ReversedAlan Zimmerman2022-05-238-21/+270
| | | | | | | Make sure comments captured in the exact print annotations are in order of increasing location Closes #20718
* EPA : Remove duplicate comments in DataFamInstDAlan Zimmerman2022-05-2310-27/+365
| | | | | | | | | | | | | | | | The code data instance Method PGMigration = MigrationQuery Query -- ^ Run a query against the database | MigrationCode (Connection -> IO (Either String ())) -- ^ Run any arbitrary IO code Resulted in two instances of the "-- ^ Run a query against the database" comment appearing in the Exact Print Annotations when it was parsed. Ensure only one is kept. Closes #20239
* Make debug a `Bool` not an `Int` in `StgToCmmConfig`John Ericson2022-05-233-6/+6
| | | | | | | We don't need any more resolution than this. Rename the field to `stgToCmmEmitDebugInfo` to indicate it is no longer conveying any "level" information.
* Improve FloatOut and SpecConstrwip/T21386Simon Peyton Jones2022-05-236-51/+111
| | | | | | | | | | | | | | | | | | | | | | | This patch addresses a relatively obscure situation that arose when chasing perf regressions in !7847, which itself is fixing It does two things: * SpecConstr can specialise on ($df d1 d2) dictionary arguments * FloatOut no longer checks argument strictness See Note [Specialising on dictionaries] in GHC.Core.Opt.SpecConstr. A test case is difficult to construct, but it makes a big difference in nofib/real/eff/VSM, at least when we have the patch for #21286 installed. (The latter stops worker/wrapper for dictionary arguments). There is a spectacular, but slightly illusory, improvement in runtime perf on T15426. I have documented the specifics in T15426 itself. Metric Decrease: T15426
* Modularize GHC.Core.Opt.LiberateCasewip/cmm-dominatorsDominik Peteler2022-05-224-16/+51
| | | | Progress towards #17957
* Consider the stage of typeable evidence when checking stage restrictionMatthew Pickering2022-05-227-21/+130
| | | | | | | | | | | | | | We were considering all Typeable evidence to be "BuiltinInstance"s which meant the stage restriction was going unchecked. In-fact, typeable has evidence and so we need to apply the stage restriction. This is complicated by the fact we don't generate typeable evidence and the corresponding DFunIds until after typechecking is concluded so we introcue a new `InstanceWhat` constructor, BuiltinTypeableInstance which records whether the evidence is going to be local or not. Fixes #21547
* Test DESTDIR in test_hadrian()wip/type-dataJulian Ospald2022-05-211-2/+23
|
* Respect DESTDIR in hadrian bindist Makefile, fixes #19646Julian Ospald2022-05-211-25/+24
|
* Change `Backend` type and remove direct dependencieswip/backend-as-recordNorman Ramsey2022-05-2149-362/+1306
| | | | | | | | | | | | | | | | | | | With this change, `Backend` becomes an abstract type (there are no more exposed value constructors). Decisions that were formerly made by asking "is the current back end equal to (or different from) this named value constructor?" are now made by interrogating the back end about its properties, which are functions exported by `GHC.Driver.Backend`. There is a description of how to migrate code using `Backend` in the user guide. Clients using the GHC API can find a backdoor to access the Backend datatype in GHC.Driver.Backend.Internal. Bumps haddock submodule. Fixes #20927
* validate: Use $make rather than makeMatthew Pickering2022-05-201-1/+1
| | | | | | | | In the validate script we are careful to use the $make variable as this stores whether we are using gmake, make, quiet mode etc. There was just this one place where we failed to use it. Fixes #21598
* docs: Fix LlvmVersion in manpage (#21280)Zubin Duggal2022-05-203-5/+7
|
* Remove pprTrace from pushCoercionIntoLambda (#21555)Matthew Pickering2022-05-203-1/+101
| | | | | | | | | | | | | This firstly caused spurious output to be emitted (as evidenced by #21555) but even worse caused a massive coercion to be attempted to be printed (> 200k terms) which would invariably eats up all the memory of your computer. The good news is that removing this trace allows the program to compile to completion, the bad news is that the program exhibits a core lint error (on 9.0.2) but not any other releases it seems. Fixes #21577 and #21555
* nonmoving: Fix documentation of GC statistics fieldsBen Gamari2022-05-202-25/+17
| | | | | | These were previously incorrect. Fixes #21553.
* document fields of `DominatorSet`Andreas Klebinger2022-05-201-2/+2
|
* add HasDebugCallStack; remove unneeded extensionsNorman Ramsey2022-05-201-16/+19
|
* add dominator-tree functionNorman Ramsey2022-05-201-0/+12
|
* add dominator analysis of `CmmGraph`Norman Ramsey2022-05-202-0/+201
| | | | | | | | | | | | This commit adds module `GHC.Cmm.Dominators`, which provides a wrapper around two existing algorithms in GHC: the Lengauer-Tarjan dominator analysis from the X86 back end and the reverse postorder ordering from the Cmm Dataflow framework. Issue #20726 proposes that we evaluate some alternatives for dominator analysis, but for the time being, the best path forward is simply to use the existing analysis on `CmmGraph`s. This commit addresses a bullet in #21200.
* configure: Check CC_STAGE0 for --target supportBen Gamari2022-05-193-12/+16
| | | | | | | | | | | | | | We previously only checked the stage 1/2 compiler for --target support. We got away with this for quite a while but it eventually caught up with us in #21579, where `bytestring`'s new NEON implementation was unbuildable on Darwin due to Rosetta's seemingly random logic for determining which executable image to execute. This lead to a confusing failure to build `bytestring`'s cbits, when `clang` tried to compile NEON builtins while targetting x86-64. Fix this by checking CC_STAGE0 for --target support. Fixes #21579.
* hadrian: Don't attempt to build dynamic profiling librariesMatthew Pickering2022-05-191-1/+1
| | | | | | | | We only support building static profiling libraries, the transformer was requesting things like a dynamic, threaded, debug, profiling RTS, which we have never produced nor distributed. Fixes #21567
* ci: Use correct syntax when args list is emptyMatthew Pickering2022-05-191-1/+1
| | | | This seems to fail on the ancient version of bash present on CentOS
* ci: Don't build sphinx documentation on centosMatthew Pickering2022-05-192-0/+6
| | | | | | | The centos docker image lacks the sphinx builder so we disable building sphinx docs for these jobs. Fixes #21580
* Add release flavour and use it for the release jobsMatthew Pickering2022-05-198-126/+161
| | | | | | | | The release flavour is essentially the same as the perf flavour currently but also enables `-haddock`. I have hopefully updated all the relevant places where the `-perf` flavour was hardcoded. Fixes #21486
* testsuite: Add tests for #21336Ben Gamari2022-05-197-0/+47
|
* base: Throw exceptions raised while closing finalized HandlesBen Gamari2022-05-194-15/+70
| | | | Fixes #21336.
* base: Introduce [sg]etFinalizerExceptionHandlerBen Gamari2022-05-1911-31/+104
| | | | | This introduces a global hook which is called when an exception is thrown during finalization.