summaryrefslogtreecommitdiff
path: root/docs/users_guide
Commit message (Collapse)AuthorAgeFilesLines
* Update docs for change to type-checking pluginssheaf2022-04-272-2/+13
| | | | | | There was no mention of the changes to type-checking plugins in the 9.4.1 notes, and the extending_ghc documentation contained a reference to an outdated type.
* Enable eventlog support in all ways by defaultBen Gamari2022-04-272-2/+11
| | | | | | | | | | | | | | | | | Here we deprecate the eventlogging RTS ways and instead enable eventlog support in the remaining ways. This simplifies packaging and reduces GHC compilation times (as we can eliminate two whole compilations of the RTS) while simplifying the end-user story. The trade-off is a small increase in binary sizes in the case that the user does not want eventlogging support, but we think that this is a fine trade-off. This also revealed a latent RTS bug: some files which included `Cmm.h` also assumed that it defined various macros which were in fact defined by `Config.h`, which `Cmm.h` did not include. Fixing this in turn revealed that `StgMiscClosures.cmm` failed to import various spinlock statistics counters, as evidenced by the failed unregisterised build. Closes #18948.
* Basic response file supportBen Gamari2022-04-272-0/+14
| | | | | | | | Here we introduce support into our command-line parsing infrastructure and driver for handling gnu-style response file arguments, typically used to work around platform command-line length limitations. Fixes #16476.
* Ensure that Any is Boxed in FFI imports/exportssheaf2022-04-271-2/+3
| | | | | | | | | | We should only accept the type `Any` in foreign import/export declarations when it has type `Type` or `UnliftedType`. This patch adds a kind check, and a special error message triggered by occurrences of `Any` in foreign import/export declarations at other kinds. Fixes #21305
* Document behaviour of RULES with KnownNatBodigrim2022-04-251-0/+9
|
* Drop libtool path from settings fileBen Gamari2022-04-251-7/+0
| | | | | GHC no longers uses libtool for linking and therefore this is no longer necessary.
* Include the way string in the file name for dump files.Andreas Klebinger2022-04-221-0/+11
| | | | | | This can be disabled by `-fno-dump-with-ways` if not desired. Finally we will be able to look at both profiled and non-profiled dumps when compiling with dump flags and we compile in both ways.
* Add -dkeep-comments flag to keep comments in the parserAlan Zimmerman2022-04-201-0/+7
| | | | | | | | | This provides a way to set the Opt_KeepRawTokenStream from the command line, allowing exact print annotation users to see exactly what is produced for a given parsed file, when used in conjunction with -ddump-parsed-ast Discussed in #19706, but this commit does not close the issue.
* Document that DuplicateRecordFields doesn't tolerates ambiguous fieldsHécate Moonlight2022-04-123-106/+70
| | | | Fix #19891
* Add flag -fprof-manual which controls if GHC should honour manual cost centres.Andreas Klebinger2022-04-081-0/+11
| | | | | | | This allows disabling of manual control centres in code a user doesn't control like libraries. Fixes #18867
* Fixes to 9.4 release notesKrzysztof Gogolewski2022-04-083-10/+22
| | | | | | - Mention -Wforall-identifier - Improve description of withDict - Fix formatting
* Properly explain where INLINE pragmas can appear.Andreas Klebinger2022-04-071-6/+41
| | | | Fixes #20676
* Add warnings for file header pragmas that appear in the body of a module ↵Zubin Duggal2022-04-061-0/+14
| | | | | | | | | | | | | | | (#20385) Once we are done parsing the header of a module to obtain the options, we look through the rest of the tokens in order to determine if they contain any misplaced file header pragmas that would usually be ignored, potentially resulting in bad error messages. The warnings are reported immediately so that later errors don't shadow over potentially helpful warnings. Metric Increase: T13719
* users-guide: Fix various markup issuesBen Gamari2022-04-011-15/+15
|
* Implement \cases (Proposal 302)Jakob Bruenker2022-04-013-5/+25
| | | | | | | | | | | | 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-012-0/+11
| | | | | | | | | | | | | | | | 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
* Change GHC.Prim to GHC.Exts in docs and testsKrzysztof Gogolewski2022-04-013-5/+4
| | | | | Users are supposed to import GHC.Exts rather than GHC.Prim. Part of #18749.
* Add tests and docs on plugin args and order.Phil de Joux2022-04-011-1/+30
|
* Clarify that runghc interprets the input programMorrow2022-04-011-2/+2
|
* new datatypes for parsedResultActionJakob Bruenker2022-04-012-27/+29
| | | | | | | | 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.
* 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.
* Give parsing plugins access to errorsJakob Brünker2022-03-302-7/+30
| | | | | | | | | | | 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
* users-guide: group ticky-ticky profiling under one headingAdam Sandberg Ericsson2022-03-281-5/+5
|
* Document typed splices inhibiting unused bind detection (#16524)jberryman2022-03-281-0/+3
|
* users-guide: Correct markdown for profilingTakenobu Tani2022-03-281-5/+6
| | | | | | This patch corrects some markdown. [skip ci]
* Add the OPAQUE pragmaChristiaan Baaij2022-03-252-0/+27
| | | | | | | | | | | | A new pragma, `OPAQUE`, that ensures that every call of a named function annotated with an `OPAQUE` pragma remains a call of that named function, not some name-mangled variant. Implements GHC proposal 0415: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0415-opaque-pragma.rst This commit also updates the haddock submodule to handle the newly introduced lexer tokens corresponding to the OPAQUE pragma.
* Fix behaviour of -Wunused-packages in ghciMatthew Pickering2022-03-231-5/+9
| | | | | | | | | | | | | | | | | Ticket #21110 points out that -Wunused-packages behaves a bit unusually in GHCi. Now we define the semantics for -Wunused-packages in interactive mode as follows: * If you use -Wunused-packages on an initial load then the warning is reported. * If you explicitly set -Wunused-packages on the command line then the warning is displayed (until it is disabled) * If you then subsequently modify the set of available targets by using :load or :cd (:cd unloads everything) then the warning is (silently) turned off. This means that every :r the warning is printed if it's turned on (but you did ask for it). Fixes #21110
* docs: clarify the eventlog format documentation a little bitAdam Sandberg Ericsson2022-03-231-14/+15
|
* Export (~) from Data.Type.Equality (#18862)wip/eqtycon-rnVladislav Zavialov2022-03-152-3/+62
| | | | | | | | | | * Users can define their own (~) type operator * Haddock can display documentation for the built-in (~) * New transitional warnings implemented: -Wtype-equality-out-of-scope -Wtype-equality-requires-operators Updates the haddock submodule.
* Worker/wrapper: Preserve float barriers (#21150)Sebastian Graf2022-03-131-2/+11
| | | | | | | | | | | | | | | | | | | | | | | Issue #21150 shows that worker/wrapper allocated a worker function for a function with multiple calls that said "called at most once" when the first argument was absent. That's bad! This patch makes it so that WW preserves at least one non-one-shot value lambda (see `Note [Preserving float barriers]`) by passing around `void#` in place of absent arguments. Fixes #21150. Since the fix is pretty similar to `Note [Protecting the last value argument]`, I put the logic in `mkWorkerArgs`. There I realised (#21204) that `-ffun-to-thunk` is basically useless with `-ffull-laziness`, so I deprecated the flag, simplified and split into `needsVoidWorkerArg`/`addVoidWorkerArg`. SpecConstr is another client of that API. Fixes #21204. Metric Decrease: T14683
* Rename -fprof-late-ccs to -fprof-lateAndreas Klebinger2022-03-122-3/+3
|
* Always generalise top-level bindingsSimon Peyton Jones2022-03-071-17/+25
| | | | | Fix #21023 by always generalising top-level binding; change the documentation of -XMonoLocalBinds to match.
* Update documentation of LiberalTypeSynonymsKrzysztof Gogolewski2022-03-041-21/+1
| | | | | | | | | We no longer require LiberalTypeSynonyms to use 'forall' or an unboxed tuple in a synonym. I also removed that kind checking before expanding synonyms "could be changed". This was true when type synonyms were thought of macros, but with the extensions such as SAKS or matchability I don't see it changing.
* docs: Add note to RULES documentation about locally bound variables [skip ci]Matthew Pickering2022-03-031-0/+25
| | | | Fixes #20100
* Improve out-of-order inferred type variablessheaf2022-03-022-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't instantiate type variables for :type in `GHC.Tc.Gen.App.tcInstFun`, to avoid inconsistently instantianting `r1` but not `r2` in the type forall {r1} (a :: TYPE r1) {r2} (b :: TYPE r2). ... This fixes #21088. This patch also changes the primop pretty-printer to ensure that we put all the inferred type variables first. For example, the type of reallyUnsafePtrEquality# is now forall {l :: Levity} {k :: Levity} (a :: TYPE (BoxedRep l)) (b :: TYPE (BoxedRep k)). a -> b -> Int# This means we avoid running into issue #21088 entirely with the types of primops. Users can still write a type signature where the inferred type variables don't come first, however. This change to primops had a knock-on consequence, revealing that we were sometimes performing eta reduction on keepAlive#. This patch updates tryEtaReduce to avoid eta reducing functions with no binding, bringing it in line with tryEtaReducePrep, and thus fixing #21090.
* Ticky profiling improvements.Matthew Pickering2022-03-021-0/+148
| | | | | | | | | | | | | | | | | | | | This adds a number of changes to ticky-ticky profiling. When an executable is profiled with IPE profiling it's now possible to associate id-related ticky counters to their source location. This works by emitting the info table address as part of the counter which can be looked up in the IPE table. Add a `-ticky-ap-thunk` flag. This flag prevents the use of some standard thunks which are precompiled into the RTS. This means reduced cache locality and increased code size. But it allows better attribution of execution cost to specific source locations instead of simple attributing it to the standard thunk. ticky-ticky now uses the `arg` field to emit additional information about counters in json format. When ticky-ticky is used in combination with the eventlog eventlog2html can be used to generate a html table from the eventlog similar to the old text output for ticky-ticky.
* Ticky: Gate tag-inference dummy ticky-counters behind a flag.Andreas Klebinger2022-02-252-1/+25
| | | | | | | | | | Tag inference included a way to collect stats about avoided tag-checks. This was dony by emitting "dummy" ticky entries with counts corresponding to predicted/unpredicated tag checks. This behaviour for ticky is now gated behind -fticky-tag-checks. I also documented ticky-LNE in the process.
* GHCi: don't normalise partially instantiated typessheaf2022-02-251-1/+7
| | | | | | | | | This patch skips performing type normalisation when we haven't fully instantiated the type. That is, in tcRnExpr (used only for :type in GHCi), skip normalisation if the result type responds True to isSigmaTy. Fixes #20974
* Kill derived constraintsRichard Eisenberg2022-02-231-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored by: Sam Derbyshire Previously, GHC had three flavours of constraint: Wanted, Given, and Derived. This removes Derived constraints. Though serving a number of purposes, the most important role of Derived constraints was to enable better error messages. This job has been taken over by the new RewriterSets, as explained in Note [Wanteds rewrite wanteds] in GHC.Tc.Types.Constraint. Other knock-on effects: - Various new Notes as I learned about under-described bits of GHC - A reshuffling around the AST for implicit-parameter bindings, with better integration with TTG. - Various improvements around fundeps. These were caused by the fact that, previously, fundep constraints were all Derived, and Derived constraints would get dropped. Thus, an unsolved Derived didn't stop compilation. Without Derived, this is no longer possible, and so we have to be considerably more careful around fundeps. - A nice little refactoring in GHC.Tc.Errors to center the work on a new datatype called ErrorItem. Constraints are converted into ErrorItems at the start of processing, and this allows for a little preprocessing before the main classification. - This commit also cleans up the behavior in generalisation around functional dependencies. Now, if a variable is determined by functional dependencies, it will not be quantified. This change is user facing, but it should trim down GHC's strange behavior around fundeps. - Previously, reportWanteds did quite a bit of work, even on an empty WantedConstraints. This commit adds a fast path. - Now, GHC will unconditionally re-simplify constraints during quantification. See Note [Unconditionally resimplify constraints when quantifying], in GHC.Tc.Solver. Close #18398. Close #18406. Solve the fundep-related non-confluence in #18851. Close #19131. Close #19137. Close #20922. Close #20668. Close #19665. ------------------------- Metric Decrease: LargeRecord T9872b T9872b_defer T9872d TcPlugin_RewritePerf -------------------------
* docs: fix error in annotation guide code snippetHugo2022-02-221-2/+2
|
* Remove -Wunticked-promoted-constructors from -WallKrzysztof Gogolewski2022-02-227-55/+60
| | | | | | | Update manual; explain ticks as optional disambiguation rather than the preferred default. This is a part of #20531.
* Track object file dependencies for TH accurately (#20604)Zubin Duggal2022-02-201-0/+18
| | | | | | | | | | | | | | | | | | | `hscCompileCoreExprHook` is changed to return a list of `Module`s required by a splice. These modules are accumulated in the TcGblEnv (tcg_th_needed_mods). Dependencies on the object files of these modules are recording in the interface. The data structures in `LoaderState` are replaced with more efficient versions to keep track of all the information required. The MultiLayerModulesTH_Make allocations increase slightly but runtime is faster. Fixes #20604 ------------------------- Metric Increase: MultiLayerModulesTH_Make -------------------------
* docs: fix release notes formattingAdam Sandberg Ericsson2022-02-161-16/+17
|
* docs: mention -fprof-late-ccs in the release notesAdam Sandberg Ericsson2022-02-162-0/+5
| | | | And note which compiler version it was added in.
* Tag inference work.Andreas Klebinger2022-02-123-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does three major things: * Enforce the invariant that all strict fields must contain tagged pointers. * Try to predict the tag on bindings in order to omit tag checks. * Allows functions to pass arguments unlifted (call-by-value). The former is "simply" achieved by wrapping any constructor allocations with a case which will evaluate the respective strict bindings. The prediction is done by a new data flow analysis based on the STG representation of a program. This also helps us to avoid generating redudant cases for the above invariant. StrictWorkers are created by W/W directly and SpecConstr indirectly. See the Note [Strict Worker Ids] Other minor changes: * Add StgUtil module containing a few functions needed by, but not specific to the tag analysis. ------------------------- Metric Decrease: T12545 T18698b T18140 T18923 LargeRecord Metric Increase: LargeRecord ManyAlternatives ManyConstructors T10421 T12425 T12707 T13035 T13056 T13253 T13253-spj T13379 T15164 T18282 T18304 T18698a T1969 T20049 T3294 T4801 T5321FD T5321Fun T783 T9233 T9675 T9961 T19695 WWRec -------------------------
* Fix copy-pasto in prof-late-ccs docsMatthew Pickering2022-02-101-2/+2
|
* Docs:Mention that safe calls don't keep their arguments alive.Andreas Klebinger2022-02-101-2/+9
|
* Add late cost centre supportAndreas Klebinger2022-02-101-0/+13
| | | | | This allows cost centres to be inserted after the core optimization pipeline has run.
* Rename -merge-objs flag to --merge-objsBen Gamari2022-02-092-2/+2
| | | | For consistency with --make and friends.