summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Refactor wantToUnboxArg a bitwip/spj-refactor-wantToUnboxSimon Peyton Jones2022-07-184-174/+217
| | | | | | | | | | | | | | | | | | | * Rename GHC.Core.Opt.WorkWrap.Utils.wantToUnboxArg to canUnboxArg and similarly wantToUnboxResult to canUnboxResult. * Add GHC.Core.Opt.DmdAnal.wantToUnboxArg as a wrapper for the (new) GHC.Core.Opt.WorkWrap.Utils.canUnboxArg, avoiding some yukky duplication. I decided it was clearer to give it a new data type for its return type, because I nedeed the FD_RecBox case which was not otherwise readiliy expressible. * Add dcpc_args to WorkWrap.Utils.DataConPatContext for the payload * Get rid of the Unlift constructor of UnboxingDecision, eliminate two panics, and two arguments to canUnboxArg (new name). Much nicer now.
* Make SetLevels honour floatConstsSimon Peyton Jones2022-07-181-4/+4
| | | | | | | | This fix, in the definition of profitableFloat, is just for consistency. `floatConsts` should do what it says! I don't think it'll affect anything much, though.
* Inline mapAccumLMSimon Peyton Jones2022-07-181-0/+5
| | | | | | | | | This function is called in inner loops in the compiler, and it's overloaded and higher order. Best just to inline it. This popped up when I was looking at something else. I think perhaps GHC is delicately balanced on the cusp of inlining this automatically.
* Make transferPolyIdInfo work for CPRSimon Peyton Jones2022-07-182-5/+14
| | | | I don't know why this hasn't bitten us before, but it was plain wrong.
* White space only in FamInstEnvSimon Peyton Jones2022-07-181-30/+34
|
* Fix incorrect proof of applyWhen’s propertiesAnselm Schüler2022-07-171-1/+1
|
* hadrian: Rename documentation directories for consistency with makeBen Gamari2022-07-176-16/+11
| | | | | | | * Rename `docs` to `doc` * Place pdf documentation in `doc/` instead of `doc/pdfs/` Fixes #21164.
* testsuite: Fix T11829 on Centos 7Ben Gamari2022-07-161-1/+1
| | | | | | It appears that Centos 7 has a more strict C++ compiler than most distributions since std::runtime_error is defined in <stdexcept> rather than <exception>. In T11829 we mistakenly imported the latter.
* rts/linker: Ensure that __cxa_finalize is called on code unloadBen Gamari2022-07-162-0/+25
|
* rts/linker: Clean up section kindsBen Gamari2022-07-161-2/+5
|
* rts/linker: Fix resolution of __dso_handle on DarwinBen Gamari2022-07-161-1/+1
| | | | Darwin expects a leading underscore.
* testsuite: Mark T13366Cxx as unbroken on DarwinBen Gamari2022-07-161-3/+1
|
* rts/linker/Elf: Work around GCC 6 init/fini behaviorBen Gamari2022-07-161-3/+19
| | | | | | | It appears that GCC 6t (at least on i386) fails to give init_array/fini_array sections the correct SHT_INIT_ARRAY/SHT_FINI_ARRAY section types, instead marking them as SHT_PROGBITS. This caused T20494 to fail on Debian.
* testsuite: Use system-cxx-std-lib instead of config.stdcxx_implBen Gamari2022-07-168-26/+11
|
* rts/linker/MachO: Introduce finalizer supportBen Gamari2022-07-163-0/+32
|
* rts/linker/MachO: Use section flags to identify initializersBen Gamari2022-07-161-20/+11
|
* rts/linker/MachO: Drop dead codeBen Gamari2022-07-161-1/+0
|
* rts/linker/PEi386: Fix exception unwind unregistrationBen Gamari2022-07-163-10/+9
| | | | | | | RtlDeleteFunctionTable expects a pointer to the .pdata section yet we passed it the .xdata section. Happily, this fixes #21354.
* testsuite: Add test for #21618 and #21847Ben Gamari2022-07-165-0/+51
|
* rts/linker/PEi386: Respect dtor/ctor priorityBen Gamari2022-07-162-2/+45
| | | | | | | Previously we would run constructors and destructors in arbitrary order despite explicit priorities. Fixes #21847.
* rts/linker/PEi386: Ensure that all .ctors/.dtors sections are runBen Gamari2022-07-162-21/+63
| | | | | | | | It turns out that PE objects may have multiple `.ctors`/`.dtors` sections but the RTS linker had assumed that there was only one. Fix this. Fixes #21618.
* Statically-link against libc++ on WindowsBen Gamari2022-07-161-0/+7
| | | | | | | | | | | Unfortunately on Windows we have no RPATH-like facility, making dynamic linking extremely fragile. Since we cannot assume that the user will add their GHC installation to `$PATH` (and therefore their DLL search path) we cannot assume that the loader will be able to locate our `libc++.dll`. To avoid this, we instead statically link against `libc++.a` on Windows. Fixes #21435.
* Loader: Implement gnu-style -l:$path syntaxBen Gamari2022-07-161-11/+31
| | | | | | Gnu ld allows `-l` to be passed an absolute file path, signalled by a `:` prefix. Implement this in the GHC's loader search logic.
* rts/linker/PEi386: Add finalization supportBen Gamari2022-07-164-6/+51
| | | | | | This implements #20494 for the PEi386 linker. Happily, this also appears to fix `T9405`, resolving #21361.
* rts/linker/PEi386: Refactor handling of oc->infoBen Gamari2022-07-162-4/+10
| | | | | | | | | | | Previously we would free oc->info after running initializers. However, we can't do this is we want to also run finalizers. Moreover, freeing oc->info so early was wrong for another reason: we will need it in order to unregister the exception tables (see the call to `RtlDeleteFunctionTable`). In service of #20494.
* rts/linker/PEi386: Rename finit field to finiBen Gamari2022-07-163-5/+5
| | | | fini is short for "finalizer", which does not contain a "t".
* testsuite: Add T20494Ben Gamari2022-07-165-0/+92
|
* rts/linker/Elf: Introduce support for invoking finalizers on unloadBen Gamari2022-07-164-3/+90
| | | | Addresses #20494.
* rts/linker/Elf: Check that there are no NULL ctorsBen Gamari2022-07-161-0/+1
|
* configure: Don't override Windows CXXFLAGSBen Gamari2022-07-161-1/+1
| | | | | | | | | | | | | | At some point we used the clang distribution from msys2's `MINGW64` environment for our Windows toolchain. This defaulted to using libgcc and libstdc++ for its runtime library. However, we found for a variety of reasons that compiler-rt, libunwind, and libc++ were more reliable, consequently we explicitly overrode the CXXFLAGS to use these. However, since then we have switched to use the `CLANG64` packaging, which default to these already. Consequently we can drop these arguments, silencing some redundant argument warnings from clang. Fixes #21669.
* compiler: Add haddock sections to GHC.Utils.PanicBen Gamari2022-07-161-6/+12
|
* cmm: Move toBlockList to GHC.CmmBen Gamari2022-07-166-8/+5
|
* cmm: Eliminate orphan Outputable instancesBen Gamari2022-07-1631-1134/+999
| | | | | | | Here we reorganize `GHC.Cmm` to eliminate the orphan `Outputable` and `OutputableP` instances for the Cmm AST. This makes it significantly easier to use the Cmm pretty-printers in tracing output without incurring module import cycles.
* rts: forkOn context switches the target capabilityDouglas Wilson2022-07-164-8/+14
| | | | Fixes #21824
* Align the behaviour of `dopt` and `log_dopt`Dominik Peteler2022-07-164-32/+45
| | | | | | | | | | | | | | Before the behaviour of `dopt` and `logHasDumpFlag` (and the underlying function `log_dopt`) were different as the latter did not take the verbosity level into account. This led to problems during the refactoring as we cannot simply replace calls to `dopt` with calls to `logHasDumpFlag`. In addition to that a subtle bug in the GHC module was fixed: `setSessionDynFlags` did not update the logger and as a consequence the verbosity value of the logger was not set appropriately. Fixes #21861
* rel-notes: Drop mention of #21745 fixBen Gamari2022-07-161-6/+0
| | | | Since we have backported the fix to 9.4.1.
* Suppress extra output from configure check for c++ librariesGreg Steuck2022-07-161-2/+2
|
* Make keepAlive# out-of-lineBen Gamari2022-07-167-36/+31
| | | | | | | | | | | | | | This is a naive approach to fixing the unsoundness noticed in #21708. Specifically, we remove the lowering of `keepAlive#` via CorePrep and instead turn it into an out-of-line primop. This is simple, inefficient (since the continuation must now be heap allocated), but good enough for 9.4.1. We will revisit this (particiularly via #16098) in a future release. Metric Increase: T4978 T7257 T9203
* Document RuntimeRep polymorphism limitations of catch#, et alBen Gamari2022-07-162-7/+69
| | | | | | | As noted in #21868, several primops accepting continuations producing RuntimeRep-polymorphic results aren't nearly as polymorphic as their types suggest. Document this limitation and adapt the `UnliftedWeakPtr` test to avoid breaking this limitation in `keepAlive#`.
* Add record-dot-syntax testColten Webb2022-07-163-0/+49
|
* Compute record-dot-syntax typesColten Webb2022-07-161-0/+1
| | | | | Ensures type information for record-dot-syntax is included in HieASTs. See #21797
* Change GHCi bytecode return convention for unlifted datatypes.Luite Stegeman2022-07-164-33/+53
| | | | | | | | | This changes the bytecode return convention for unlifted algebraic datatypes to be the same as for lifted types, i.e. ENTER/PUSH_ALTS instead of RETURN_UNLIFTED/PUSH_ALTS_UNLIFTED Fixes #20849
* rts: Fix AdjustorPool bitmap manipulationBen Gamari2022-07-131-14/+14
| | | | | | | | | | | | | | Previously the implementation of bitmap_first_unset assumed that `__builtin_clz` would accept `uint8_t` however it apparently rather extends its argument to `unsigned int`. To fix this we simply revert to a naive implementation since handling the various corner cases with `clz` is quite tricky. This should be fine given that AdjustorPool isn't particularly hot. Ideally we would have a single, optimised bitmap implementation in the RTS but I'll leave this for future work. Fixes #21838.
* Fix potential space leak that arise from ModuleGraphs retaining referencesZubin Duggal2022-07-131-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | to previous ModuleGraphs, in particular the lazy `mg_non_boot` field. This manifests in `extendMG`. Solution: Delete `mg_non_boot` as it is only used for `mgLookupModule`, which is only called in two places in the compiler, and should only be called at most once for every home unit: GHC.Driver.Make: mainModuleSrcPath :: Maybe String mainModuleSrcPath = do ms <- mgLookupModule mod_graph (mainModIs hue) ml_hs_file (ms_location ms) GHCI.UI: listModuleLine modl line = do graph <- GHC.getModuleGraph let this = GHC.mgLookupModule graph modl Instead `mgLookupModule` can be a linear function that looks through the entire list of `ModuleGraphNodes` Fixes #21816
* Hadrian: update documentation of settingssheaf2022-07-133-102/+117
| | | | | | | | | | The documentation for key-value settings was a bit out of date. This patch updates it to account for `cabal.configure.opts` and `hsc2hs.run.opts`. The user-settings document was also re-arranged, to make the key-value settings more prominent (as it doesn't involve changing the Hadrian source code, and thus doesn't require any recompilation of Hadrian).
* testsuite: Factor out common parts from hiefile testsZubin Duggal2022-07-138-145/+104
|
* hie-files: Record location of filled in default method bindingsZubin Duggal2022-07-136-44/+190
| | | | | This is useful for hie files to reconstruct the evidence that default methods depend on.
* hie-files: Fix scopes for deriving clauses and instance signatures (#18425)Zubin Duggal2022-07-135-7/+29
|
* tarballEric Lindblad2022-07-131-3/+6
|
* fix bootstrapEric Lindblad2022-07-131-4/+12
|