summaryrefslogtreecommitdiff
path: root/docs
Commit message (Collapse)AuthorAgeFilesLines
* llvmGen: Remove -fast-llvm flagBen Gamari2020-04-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | Issue #18076 drew my attention to the undocumented `-fast-llvm` flag for the LLVM code generator introduced in 22733532171330136d87533d523f565f2a4f102f. Speaking to Moritz about this, the motivation for this flag was to avoid potential incompatibilities between LLVM and the assembler/linker toolchain by making LLVM responsible for machine-code generation. Unfortunately, this cannot possibly work: the LLVM backend's mangler performs a number of transforms on the assembler generated by LLVM that are necessary for correctness. These are currently: * mangling Haskell functions' symbol types to be `object` instead of `function` on ELF platforms (necessary for tables-next-to-code) * mangling AVX instructions to ensure that we don't assume alignment (which LLVM otherwise does) * mangling Darwin's subsections-via-symbols directives Given that these are all necessary I don't believe that we can support `-fast-llvm`. Let's rather remove it.
* Add "ddump-cmm-opt" as alias for "ddump-opt-cmm".Andreas Klebinger2020-04-221-1/+7
|
* Do eager instantation in termsSimon Peyton Jones2020-04-221-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements eager instantiation, a small but critical change to the type inference engine, #17173. The main change is this: When inferring types, always return an instantiated type (for now, deeply instantiated; in future shallowly instantiated) There is more discussion in https://www.tweag.io/posts/2020-04-02-lazy-eager-instantiation.html There is quite a bit of refactoring in this patch: * The ir_inst field of GHC.Tc.Utils.TcType.InferResultk has entirely gone. So tcInferInst and tcInferNoInst have collapsed into tcInfer. * Type inference of applications, via tcInferApp and tcInferAppHead, are substantially refactored, preparing the way for Quick Look impredicativity. * New pure function GHC.Tc.Gen.Expr.collectHsArgs and applyHsArgs are beatifully dual. We can see the zipper! * GHC.Tc.Gen.Expr.tcArgs is now much nicer; no longer needs to return a wrapper * In HsExpr, HsTypeApp now contains the the actual type argument, and is used in desugaring, rather than putting it in a mysterious wrapper. * I struggled a bit with good error reporting in Unify.matchActualFunTysPart. It's a little bit simpler than before, but still not great. Some smaller things * Rename tcPolyExpr --> tcCheckExpr tcMonoExpr --> tcLExpr * tcPatSig moves from GHC.Tc.Gen.HsType to GHC.Tc.Gen.Pat Metric Decrease: T9961 Reduction of 1.6% in comiler allocation on T9961, I think.
* stg-spec: Modify file paths according to new module hierarchyTakenobu Tani2020-04-222-11/+11
| | | | | | | | | | | | | | | | | This patch updates file paths according to new module hierarchy [1]: * GHC/Stg/Syntax.hs <= stgSyn/StgSyn.hs * GHC/Types/Literal.hs <= basicTypes/Literal.hs * GHC/Types/CostCentre.hs <= profiling/CostCentre.hs This patch also updates old file path [2]: * utils/genapply/Main.hs <= utils/genapply/GenApply.hs [1]: https://gitlab.haskell.org/ghc/ghc/-/wikis/Make-GHC-codebase-more-modular [2]: commit 0cc4aad36f [skip ci]
* docs: drop note about not supporting shared libraries on unix systemsAdam Sandberg Ericsson2020-04-211-2/+0
| | | | [skip ci]
* Modules (#13009)Sylvain Henry2020-04-183-6/+7
| | | | | | | | | | | | | | * SysTools * Parser * GHC.Builtin * GHC.Iface.Recomp * Settings Update Haddock submodule Metric Decrease: Naperian parsing001
* Use conLikeUserTyVarBinders to quantify field selector typesRyan Scott2020-04-126-2/+162
| | | | | | | | | | | | | This patch: 1. Writes up a specification for how the types of top-level field selectors should be determined in a new section of the GHC User's Guide, and 2. Makes GHC actually implement that specification by using `conLikeUserTyVarBinders` in `mkOneRecordSelector` to preserve the order and specificity of type variables written by the user. Fixes #18023.
* Implement extensible interface filesJosh Meredith2020-04-121-0/+27
|
* Modules: type-checker (#13009)Sylvain Henry2020-04-074-9/+9
| | | | Update Haddock submodule
* Add outputable instances for the types in GHC.Iface.Ext.Types, add -ddump-hieZubin Duggal2020-04-031-0/+6
| | | | | | | | | | | | | | | | | flag to dump pretty printed contents of the .hie file Metric Increase: hie002 Because of the regression on i386: compile_time/bytes allocated increased from i386-linux-deb9 baseline @ HEAD~10: Expected hie002 (normal) compile_time/bytes allocated: 583014888.0 +/-10% Lower bound hie002 (normal) compile_time/bytes allocated: 524713399 Upper bound hie002 (normal) compile_time/bytes allocated: 641316377 Actual hie002 (normal) compile_time/bytes allocated: 877986292 Deviation hie002 (normal) compile_time/bytes allocated: 50.6 % *** unexpected stat test failure for hie002(normal)
* Modules: Types (#13009)Sylvain Henry2020-03-291-1/+1
| | | | | | | Update Haddock submodule Metric Increase: haddock.compiler
* Update core spec to reflect changes to Core.Richard Eisenberg2020-03-205-20/+68
| | | | | | | | | | | | Key changes: * Adds a new rule for forall-coercions over coercion variables, which was implemented but conspicuously missing from the spec. * Adds treatment for FunCo. * Adds treatment for ForAllTy over coercion variables. * Improves commentary (including restoring a Note lost in 03d4852658e1b7407abb4da84b1b03bfa6f6db3b) in the source. No changes to running code.
* Update "GHC differences to the FFI Chapter" in user guide.Andreas Klebinger2020-03-191-15/+35
| | | | | | | | | The old entry had a heavy focus on how things had been. Which is not what I generally look for in a user guide. I also added a small section on behaviour of nested safe ffi calls. [skip-ci]
* Add release note about fix to #16502.Richard Eisenberg2020-03-181-0/+17
| | | | | | We thought we needed to update the manual, but the fix for #16502 actually brings the implementation in line with the manual. So we just alert users of how to update their code.
* Fix #17021 by checking more return kindsRichard Eisenberg2020-03-171-0/+71
| | | | | | | | | | All the details are in new Note [Datatype return kinds] in TcTyClsDecls. Test case: typecheck/should_fail/T17021{,b} typecheck/should_compile/T17021a Updates haddock submodule
* Document the units of -ddump-timingsMaximilian Tagher2020-03-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Right now, in the output of -ddump-timings to a file, you can't tell what the units are: ``` CodeGen [TemplateTestImports]: alloc=22454880 time=14.597 ``` I believe bytes/milliseconds are the correct units, but confirmation would be appreciated. I'm basing it off of this snippet from `withTiming'`: ``` when (verbosity dflags >= 2 && prtimings == PrintTimings) $ liftIO $ logInfo dflags (defaultUserStyle dflags) (text "!!!" <+> what <> colon <+> text "finished in" <+> doublePrec 2 time <+> text "milliseconds" <> comma <+> text "allocated" <+> doublePrec 3 (realToFrac alloc / 1024 / 1024) <+> text "megabytes") ``` which implies time is in milliseconds, and allocations in bytes (which divided by 1024 would be KB, and again would be MB)
* Add a -no-haddock flag.Judah Jacobson2020-03-152-1/+20
| | | | | | | | This flag undoes the effect of a previous "-haddock" flag. Having both flags makes it easier for build systems to enable Haddock parsing in a set of global flags, but then disable it locally for specific targets (e.g., third-party packages whose comments don't pass the validation in the latest GHC). I added the flag to expected-undocumented-flags.txt since `-haddock` was alreadyin that list.
* Document restriction on SCC pragma syntaxKrzysztof Gogolewski2020-03-151-1/+1
| | | | | | | Currently, the names of cost centres must be quoted or be lowercase identifiers. Fixes #17916.
* Use correct option name (-opti) (fix #17314)Sylvain Henry2020-03-142-8/+4
| | | | s/pgmo/opti
* Fixed a minor typo in codegen.rstGreg Steuck2020-03-111-1/+1
|
* docs: correct link to th haddocks from users guideAdam Sandberg Ericsson2020-02-291-1/+1
|
* docs: correct relative links to haddocks from users guide (fixes #17866)Adam Sandberg Ericsson2020-02-291-2/+29
|
* users-guide: Drop old release notesBen Gamari2020-02-243-663/+0
|
* users-guide: Shuffle textBen Gamari2020-02-241-18/+16
|
* Modules: Driver (#13009)Sylvain Henry2020-02-211-14/+14
| | | | submodule updates: nofib, haddock
* users-guide: Mention dependency on `exceptions` in release notesBen Gamari2020-02-202-0/+2
| | | | Fixes #17845.
* Enable -Wstar-is-type in -WallBen Gamari2020-02-201-1/+0
| | | | | | | | | | As noted in [proposal 0143][proposal] this is supposed to happen in 8.12. Also fix an incorrect claim in the users guide that -Wstar-is-type is enabled by default. [proposal]: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0143-remove-star-kind.rst
* 8.10 Release notes for --disable-delayed-os-memory-return [skip ci]Niklas Hambüchen2020-02-201-0/+15
|
* 8.10 Release notes for atomic .o writes [skip ci]Niklas Hambüchen2020-02-201-0/+15
|
* Revert "users-guide: Document -ddump-srts"Ömer Sinan Ağacan2020-02-161-6/+0
| | | | | | | | This reverts commit 8cf646d36b02b8ea1c289cb52781c9171853b514. The flag was removed by 16d643cf. [ci skip]
* users-guide: Fix broken referenceBen Gamari2020-02-141-1/+1
|
* users-guide: Document -ddump-srtsBen Gamari2020-02-141-0/+6
|
* compare-flags: Fix outputBen Gamari2020-02-141-6/+9
|
* compare-flags: Don't rely on encoding flag of subprocess.check_outputBen Gamari2020-02-141-3/+2
| | | | Apparently it isn't supported by some slightly older Python versions.
* users-guide: Fix "invalid file" failureBen Gamari2020-02-141-1/+1
| | | | I have no idea how this worked previously. Different Python version?
* docs/compare-flags: Don't use python f-stringsBen Gamari2020-02-141-4/+4
|
* users-guide: Fix unknown link targetsBen Gamari2020-02-142-6/+17
|
* Fix flag documentation (#17826)Sylvain Henry2020-02-131-2/+4
|
* Always display inferred variables using bracesKrzysztof Gogolewski2020-02-123-8/+4
| | | | | | | | | | | | | We now always show "forall {a}. T" for inferred variables, previously this was controlled by -fprint-explicit-foralls. This implements part 1 of https://github.com/ghc-proposals/ghc-proposals/pull/179. Part of GHC ticket #16320. Furthermore, when printing a levity restriction error, we now display the HsWrap of the expression. This lets users see the full elaboration with -fprint-typechecker-elaboration (see also #17670)
* Separate CPR analysis from the Demand analyserwip/sep-cprSebastian Graf2020-02-121-0/+12
| | | | | | | | | | | | | | | | | | | The reasons for that can be found in the wiki: https://gitlab.haskell.org/ghc/ghc/wikis/nested-cpr/split-off-cpr We now run CPR after demand analysis (except for after the final demand analysis run just before code gen). CPR got its own dump flags (`-ddump-cpr-anal`, `-ddump-cpr-signatures`), but not its own flag to activate/deactivate. It will run with `-fstrictness`/`-fworker-wrapper`. As explained on the wiki page, this step is necessary for a sane Nested CPR analysis. And it has quite positive impact on compiler performance: Metric Decrease: T9233 T9675 T9961 T15263
* TemplateHaskellQuotes: Allow nested splicesMatthew Pickering2020-02-112-1/+4
| | | | | | There is no issue with nested splices as they do not require any compile time code execution. All execution is delayed until the top-level splice.
* 8.10 Release notes for improvements to the pattern-match checker [skip ci]Sebastian Graf2020-02-091-0/+14
| | | | A little late to the game, but better late than never.
* users-guide: Clarify that bundled patsyns were introduced in GHC 8.0Ben Gamari2020-02-081-3/+5
| | | | Closes #17094.
* Introduce -Wcompat-unqualified-importsBen Gamari2020-02-081-3/+22
| | | | | | | | | | | | | This implements the warning proposed in option (B) of the Data.List.singleton CLC [discussion][]. This warning, which is included in `-Wcompat` is intended to help users identify imports of modules that will change incompatibly in future GHC releases. This currently only includes `Data.List` due to the expected specialisation and addition of `Data.List.singleton`. Fixes #17244. [discussion]: https://groups.google.com/d/msg/haskell-core-libraries/q3zHLmzBa5E/PmlAs_kYAQAJ
* Improve/fix -fcatch-bottoms documentationÖmer Sinan Ağacan2020-02-011-6/+13
| | | | | | | | | | | | | | | Old documentation suggests that -fcatch-bottoms only adds a default alternative to bottoming case expression, but that's not true. We use a very simplistic "is exhaustive" check and add default alternatives to any case expression that does not cover all constructors of the type. In case of GADTs this simple check assumes all constructors should be covered, even the ones ruled out by the type of the scrutinee. Update the documentation to reflect this. (Originally noticed in #17648) [ci skip]
* Split glasgow_exts into several files (#17316)Sylvain Henry2020-01-25122-17042/+17295
|
* Handle local fixity declarations in DsMeta properlyRyan Scott2020-01-251-0/+18
| | | | | | | | | | | | | | | | | | | | | `DsMeta.rep_sig` used to skip over `FixSig` entirely, which had the effect of causing local fixity declarations to be dropped when quoted in Template Haskell. But there is no good reason for this state of affairs, as the code in `DsMeta.repFixD` (which handles top-level fixity declarations) handles local fixity declarations just fine. This patch factors out the necessary parts of `repFixD` so that they can be used in `rep_sig` as well. There was one minor complication: the fixity signatures for class methods in each `HsGroup` were stored both in `FixSig`s _and_ the list of `LFixitySig`s for top-level fixity signatures, so I needed to take action to prevent fixity signatures for class methods being converted to `Dec`s twice. I tweaked `RnSource.add` to avoid putting these fixity signatures in two places and added `Note [Top-level fixity signatures in an HsGroup]` in `GHC.Hs.Decls` to explain the new design. Fixes #17608. Bumps the Haddock submodule.
* PmCheck: Formulate as translation between Clause TreesSebastian Graf2020-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to check `GrdVec`s arising from multiple clauses and guards in isolation. That resulted in a split between `pmCheck` and `pmCheckGuards`, the implementations of which were similar, but subtly different in detail. Also the throttling mechanism described in `Note [Countering exponential blowup]` ultimately got quite complicated because it had to cater for both checking functions. This patch realises that pattern match checking doesn't just consider single guarded RHSs, but that it's always a whole set of clauses, each of which can have multiple guarded RHSs in turn. We do so by translating a list of `Match`es to a `GrdTree`: ```haskell data GrdTree = Rhs !RhsInfo | Guard !PmGrd !GrdTree -- captures lef-to-right match semantics | Sequence !GrdTree !GrdTree -- captures top-to-bottom match semantics | Empty -- For -XEmptyCase, neutral element of Sequence ``` Then we have a function `checkGrdTree` that matches a given `GrdTree` against an incoming set of values, represented by `Deltas`: ```haskell checkGrdTree :: GrdTree -> Deltas -> CheckResult ... ``` Throttling is isolated to the `Sequence` case and becomes as easy as one would expect: When the union of uncovered values becomes too big, just return the original incoming `Deltas` instead (which is always a superset of the union, thus a sound approximation). The returned `CheckResult` contains two things: 1. The set of values that were not covered by any of the clauses, for exhaustivity warnings. 2. The `AnnotatedTree` that enriches the syntactic structure of the input program with divergence and inaccessibility information. This is `AnnotatedTree`: ```haskell data AnnotatedTree = AccessibleRhs !RhsInfo | InaccessibleRhs !RhsInfo | MayDiverge !AnnotatedTree | SequenceAnn !AnnotatedTree !AnnotatedTree | EmptyAnn ``` Crucially, `MayDiverge` asserts that the tree may force diverging values, so not all of its wrapped clauses can be redundant. While the set of uncovered values can be used to generate the missing equations for warning messages, redundant and proper inaccessible equations can be extracted from `AnnotatedTree` by `redundantAndInaccessibleRhss`. For this to work properly, the interface to the Oracle had to change. There's only `addPmCts` now, which takes a bag of `PmCt`s. There's a whole bunch of `PmCt` variants to replace the different oracle functions from before. The new `AnnotatedTree` structure allows for more accurate warning reporting (as evidenced by a number of changes spread throughout GHC's code base), thus we fix #17465. Fixes #17646 on the go. Metric Decrease: T11822 T9233 PmSeriesS haddock.compiler
* Put the docs for :instances in alphabetical positionXavier Denis2020-01-201-33/+33
|
* Fix +RTS -Z flag documentationÖmer Sinan Ağacan2020-01-201-1/+1
| | | | | | | | | Stack squeezing is done on context switch, not on GC or stack overflow. Fix the documentation. Fixes #17685 [ci skip]