summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Modify InlineSpec data constructor (helps fix #18138)wip/fix-18138Alina Banerjee2021-08-1018-87/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The inl_inline field of the InlinePragma record is modified to store pragma source text by adding a data constructor of type SourceText. This can help in tracking the actual text of pragma names. Add/modify functions, modify type instance for InlineSpec type Modify parser, lexer to handle InlineSpec constructors containing SourceText Modify functions with InlineSpec type Extract pragma source from InlineSpec for SpecSig, InlineSig types Modify cvtInline function to add SourceText to InlineSpec type Extract name for InlineSig, SpecSig from pragma, SpectInstSig from source (fixes #18138) Extract pragma name for SpecPrag pragma, SpecSig signature Add Haddock annotation for inlinePragmaName function Add Haddock annotations for using helper functions in hsSigDoc Remove redundant ppr in pragma name for SpecSig, InlineSig; update comment Rename test to T18138 for misplaced SPECIALIZE pragma testcase
* Minor fix to pretty-printing of linear typesKrzysztof Gogolewski2021-08-057-12/+31
| | | | | | The function ppr_arrow_chain was not printing multiplicities. Also remove the Outputable instance: no longer used, and could cover bugs like those.
* Add Data.ByteArray, derived from primitiveBodigrim2021-08-053-0/+245
|
* Use Reductions to keep track of rewritingssheaf2021-08-0421-919/+1410
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We define Reduction = Reduction Coercion !Type. A reduction of the form 'Reduction co new_ty' witnesses an equality ty ~co~> new_ty. That is, the rewriting happens left-to-right: the right-hand-side type of the coercion is the rewritten type, and the left-hand-side type the original type. Sticking to this convention makes the codebase more consistent, helping to avoid certain applications of SymCo. This replaces the parts of the codebase which represented reductions as pairs, (Coercion,Type) or (Type,Coercion). Reduction being strict in the Type argument improves performance in some programs that rewrite many type families (such as T9872). Fixes #20161 ------------------------- Metric Decrease: T5321Fun T9872a T9872b T9872c T9872d -------------------------
* Fix GHCi completion (#20101)Zubin Duggal2021-08-047-17/+38
| | | | Updates haskeline submodule
* hadrian: Create relative rather than absolute symlinks in binary dist folderMatthew Pickering2021-08-041-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The symlink structure now looks like: ``` lrwxrwxrwx 1 matt users 16 Aug 3 16:27 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/ghc -> ghc-9.3.20210721 -rwxr-xr-x 1 matt users 1750336 Aug 3 15:00 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/ghc-9.3.20210721 lrwxrwxrwx 1 matt users 22 Aug 3 16:27 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/ghc-iserv -> ghc-iserv-9.3.20210721 -rwxr-xr-x 1 matt users 31703176 Aug 3 15:00 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/ghc-iserv-9.3.20210721 lrwxrwxrwx 1 matt users 26 Aug 3 16:27 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/ghc-iserv-dyn -> ghc-iserv-dyn-9.3.20210721 -rwxr-xr-x 1 matt users 40808 Aug 3 15:00 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/ghc-iserv-dyn-9.3.20210721 lrwxrwxrwx 1 matt users 20 Aug 3 16:27 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/ghc-pkg -> ghc-pkg-9.3.20210721 -rwxr-xr-x 1 matt users 634872 Aug 3 15:00 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/ghc-pkg-9.3.20210721 lrwxrwxrwx 1 matt users 14 Aug 3 16:27 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/haddock -> haddock-2.24.0 -rwxr-xr-x 1 matt users 4336664 Aug 3 15:00 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/haddock-2.24.0 lrwxrwxrwx 1 matt users 9 Aug 3 16:27 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/hp2ps -> hp2ps-0.1 -rwxr-xr-x 1 matt users 49312 Aug 3 15:00 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/hp2ps-0.1 lrwxrwxrwx 1 matt users 8 Aug 3 16:27 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/hpc -> hpc-0.68 -rwxr-xr-x 1 matt users 687896 Aug 3 15:00 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/hpc-0.68 lrwxrwxrwx 1 matt users 13 Aug 3 16:27 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/hsc2hs -> hsc2hs-0.68.8 -rwxr-xr-x 1 matt users 729904 Aug 3 15:00 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/hsc2hs-0.68.8 lrwxrwxrwx 1 matt users 19 Aug 3 16:27 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/runghc -> runghc-9.3.20210721 -rwxr-xr-x 1 matt users 57672 Aug 3 15:00 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/runghc-9.3.20210721 lrwxrwxrwx 1 matt users 9 Aug 3 16:27 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/unlit -> unlit-0.1 -rwxr-xr-x 1 matt users 14896 Aug 3 15:00 _build/bindist/ghc-9.3.20210721-x86_64-unknown-linux/bin/unlit-0.1 ``` Fixes #20198
* Make HsWrapper a MonoidJohn Ericson2021-08-041-0/+21
| | | | See instance documentation for caviat.
* Linear types: fix linting of multiplicities (#19165)Krzysztof Gogolewski2021-08-042-15/+21
| | | | The previous version did not substitute the type used in the scrutinee.
* Disable -fdefer-type-errors for linear types (#20083)Krzysztof Gogolewski2021-08-048-5/+67
|
* Don't store tmpDir in SettingsSylvain Henry2021-08-033-18/+9
| | | | There was no point in doing this as indicated by the TODO.
* Fix ASSERTS_ENABLED CPPSylvain Henry2021-08-033-3/+3
|
* move bytecode preparation into the STG pipelineLuite Stegeman2021-08-035-199/+245
| | | | | this makes it possible to combine passes to compute free variables more efficiently in a future change
* Correctly unload libs on GHCi with external iservTito Sacchi2021-08-032-3/+2
| | | | | | | | | Fix #17669 `hostIsDynamic` is basically a compile-time constant embedded in the RTS. Therefore, GHCi didn't unload object files properly when used with an external interpreter built in a different way.
* Handle OverloadedRecordDot in TH (#20185)Zubin Duggal2021-08-0312-5/+95
|
* Improve documentation for HscTypes.usg_mod_hashAndreas Klebinger2021-08-031-2/+5
|
* Add "fast-ci" label, for skipping most builds (#19280)Krzysztof Gogolewski2021-08-031-0/+20
| | | | | | | If "fast-ci" is present, only the following parts of full-build are run: - validate-x86_64-linux-deb9-debug - validate-x86_64-windows-hadrian - validate-x86_64-linux-deb9-unreg-hadrian
* Remove eager forcing of RuleInfo in substRuleInfoMatthew Pickering2021-08-035-9/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | substRuleInfo updates the IdInfo for an Id, therefore it is important to not force said IdInfo whilst updating it, otherwise we end up in an infinite loop. This is what happened in #20112 where `mkTick` forced the IdInfo being updated by checking the arity in isSaturatedConApp. The fix is to stop the expression being forced so early by removing the call to seqRuleInfo. The call sequence looked something like: * `substRecBndrs` * `substIdBndr` * `substIdInfo` * `substRuleInfo` * `substRule` * `substExpr` * `mkTick` * `isSaturatedConApp` * Look at `IdInfo` for thing we are currently substituting because the rule is attached to `transpose` and mentions it in the `RHS` of the rule. Which arose because the `transpose` Id had a rule attached where the RHS of the rule also mentioned `transpose`. This call to seqRuleInfo was introduced in 4e7d56fde0f44d38bbb9a6fc72cf9c603264899d where it was explained > I think there are now *too many* seqs, and they waste work, but I don't have > time to find which ones. We also observe that there is the ominous note on `substRule` about making sure substExpr is called lazily. > {- Note [Substitute lazily] > ~~~~~~~~~~~~~~~~~~~~~~~~~~~ > The functions that substitute over IdInfo must be pretty lazy, because > they are knot-tied by substRecBndrs. > > One case in point was #10627 in which a rule for a function 'f' > referred to 'f' (at a different type) on the RHS. But instead of just > substituting in the rhs of the rule, we were calling simpleOptExpr, which > looked at the idInfo for 'f'; result <<loop>>. > > In any case we don't need to optimise the RHS of rules, or unfoldings, > because the simplifier will do that. Before `seqRuleInfo` was removed, this note was pretty much ignored in the `substSpec` case because the expression was immediately forced after `substRule` was called. Unfortunately it's a bit tricky to add a test for this as the failure only manifested (for an unknown reason) with a dwarf enabled compiler *AND* compiling with -g3. Fortunatley there is currently a CI configuration which builds a dwarf compiler to test this. Also, for good measure, finish off the work started in 840df33685e8c746ade4b9d4d0eb7c764a773e48 which renamed SpecInfo to RuleInfo but then didn't rename 'substSpec' to 'substRuleInfo'. Fixes #20112
* Bump process submoduleBen Gamari2021-08-031-0/+0
|
* Properly escape arguments in ghc-cabalZubin Duggal2021-08-031-3/+17
|
* Remove hschooks.c and -no-hs-main for ghc-binZubin Duggal2021-08-035-105/+3
|
* include README in hadrian.cabal Jens Petersen2021-08-031-0/+1
| | | [skip ci]
* Catch type-checker exceptions when splicingSimon Peyton Jones2021-08-024-4/+28
| | | | | | | | In GHC.Tc.Gen.Splice.tcTopSpliceExpr we were forgetting to catch exceptions. As a result we missed the kind error in the unsolved constraints. This patch has an easy fix, which cures #20179
* Supply missing case for '.' inShayne Fletcher2021-08-024-3/+10
|
* Disallow nonlinear fields in Template Haskell (#18378)Krzysztof Gogolewski2021-08-0211-1/+54
|
* hadrian: Drop --configure supportBen Gamari2021-08-024-93/+3
| | | | | | | | | | | | | | | Hadrian's `--configure` support has long been a point of contention. While it's convenient, it also introduces a fair bit of implementation complexity and quite a few non-trivial failure modes (see #19804, 17883, and #15948). Moreover, the feature is actively misleading to the user: `./configure` is the primary means for the user to inform the build system about the system environment and in general will require input from the user. This commits removes the feature, replacing the flag with a stub message informing the user of the deprecation. Closes #20167.
* Remove Semigroup instance for UniqDFM (#19654)Krzysztof Gogolewski2021-08-022-11/+1
| | | | | | | The (<>) operator was not associative. Fortunately, the instance is not used anywhere, except to derive another unused instance for UniqDSet.
* validate: Look for python3 executable in python detectionBen Gamari2021-08-021-4/+6
| | | | | Previously we would only look for a `python` executable, but in general we should prefer `python3` and sometimes `python` doesn't exist.
* Lookup string literals in top-level thunks (fix #16373)Sylvain Henry2021-08-024-6/+35
|
* Constant-fold unpackAppendCString (fix #20174)Sylvain Henry2021-08-026-48/+143
| | | | | | | Minor renaming: since 1ed0409010afeaa318676e351b833aea659bf93a rules get an InScopeEnv arg (containing an IdUnfoldingFun) instead of an IdUnfoldingFun directly, hence I've renamed the parameter from "id_unf" to "env" for clarity.
* Only create callstack in DEBUG buildsSylvain Henry2021-08-021-16/+16
|
* rts/OSThreads: Fix reference clock of timedWaitConditionBen Gamari2021-08-023-13/+46
| | | | | | | | | | | | | | | Previously `timedWaitCondition` assumed that timeouts were referenced against `CLOCK_MONOTONIC`. This is wrong; by default `pthread_cond_timedwait` references against `CLOCK_REALTIME`, although this can be overridden using `pthread_condattr_setclock`. Fix this and add support for using `CLOCK_MONOTONIC` whenever possible as it is more robust against system time changes and is likely cheaper to query. Unfortunately, this is complicated by the fact that older versions of Darwin did not provide `clock_gettime`, which means we also need to introduce a fallback path using `gettimeofday`. Fixes #20144.
* docs: rename the "Running a compiled program" section in the users guideAdam Sandberg Ericsson2021-08-021-3/+3
| | | | | This hopefully makes it easier to find the right section when scanning the table of contents.
* testsuite: Add test for #20137Ben Gamari2021-08-025-0/+118
|
* [AArch64/Darwin] fix packed calling conv alignmentMoritz Angermann2021-08-021-6/+38
| | | | | | Apparently we need some padding as well. Fixes #20137
* Fix spellingSylvain Henry2021-08-021-1/+1
|
* Improve documentation of openTempFile argsJulian Ospald2021-08-021-1/+3
| | | | | | | | | | https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettempfilenamew Specifically: > The null-terminated prefix string. The function uses up to the first > three characters of this string as the prefix of the file name. This > string must consist of characters in the OEM-defined character set.
* Add Generically (generic Semigroup, Monoid instances) and Generically1 ↵Baldur Blöndal2021-08-028-13/+225
| | | | (generic Functor, Applicative, Alternative, Eq1, Ord1 instances) to GHC.Generics.
* PrimOps: Add CAS op for all int sizesPeter Trommler2021-08-0213-12/+473
| | | | | | | | | | | PPC NCG: Implement CAS inline for 32 and 64 bit testsuite: Add tests for smaller atomic CAS X86 NCG: Catch calls to CAS C fallback Primops: Add atomicCasWord[8|16|32|64]Addr# Add tests for atomicCasWord[8|16|32|64]Addr# Add changelog entry for new primops X86 NCG: Fix MO-Cmpxchg W64 on 32-bit arch ghc-prim: 64-bit CAS C fallback on all archs
* base: Document overflow behaviour of genericLengthSimon Jakobi2021-08-021-0/+9
|
* ghc: Introduce --run modeBen Gamari2021-08-026-3/+49
| | | | | | As described in #18011, this mode provides similar functionality to the `runhaskell` command, but doesn't require that the user know the path of yet another executable, simplifying interactions with upstream tools.
* Improve preprocessor error messageShayne Fletcher2021-07-291-1/+1
|
* Reject pattern synonyms with linear types (#18806)Krzysztof Gogolewski2021-07-298-5/+36
|
* Add test for #18567Matthew Pickering2021-07-298-0/+68
| | | | Closes #18567
* UNREG: implement 64-bit mach ops for 32-bit targetsSergei Trofimovich2021-07-292-30/+63
| | | | | | | | | | | | | | | Noticed build failures like ``` ghc-stage1: panic! (the 'impossible' happened) GHC version 9.3.20210721: pprCallishMachOp_for_C: MO_x64_Ne not supported! ``` on `--tagget=hppa2.0-unknown-linux-gnu`. The change does not fix all 32-bit unreg target problems, but at least allows linking final ghc binaries. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* compiler: Name generated locals more descriptivelyBen Gamari2021-07-294-17/+25
| | | | | | Previously `GHC.Types.Id.Make.newLocal` would name all locals `dt`, making it unnecessarily difficult to determine their origin. Noticed while looking at #19557.
* Add configure flag to enable ASSERTs in all waysDaniel Gröber2021-07-298-15/+42
| | | | | | | | Running the test suite with asserts enabled is somewhat tricky at the moment as running it with a GHC compiled the DEBUG way has some hundred failures from the start. These seem to be unrelated to assertions though. So this provides a toggle to make it easier to debug failing assertions using the test suite.
* rts: Allow building with ASSERTs on in non-DEBUG wayDaniel Gröber2021-07-293-8/+2
| | | | | | | | | | We have a couple of places where the conditions in asserts depend on code ifdefed out when DEBUG is off. I'd like to allow compiling assertions into non-DEBUG RTSen so that won't do. Currently if we remove the conditional around the definition of ASSERT() the build will not actually work due to a deadlock caused by initMutex not initializing mutexes with PTHREAD_MUTEX_ERRORCHECK because DEBUG is off.
* Delete ToDo about incorrect optimisation [skip ci]Peter Trommler2021-07-291-4/+0
| | | | | On big-endian systems a narrow after a load cannot be replaced with a narrow load.
* Port more DriverUnknownMessage into richer DriverMessage constructorsAlfredo Di Napoli2021-07-2813-74/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order: * Introduce the `PsErrUnknownOptionsPragma` diagnostic message This commit changes the diagnostic emitted inside `GHC.Parser.Header.checkProcessArgsResult` from an (erroneous) and unstructured `DriverUnknownMessage` to a `PsErrUnknownOPtionsPragma`, i.e. a new data constructor of a `PsHeaderMessage`. * Add the `DriverUserDefinedRuleIgnored` diagnostic message * Add `DriverUserDefinedRuleIgnored` data constructor This commit adds (and use) a new data constructor to the `DriverMessage` type, replacing a `DriverUnknownMessage` with it. * Add and use `DriverCannotLoadInterfaceFile` constructor This commit introduces the DriverCannotLoadInterfaceFile constructor for the `DriverMessage` type and it uses it to replace and occurrence of `DriverUnknownMessage`. * Add and use the `DriverInferredSafeImport` constructor This commit adds a new `DriverInferredSafeImport` constructor to the `DriverMessage` type, and uses it in `GHC.Driver.Main` to replace one occurrence of `DriverUnknownMessage`. * Add and use `DriverCannotImportUnsafeModule` constructor This commit adds the `DriverCannotImportUnsafeModule` constructor to the `DriverMessage` type, and later using it to replace one usage of `DriverUnknownMessage` in the `GHC.Driver.Main` module. * Add and use `DriverMissingSafeHaskellMode` constructor * Add and use `DriverPackageNotTrusted` constructor * Introduce and use `DriverInferredSafeModule` constructor * Add and use `DriverMarkedTrustworthyButInferredSafe` constructor * Add and use `DriverCannotImportFromUntrustedPackage`
* Update expected stderr for affected tests, which are not under Tc directoryCarrieMY2021-07-282-4/+4
|