summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Minor refactor around FastStringswip/strings-refactor3Krzysztof Gogolewski2022-11-0436-95/+102
| | | | | | | Pass FastStrings to functions directly, to make sure the rule for fsLit "literal" fires. Remove SDoc indirection in GHCi.UI.Tags and GHC.Unit.Module.Graph.
* Export pprTrace and friends from GHC.Prelude.Andreas Klebinger2022-11-0369-127/+146
| | | | | Introduces GHC.Prelude.Basic which can be used in modules which are a dependency of the ppr code.
* Fix haddocks for GHC.IORefBodigrim2022-11-031-2/+2
|
* Clarify status of bindings in WholeCoreBindingsMatthew Pickering2022-11-032-5/+5
| | | | | | | | | Gergo points out that these bindings are tidied, rather than prepd as the variable claims. Therefore we update the name of the variable to reflect reality and add a comment to the data type to try to erase any future confusion. Fixes #22307
* git: ignore HIE files.M Farkas-Dyck2022-11-031-0/+2
| | | | Cleans up git status if one sets -fwrite-ide-info in hadrian/ghci.
* Port foundation numeric tests to GHC testsuiteMatthew Pickering2022-11-033-0/+838
| | | | | | | | | | | | | This commit ports the numeric tests which found a regression in GHC-9.4. https://github.com/haskell-foundation/foundation/issues/571 Included in the commit is a simple random number generator and simplified QuickCheck implementation. In future these could be factored out of this standalone file and reused as a general purpose library which could be used for other QuickCheck style tests in the testsuite. See #22282
* gen-dll: Drop itBen Gamari2022-11-035-562/+0
| | | | | | | | | Currently it is only used by the make build system, which is soon to be retired, and it has not built since 41cf758b. We may need to reintroduce it when dynamic-linking support is introduced on Windows, but we will cross that bridge once we get there. Fixes #21753.
* Move Symbol implementation note out of public haddockOleg Grenrus2022-11-021-1/+2
|
* rts: tag `stgStrndup` as `STG_MALLOC`Nicolas Trangez2022-11-021-1/+2
| | | | See: https://gitlab.haskell.org/ghc/ghc/-/issues/22381
* rts: add and use `STG_RETURNS_NONNULL`Nicolas Trangez2022-11-022-2/+19
| | | | | See: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-returns_005fnonnull-function-attribute See: https://gitlab.haskell.org/ghc/ghc/-/issues/22381
* rts: use `alloc_size` attributeNicolas Trangez2022-11-022-3/+17
| | | | | | | | This patch adds the `STG_ALLOC_SIZE1` and `STG_ALLOC_SIZE2` macros which allow to set the `alloc_size` attribute on functions, when available. See: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-alloc_005fsize-function-attribute See: https://gitlab.haskell.org/ghc/ghc/-/issues/22381
* rts: specify deallocator of allocating functionsNicolas Trangez2022-11-023-6/+50
| | | | | | | | | | | | | This patch adds a new `STG_MALLOC1` macro (and its counterpart `STG_MALLOC2` for completeness) which allows to specify the deallocation function to be used with allocations of allocating functions, and applies it to `stg*allocBytes`. It also fixes a case where `free` was used to free up an `stgMallocBytes` allocation, found by the above change. See: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-malloc-function-attribute See: https://gitlab.haskell.org/ghc/ghc/-/issues/22381
* rts: use `STG_UNUSED`Nicolas Trangez2022-11-022-3/+3
|
* rts: introduce (and use) `STG_MALLOC`Nicolas Trangez2022-11-022-2/+4
| | | | | Instead of using `GNUC3_ATTRIBUTE(__malloc__)`, provide a `STG_MALLOC` macro definition and use it instead.
* rts: introduce (and use) `STG_USED`Nicolas Trangez2022-11-022-4/+5
| | | | | Similar to `STG_UNUSED`, have a specific macro for `__attribute__(used)`.
* rts: consistently use `STG_UNUSED`Nicolas Trangez2022-11-022-2/+2
|
* rts: introduce (and use) `STG_NORETURN`Nicolas Trangez2022-11-0217-24/+26
| | | | | | | Instead of sprinkling the codebase with `GNU(C3)_ATTRIBUTE(__noreturn__)`, add a `STG_NORETURN` macro (for, basically, the same thing) similar to `STG_UNUSED` and others, and update the code to use this macro where applicable.
* Add two tests for #17366Simon Peyton Jones2022-11-017-0/+116
|
* Shrink test case for #22357Simon Peyton Jones2022-11-011-678/+12
| | | | | Ryan Scott offered a cut-down repro case (60 lines instead of more than 700 lines)
* Expose UnitEnvGraphKey for user-codeFendor2022-11-011-0/+1
|
* Add accurate skolem info when quantifyingSimon Peyton Jones2022-11-019-64/+139
| | | | | | | Ticket #22379 revealed that skolemiseQuantifiedTyVar was dropping the passed-in skol_info on the floor when it encountered a SkolemTv. Bad! Several TyCons thereby share a single SkolemInfo on their binders, which lead to bogus error reports.
* ThToHs: fix overzealous parenthesizationVladislav Zavialov2022-11-017-13/+29
| | | | | | | | | | | | | | | | | | Before this patch, when converting from TH.Exp to LHsExpr GhcPs, the compiler inserted more parentheses than required: ((f a) (b + c)) d This was happening because the LHS of the function application was parenthesized as if it was the RHS. Now we use funPrec and appPrec appropriately and produce sensibly parenthesized expressions: f a (b + c) d I also took the opportunity to remove the special case for LamE, which was not special at all and simply duplicated code.
* Typo: rename -fwrite-if-simplfied-core to -fwrite-if-simplified-coreKrzysztof Gogolewski2022-11-015-19/+19
|
* rts: fix OS thread naming in tickerNicolas Trangez2022-11-013-26/+20
| | | | | | | | | | | | | | | Since ee0deb805, the use of `pthread_setname_np` on Darwin was fixed when invoking `createOSThread`. However, the 'ticker' has some thread-creation code which doesn't rely on `createOSThread`, yet also uses `pthread_setname_np`. This patch enforces all thread creation to go through a single function, which uses the (correct) thread-naming code introduced in ee0deb805. See: https://gitlab.haskell.org/ghc/ghc/-/commit/ee0deb8054da2a597fc5624469b4c44fd769ada2 See: https://gitlab.haskell.org/ghc/ghc/-/issues/22206 See: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9066
* rts: fix lifetime of `start_thread`s `name` valueNicolas Trangez2022-11-011-8/+14
| | | | | | | | | | Since, unlike the code in ee0deb8054da2^, usage of the `name` value passed to `createOSThread` now outlives said function's lifetime, and could hence be released by the caller by the time the new thread runs `start_thread`, it needs to be copied. See: https://gitlab.haskell.org/ghc/ghc/-/commit/ee0deb8054da2a597fc5624469b4c44fd769ada2#note_460080 See: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9066
* rts: `name` argument of `createOSThread` can be `const`Nicolas Trangez2022-11-013-3/+3
| | | | | | | | | | Since we don't intend to ever change the incoming string, declare this to be true. Also, in the POSIX implementation, the argument is no longer `STG_UNUSED` (since ee0deb8054da2a597fc5624469b4c44fd769ada2) in any code path. See: https://gitlab.haskell.org/ghc/ghc/-/commit/ee0deb8054da2a597fc5624469b4c44fd769ada2#note_460080
* Drop a kludge for binutils<2.17, which is now over 10 years old.M Farkas-Dyck2022-11-012-39/+2
|
* Start the deprecation process for GHC.PackHécate Moonlight2022-10-281-0/+5
|
* CI: Don't run lint-submods on nightlywip/T22325Bryan Richter2022-10-281-0/+3
| | | | Fixes #22325
* Minor SDoc-related cleanupKrzysztof Gogolewski2022-10-2822-134/+138
| | | | | | | | | | | * Rename pprCLabel to pprCLabelStyle, and use the name pprCLabel for a function using CStyle (analogous to pprAsmLabel) * Move LabelStyle to the CLabel module, it no longer needs to be in Outputable. * Move calls to 'text' right next to literals, to make sure the text/str rule is triggered. * Remove FastString/String roundtrip in Tc.Deriv.Generate * Introduce showSDocForUser', which abstracts over a pattern in GHCi.UI
* Pass correct package db when testing stage1.Zubin Duggal2022-10-282-2/+2
| | | | It used to pick the db for stage-2 which obviously didn't work.
* Fix broken link to `async` packageEvan Relf2022-10-271-1/+1
|
* Add missing dict binds to specialiserSimon Peyton Jones2022-10-274-14/+741
| | | | | | | | | | I had forgotten to add the auxiliary dict bindings to the /unfolding/ of a specialised function. This caused #22358, which reports failures when compiling Hackage packages fixed-vector indexed-traversable Regression test T22357 is snarfed from indexed-traversable
* Remove source location information from interface filesOwen Shepherd2022-10-278-72/+88
| | | | | | | | | | | | | This change aims to minimize source location information leaking into interface files, which makes ABI hashes dependent on the build location. The `Binary (Located a)` instance has been removed completely. It seems that the HIE interface still needs the ability to serialize SrcSpans, but by wrapping the instances, it should be a lot more difficult to inadvertently add source location information.
* Use TcRnVDQInTermType in noNestedForallsContextsErr (#20115)Vladislav Zavialov2022-10-268-23/+29
| | | | | | | | | | | | | | | | | | | | | When faced with VDQ in the type of a term, GHC generates the following error message: Illegal visible, dependent quantification in the type of a term (GHC does not yet support this) Prior to this patch, there were two ways this message could have been generated and represented: 1. with the dedicated constructor TcRnVDQInTermType (see check_type in GHC.Tc.Validity) 2. with the transitional constructor TcRnUnknownMessage (see noNestedForallsContextsErr in GHC.Rename.Utils) Not only this led to duplication of code generating the final SDoc, it also made it tricky to track the origin of the error message. This patch fixes the problem by using TcRnVDQInTermType exclusively.
* Testsuite: more precise test optionsSylvain Henry2022-10-2647-160/+145
| | | | | Necessary for newer cross-compiling backends (JS, Wasm) that don't support TH yet.
* Introduce TcRnWithHsDocContext (#22346)Vladislav Zavialov2022-10-2638-105/+122
| | | | | | | | | | | | | | | | | Before this patch, GHC used withHsDocContext to attach an HsDocContext to an error message: addErr $ mkTcRnUnknownMessage $ mkPlainError noHints (withHsDocContext ctxt msg) The problem with this approach is that it only works with TcRnUnknownMessage. But could we attach an HsDocContext to a structured error message in a generic way? This patch solves the problem by introducing a new constructor to TcRnMessage: data TcRnMessage where ... TcRnWithHsDocContext :: !HsDocContext -> !TcRnMessage -> TcRnMessage ...
* Broaden the in-scope sets for liftEnvSubst and composeTCvSubstRyan Scott2022-10-264-3/+37
| | | | | | | | | | | | | | | | | This patch fixes two distinct (but closely related) buglets that were uncovered in #22235: * `liftEnvSubst` used an empty in-scope set, which was not wide enough to cover the variables in the range of the substitution. This patch fixes this by populating the in-scope set from the free variables in the range of the substitution. * `composeTCvSubst` applied the first substitution argument to the range of the second substitution argument, but the first substitution's in-scope set was not wide enough to cover the range of the second substutition. We similarly fix this issue in this patch by widening the first substitution's in-scope set before applying it. Fixes #22235.
* Cleanup String/FastString conversionsKrzysztof Gogolewski2022-10-2517-99/+67
| | | | | | | Remove unused mkPtrString and isUnderscoreFS. We no longer use mkPtrString since 1d03d8bef96. Remove unnecessary conversions between FastString and String and back.
* llvm-targets: Add datalayouts for big-endian AArch64 targetsBen Gamari2022-10-252-0/+6
| | | | | | Fixes #22311. Thanks to @zeldin for the patch.
* Add GHC.SysTools.Cpp moduleSylvain Henry2022-10-254-156/+246
| | | | Move doCpp out of the driver to be able to use it in the upcoming JS backend.
* Enable popcount rewrite rule when cross-compilingSylvain Henry2022-10-251-1/+1
| | | | | The comment applies only when host's word size < target's word size. So we can relax the guard.
* Numeric exceptions: replace FFI calls with primopsSylvain Henry2022-10-257-65/+41
| | | | | | | | | | | | | ghc-bignum needs a way to raise numerical exceptions defined in base package. At the time we used FFI calls into primops defined in the RTS. These FFI calls had to be wrapped into hacky bottoming functions because "foreign import prim" syntax doesn't support giving a bottoming demand to the foreign call (cf #16929). These hacky wrapper functions trip up the JavaScript backend (#21078) because they are polymorphic in their return type. This commit replaces them with primops very similar to raise# but raising predefined exceptions.
* Make the specialiser handle polymorphic specialisationSimon Peyton Jones2022-10-257-76/+419
| | | | | | | | | | | | | | | | | | | | | | | | | | | Ticket #13873 unexpectedly showed that a SPECIALISE pragma made a program run (a lot) slower, because less specialisation took place overall. It turned out that the specialiser was missing opportunities because of quantified type variables. It was quite easy to fix. The story is given in Note [Specialising polymorphic dictionaries] Two other minor fixes in the specialiser * There is no benefit in specialising data constructor /wrappers/. (They can appear overloaded because they are given a dictionary to store in the constructor.) Small guard in canSpecImport. * There was a buglet in the UnspecArg case of specHeader, in the case where there is a dead binder. We need a LitRubbish filler for the specUnfolding stuff. I expanded Note [Drop dead args from specialisations] to explain. There is a 4% increase in compile time for T15164, because we generate more specialised code. This seems OK. Metric Increase: T15164
* Fix binder-swap bugSimon Peyton Jones2022-10-257-106/+162
| | | | | | | | | | | | | | | | | | | | | | | This patch fixes #21229 properly, by avoiding doing a binder-swap on dictionary Ids. This is pretty subtle, and explained in Note [Care with binder-swap on dictionaries]. Test is already in simplCore/should_run/T21229 This allows us to restore a feature to the specialiser that we had to revert: see Note [Specialising polymorphic dictionaries]. (This is done in a separate patch.) I also modularised things, using a new function scrutBinderSwap_maybe in all the places where we are (effectively) doing a binder-swap, notably * Simplify.Iteration.addAltUnfoldings * SpecConstr.extendCaseBndrs In Simplify.Iteration.addAltUnfoldings I also eliminated a guard Many <- idMult case_bndr because we concluded, in #22123, that it was doing no good.
* Improve stg lint for unboxed sums.Andreas Klebinger2022-10-241-11/+39
| | | | | | | It now properly lints cases where sums end up distributed over multiple args after unarise. Fixes #22026.
* Convert Diagnostics in GHC.Tc.Gen.Splice (#20116)Aaron Allen2022-10-2458-237/+717
| | | | | | | Replaces uses of `TcRnUnknownMessage` in `GHC.Tc.Gen.Splice` with structured diagnostics. closes #20116
* Pin used way for test cloneMyStack (#21977)Sven Tennie2022-10-241-1/+5
| | | | | cloneMyStack checks the order of closures on the cloned stack. This may change for different ways. Thus we limit this test to one way (normal).
* Class layout info (#19623)Vladislav Zavialov2022-10-2328-148/+252
| | | | Updates the haddock submodule.
* hadrian: Improve error for wrong key/value errors.Andreas Klebinger2022-10-221-1/+2
|