summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Another way to fix the issuewip/t16981Matthew Pickering2021-07-222-9/+38
| | | | There are actually many places other than FloatOut which do floating.
* Add test for t16981Matthew Pickering2021-07-224-0/+43
|
* Failing splice static pointer testMatthew Pickering2021-07-222-0/+10
|
* template-haskell: Add support for default declarationsMario Blažević2021-07-2113-9/+49
| | | | Fixes #19373
* Use Ways API instead of Set specific functionsFendor2021-07-2112-31/+37
|
* Refactor SuggestExtension constructor in GhcHintAlfredo Di Napoli2021-07-2116-78/+153
| | | | | | | | | | | | | | | | | | This commit refactors the SuggestExtension type constructor of the GhcHint to be more powerful and flexible. In particular, we can now embed extra user information (essentially "sugar") to help clarifying the suggestion. This makes the following possible: Suggested fix: Perhaps you intended to use GADTs or a similar language extension to enable syntax: data T where We can still give to IDEs and tools a `LangExt.Extension` they can use, but in the pretty-printed message we can tell the user a bit more on why such extension is needed. On top of that, we now have the ability to express conjuctions and disjunctons, for those cases where GHC suggests to enable "X or Y" and for the cases where we need "X and Y".
* driver: Fix recompilation for modules importing GHC.PrimMatthew Pickering2021-07-2110-15/+45
| | | | | | | | | | | | | The GHC.Prim module is quite special as there is no interface file, therefore it doesn't appear in ms_textual_imports, but the ghc-prim package does appear in the direct package dependencies. This confused the recompilation checking which couldn't find any modules from ghc-prim and concluded that the package was no longer a dependency. The fix is to keep track of whether GHC.Prim is imported separately in the relevant places. Fixes #20084
* hadrian: Update docs targets documentation [skip ci]wip/hadrian-docs-targetsMatthew Pickering2021-07-201-3/+21
| | | | | The README had got a little out of sync with the current state of affairs.
* Make TmpFs independent of DynFlagsSylvain Henry2021-07-1916-60/+68
| | | | | | | | | This is small step towards #19877. We want to make the Loader/Linker interface more abstract to be easily reused (i.e. don't pass it DynFlags) but the system linker uses TmpFs which required a DynFlags value to get its temp directory. We explicitly pass the temp directory now. Similarly TmpFs was consulting the DynFlags to decide whether to clean or: this is now done by the caller in the driver code.
* Don't duplicate constructors in the simplifierSimon Peyton Jones2021-07-194-10/+196
| | | | | | | | | | | | Ticket #20125 showed that the Simplifier could sometimes duplicate a constructor binding. CSE would often eliminate it later, but doing it in the first place was utterly wrong. See Note [Do not duplicate constructor applications] in Simplify.hs I also added a short-cut to Simplify.simplNonRecX for the case when the RHS is trivial. I don't think this will change anything, just make the compiler run a tiny bit faster.
* Rename RecordPuns to NamedFieldPuns in LangExt.ExtensionAlfredo Di Napoli2021-07-197-13/+9
| | | | | | | | | | This commit renames the `RecordPuns` type constructor inside `GHC.LanguageExtensions.Type.hs` to `NamedFieldPuns`. The rationale is that the `RecordPuns` language extension was deprecated a long time ago, but it was still present in the AST, introducing an annoying mismatch between what GHC suggested (i.e. "use NamedFieldPuns") and what that translated into in terms of Haskell types.
* th: Weaken return type of myCoreToStgExprMatthew Pickering2021-07-195-56/+30
| | | | | | | | | | | | | | | | | | | | The previous code assumed properties of the CoreToStg translation, namely that a core let expression which be translated to a single non-recursive top-level STG binding. This assumption was false, as evidenced by #20060. The consequence of this was the need to modify the call sites of `myCoreToStgExpr`, the main one being in hscCompileCoreExpr', which the meant we had to use byteCodeGen instead of stgExprToBCOs to convert the returned value to bytecode. I removed the `stgExprToBCOs` function as it is no longer used in the compiler. There is still some partiallity with this patch (the lookup in hscCompileCoreExpr') but this should be more robust that before. Fixes #20060
* Bignum: don't allocate in bignat_mul (#20028)Sylvain Henry2021-07-191-4/+4
| | | | | We allocated the recursively entered `mul` helper function because it captures some args.
* Better sharing of join points (#19996)wip/T19557Simon Peyton Jones2021-07-194-29/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch, provoked by regressions in the text package (#19557), improves sharing of join points. This also fixes the terrible behaviour in #20049. See Note [Duplicating join points] in GHC.Core.Opt.Simplify. * In the StrictArg case of mkDupableContWithDmds, don't use Plan A for data constructors * In postInlineUnconditionally, don't inline JoinIds Avoids inlining join $j x = Just x in case blah of A -> $j x1 B -> $j x2 C -> $j x3 * In mkDupableStrictBind and mkDupableStrictAlt, create join points (much) more often: exprIsTrivial rather than exprIsDupable. This may be much, but we'll see. Metric Decrease: T12545 T13253-spj T13719 T18140 T18282 T18304 T18698a T18698b Metric Increase: T16577 T18923 T9961
* Add Word64#/Int64# primopsSylvain Henry2021-07-1523-150/+639
| | | | | | | | | | | | | | | | | | | | | | | Word64#/Int64# are only used on 32-bit architectures. Before this patch, operations on these types were directly using the FFI. Now we use real primops that are then lowered into ccalls. The advantage of doing this is that we can now perform constant folding on Word64#/Int64# (#19024). Most of this work was done by John Ericson in !3658. However this patch doesn't go as far as e.g. changing Word64 to always be using Word64#. Noticeable performance improvements T9203(normal) run/alloc 89870808.0 66662456.0 -25.8% GOOD haddock.Cabal(normal) run/alloc 14215777340.8 12780374172.0 -10.1% GOOD haddock.base(normal) run/alloc 15420020877.6 13643834480.0 -11.5% GOOD Metric Decrease: T9203 haddock.Cabal haddock.base
* Additional constant-folding rule for binary AND/ORSylvain Henry2021-07-151-10/+51
| | | | | | | | Add a constant folding rule allowing the subsumption of an application if the same argument is applied twice, e.g. (v .&. 0xFF) .&. 0xFF ~~> v .&. 0xFF (v .|. 0xFF) .|. 0xFF ~~> v .|. 0xFF
* Don't panic on 'no skolem info' and add failing testswip/no-skolem-panicZubin Duggal2021-07-1311-3/+117
|
* Added a hopefully clarificatory sentence about the notion of "atomicity" ↵Adrien2021-07-131-5/+13
| | | | presupposed in the documentation on MVar.
* driver: Fix interaction of -Wunused-packages and reexported-modulesMatthew Pickering2021-07-1319-18/+142
| | | | | | | | | | | | | | Spurious warnings were previously emitted if an import came from a reexport due to how -Wunused-packages were implemented. Removing the dependency would cause compilation to fail. The fix is to reimplement the warning a bit more directly, by searching for which package each import comes from using the normal module finding functions rather than consulting the EPS. This has the advantage that the check could be performed at any time after downsweep rather than also relying on a populated EPS. Fixes #19518 and #19777
* Add proper GHCHints for most PsMessage constructorswip/adinapoli-issue-20055Alfredo Di Napoli2021-07-1240-159/+284
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds proper hints to most diagnostic types in the `GHC.Parser.Errors.Types` module. By "proper" we mean that previous to this commit the hints were bundled together with the diagnostic message, whereas now we moved most of them as proper `[GhcHint]` in the implementation of `diagnosticHints`. More specifically, this is the list of constructors which now has proper hints: * PsErrIllegalBangPattern * PsWarnOperatorWhitespaceExtConflict * PsErrLambdaCase * PsErrIllegalPatSynExport * PsWarnOperatorWhitespace * PsErrMultiWayIf * PsErrIllegalQualifiedDo * PsErrNumUnderscores * PsErrLinearFunction * PsErrIllegalTraditionalRecordSyntax * PsErrIllegalExplicitNamespace * PsErrOverloadedRecordUpdateNotEnabled * PsErrIllegalDataTypeContext * PsErrSemiColonsInCondExpr * PsErrSemiColonsInCondCmd * PsWarnStarIsType * PsWarnImportPreQualified * PsErrImportPostQualified * PsErrEmptyDoubleQuotes * PsErrIllegalRoleName * PsWarnStarBinder For some reason, this patch increases the peak_megabyte_allocated of the T11545 test to 90 (from a baseline of 80) but that particular test doesn't emit any parsing diagnostic or hint and the metric increase happens only for the `aarch64-linux-deb10`. Metric Increase: T11545
* ci: Copy the cache from inside the nix-shell where $HOME is different on darwinMatthew Pickering2021-07-102-7/+19
| | | | | | Hopefully fixes the flaky CI failures we have seen recently. Co-authored-by: Moritz Angerman <moritz.angermann@gmail.com>
* Don't return unitExpr in dsWhenNoErrssheaf2021-07-108-26/+124
| | | | | | | | | | | | | - fixes #18149 and #14765 dsWhenNoErrs now returns "runtimeError @ty" when disallowed representation polymorphism is detected, where ty is the type of the result CoreExpr. "ty" is passed as an additional argument to dsWhenNoErrs, and is used only in the case of such an error. The calls to dsWhenNoErrs must now compute the type of the CoreExpr they are trying to build, so that an error of the right type can be used in case of a representation polymorphism failure.
* Avoid unsafePerformIO for getProgNameSylvain Henry2021-07-097-27/+20
| | | | | | | | getProgName was used to append the name of the program (e.g. "ghc") to printed error messages in the Show instance of GhcException. It doesn't belong here as GHCi and GHC API users may want to override this behavior by setting a different error handler. So we now call it in the defaultErrorHandler instead.
* Add TcRnIllegalWildcardsInConstructor to TcRnMessageAlfredo Di Napoli2021-07-093-7/+18
|
* Remove redundant patSigErrAlfredo Di Napoli2021-07-091-16/+0
|
* Add TcRnCharLiteralOutOfRange to TcRnMessageAlfredo Di Napoli2021-07-093-6/+18
|
* Add TcRnIllegalViewPattern to TcRnMessageAlfredo Di Napoli2021-07-096-6/+33
|
* Add TcRnDuplicateFieldName to TcRnMessageAlfredo Di Napoli2021-07-093-16/+31
|
* Add TcRnIllegalWildCardsInRecord to TcRnMessageAlfredo Di Napoli2021-07-096-3/+48
|
* Add TcRnIllegalFieldPunning to TcRnMessageAlfredo Di Napoli2021-07-095-10/+30
|
* Add TcRnEmptyRecordUpdate to TcRnMessageAlfredo Di Napoli2021-07-093-4/+18
|
* Add TcRnIllegalPatSynDecl to TcRnMessageAlfredo Di Napoli2021-07-093-4/+23
|
* Add TcRnSimplifierTooManyIterations to TcRnMessageAlfredo Di Napoli2021-07-095-6/+33
|
* Add the TcRnDuplicateWarningDecls to TcRnMessageAlfredo Di Napoli2021-07-093-8/+20
|
* Add the TcRnShadowedName constructor to TcRnMessageAlfredo Di Napoli2021-07-093-16/+46
| | | | | This commit adds the TcRnShadowedName to the TcRnMessage type and it uses it in GHC.Rename.Utils.
* Make throwto002 a normal (not reqlib) testMatthew Pickering2021-07-092-2/+1
|
* Remove reqlib from cgrun025 testMatthew Pickering2021-07-093-8/+8
|
* Rename getErrorMessages and getMessages function in parser codewip/adinapoli-issue-19920Alfredo Di Napoli2021-07-0810-35/+34
| | | | | | | | | | | This commit renames the `getErrorMessages` and `getMessages` function in the parser code to `getPsErrorMessages` and `getPsMessages`, to avoid import conflicts, as we have already `getErrorMessages` and `getMessages` defined in `GHC.Types.Error`. Fixes #19920. Update haddock submodule
* driver: Add test for #12983Matthew Pickering2021-07-079-0/+145
| | | | | | | This test has worked since 8.10.2 at least but was recently broken and is now working again after this patch. Closes #12983
* driver: Convert runPipeline to use a free monadMatthew Pickering2021-07-0715-1947/+1922
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts the runPipeline function to be implemented in terms of a free monad rather than the previous CompPipeline. The advantages of this are three-fold: 1. Different parts of the pipeline can return different results, the limits of runPipeline were being pushed already by !5555, this opens up futher fine-grainedism of the pipeline. 2. The same mechanism can be extended to build-plan at the module level so the whole build plan can be expressed in terms of one computation which can then be treated uniformly. 3. The pipeline monad can now be interpreted in different ways, for example, you may want to interpret the `TPhase` action into the monad for your own build system (such as shake). That bit will probably require a bit more work, but this is a step in the right directin. There are a few more modules containing useful functions for interacting with the pipelines. * GHC.Driver.Pipeline: Functions for building pipelines at a high-level * GHC.Driver.Pipeline.Execute: Functions for providing the default interpretation of TPhase, in terms of normal IO. * GHC.Driver.Pipeline.Phases: The home for TPhase, the typed phase data type which dictates what the phases are. * GHC.Driver.Pipeline.Monad: Definitions to do with the TPipelineClass and MonadUse class. Hooks consumers may notice the type of the `phaseHook` has got slightly more restrictive, you can now no longer control the continuation of the pipeline by returning the next phase to execute but only override individual phases. If this is a problem then please open an issue and we will work out a solution. ------------------------- Metric Decrease: T4029 -------------------------
* Fix #19889 - Invalid BMI2 instructions generated.wip/andreask/bim-fixAndreas Klebinger2021-07-062-24/+26
| | | | | When arguments are 8 *or 16* bits wide, then truncate before/after and use the 32bit operation.
* Fix issue 20038 - Change 'variable' -> 'variables'Edward2021-07-064-4/+4
|
* Use target platform in guessOutputFileSylvain Henry2021-07-061-2/+3
|
* Pass '-x c++' and '-std=c++11' to `cc` for cpp files, in HadrianEthan Kiang2021-07-065-13/+30
| | | | | '-x c++' was found to be required on Darwin Clang 11 and 12. '-std=c++' was found to be needed on Clang 12 but not 11.
* Add test for executablePathFraser Tweedale2021-07-062-1/+51
|
* Implement improved "get executable path" queryFraser Tweedale2021-07-063-2/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | System.Environment.getExecutablePath has some problems: - Some system-specific implementations throw an exception in some scenarios, e.g. when the executable file has been deleted - The Linux implementation succeeds but returns an invalid FilePath when the file has been deleted. - The fallback implementation returns argv[0] which is not necessarily an absolute path, and is subject to manipulation. - The documentation does not explain any of this. Breaking the getExecutablePath API or changing its behaviour is not an appealing direction. So we will provide a new API. There are two facets to the problem of querying the executable path: 1. Does the platform provide a reliable way to do it? This is statically known. 2. If so, is there a valid answer, and what is it? This may vary, even over the runtime of a single process. Accordingly, the type of the new mechanism is: Maybe (IO (Maybe FilePath)) This commit implements this mechanism, defining the query action for FreeBSD, Linux, macOS and Windows. Fixes: #10957 Fixes: #12377
* Arity: Handle shadowing properlySebastian Graf2021-07-021-9/+51
| | | | | | | | | | | | | | In #20070, we noticed that `findRhsArity` copes badly with shadowing. A simple function like `g_123 x_123 = x_123`, where the labmda binder shadows, already regressed badly. Indeed, the whole `arityType` function wasn't thinking about shadowing *at all*. I rectified that and established the invariant that `ae_join` and `am_sigs` should always be disjoint. That entails deleting bindings from `ae_join` whenever we add something to `am_sigs` and vice versa, which would otherwise be a bug in the making. That *should* fix (but I don't want to close it) #20070.
* Support unlifted datatypes in GHCiLuite Stegeman2021-07-029-61/+204
| | | | fixes #19628
* Move aarch64-linux-llvm to nightlyMoritz Angermann2021-07-021-0/+1
| | | | | | This job takes by far the longest time on its own, we now have a NCG. Once we have fast aarch64 machines, we can consider putting this one back.
* Revert "Move validate-x86_64-linux-deb9-hadrian back to quick-build"Moritz Angermann2021-07-021-1/+1
| | | | This reverts commit a0622459f1d9a7068e81b8a707ffc63e153444f8.