summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* EPA: handling of con_bndrs in mkGadtDeclwip/az/T20558Alan Zimmerman2022-04-063-21/+571
| | | | | | Get rid of unnnecessary case clause that always matched. Closes #20558
* gitlab-ci: Disable cabal-install store caching on WindowsBen Gamari2022-04-052-34/+21
| | | | | | | For reasons that remain a mystery, cabal-install seems to consistently corrupt its cache on Windows. Disable caching for now. Works around #21347.
* Ensure implicit parameters are liftedsheaf2022-04-014-5/+19
| | | | | | | | `tcExpr` typechecked implicit parameters by introducing a metavariable of kind `TYPE kappa`, without enforcing that `kappa ~ LiftedRep`. This patch instead creates a metavariable of kind `Type`. Fixes #21327
* users-guide: Fix various markup issuesBen Gamari2022-04-011-15/+15
|
* Fix error when using empty case in arrow notationJakob Bruenker2022-04-015-13/+50
| | | | | | | | | It was previously not possible to use -XEmptyCase in Arrow notation, since GHC would print "Exception: foldb of empty list". This is now fixed. Closes #21301
* Add a regression test for #21323sheaf2022-04-012-0/+56
| | | | | This bug was fixed at some point between GHC 9.0 and GHC 9.2; this patch simply adds a regression test.
* Implement \cases (Proposal 302)Jakob Bruenker2022-04-0175-568/+1096
| | | | | | | | | | | | This commit implements proposal 302: \cases - Multi-way lambda expressions. This adds a new expression heralded by \cases, which works exactly like \case, but can match multiple apats instead of a single pat. Updates submodule haddock to support the ITlcases token. Closes #20768
* Keep track of promotion ticks in HsOpTywip/no-c-stubswip/matt-merge-batchsheaf2022-04-0132-132/+295
| | | | | | | | | | | | | | | | This patch adds a PromotionFlag field to HsOpTy, which is used in pretty-printing and when determining whether to emit warnings with -fwarn-unticked-promoted-constructors. This allows us to correctly report tick-related warnings for things like: type A = Int : '[] type B = [Int, Bool] Updates haddock submodule Fixes #19984
* docs: Update documentation interaction of search path, -hidir and -c mode.Matthew Pickering2022-04-011-5/+9
| | | | | | | | | As noted in #20569 the documentation for search path was wrong because it seemed to indicate that `-i` dirs were important when looking for interface files in `-c` mode, but they are not important if `-hidir` is set. Fixes #20569
* driver: In oneshot mode, look for interface files in hidirMatthew Pickering2022-04-015-3/+20
| | | | | | | | | | | | | | | | How things should work: * -i is the search path for source files * -hidir explicitly sets the search path for interface files and the output location for interface files. * -odir sets the search path and output location for object files. Before in one shot mode we would look for the interface file in the search locations given by `-i`, but then set the path to be in the `hidir`, so in unusual situations the finder could find an interface file in the `-i` dir but later fail because it tried to read the interface file from the `-hidir`. A bug identified by #20569
* driver: Improve -Wunused-packages error message (and simplify implementation)Matthew Pickering2022-04-018-46/+42
| | | | | | | | | | | | | | | | | | | | | In the past I improved the part of -Wunused-packages which found which packages were used. Now I improve the part which detects which ones were specified. The key innovation is to use the explicitUnits field from UnitState which has the result of resolving the package flags, so we don't need to mess about with the flag arguments from DynFlags anymore. The output now always includes the package name and version (and the flag which exposed it). ``` The following packages were specified via -package or -package-id flags, but were not needed for compilation: - bytestring-0.11.2.0 (exposed by flag -package bytestring) - ghc-9.3 (exposed by flag -package ghc) - process-1.6.13.2 (exposed by flag -package process) ``` Fixes #21307
* Change GHC.Prim to GHC.Exts in docs and testsKrzysztof Gogolewski2022-04-01113-118/+93
| | | | | Users are supposed to import GHC.Exts rather than GHC.Prim. Part of #18749.
* hlint: Ignore suggestions in generated HaddockLex fileMatthew Pickering2022-04-011-1/+1
| | | | | | | | With the make build system this file ends up in the compiler/ subdirectory so is linted. With hadrian, the file ends up in _build so it's not linted. Fixes #21313
* hadrian: Add assertion that in/out tree args are the sameMatthew Pickering2022-04-012-23/+37
| | | | | | | | There have been a few instances where this calculation was incorrect, so we add a non-terminal assertion when now checks they the two computations indeed compute the same thing. Fixes #21285
* hadrian: Fix race involving empty package databasesMatthew Pickering2022-04-013-5/+18
| | | | | | | | | | | | | | | | There was a small chance of a race occuring between the small window of 1. The first package (.conf) file get written into the database 2. hadrian calling "ghc-pkg recache" to refresh the package.conf file In this window the package database would contain rts.conf but not a package.cache file, and therefore if ghc was invoked it would error because it was missing. To solve this we call "ghc-pkg recache" at when the database is created by shake by writing the stamp file into the database folder. This also creates the package.cache file and so avoids the possibility of this race.
* hadrian: Remove vestigial -this-unit-id support checkJohn Ericson2022-04-011-2/+0
| | | | This has been dead code since 400ead81e80f66ad7b1260b11b2a92f25ccc3e5a.
* Fix panic when pretty printing HsCmdLamJakob Bruenker2022-04-015-2/+17
| | | | | | | When pretty printing a HsCmdLam with more than one argument, GHC panicked because of a missing case. This fixes that. Closes #21300
* hadrian: Introduce CheckProgram datatype to replace a 7-tupleMatthew Pickering2022-04-011-10/+19
|
* hadrian: allow testing linters with out of tree compilersZubin Duggal2022-04-011-21/+21
|
* hadrian: Remove linters-common from bindistMatthew Pickering2022-04-012-3/+22
| | | | | | | | | | | | | | Zubin observed that the bindists contains the utility library linters-common. There are two options: 1. Make sure only the right files are added into the bindist.. a bit tricky due to the non-trivial structure of the lib directory. 2. Remove the bad files once they get copied in.. a bit easier So I went for option 2 but we perhaps should go for option 1 in the future. Fixes #21203
* Change may not to might notMaxHearnden2022-04-011-1/+1
|
* Add tests and docs on plugin args and order.Phil de Joux2022-04-0117-1/+208
|
* two typosEric Lindblad2022-04-012-2/+2
|
* hadrian typosEric Lindblad2022-04-014-4/+4
|
* Minor cleanupKrzysztof Gogolewski2022-04-0125-108/+28
| | | | | | | | | | | - Remove unused functions exprToCoercion_maybe, applyTypeToArg, typeMonoPrimRep_maybe, runtimeRepMonoPrimRep_maybe. - Replace orValid with a simpler check - Use splitAtList in applyTysX - Remove calls to extra_clean in the testsuite; it does not do anything. Metric Decrease: T18223
* Add test cases for #20640ARATA Mizuki2022-04-015-0/+22
| | | | Closes #20640
* Export MutableByteArray from Data.Array.ByteAndreas Klebinger2022-04-011-2/+22
| | | | This implements CLC proposal #49
* Unify RuntimeRep arguments in ty_co_matchsheaf2022-04-013-13/+45
| | | | | | | | | | | | | | | | | The `ty_co_match` function ignored the implicit RuntimeRep coercions that occur in a `FunCo`. Even though a comment explained that this should be fine, #21205 showed that it could result in discarding a RuntimeRep coercion, and thus discarding an important cast entirely. With this patch, we first match the kinds in `ty_co_match`. Fixes #21205 ------------------------- Metric Increase: T12227 T18223 -------------------------
* Clarify that runghc interprets the input programMorrow2022-04-011-2/+2
|
* new datatypes for parsedResultActionJakob Bruenker2022-04-018-56/+69
| | | | | | | | Previously, the warnings and errors were given and returned as a tuple (Messages PsWarnings, Messages PsErrors). Now, it's just PsMessages. This, together with the HsParsedModule the parser plugin gets and returns, has been wrapped up as ParsedResult.
* T13366 requires c++ & c++abi libraries on OpenBSDGreg Steuck2022-04-011-1/+1
| | | | | | | | | | | | | | Fixes this failure: =====> 1 of 1 [0, 0, 0] T13366(normal) 1 of 1 [0, 0, 0] Compile failed (exit code 1) errors were: <no location info>: error: user specified .o/.so/.DLL could not be loaded (File not found) Whilst trying to load: (dynamic) stdc++ Additional directories searched: (none) *** unexpected failure for T13366(normal)
* fp_prog_ar.m4: take AR var into considerationAdrian Ratiu2022-04-011-1/+2
| | | | | | | | | | In ChromeOS and Gentoo we want the ability to use LLVM ar instead of GNU ar even though both are installed, thus we pass (for eg) AR=llvm-ar to configure. Unfortunately GNU ar always gets picked regardless of the AR setting because the check does not consider the AR var when setting fp_prog_ar, hence this fix.
* ci: Attempt to fix windows cache issuesMatthew Pickering2022-04-012-19/+18
| | | | | It appears that running the script directly does nothing (no info is printed about saving the cache).
* ci: Regenerate jobs.yamlMatthew Pickering2022-04-012-6/+8
| | | | | It seems I forgot to update this to reflect the current state of gen_ci.hs
* users-guide: Fix a few small issues in eventlog format descriptionsBen Gamari2022-04-011-1/+2
| | | | | The CONC_MARK_END event description didn't mention its payload. Clarify the meaning of the CREATE_TASK's payload.
* Fix remaining issues in eventlog types (gen_event_types.py)Matthew Pickering2022-04-011-3/+4
| | | | | | | | | * The size of End concurrent mark phase looks wrong and, it used to be 4 and now it's 0. * The size of Task create is wrong, used to be 18 and now 14. * The event ticky-ticky entry counter begin sample has the wrong name * The event ticky-ticky entry counter being sample has the wrong size, was 0 now 32. Closes #21070
* Refactor handling of global initializersBen Gamari2022-04-0117-89/+372
| | | | | | | | | | | | | | | | | | | | | | | | | | | GHC uses global initializers for a number of things including cost-center registration, info-table provenance registration, and setup of foreign exports. Previously, the global initializer arrays which referenced these initializers would live in the object file of the C stub, which would then be merged into the main object file of the module. Unfortunately, this approach is no longer tenable with the move to Clang/LLVM on Windows (see #21019). Specifically, lld's PE backend does not support object merging (that is, the -r flag). Instead we are now rather packaging a module's object files into a static library. However, this is problematic in the case of initializers as there are no references to the C stub object in the archive, meaning that the linker may drop the object from the final link. This patch refactors our handling of global initializers to instead place initializer arrays within the object file of the module to which they belong. We do this by introducing a Cmm data declaration containing the initializer array in the module's Cmm stream. While the initializer functions themselves remain in separate C stub objects, the reference from the module's object ensures that they are not dropped from the final link. In service of #21068.
* Remove wrong claim about naturality law.gershomb2022-04-011-4/+1
| | | | | | | | | | This docs change removes a longstanding confusion in the Traversable docs. The docs say "(The naturality law is implied by parametricity and thus so is the purity law [1, p15].)". However if one reads the reference a different "natural" law is implied by parametricity. The naturality law given as a law here is imposed. Further, the reference gives examples which violate both laws -- so they cannot be implied by parametricity. This PR just removes the wrong claim.
* Fix mention of non-existent "rehydrateIface" function [skip ci]wip/t21303Matthew Pickering2022-03-301-1/+1
| | | | Fixes #21303
* Refactor: make primtypes independent of PrimRepsKrzysztof Gogolewski2022-03-305-126/+106
| | | | | | | | | | | | | | | | | Previously, 'pcPrimTyCon', the function used to define a primitive type, was taking a PrimRep, only to convert it to a RuntimeRep. Now it takes a RuntimeRep directly. Moved primRepToRuntimeRep to GHC.Types.RepType. It is now located next to its inverse function runtimeRepPrimRep. Now GHC.Builtin.Types.Prim no longer mentions PrimRep, and GHC.Types.RepType no longer imports GHC.Builtin.Types.Prim. Removed unused functions `primRepsToRuntimeRep` and `mkTupleRep`. Removed Note [PrimRep and kindPrimRep] - it was never referenced, didn't belong to Types.Prim, and Note [Getting from RuntimeRep to PrimRep] is more comprehensive.
* Fix reference to Note [FunBind vs PatBind]Ben Gamari2022-03-301-2/+2
| | | | | This Note was renamed in 2535a6716202253df74d8190b028f85cc6d21b72 yet this occurrence was not updated.
* Give parsing plugins access to errorsJakob Brünker2022-03-3018-22/+226
| | | | | | | | | | | Previously, when the parser produced non-fatal errors (i.e. it produced errors but the 'PState' is 'POk'), compilation would be aborted before the 'parsedResultAction' of any plugin was invoked. This commit changes that, so that such that 'parsedResultAction' gets collections of warnings and errors as argument, and must return them after potentially modifying them. Closes #20803
* Add test for T21306Matthew Pickering2022-03-293-0/+55
| | | | Fixes #21306
* RTS: Zero gc_cpu_start and gc_cpu_end after accountingMatthew Pickering2022-03-291-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | When passed a combination of `-N` and `-qn` options the cpu time for garbage collection was being vastly overcounted because the counters were not being zeroed appropiately. When -qn1 is passed, only 1 of the N avaiable GC threads is chosen to perform work, the rest are idle. At the end of the GC period, stat_endGC traverses all the GC threads and adds up the elapsed time from each of them. For threads which didn't participate in this GC, the value of the cpu time should be zero, but before this patch, the counters were not zeroed and hence we would count the same elapsed time on many subsequent iterations (until the thread participated in a GC again). The most direct way to zero these fields is to do so immediately after the value is added into the global counter, after which point they are never used again. We also tried another approach where we would zero the counter in yieldCapability but there are some (undiagnosed) siations where a capbility would not pass through yieldCapability before the GC ended and the same double counting problem would occur. Fixes #21082
* Hadrian: make DDEBUG separate from debugged RTSsheaf2022-03-298-36/+46
| | | | | | | | | | | This patchs separates whether -DDEBUG is enabled (i.e. whether debug assertions are enabled) from whether we are using the debugged RTS (i.e. GhcDebugged = YES). This means that we properly skip tests which have been marked with `when(compiler_debugged(), skip)`. Fixes #21113, #21153 and #21234
* hadrian: Build lib:GHC with -haddock and -Winvalid-haddock (#21273)Zubin Duggal2022-03-291-0/+3
|
* Fix all invalid haddock comments in the compilerZubin Duggal2022-03-2941-154/+154
| | | | Fixes #20935 and #20924
* Consistently attach SrcSpans to sub-expressions in TH splicesRyan Scott2022-03-281-139/+173
| | | | | | | | | | | Before, `GHC.ThToHs` was very inconsistent about where various sub-expressions would get the same `SrcSpan` from the original TH splice location or just a generic `noLoc` `SrcSpan`. I have ripped out all uses of `noLoc` in favor of the former instead, and I have added a `Note [Source locations within TH splices]` to officially enshrine this design choice. Fixes #21299.
* EPA: let stmt with semicolon has wrong anchorAlan Zimmerman2022-03-286-3/+25
| | | | | | | | | | | | | The code let ;x =1 Captures the semicolon annotation, but did not widen the anchor in the ValBinds. Fix that. Closes #20247
* hadrian: Add show target to bindist makefileMatthew Pickering2022-03-281-0/+4
| | | | | | | | | | | Some build systems use "make show" to query facts about the bindist, for example: ``` make show VALUE=ProjectVersion > version ``` to determine the ProjectVersion