summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* base: Export Finalizerswip/T16750Ben Gamari2019-06-041-0/+1
| | | | As requested in #16750.
* Hadrian: profiling and debug enabled ways support -eventlog tooAlp Mestanogullari2019-06-041-1/+3
|
* make: Fix bindist installationBen Gamari2019-06-042-6/+5
| | | | | This fixes a few vestigial references to `settings` left over from !655. Fixes #16715.
* gitlab-ci: Run bindisttest during CIBen Gamari2019-06-041-0/+3
|
* Add GHCi :instances commandXavier Denis2019-06-0412-6/+314
| | | | | | | | | | | This commit adds the `:instances` command to ghci following proosal number 41. This makes it possible to query which instances are available to a given type. The output of this command is all the possible instances with type variables and constraints instantiated.
* Hadrian: fix OSX build failure and add an OSX/Hadrian CI jobAlp Mestanogullari2019-06-042-1/+41
| | | | | | | The OSX build failure introduced in 3aa71a22 was due to a change in the glob we use to collect libffi shared libraries in hadrian/src/Rules/Libffi.hs. This commit fixes the problem and adds an OSX CI job that builds GHC with Hadrian, to make sure we don't break it again.
* Use a better strategy for determining the offset applied to foreign function ↵Andrew Martin2019-06-0423-45/+443
| | | | arguments that have an unlifted boxed type. We used to use the type of the argument. We now use the type of the foreign function. Add a test to confirm that the roundtrip conversion between an unlifted boxed type and Any is sound in the presence of a foreign function call.
* TestRunner: Added --chart to display a chart of performance testsDavid Eichmann2019-06-045-124/+354
| | | | | | | | | | | | | This uses the Chart.js javascript library. Everything is put into a standalone .html file and opened with the default browser. I also simplified the text output to use the same data as the chart. You can now use a commit range with git's ".." syntax. The --ci option will use results from CI (you'll need to fetch them first): $ git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/ci/perf $ python3 testsuite/driver/perf_notes.py --ci --chart --test-env x86_64-darwin --test-name T9630 master~500..master
* 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.