summaryrefslogtreecommitdiff
path: root/utils
Commit message (Collapse)AuthorAgeFilesLines
* Data.List specialization to []Oleg Grenrus2021-04-011-0/+0
| | | | | | | - Remove GHC.OldList - Remove Data.OldList - compat-unqualified-imports is no-op - update haddock submodule
* import Data.List with explicit import listOleg Grenrus2021-04-011-1/+1
|
* EPA : Rename AnnComment to EpaCommentAlan Zimmerman2021-03-315-45/+45
| | | | Follow-up from !2418, see #19579
* EPA : rename AnnAnchor to EpaAnchorAlan Zimmerman2021-03-313-18/+18
| | | | Follow-up from !2418, see #19579
* EPA : rename 'api annotations' to 'exact print annotations'Alan Zimmerman2021-03-313-14/+8
| | | | | | In comments, and notes. Follow-up from !2418, see #19579
* EPA : Rename ApiAnn to EPAnnAlan Zimmerman2021-03-317-406/+380
| | | | | | Follow-up from !2418, see #19579 Updates haddock submodule
* EPA : Rename AddApiAnn to AddEpAnnAlan Zimmerman2021-03-315-61/+43
| | | | | | | As port of the process of migrating naming from API Annotations to exact print annotations (EPA) Follow-up from !2418, see #19579
* import Data.List with explicit import listOleg Grenrus2021-03-315-5/+5
|
* Allocate Adjustors and mark them readable in two stepsMoritz Angermann2021-03-291-1/+1
| | | | | | | | | This drops allocateExec for darwin, and replaces it with a alloc, write, mark executable strategy instead. This prevents us from trying to allocate an executable range and then write to it, which X^W will prohibit on darwin. This will *only* work if we can use mmap.
* Add UnitId to Target recordFendor2021-03-283-0/+2
| | | | | | | | | | In the future, we want `HscEnv` to support multiple home units at the same time. This means, that there will be 'Target's that do not belong to the current 'HomeUnit'. This is an API change without changing behaviour. Update haddock submodule to incorporate API changes.
* Bump haddock submoduleSylvain Henry2021-03-261-0/+0
|
* Remove UniqSupply from NameCacheSylvain Henry2021-03-261-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As suggested by @alexbiehl, this patch replaces the always updated UniqSupply in NameCache with a fixed Char and use it with `uniqFromMask` to generate uniques. This required some refactoring because getting a new unique from the NameCache can't be done in pure code anymore, in particular not in an atomic update function for `atomicModifyIORef`. So we use an MVar instead to store the OrigNameCache field. For some reason, T12545 increases (+1%) on i386 while it decreases on other CI runners. T9630 ghc/peak increases only with the dwarf build on CI (+16%). Metric Decrease: T12425 T12545 T9198 T12234 Metric Increase: T12545 T9630 Update haddock submodule
* Refactor NameCacheSylvain Henry2021-03-261-0/+0
| | | | | | | | * Make NameCache the mutable one and replace NameCacheUpdater with it * Remove NameCache related code duplicated into haddock Bump haddock submodule
* EPA : Remove ApiAnn from ParsedModuleGHC GitLab CI2021-03-255-207/+170
| | | | | All the comments are now captured in the AST, there is no need for a side-channel structure for them.
* EPA: Run exactprint transformation tests as part of CIGHC GitLab CI2021-03-2380-1843/+868
| | | | | | | | | | EPA == exact print annotations. When !2418 landed, it did not run the tests brought over from ghc-exactprint for making sure the AST prints correctly efter being edited. This enables those tests.
* rts: Use long-path-aware statBen Gamari2021-03-232-2/+6
| | | | | | | | Previously `pathstat` relied on msvcrt's `stat` implementation, which was not long-path-aware. It should rather be defined in terms of the `stat` implementation provided by `utils/fs`. Fixes #19541.
* check-ppr,check-exact: Write out result as binaryGHC GitLab CI2021-03-202-8/+19
| | | | | | | | | | | Previously we would use `writeFile` to write the intermediate files to check for round-tripping. However, this will open the output handle as a text handle, which on Windows will change line endings. Avoid this by opening as binary. Explicitly use utf8 encoding. This is for tests only, do not need to worry about user compatibility.
* GHC Exactprint main commitAlan Zimmerman2021-03-2097-285/+9398
| | | | | | | | Metric Increase: T10370 parsing001 Updates haddock submodule
* template-haskell: Add putDoc, getDoc, withDecDoc and friendsLuke Lau2021-03-101-0/+0
| | | | | | | | | | | | | | | | | | | | | | | This adds two new methods to the Quasi class, putDoc and getDoc. They allow Haddock documentation to be added to declarations, module headers, function arguments and class/type family instances, as well as looked up. It works by building up a map of names to attach pieces of documentation to, which are then added in the extractDocs function in GHC.HsToCore.Docs. However because these template haskell names need to be resolved to GHC names at the time they are added, putDoc cannot directly add documentation to declarations that are currently being spliced. To remedy this, withDecDoc/withDecsDoc wraps the operation with addModFinalizer, and provides a more ergonomic interface for doing so. Similarly, the funD_doc, dataD_doc etc. combinators provide a more ergonomic interface for documenting functions and their arguments simultaneously. This also changes ArgDocMap to use an IntMap rather than an Map Int, for efficiency. Part of the work towards #5467
* Bump bytestring submodule to 0.11.1.0Ben Gamari2021-03-103-3/+3
|
* FastMutInt: Ensure that newFastMutInt initializes valueBen Gamari2021-03-101-0/+0
| | | | Updates haddock submodule.
* Require GHC 8.10 as the minimum compiler for bootstrappingRyan Scott2021-03-093-3/+3
| | | | | | | Now that GHC 9.0.1 is released, it is time to drop support for bootstrapping with GHC 8.8, as we only support building with the previous two major GHC releases. As an added bonus, this allows us to remove several bits of CPP that are either always true or no longer reachable.
* Implement BoxedRep proposalwip/boxed-repBen Gamari2021-03-071-0/+0
| | | | | | | | | | | | | | | | | | | | | | | This implements the BoxedRep proposal, refactoring the `RuntimeRep` hierarchy from: ```haskell data RuntimeRep = LiftedPtrRep | UnliftedPtrRep | ... ``` to ```haskell data RuntimeRep = BoxedRep Levity | ... data Levity = Lifted | Unlifted ``` Updates binary, haddock submodules. Closes #17526. Metric Increase: T12545
* Implement record dot syntaxwip/joachim/bump-haddockShayne Fletcher2021-03-061-0/+0
|
* Implement riscv64 LLVM backendAndreas Schwab2021-03-051-0/+3
| | | | This enables a registerised build for the riscv64 architecture.
* Fix array and cleanup conversion primops (#19026)Sylvain Henry2021-03-031-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first change makes the array ones use the proper fixed-size types, which also means that just like before, they can be used without explicit conversions with the boxed sized types. (Before, it was Int# / Word# on both sides, now it is fixed sized on both sides). For the second change, don't use "extend" or "narrow" in some of the user-facing primops names for conversions. - Names like `narrowInt32#` are misleading when `Int` is 32-bits. - Names like `extendInt64#` are flat-out wrong when `Int is 32-bits. - `narrow{Int,Word}<N>#` however map a type to itself, and so don't suffer from this problem. They are left as-is. These changes are batched together because Alex happend to use the array ops. We can only use released versions of Alex at this time, sadly, and I don't want to have to have a release thatwon't work for the final GHC 9.2. So by combining these we get all the changes for Alex done at once. Bump hackage state in a few places, and also make that workflow slightly easier for the future. Bump minimum Alex version Bump Cabal, array, bytestring, containers, text, and binary submodules
* Wrap LHsContext in Maybe in the GHC ASTAlan Zimmerman2021-03-011-0/+0
| | | | | | | If the context is missing it is captured as Nothing, rather than putting a noLoc in the ParsedSource. Updates haddock submodule
* touchy: use a valid cabal-versionSylvain Henry2021-02-271-1/+1
|
* Move absentError into ghc-prim.Andreas Klebinger2021-02-261-1/+1
| | | | | | | | | | | | When using -fdicts-strict we generate references to absentError while compiling ghc-prim. However we always load ghc-prim before base so this caused linker errors. We simply solve this by moving absentError into ghc-prim. This does mean it's now a panic instead of an exception which can no longer be caught. But given that it should only be thrown if there is a compiler error that seems acceptable, and in fact we already do this for absentSumFieldError which has similar constraints.
* directory: ensure xdg compliance (Fix #6077)Gauvain 'GovanifY' Roussel-Tarbouriech2021-02-181-4/+4
|
* ghc-in-ghci: Drop itBen Gamari2021-02-144-110/+0
| | | | | isovector recently noticed that it is broken and regardless it is superceded by `hadrian/ghci`.
* genprimopcode: Add a second levity-polymorphic tyvarBen Gamari2021-02-141-0/+3
| | | | This will be needed shortly.
* Refactor LoggerSylvain Henry2021-02-131-0/+0
| | | | | | | | | | | | | | | | | | | | | Before this patch, the only way to override GHC's default logging behavior was to set `log_action`, `dump_action` and `trace_action` fields in DynFlags. This patch introduces a new Logger abstraction and stores it in HscEnv instead. This is part of #17957 (avoid storing state in DynFlags). DynFlags are duplicated and updated per-module (because of OPTIONS_GHC pragma), so we shouldn't store global state in them. This patch also fixes a race in parallel "--make" mode which updated the `generatedDumps` IORef concurrently. Bump haddock submodule The increase in MultilayerModules is tracked in #19293. Metric Increase: MultiLayerModules
* Bump Haddock submodulewip/bump-haddockBen Gamari2021-02-061-0/+0
| | | | Merged ghc-8.10 into ghc-head.
* The Char kind (#11342)Daniel Rogozin2021-02-061-0/+0
| | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Rinat Stryungis <rinat.stryungis@serokell.io> Implement GHC Proposal #387 * Parse char literals 'x' at the type level * New built-in type families CmpChar, ConsSymbol, UnconsSymbol * New KnownChar class (cf. KnownSymbol and KnownNat) * New SomeChar type (cf. SomeSymbol and SomeNat) * CharTyLit support in template-haskell Updated submodules: binary, haddock. Metric Decrease: T5205 haddock.base Metric Increase: Naperian T13035
* Rename ErrMsg into MsgEnvelopeAlfredo Di Napoli2021-02-011-0/+0
| | | | Updates Haddock submodule
* Make PatSyn immutableSimon Peyton Jones2021-01-291-0/+0
| | | | | | | | | | Provoked by #19074, this patch makes GHC.Core.PatSyn.PatSyn immutable, by recording only the *Name* of the matcher and builder rather than (as currently) the *Id*. See Note [Keep Ids out of PatSyn] in GHC.Core.PatSyn. Updates haddock submodule.
* Fix check-uniques scriptKrzysztof Gogolewski2021-01-291-7/+7
| | | | | It was checking the old path compiler/prelude/*, outdated with the new module hierarchy. I added a sanity check to avoid this in the future.
* Add explicit import lists to Data.List importsOleg Grenrus2021-01-292-2/+4
| | | | | | | | | | | | | Related to a future change in Data.List, https://downloads.haskell.org/ghc/8.10.3/docs/html/users_guide/using-warnings.html?highlight=wcompat#ghc-flag--Wcompat-unqualified-imports Companion pull&merge requests: - https://github.com/judah/haskeline/pull/153 - https://github.com/haskell/containers/pull/762 - https://gitlab.haskell.org/ghc/packages/hpc/-/merge_requests/9 After these the actual change in Data.List should be easy to do.
* Bump haddock submoduleJoachim Breitner2021-01-281-0/+0
| | | | | | | | | | | | | | | | | | | to get this commit: commit 0952d94a2e30a3e7cddbede811b15fa70f7b9462 (HEAD) Author: Joachim Breitner <mail@joachim-breitner.de> Date: Tue Jan 19 11:39:38 2021 +0100 Make haddock more robust to changes to the `Language` data type With the introduction of GHC2021, the `Languages` data type in GHC will grow. In preparation of that (and to avoid changing haddock with each new language), this change makes the code handle extensions to that data type gracefully. (cherry picked from commit c341dd7c9c3fc5ebc83a2d577c5a726f3eb152a5) This can go in as preparation for !4853
* Separate AST from GhcPass (#18936)John Ericson2021-01-231-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---------------- What: There are two splits. The first spit is: - `Language.Haskell.Syntax.Extension` - `GHC.Hs.Extension` where the former now just contains helpers like `NoExtCon` and all the families, and the latter is everything having to do with `GhcPass`. The second split is: - `Language.Haskell.Syntax.<mod>` - `GHC.Hs.<mod>` Where the former contains all the data definitions, and the few helpers that don't use `GhcPass`, and the latter contains everything else. The second modules also reexport the former. ---------------- Why: See the issue for more details, but in short answer is we're trying to grasp at the modularity TTG is supposed to offer, after a long time of mainly just getting the safety benefits of more complete pattern matching on the AST. Now, we have an AST datatype which, without `GhcPass` is decently stripped of GHC-specific concerns. Whereas before, not was it GHC-specific, it was aware of all the GHC phases despite the parameterization, with the instances and parametric data structure side-by-side. For what it's worth there are also some smaller, imminent benefits: - The latter change also splits a strongly connected component in two, since none of the `Language.Haskell.Syntax.*` modules import the older ones. - A few TTG violations (Using GhcPass directly in the AST) in `Expr` are now more explicitly accounted for with new type families to provide the necessary indirection. ----------------- Future work: - I don't see why all the type families should live in `Language.Haskell.Syntax.Extension`. That seems anti-modular for little benefit. All the ones used just once can be moved next to the AST type they serve as an extension point for. - Decide what to do with the `Outputable` instances. Some of these are no orphans because they referred to `GhcPass`, and had to be moved. I think the types could be generalized so they don't refer to `GhcPass` and therefore can be moved back, but having gotten flak for increasing the size and complexity types when generalizing before, I did *not* want to do this. - We should triage the remaining contents of `GHC.Hs.<mod>`. The renaming helpers are somewhat odd for needing `GhcPass`. We might consider if they are a) in fact only needed by one phase b) can be generalized to be non-GhcPass-specific (e.g. take a callback rather than GADT-match with `IsPass`) and then they can live in `Language.Haskell.Syntax.<mod>`. For more details, see https://gitlab.haskell.org/ghc/ghc/-/wikis/implementing-trees-that-grow Bumps Haddock submodule
* Factorize and document binder collect functionsSylvain Henry2021-01-221-0/+0
| | | | | | | | | Parameterize collect*Binders functions with a flag indicating if evidence binders should be collected. The related note in GHC.Hs.Utils has been updated. Bump haddock submodule
* Bump Haddock submodulealexbiehl2021-01-171-0/+0
| | | | | Metric Decrease: haddock.base
* rts: Zero shrunk array slop in vanilla RTSBen Gamari2021-01-071-0/+2
| | | | | | But only when profiling or DEBUG are enabled. Fixes #17572.
* Put hole instantiation typechecking in the module graph and fix driver batch ↵John Ericson2020-12-281-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mode backpack edges Backpack instantiations need to be typechecked to make sure that the arguments fit the parameters. `tcRnInstantiateSignature` checks instantiations with concrete modules, while `tcRnCheckUnit` checks instantiations with free holes (signatures in the current modules). Before this change, it worked that `tcRnInstantiateSignature` was called after typechecking the argument module, see `HscMain.hsc_typecheck`, while `tcRnCheckUnit` was called in `unsweep'` where-bound in `GhcMake.upsweep`. `tcRnCheckUnit` was called once per each instantiation once all the argument sigs were processed. This was done with simple "to do" and "already done" accumulators in the fold. `parUpsweep` did not implement the change. With this change, `tcRnCheckUnit` instead is associated with its own node in the `ModuleGraph`. Nodes are now: ```haskell data ModuleGraphNode -- | Instantiation nodes track the instantiation of other units -- (backpack dependencies) with the holes (signatures) of the current package. = InstantiationNode InstantiatedUnit -- | There is a module summary node for each module, signature, and boot module being built. | ModuleNode ExtendedModSummary ``` instead of just `ModSummary`; the `InstantiationNode` case is the instantiation of a unit to be checked. The dependencies of such nodes are the same "free holes" as was checked with the accumulator before. Both versions of upsweep on such a node call `tcRnCheckUnit`. There previously was an `implicitRequirements` function which would crawl through every non-current-unit module dep to look for all free holes (signatures) to add as dependencies in `GHC.Driver.Make`. But this is no good: we shouldn't be looking for transitive anything when building the graph: the graph should only have immediate edges and the scheduler takes care that all transitive requirements are met. So `GHC.Driver.Make` stopped using `implicitRequirements`, and instead uses a new `implicitRequirementsShallow`, which just returns the outermost instantiation node (or module name if the immediate dependency is itself a signature). The signature dependencies are just treated like any other imported module, but the module ones then go in a list stored in the `ModuleNode` next to the `ModSummary` as the "extra backpack dependencies". When `downsweep` creates the mod summaries, it adds this information too. ------ There is one code quality, and possible correctness thing left: In addition to `implicitRequirements` there is `findExtraSigImports`, which says something like "if you are an instantiation argument (you are substituted or a signature), you need to import its things too". This is a little non-local so I am not quite sure how to get rid of it in `GHC.Driver.Make`, but we probably should eventually. First though, let's try to make a test case that observes that we don't do this, lest it actually be unneeded. Until then, I'm happy to leave it as is. ------ Beside the ability to use `-j`, the other major user-visibile side effect of this change is that that the --make progress log now includes "Instantiating" messages for these new nodes. Those also are numbered like module nodes and count towards the total. ------ Fixes #17188 Updates hackage submomdule Metric Increase: T12425 T13035
* Refactor renamer datastructuresAdam Gundry2020-12-241-0/+0
| | | | | | | | | | | | | | | This patch significantly refactors key renamer datastructures (primarily Avail and GlobalRdrElt) in order to treat DuplicateRecordFields in a more robust way. In particular it allows the extension to be used with pattern synonyms (fixes where mangled record selector names could be printed instead of field labels (e.g. with -Wpartial-fields or hole fits, see new tests). The key idea is the introduction of a new type GreName for names that may represent either normal entities or field labels. This is then used in GlobalRdrElt and AvailInfo, in place of the old way of representing fields using FldParent (yuck) and an extra list in AvailTC. Updates the haddock submodule.
* make: disable ghc package environments #18988Adam Sandberg Ericsson2020-12-221-0/+1
|
* submodule update: haddockTom Ellis2020-12-191-0/+0
| | | | | Ensure it is ready for -Wincomplete-uni-patterns and -Wincomplete-record-updates in -Wall
* Use HsOuterExplicit in instance sigs in deriving-generated codeRyan Scott2020-12-181-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Issue #18914 revealed that `GeneralizedNewtypeDeriving` would generate code that mentions unbound type variables, which is dangerously fragile. The problem (and fix) is described in the new `Wrinkle: Use HsOuterExplicit` in `Note [GND and QuantifiedConstraints]`. The gist of it: make sure to put the top-level `forall`s in `deriving`-generated instance signatures in an `HsOuterExplicit` to ensure that they scope over the bodies of methods correctly. A side effect of this process is that it will expand any type synonyms in the instance signature, which will surface any `forall`s that are hidden underneath type synonyms (such as in the test case for #18914). While I was in town, I also performed some maintenance on `NewHsTypeX`, which powers `GeneralizedNewtypeDeriving`: * I renamed `NewHsTypeX` to `HsCoreTy`, which more accurately describes its intended purpose (#15706). I also made `HsCoreTy` a type synonym instead of a newtype, as making it a distinct data type wasn't buying us much. * To make sure that mistakes similar to #18914 do not occur later, I added an additional validity check when renaming `HsCoreTy`s that complains if an `HsCoreTy`s contains an out-of-scope type variable. See the new `Note [Renaming HsCoreTys]` in `GHC.Rename.HsType` for the details. Fixes #15706. Fixes #18914. Bumps the `haddock` submodule.
* Bump haddock submoduleGHC GitLab CI2020-12-161-0/+0
| | | | To adapt haddock for the nullary tyconapp optimisation patch.