summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix build systemsSylvain Henry2020-07-258-30/+15
|
* Move GHC.Platform into the compilerSylvain Henry2020-07-2518-349/+337
| | | | | | | Previously it was in ghc-boot so that ghc-pkg could use it. However it wasn't necessary because ghc-pkg only uses a subset of it: reading target arch and OS from the settings file. This is now done via GHC.Platform.ArchOS (was called PlatformMini before).
* Remove dead code in utils/derivConstantsSylvain Henry2020-07-251-48/+0
|
* Remove platform constant wrappersSylvain Henry2020-07-2541-1289/+1392
| | | | | | | | | | Platform constant wrappers took a DynFlags parameter, hence implicitly used the target platform constants. We removed them to allow support for several platforms at once (#14335) and to avoid having to pass the full DynFlags to every function (#17957). Metric Decrease: T4801
* Put PlatformConstants into PlatformSylvain Henry2020-07-2512-28/+49
|
* Add GHC.Platform.ProfileSylvain Henry2020-07-255-26/+61
|
* Rename GHC.Driver.Ways into GHC.Platform.WaysSylvain Henry2020-07-2515-15/+15
|
* DynFlags: store printer in TraceBinIfaceReadingSylvain Henry2020-07-252-33/+36
| | | | | We don't need to pass the whole DynFlags, just pass the logging function, if any.
* Simplify XRec definitionZubin Duggal2020-07-2524-337/+403
| | | | | | | | | | | | Change `Located X` usage to `XRec pass X` This increases the scope of the LPat experiment to almost all of GHC. Introduce UnXRec and MapXRec classes Fixes #17587 and #18408 Updates haddock submodule Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
* Care with occCheckExpand in kind of occurrencesSimon Peyton Jones2020-07-2410-40/+170
| | | | | | | | | | | | | | | | | | | Issue #18451 showed that we could get an infinite type, through over-use of occCheckExpand in the kind of an /occurrence/ of a type variable. See Note [Occurrence checking: look inside kinds] in GHC.Core.Type This patch fixes the problem by making occCheckExpand less eager to expand synonyms in kinds. It also improves pretty printing of kinds, by *not* suppressing the kind on a tyvar-binder like (a :: Const Type b) where type Const p q = p. Even though the kind of 'a' is Type, we don't want to suppress the kind ascription. Example: the error message for polykinds/T18451{a,b}. See GHC.Core.TyCo.Ppr Note [Suppressing * kinds].
* winio: change memory allocation strategy and fix double free errors.Tamar Christina2020-07-242-73/+95
|
* winio: restore console cp on exitTamar Christina2020-07-243-2/+39
|
* [linker] Fix out of range relocations.Moritz Angermann2020-07-238-28/+122
| | | | | | | | | | | | mmap may return address all over the place. mmap_next will ensure we get the next free page after the requested address. This is especially important for linking on aarch64, where the memory model with PIC admits relocations in the +-4GB range, and as such we can't work with arbitrary object locations in memory. Of note: we map the rts into process space, so any mapped objects must not be ouside of the 4GB from the processes address space.
* Minor refactoring of Unit displaySylvain Henry2020-07-227-56/+63
| | | | | | | | * for consistency, try to always use UnitPprInfo to display units to users * remove some uses of `unitPackageIdString` as it doesn't show the component name and it uses String
* Add regression test for #18478Sebastian Graf2020-07-222-0/+953
| | | | | | !3392 backported !2993 to GHC 8.10.2 which most probably is responsible for fixing #18478, which triggered a pattern match checker performance regression in GHC 8.10.1 as first observed in #17977.
* Define type Void# = (# #) (#18441)Krzysztof Gogolewski2020-07-2226-116/+119
| | | | | There's one backwards compatibility issue: GHC.Prim no longer exports Void#, we now manually re-export it from GHC.Exts.
* Add test for #18064Sylvain Henry2020-07-228-0/+29
| | | | It has been fixed by 0effc57d48ace6b719a9f4cbeac67c95ad55010b
* Deprecate -fdmd-tx-dict-sel.Andreas Klebinger2020-07-224-7/+9
| | | | | | | | | | | It's behaviour is now unconditionally enabled as it's slightly beneficial. There are almost no benchmarks which benefit from disabling it, so it's not worth the keep this configurable. This fixes #18429.
* Replace HscTarget with BackendSylvain Henry2020-07-2233-277/+333
| | | | | | | | | They both have the same role and Backend name is more explicit. Metric Decrease: T3064 Update Haddock submodule
* Replace ghcWithNativeCodeGen with a proper Backend datatypeSylvain Henry2020-07-2212-46/+71
| | | | | | | | | | | | | | | | * Represent backends with a `Backend` datatype in GHC.Driver.Backend * Don't detect the default backend to use for the target platform at compile time in Hadrian/make but at runtime. It makes "Settings" simpler and it is a step toward making GHC multi-target. * The latter change also fixes hadrian which has not been updated to take into account that the NCG now supports AIX and PPC64 (cf df26b95559fd467abc0a3a4151127c95cb5011b9 and d3c1dda60d0ec07fc7f593bfd83ec9457dfa7984) * Also we don't treat iOS specifically anymore (cf cb4878ffd18a3c70f98bdbb413cd3c4d1f054e1f)
* Correctly test active backendSylvain Henry2020-07-221-1/+1
| | | | | | Previously we used a platform settings to detect if the native code generator was used. This was wrong. We need to use the `DynFlags.hscTarget` field instead.
* Remove unused sGhcWithNativeCodeGenSylvain Henry2020-07-222-4/+0
|
* Don't panic if the NCG isn't built (it is always built)Sylvain Henry2020-07-221-4/+0
|
* Remove unused "ncg" flagSylvain Henry2020-07-222-7/+1
| | | | | This flag has been removed in 066b369de2c6f7da03c88206288dca29ab061b31 in 2011.
* Enable BangPatterns, ScopedTypeVariables for ghc and hadrian by default.Andreas Klebinger2020-07-223-3/+5
| | | | This is only for their respective codebases.
* get-win32-tarballs: Fix detection of missing tarballsBen Gamari2020-07-221-1/+3
| | | | | This fixes the error message given by configure when the user attempts to configure without first download the win32 tarballs.
* FastString: Reintroduce character count cacheDaniel Gröber2020-07-221-12/+14
| | | | | | | | Metric Increase: ManyConstructors Metric Decrease: T4029
* Encoding: Reformat utf8EncodeShortByteString to be more consistentDaniel Gröber2020-07-221-5/+5
|
* Encoding: Remove redundant use of withForeignPtrDaniel Gröber2020-07-221-2/+3
|
* Use IO constructor instead of `stToIO . ST`Daniel Gröber2020-07-222-7/+5
|
* Encoding: Add comment about tricky ForeignPtr lifetimeDaniel Gröber2020-07-221-0/+4
|
* Pass specialised utf8DecodeChar# to utf8DecodeLazy# for performanceDaniel Gröber2020-07-222-14/+12
| | | | | | | Currently we're passing a indexWord8OffAddr# type function to utf8DecodeLazy# which then passes it on to utf8DecodeChar#. By passing one of utf8DecodeCharAddr# or utf8DecodeCharByteArray# instead we benefit from the inlining and specialization already done for those.
* Use ShortByteString for FastStringDaniel Gröber2020-07-225-188/+193
| | | | | | | | | | | | | | | There are multiple reasons we want this: - Fewer allocations: ByteString has 3 fields, ShortByteString just has one. - ByteString memory is pinned: - This can cause fragmentation issues (see for example #13110) but also - makes using FastStrings in compact regions impossible. Metric Decrease: T5837 T12150 T12234 T12425
* Remove length field from FastStringDaniel Gröber2020-07-221-24/+24
|
* Replace broken links to old haskell-prime site by working links to gitlab ↵BinderDavid2020-07-222-2/+2
| | | | | | instance. [skip ci]
* Fix dead link to haskell prime discussionghc-9.1-startDavid Binder2020-07-221-1/+1
|
* Accumulate Haddock comments in P (#17544, #17561, #8944)Vladislav Zavialov2020-07-2141-626/+3655
| | | | | | | | | | | | | | | | | | Haddock comments are, first and foremost, comments. It's very annoying to incorporate them into the grammar. We can take advantage of an important property: adding a Haddock comment does not change the parse tree in any way other than wrapping some nodes in HsDocTy and the like (and if it does, that's a bug). This patch implements the following: * Accumulate Haddock comments with their locations in the P monad. This is handled in the lexer. * After parsing, do a pass over the AST to associate Haddock comments with AST nodes using location info. * Report the leftover comments to the user as a warning (-Winvalid-haddock).
* users-guide: Fix :rts-flag:`--copying-gc` documentationBen Gamari2020-07-211-0/+1
| | | | It was missing a newline.
* Use a newtype `Code` for the return type of typed quotations (Proposal #195)Matthew Pickering2020-07-2133-154/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are three problems with the current API: 1. It is hard to properly write instances for ``Quote m => m (TExp a)`` as the type is the composition of two type constructors. Doing so in your program involves making your own newtype and doing a lot of wrapping/unwrapping. For example, if I want to create a language which I can either run immediately or generate code from I could write the following with the new API. :: class Lang r where _int :: Int -> r Int _if :: r Bool -> r a -> r a -> r a instance Lang Identity where _int = Identity _if (Identity b) (Identity t) (Identity f) = Identity (if b then t else f) instance Quote m => Lang (Code m) where _int = liftTyped _if cb ct cf = [|| if $$cb then $$ct else $$cf ||] 2. When doing code generation it is common to want to store code fragments in a map. When doing typed code generation, these code fragments contain a type index so it is desirable to store them in one of the parameterised map data types such as ``DMap`` from ``dependent-map`` or ``MapF`` from ``parameterized-utils``. :: compiler :: Env -> AST a -> Code Q a data AST a where ... data Ident a = ... type Env = MapF Ident (Code Q) newtype Code m a = Code (m (TExp a)) In this example, the ``MapF`` maps an ``Ident String`` directly to a ``Code Q String``. Using one of these map types currently requires creating your own newtype and constantly wrapping every quotation and unwrapping it when using a splice. Achievable, but it creates even more syntactic noise than normal metaprogramming. 3. ``m (TExp a)`` is ugly to read and write, understanding ``Code m a`` is easier. This is a weak reason but one everyone can surely agree with. Updates text submodule.
* Add release notes entry for #17816Krzysztof Gogolewski2020-07-211-0/+11
| | | | [skip ci]
* Fix a typo in existential_quantification.rstMark2020-07-211-1/+1
|
* DynFlags: remove use of sdocWithDynFlags from GHC.Stg.* (#17957)Sylvain Henry2020-07-218-172/+200
| | | | | | | | | * add StgPprOpts datatype * remove Outputable instances for types that need `StgPprOpts` to be pretty-printed and explicitly call type specific ppr functions * add default `panicStgPprOpts` for panic messages (when it's not convenient to thread StgPprOpts or DynFlags down to the ppr function call)
* Revert "[linker/rtsSymbols] More linker symbols"wip/angerman/revert-symbolswip/T18272Moritz Angermann2020-07-201-206/+17
| | | | | | This reverts commit 686e72253aed3880268dd6858eadd8c320f09e97. Signed-off-by: Moritz Angermann <moritz.angermann@gmail.com>
* Revert "better if guards."Moritz Angermann2020-07-201-1/+1
| | | | | | This reverts commit 3f60b94de1f460ca3f689152860b108a19ce193e. Signed-off-by: Moritz Angermann <moritz.angermann@gmail.com>
* Revert "Fix (1)"Moritz Angermann2020-07-201-1/+1
| | | | | | This reverts commit 7abffced01f5680efafe44f6be2733eab321b039. Signed-off-by: Moritz Angermann <moritz.angermann@gmail.com>
* Revert "AArch32 symbols only on aarch32."Moritz Angermann2020-07-201-6/+5
| | | | | | This reverts commit cdfeb3f24f76e8fd30452016676e56fbc827789a. Signed-off-by: Moritz Angermann <moritz.angermann@gmail.com>
* testsuite: Mark ghci tests as fragile under unreg compilerBen Gamari2020-07-181-2/+2
| | | | | In particular I have seen T16012 fail repeatedly under the unregisterised compiler.
* GHCi: Fix isLittleEndianStefan Schulze Frielinghaus2020-07-181-2/+2
|
* Fix minor typos in a Core.hs noteChaitanya Koparkar2020-07-182-9/+7
|
* Refactor the simplification of join bindersSimon Peyton Jones2020-07-184-120/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | This MR (for #18449) refactors the Simplifier's treatment of join-point binders. Specifically, it puts together, into GHC.Core.Opt.Simplify.Env.adjustJoinPointType two currently-separate ways in which we adjust the type of a join point. As the comment says: -- (adjustJoinPointType mult new_res_ty join_id) does two things: -- -- 1. Set the return type of the join_id to new_res_ty -- See Note [Return type for join points] -- -- 2. Adjust the multiplicity of arrows in join_id's type, as -- directed by 'mult'. See Note [Scaling join point arguments] I think this actually fixes a latent bug, by ensuring that the seIdSubst and seInScope have the right multiplicity on the type of join points. I did some tidying up while I was at it. No more setJoinResTy, or modifyJoinResTy: instead it's done locally in Simplify.Env.adjustJoinPointType