summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* TmOracle: Replace negative term equalities by refutable PmAltConswip/pmcheck-refutsSebastian Graf2019-06-0515-550/+672
| | | | | | | | | | | | | | | | | | | | | | | | | The `PmExprEq` business was a huge hack and was at the same time vastly too powerful and not powerful enough to encode negative term equalities, i.e. facts of the form "forall y. x ≁ Just y". This patch introduces the concept of 'refutable shapes': What matters for the pattern match checker is being able to encode knowledge of the kind "x can no longer be the literal 5". We encode this knowledge in a `PmRefutEnv`, mapping a set of newly introduced `PmAltCon`s (which are just `PmLit`s at the moment) to each variable denoting above inequalities. So, say we have `x ≁ 42 ∈ refuts` in the term oracle context and try to solve an equality like `x ~ 42`. The entry in the refutable environment will immediately lead to a contradiction. This machinery renders the whole `PmExprEq` and `ComplexEq` business unnecessary, getting rid of a lot of (mostly dead) code. See the Note [Refutable shapes] in TmOracle for a place to start. Metric Decrease: T11195
* gitlab-ci: Use GHC 8.6.5 for Windows CI buildsBen Gamari2019-06-021-3/+3
|
* Add `-haddock` to prepare-system.sh and .gitlab-ci.ymlTakenobu Tani2019-06-023-1/+3
| | | | | | To cover ci conditions from ghc8.6 to 8.9, I add `-haddock` option to `.circleci/prepare-system.sh` and .gitlab-ci.yml. after including `mk/flavours/*`.
* Add `-haddock` to perf.mk rather than prepare-system.shTakenobu Tani2019-06-022-2/+1
| | | | | | | | | | To cover ci conditions from ghc8.6 to 8.9, I add `-haddock` option to `mk/flavours/perf.mk` rather than `.circleci/prepare-system.sh`. Because in windows condition of ghc-8.9, `mk/flavours/*` is included after `prepare-system.sh`. In addition, in linux condition of ghc-8.6, `mk/flavors/perf.mk` is used.
* Add `-haddock` option under ci condition to fix #16415Takenobu Tani2019-06-021-0/+1
| | | | | | | | | | | | | | In order to use the `:doc` command in ghci, it is necessary to compile for core libraries with `-haddock` option. Especially, the `-haddock` option is essential for release building. Note: * The `-haddock` option may affect compile time and binary size. * But hadrian has already set `-haddock` as the default. * This patch affects the make-based building. This patch has been split from !532.
* rts: Remove unused decls from CNF.hÖmer Sinan Ağacan2019-06-011-3/+0
|
* Fix rewriting invalid shifts to errorsÖmer Sinan Ağacan2019-06-016-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #16449. 5341edf3 removed a code in rewrite rules for bit shifts, which broke the "silly shift guard", causing generating invalid bit shifts or heap overflow in compile time while trying to evaluate those invalid bit shifts. The "guard" is explained in Note [Guarding against silly shifts] in PrelRules.hs. More specifically, this was the breaking change: --- a/compiler/prelude/PrelRules.hs +++ b/compiler/prelude/PrelRules.hs @@ -474,12 +474,11 @@ shiftRule shift_op ; case e1 of _ | shift_len == 0 -> return e1 - | shift_len < 0 || wordSizeInBits dflags < shift_len - -> return (mkRuntimeErrorApp rUNTIME_ERROR_ID wordPrimTy - ("Bad shift length" ++ show shift_len)) This patch reverts this change. Two new tests added: - T16449_1: The original reproducer in #16449. This was previously casing a heap overflow in compile time when CmmOpt tries to evaluate the large (invalid) bit shift in compile time, using `Integer` as the result type. Now it builds as expected. We now generate an error for the shift as expected. - T16449_2: Tests code generator for large (invalid) bit shifts.
* Fix space leaks in dynLoadObjs (#16708)Ryan Scott2019-05-311-7/+7
| | | | | | | | | | | When running the test suite on a GHC built with the `quick` build flavour, `-fghci-leak-check` noticed some space leaks. Careful investigation led to `Linker.dynLoadObjs` being the culprit. Pattern-matching on `PeristentLinkerState` and a dash of `$!` were sufficient to fix the issue. (ht to mpickering for his suggestions, which were crucial to discovering a fix) Fixes #16708.
* Reject nested foralls in foreign imports (#16702)Ryan Scott2019-05-315-9/+85
| | | | | | | | This replaces a panic observed in #16702 with a simple error message stating that nested `forall`s simply aren't allowed in the type signature of a `foreign import` (at least, not at present). Fixes #16702.
* Improve ThreadId Show instanceNathan Collins2019-05-311-2/+2
| | | | By making it include parens when a derived instance would. For example, this changes the (hypothetical) code `show (Just (ThreadId 3))` to produce `"Just (ThreadId 3)"` instead of the current `"Just ThreadId 3"`.
* Fix and enforce validation of header for .hie filesZubin Duggal2019-05-316-28/+134
| | | | | | | | | | Implements #16686 The files version is automatically generated from the current GHC version in the same manner as normal interface files. This means that clients can first read the version and then decide how to read the rest of the file.
* Implement (Functor.<$) for Data.Functor.{Compose,Product,Sum}Simon Jakobi2019-05-313-0/+5
| | | | | This allows us to make use of the (<$) implementations of the underlying functors.
* Implement (Functor.<$) for ArraySimon Jakobi2019-05-311-0/+9
|
* Put COMPLETE sigs into ModDetails with -fno-code (#16682)Ryan Scott2019-05-314-14/+30
| | | | | | | | | `mkBootModDetailsTc`, which creates a special `ModDetails` when `-fno-code` is enabled, was not properly filling in the `COMPLETE` signatures from the `TcGblEnv`, resulting in incorrect pattern-match coverage warnings. Easily fixed. Fixes #16682.
* Fix arity type of coerced types in CoreArityÖmer Sinan Ağacan2019-05-314-2/+57
| | | | | | | | | | | | | | | | | | | | | Previously if we had f |> co where `f` had arity type `ABot N` and `co` had arity M and M < N, `arityType` would return `ABot M` which is wrong, because `f` is only known to diverge when applied to `N` args, as described in Note [ArityType]: If at = ABot n, then (f x1..xn) definitely diverges. Partial applications to fewer than n args may *or may not* diverge. This caused incorrect eta expansion in the simplifier, causing #16066. We now return `ATop M` for the same expression so the simplifier can't assume partial applications of `f |> co` is divergent. A regression test T16066 is also added.
* Remove unused RTS function 'unmark'Ömer Sinan Ağacan2019-05-311-10/+0
|
* Expose doCppNeil Mitchell2019-05-311-0/+1
|
* support small arrays and CONSTR_NOCAF in ghc-heapDavid Hewson2019-05-313-0/+27
|
* Use types already in AST when making .hie fileMatthew Pickering2019-05-312-1/+3
| | | | | | | These were meant to be added in !214 but for some reason wasn't included in the patch. Update Haddock submodule for new Types.hs hyperlinker output
* powerpc32: fix stack allocation code generationSergei Trofimovich2019-05-311-1/+1
| | | | | | | | | | | | | | | | When ghc was built for powerpc32 built failed as: It's a fallout of commit 3f46cffcc2850e68405a1 ("PPC NCG: Refactor stack allocation code") where word size used to be II32/II64 and changed to II8/panic "no width for given number of bytes" widthFromBytes ((platformWordSize platform) `quot` 8) The change restores initial behaviour by removing extra division. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* powerpc32: fix 64-bit comparison (#16465)Sergei Trofimovich2019-05-311-0/+1
| | | | | | | | | | | | | | | | | | On powerpc32 64-bit comparison code generated dangling target labels. This caused ghc build failure as: $ ./configure --target=powerpc-unknown-linux-gnu && make ... SCCs aren't in reverse dependent order bad blockId n3U This happened because condIntCode' in PPC codegen generated label name but did not place the label into `cmp_lo` code block. The change adds the `cmp_lo` label into the case of negative comparison. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Update `$(TOP)/*.md` documentsTakenobu Tani2019-05-314-35/+36
| | | | | | | | | | | | | | | | | | | | | | | | | I updated the top documents to the latest status: - HACKING.md: - Modify Phabricator to GitLab infomation - Remove old Trac information - Add link to GitLab activity - MAKEHELP.md: - Add link to hadrian wiki - Fix markdown format - INSTALL.md: - Modify boot command to remove python3 - Fix markdown format - README.md: - Modify tarball file suffix - Fix markdown format I checked the page display on the GitHub and GitLab web. [skip ci]
* Eventlog: Document the fact timestamps are nanosecondsMatthew Pickering2019-05-311-0/+4
| | | | [skip ci]
* testsuite: Compile T9630 with +RTS -G1Ben Gamari2019-05-301-1/+4
| | | | | For the reasons described in Note [residency] we run programs with -G1 when we care about the max_bytes_used metric.
* Improve targetContents code docsDaniel Gröber2019-05-303-6/+9
|
* Add depanalPartial to make getting a partial modgraph easierDaniel Gröber2019-05-301-10/+32
| | | | | | As per @mpickering's suggestion on IRC this is to make the partial module-graph more easily accessible for API clients which don't intend to re-implementing depanal.
* PartialDownsweep: Add test for import errorsDaniel Gröber2019-05-302-0/+14
|
* Catch preprocessor errors in downsweepDaniel Gröber2019-05-307-28/+95
| | | | | | | | | | | | | | | | This changes the way preprocessor failures are presented to the user. Previously the user would simply get an unlocated message on stderr such as: `gcc' failed in phase `C pre-processor'. (Exit code: 1) Now at the problematic source file is mentioned: A.hs:1:1: error: `gcc' failed in phase `C pre-processor'. (Exit code: 1) This also makes live easier for GHC API clients as the preprocessor error is now thrown as a SourceError exception.
* Make downsweep return all errors per-module instead of throwing someDaniel Gröber2019-05-305-29/+28
| | | | | | | | This enables API clients to handle such errors instead of immideately crashing in the face of some kinds of user errors, which is arguably quite bad UX. Fixes #10887
* Refactor summarise{File,Module} to extract checkSummaryTimestampDaniel Gröber2019-05-304-47/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a slight change of behaviour in the interrest of keeping the code simple: Previously summariseModule would not call addHomeModuleToFinder for summaries that are being re-used but now we do. We're forced to to do this in summariseFile because the file being summarised might not even be on the regular search path! So if GHC is to find it at all we have to pre-populate the cache with its location. For modules however the finder cache is really just a cache so we don't have to pre-populate it with the module's location. As straightforward as that seems I did almost manage to introduce a bug (or so I thought) because the call to addHomeModuleToFinder I copied from summariseFile used to use `ms_location old_summary` instead of the `location` argument to checkSummaryTimestamp. If this call were to overwrite the existing entry in the cache that would have resulted in us using the old location of any module even if it was, say, moved to a different directory between calls to 'depanal'. However it turns out the cache just ignores the location if the module is already in the cache. Since summariseModule has to search for the module, which has the side effect of populating the cache, everything would have been fine either way. Well I'm adding a test for this anyways: tests/depanal/OldModLocation.hs.
* Refactor summarise{File,Module} to reduce code duplicationDaniel Gröber2019-05-301-84/+123
|
* Refactor downsweep to allow returning multiple errors per moduleDaniel Gröber2019-05-302-29/+27
|
* Add failing test for #10887Daniel Gröber2019-05-303-0/+143
|
* Export GhcMake.downsweepDaniel Gröber2019-05-301-0/+2
| | | | | This is to enable #10887 as well as to make it possible to test downsweep on its own in the testsuite.
* Apply suggestion to rts/CheckUnload.cTrịnh Tuấn Phương2019-05-301-1/+2
|
* Apply suggestion to rts/CheckUnload.cTrịnh Tuấn Phương2019-05-301-1/+1
|
* Use binary search to speedup checkUnloadPhuong Trinh2019-05-309-32/+369
| | | | | | | | | We are iterating through all object code for each heap objects when checking whether object code can be unloaded. For large projects in GHCi, this can be very expensive due to the large number of object code that needs to be loaded/unloaded. To speed it up, this arrangess all mapped sections of unloaded object code in a sorted array and use binary search to check if an address location fall on them.
* rts: Handle zero-sized mappings in MachO linkerBen Gamari2019-05-301-2/+6
| | | | | | | As noted in #16701, it is possible that we will find that an object has no segments needing to be mapped. Previously this would result in mmap being called for a zero-length mapping, which would fail. We now simply skip the mmap call in this case; the rest of the logic just works.
* CODEOWNERS: Use correct username for Richard EisenbergBen Gamari2019-05-301-6/+6
| | | | | | | In !980 Richard noted that he could not approve the MR. This mis-spelling was the reason. [skip ci]
* Hadrian: always generate the libffi dynlibs manifest with globbingAlp Mestanogullari2019-05-302-14/+10
| | | | | | | | | | | | | | | Instead of trying to deduce which dynlibs are expected to be found (and then copied to the RTS's build dir) in libffi's build directory, with some OS specific logic, we now always just use `getDirectoryFilesIO` to look for those dynlibs and record their names in the manifest. The previous logic ended up causing problems on Windows, where we don't build dynlibs at all for now but the manifest file's logic didn't take that into account because it was only partially reproducing the criterions that determine whether or not we will be building shared libraries. This patch also re-enables the Hadrian/Windows CI job, which was failing to build GHC precisely because of libffi shared libraries and the aforementionned duplicated logic.
* Hadrian: Add note about Libffi's Indicating Inputs #16653David Eichmann2019-05-291-7/+30
| | | | [skip ci]
* Inline `Settings` into `DynFlags`John Ericson2019-05-2913-122/+146
| | | | | | | | | | After the previous commit, `Settings` is just a thin wrapper around other groups of settings. While `Settings` is used by GHC-the-executable to initalize `DynFlags`, in principle another consumer of GHC-the-library could initialize `DynFlags` a different way. It therefore doesn't make sense for `DynFlags` itself (library code) to separate the settings that typically come from `Settings` from the settings that typically don't.
* Break up `Settings` into smaller structsJohn Ericson2019-05-299-190/+541
| | | | | | | | | | | | | | | | | As far as I can tell, the fields within `Settings` aren't *intrinsicly* related. They just happen to be initialized the same way (in particular prior to the rest of `DynFlags`), and that is why they are grouped together. Within `Settings`, however, there are groups of settings that clearly do share something in common, regardless of how they anything is initialized. In the spirit of GHC being a library, where the end cosumer may choose to initialize this configuration in arbitrary ways, I made some new data types for thoses groups internal to `Settings`, and used them to define `Settings` instead. Hopefully this is a baby step towards a general decoupling of the stateful and stateless parts of GHC.
* Provide details in `plusSimplCount` errorsJosh Meredith2019-05-291-1/+8
|
* tcMatchesFun s/rho/sigma #16692Vladislav Zavialov2019-05-292-3/+3
|
* CNF.c: Move debug functions behind ifdefÖmer Sinan Ağacan2019-05-291-1/+1
|
* downsweep: Allow TargetFile not to exist when a buffer is givenDaniel Gröber2019-05-294-18/+14
| | | | | | | | | | Currently 'getRootSummary' will fail with an exception if a 'TargetFile' is given but it does not exist even if an input buffer is passed along for this target. In this case it is not necessary for the file to exist since the buffer will be used as input for the compilation pipeline instead of the file anyways.
* Allow using tagetContents for modules needing preprocessingDaniel Gröber2019-05-296-38/+242
| | | | | | | | | | | | | | | | | | This allows GHC API clients, most notably tooling such as Haskell-IDE-Engine, to pass unsaved files to GHC more easily. Currently when targetContents is used but the module requires preprocessing 'preprocessFile' simply throws an error because the pipeline does not support passing a buffer. This change extends `runPipeline` to allow passing the input buffer into the pipeline. Before proceeding with the actual pipeline loop the input buffer is immediately written out to a new tempfile. I briefly considered refactoring the pipeline at large to pass around in-memory buffers instead of files, but this seems needlessly complicated since no pipeline stages other than Hsc could really support this at the moment.
* Add hPutStringBuffer utilityDaniel Gröber2019-05-291-0/+6
|
* Don't lose parentheses in show SomeAsyncExceptionNathan Collins2019-05-291-1/+1
|