summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Expand Note [Data con representation].wip/andreask/document_dataConRepAndreas Klebinger2021-05-101-4/+30
| | | | Not perfect. But I consider this to be a documentation fix for #19789.
* Improve hs-boot binds error (#19781)sheaf2021-05-037-10/+52
|
* visually align expected and actual modules nameiori tsu2021-05-033-3/+3
| | | | | | | | | | | | | | | | | | | | before: > /home/matt/Projects/persistent/persistent/Database/Persist/ImplicitIdDef.hs:1:8: error: > File name does not match module name: > Saw: ‘A.B.Module’ > Expected: ‘A.B.Motule’ > | > 1 | module A.B.Motule > | ^^^^^^^^^^> after: > /home/matt/Projects/persistent/persistent/Database/Persist/ImplicitIdDef.hs:1:8: error: > File name does not match module name: > Saw: ‘A.B.Module’ > Expected: ‘A.B.Motule’ > | > 1 | module A.B.Motule > | ^^^^^^^^^^>
* Disable HLint coloursHécate Moonlight2021-05-031-2/+3
| | | | closes #19776
* Remove duplicate modules in GHCi %s promptPhilipp Dargel2021-05-031-1/+1
| | | | fixes #19757
* pe: enable code unloading for WindowsTamar Christina2021-05-032-6/+3
|
* Update documentation of 'Weak'bit2021-05-031-8/+7
|
* Move shift ops out of GHC.BaseSylvain Henry2021-05-033-66/+72
| | | | | | | With a quick flavour I get: before T12545(normal) ghc/alloc 8628109152 after T12545(normal) ghc/alloc 8559741088
* Use fix-sized bit-fiddling primops for fixed size boxed typesJohn Ericson2021-05-033-80/+145
| | | | | Like !5572, this is switching over a portion of the primops which seems safe to use.
* Add test case for #8144Harry Garrood harry@garrood.me2021-05-035-0/+26
| | | | Fixes #8144
* Make sized division primops ok-for-spec (#19026)Sylvain Henry2021-04-302-14/+47
|
* Bring tcTyConScopedTyVars into scope in tcClassDecl2Ryan Scott2021-04-308-30/+112
| | | | | | | | | | | It is possible that the type variables bound by a class header will map to something different in the typechecker in the presence of `StandaloneKindSignatures`. `tcClassDecl2` was not aware of this, however, leading to #19738. To fix it, in `tcTyClDecls` we map each class `TcTyCon` to its `tcTyConScopedTyVars` as a `ClassScopedTVEnv`. We then plumb that `ClassScopedTVEnv` to `tcClassDecl2` where it can be used. Fixes #19738.
* Hadrian: build check-* with -Wall/-WerrorSylvain Henry2021-04-301-1/+1
| | | | Otherwise CI fails only with make build system.
* Fix genprimopcode warningSylvain Henry2021-04-301-1/+1
|
* Make GHC.Runtime.Interpreter independent of GHC.DriverSylvain Henry2021-04-309-32/+36
|
* Interpreter: replace DynFlags with EvalOpts/BCOOptsSylvain Henry2021-04-304-45/+68
|
* Tighten scope of non-POSIX visibility macrosViktor Dukhovni2021-04-304-15/+34
| | | | | | | The __BSD_VISIBLE and _DARWIN_C_SOURCE macros expose non-POSIX prototypes in system header files. We should scope these to just the ".c" modules that actually need them, and avoid defining them in header files used in other C modules.
* rts: export allocateWrite, freeWrite and markExec #19763Adam Sandberg Ericsson2021-04-291-0/+10
|
* Replace (ptext .. sLit) with `text`Sylvain Henry2021-04-2955-818/+789
| | | | | | | | | | | | | | | 1. `text` is as efficient as `ptext . sLit` thanks to the rewrite rules 2. `text` is visually nicer than `ptext . sLit` 3. `ptext . sLit` encourages using one `ptext` for several `sLit` as in: ptext $ case xy of ... -> sLit ... ... -> sLit ... which may allocate SDoc's TextBeside constructors at runtime instead of sharing them into CAFs.
* Propagate free variables in extract_lctxt correctlyRyan Scott2021-04-293-1/+27
| | | | | This fixes an oversight in the implementation of `extract_lctxt` which was introduced in commit ce85cffc. Fixes #19759.
* Expand synonyms in mkCastTy when necessaryRyan Scott2021-04-293-20/+72
| | | | | | | | Doing so is important to maintain invariants (EQ3) and (EQ4) from `Note [Respecting definitional equality]` in `GHC.Core.TyCo.Rep`. For the details, see the new `Note [Using coreView in mk_cast_ty]`. Fixes #19742.
* Redesign withDict (formerly magicDict)Ryan Scott2021-04-2925-135/+437
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives a more precise type signature to `magicDict` as proposed in #16646. In addition, this replaces the constant-folding rule for `magicDict` in `GHC.Core.Opt.ConstantFold` with a special case in the desugarer in `GHC.HsToCore.Expr.dsHsWrapped`. I have also renamed `magicDict` to `withDict` in light of the discussion in https://mail.haskell.org/pipermail/ghc-devs/2021-April/019833.html. All of this has the following benefits: * `withDict` is now more type safe than before. Moreover, if a user applies `withDict` at an incorrect type, the special-casing in `dsHsWrapped` will now throw an error message indicating what the user did incorrectly. * `withDict` can now work with classes that have multiple type arguments, such as `Typeable @k a`. This means that `Data.Typeable.Internal.withTypeable` can now be implemented in terms of `withDict`. * Since the special-casing for `withDict` no longer needs to match on the structure of the expression passed as an argument to `withDict`, it no longer cares about the presence or absence of `Tick`s. In effect, this obsoletes the fix for #19667. The new `T16646` test case demonstrates the new version of `withDict` in action, both in terms of `base` functions defined in terms of `withDict` as well as in terms of functions from the `reflection` and `singletons` libraries. The `T16646Fail` test case demonstrates the error message that GHC throws when `withDict` is applied incorrectly. This fixes #16646. By adding more tests for `withDict`, this also fixes #19673 as a side effect.
* Add GhcMessage and ancillary typesAlfredo Di Napoli2021-04-2988-653/+1333
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds GhcMessage and ancillary (PsMessage, TcRnMessage, ..) types. These types will be expanded to represent more errors generated by different subsystems within GHC. Right now, they are underused, but more will come in the glorious future. See https://gitlab.haskell.org/ghc/ghc/-/wikis/Errors-as-(structured)-values for a design overview. Along the way, lots of other things had to happen: * Adds Semigroup and Monoid instance for Bag * Fixes #19746 by parsing OPTIONS_GHC pragmas into Located Strings. See GHC.Parser.Header.toArgs (moved from GHC.Utils.Misc, where it didn't belong anyway). * Addresses (but does not completely fix) #19709, now reporting desugarer warnings and errors appropriately for TH splices. Not done: reporting type-checker warnings for TH splices. * Some small refactoring around Safe Haskell inference, in order to keep separate classes of messages separate. * Some small refactoring around initDsTc, in order to keep separate classes of messages separate. * Separate out the generation of messages (that is, the construction of the text block) from the wrapping of messages (that is, assigning a SrcSpan). This is more modular than the previous design, which mixed the two. Close #19746. This was a collaborative effort by Alfredo di Napoli and Richard Eisenberg, with a key assist on #19746 by Iavor Diatchki. Metric Increase: MultiLayerModules
* Fix inlining of division wrappersSylvain Henry2021-04-291-0/+18
|
* Make divModInt# branchlessSylvain Henry2021-04-292-24/+69
|
* Allow divInt#/modInt# to inline (#18067)Sylvain Henry2021-04-291-2/+2
|
* Refactor modInt# to make it branchlessSylvain Henry2021-04-291-7/+59
|
* Refactor divInt# to make it branchless (#18067, #19636)Sylvain Henry2021-04-291-9/+68
|
* 19079 DerivingVia: incorrectly accepts deriving via types with differing ↵Sasha Bogicevic2021-04-271-3/+5
| | | | runtime representations
* fix #19736Daniel Rogozin2021-04-276-6/+24
|
* Introduce -ddump-verbose-inliningsBen Gamari2021-04-274-6/+15
| | | | | | | | Previously -ddump-inlinings and -dverbose-core2core used in conjunction would have the side-effect of dumping additional information about all inlinings considered by the simplifier. However, I have sometimes wanted this inlining information without the firehose of information produced by -dverbose-core2core. Introduce a new dump flag for this purpose.
* Pretty-print HsArgPar applications correctly (#19737)Ryan Scott2021-04-276-16/+88
| | | | | | | | | | | Previously, the `Outputable` instance for `HsArg` was being used to pretty-print each `HsArgPar` in a list of `HsArg`s individually, which simply doesn't work. In lieu of the `Outputable` instance, we now use a dedicated `pprHsArgsApp` function to print a list of `HsArg`s as a single unit. I have also added documentation to the `Outputable` instance for `HsArg` to more clearly signpost that it is only suitable for debug pretty-printing. Fixes #19737.
* Add documentation for GHC.Exts.sortWithiori tsu2021-04-271-0/+5
| | | | | | sortWith has the same type definition as `Data.List.sortOn` (eg: `Ord b => (a -> b) -> [a] -> [a]`). Nonetheless, they behave differently, sortOn being more efficient. This merge request add documentation to reflect on this differences
* docs: add a short up-front description for -O, -n, -qn, -I and -IwAdam Sandberg Ericsson2021-04-261-10/+19
|
* 18000 Use GHC.IO.catchException in favor of Exception.catchSasha Bogicevic2021-04-269-22/+27
| | | | fix #18000
* rts/m32: Fix bounds checkBen Gamari2021-04-261-2/+3
| | | | | | | | Previously we would check only that the *start* of the mapping was in the bottom 32-bits of address space. However, we need the *entire* mapping to be in low memory. Fix this. Noticed by @Phyx.
* Add GHC.Utils.Error.pprMessagesRafal Gwozdzinski2021-04-264-3/+8
|
* Eliminate unsafeEqualityProof in CorePrepSimon Peyton Jones2021-04-2623-222/+524
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main idea here is to avoid treating * case e of {} * case unsafeEqualityProof of UnsafeRefl co -> blah specially in CoreToStg. Instead, nail them in CorePrep, by converting case e of {} ==> e |> unsafe-co case unsafeEqualityProof of UnsafeRefl cv -> blah ==> blah[unsafe-co/cv] in GHC.Core.Prep. Now expressions that we want to treat as trivial really are trivial. We can get rid of cpExprIsTrivial. And we fix #19700. A downside is that, at least under unsafeEqualityProof, we substitute in types and coercions, which is more work. But a big advantage is that it's all very simple and principled: CorePrep really gets rid of the unsafeCoerce stuff, as it does empty case, runRW#, lazyId etc. I've updated the overview in GHC.Core.Prep, and added Note [Unsafe coercions] in GHC.Core.Prep Note [Implementing unsafeCoerce] in base:Unsafe.Coerce We get 3% fewer bytes allocated when compiling perf/compiler/T5631, which uses a lot of unsafeCoerces. (It's a happy-generated parser.) Metric Decrease: T5631
* Correct treatment of rexported modules in mkModuleNameProvidersMapMatthew Pickering2021-04-262-4/+3
| | | | | | | | | | | | | | | | | | | | Before we would get the incorrect error message saying that the rexporting package was the same as the defining package. I think this only affects error messages for now. ``` - it is bound as p-0.1.0.0:P2 by a reexport in package p-0.1.0.0 - it is bound as P by a reexport in package p-0.1.0.0 + it is bound as p-0.1.0.0:P2 by a reexport in package q-0.1.0.0 + it is bound as P by a reexport in package r-0.1.0.0 ``` and the output of `-ddump-mod-map` claimed.. ``` Moo moo-0.0.0.1 (hidden package, reexport by moo-0.0.0.1) ```
* users guide: Various other cleanupsBen Gamari2021-04-262-10/+26
|
* users-guide: Document deprecation of -funfolding-keeness-factorBen Gamari2021-04-263-1/+16
| | | | See #15304.
* testsuite: Add test for #19645Ben Gamari2021-04-263-0/+31
|
* codeGen: Teach unboxed sum rep logic about levityBen Gamari2021-04-264-36/+81
| | | | | | | | | | | | | | Previously Unarise would happily project lifted and unlifted fields to lifted slots. This broke horribly in #19645, where a ByteArray# was passed in a lifted slot and consequently entered. The simplest way to fix this is what I've done here, distinguishing between lifted and unlifted slots in unarise. However, one can imagine more clever solutions, where we coerce the binder to the correct levity with respect to the sum's tag. I doubt that this would be worth the effort. Fixes #19645.
* Add Eq1 and Ord1 Fixed instancesOleg Grenrus2021-04-262-1/+11
|
* Parser: Unbox `ParseResult`Sebastian Graf2021-04-261-14/+26
| | | | | | | Using `UnliftedNewtypes`, unboxed tuples and sums and a few pattern synonyms, we can make `ParseResult` completely allocation-free. Part of #19263.
* Rename references to Note [Trees That Grow] consistently [skip ci]wip/amg/rename-ttg-notesAdam Gundry2021-04-236-12/+18
| | | | | | I tend to find Notes by (case-sensitive) grep, and I spent a surprisingly long time looking for this Note, because it was referenced inconsistently with different cases, and without the module name.
* Make tests more portable on FreeBSDViktor Dukhovni2021-04-226-11/+22
|
* Block signals in the ticker threadViktor Dukhovni2021-04-221-1/+21
| | | | | | This avoids surprises in the non-threaded runtime with blocked signals killing the process because they're only blocked in the main thread and not in the ticker thread.
* Add background note in elf_tlsgd.c.Viktor Dukhovni2021-04-226-23/+173
| | | | | | | | | | | | | | | | | | | | | | | | Also some code cleanup, and a fix for an (extant unrelated) missing <pthread_np.h> include that should hopefully resolve a failure in the FreeBSD CI build, since it is best to make sure that this MR actually builds on FreeBSD systems other than mine. Some unexpected metric changes on FreeBSD (perhaps because CI had been failing for a while???): Metric Decrease: T3064 T5321Fun T5642 T9020 T12227 T13253-spj T15164 T18282 WWRec Metric Increase: haddock.compiler
* Support R_X86_64_TLSGD relocation on FreeBSDViktor Dukhovni2021-04-225-4/+170
| | | | | | | | | | | | | | | The FreeBSD C <ctype.h> header supports per-thread locales by exporting a static inline function that references the `_ThreadRuneLocale` thread-local variable. This means that object files that use e.g. isdigit(3) end up with TLSGD(19) relocations, and would not load into ghci or the language server. Here we add support for this type of relocation, for now just on FreeBSD, and only for external references to thread-specifics defined in already loaded dynamic modules (primarily libc.so). This is sufficient to resolve the <ctype.h> issues. Runtime linking of ".o" files which *define* new thread-specific variables would be noticeably more difficult, as this would likely require new rtld APIs.