summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Windows: Fix hsc2hs non-deterministic failures.Tamar Christina2019-09-131-0/+0
|
* Fix scoping of implicit parametersSimon Peyton Jones2019-09-134-3/+33
| | | | | | | | There was an outright bug in TcInteract.solveOneFromTheOther which meant that we did not always pick the innermost implicit parameter binding, causing #17104. The fix is easy, just a rearrangement of conditional tests
* Update mailmapBen Gamari2019-09-131-2/+18
|
* Fix StandaloneDerivingNingning Xie2019-09-121-1/+1
| | | | | If I understand correctly, `deriving instance _ => Eq (Foo a)` is equivalent to `data Foo a deriving Eq`, rather than `data Foo a deriving Foo`.
* Bump Cabal submodule to 3.1Sebastian Graf2019-09-126-6/+5
| | | | | | | | ------------------------- Metric Increase: haddock.Cabal T4029 -------------------------
* Remove unused `#include`s from parser/cutils.cJohn Ericson2019-09-121-6/+0
| | | | | Looks like these have been unused since 7c665f9ce0980ee7c81a44c8f861686395637453.
* Do not throw away backpack instantiations for module lookup cacheJohn Ericson2019-09-121-1/+1
| | | | | | | | | | | | | | | Currently, there is only one home package so this probably doesn't matter. But if we support multiple home packages, they could differ only in arguments (same indef component being applied). It looks like it used to be this way before 4e8a0607140b23561248a41aeaf837224aa6315b, but that commit doesn't seem to comment on this change in the particular. (It's main purpose is creating the InstalledUnitId and recategorizing the UnitId expressions accordingly.) Trying this as a separate commit for testing purposes. I leave it to others to decide whether this is a good change on its own.
* Print the correct system memory in use with +RTS -s (#17158)Pranay Sashank2019-09-121-2/+2
| | | | | | | Use `stats.max_mem_in_use_bytes` to print the memory usage instead of `stats.max_live_bytes` which prints maximum residency. Fixes (#17158).
* Windows: make openTempFile fully atomic.Tamar Christina2019-09-112-29/+47
|
* Refactor bad coercion checking in a few placesÖmer Sinan Ağacan2019-09-114-34/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do bad coercion checking in a few places in the compiler, but they all checked it differently: - CoreToStg.coreToStgArgs: Disallowed lifted-to-unlifted, disallowed changing prim reps even when the sizes are the same. - StgCmmExpr.cgCase: Checked primRepSlot equality. This disallowed Int to Int64 coercions on 64-bit systems (and Int to Int32 on 32-bit) even though those are fine. - CoreLint: Only place where we do this right. Full rules are explained in Note [Bad unsafe coercion]. This patch implements the check explained in Note [Bad unsafe coercion] in CoreLint and uses it in CoreToStg.coreToStgArgs and StgCmmExpr.cgCase. This fixes #16952 and unblocks !1381 (which fixes #16893). This is the most conservative and correct change I came up with that fixes #16952. One remaining problem with coercion checking is that it's currently done in seemingly random places. What's special about CoreToStg.coreToStgArgs and StgCmmExpr.cgCase? My guess is that adding assertions to those places caught bugs before so we left assertions in those places. I think we should remove these assertions and do coercion checking in CoreLint and StgLint only (#17041).
* SetLevels: Fix potential panic in lvlBindBen Gamari2019-09-112-4/+14
| | | | | | 3b31a94d introduced a use of isUnliftedType which can panic in the case of levity-polymorphic types. Fix this by introducing mightBeUnliftedType which returns whether the type is *guaranteed* to be lifted.
* Remove dead `ncgDebugIsOn` and `NCG_DEBUG`John Ericson2019-09-111-8/+1
| | | | Haven't been used since 16206a6603e87e15d61c57456267c5f7ba68050e.
* Bump Hadrian's QuickCheck dependencyLuke Lau2019-09-111-1/+1
|
* testsuite: check for RTS linkerPeter Trommler2019-09-112-1/+2
| | | | Fixes #16833
* Remove COMPILING_GHCJohn Ericson2019-09-111-3/+0
| | | | | It is no longer used. I guess we are sharing fewer headers with the RTS than the comment claims. That's a relief!
* linker: Move -optl flags to end of linker invocation.Niklas Hambüchen2019-09-111-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, giving `-optl` linker flags to `ghc` on the command line placed them in the wrong place in the `ld` command line: They were given before all the Haskell libararies, when they should appear after. Background: Most linkers like `ld.bfd` and `ld.gold`, but not the newer LLVM `lld`, work in a way where the order of `-l` flags given matters; earlier `-lmylib1` flags are supposed to create "holes" for linker symbols that are to be filled with later `lmylib2` flags that "fill the holes" for these symbols. As discovered in https://github.com/haskell/cabal/pull/5451#issuecomment-518001240, the `-optl` flags appeared before e.g. the -lHStext-1.2.3.1 -lHSbinary-0.8.6.0 -lHScontainers-0.6.0.1 flags that GHC added at the very end. Haskell libraries typically depend on C libraries, so `-lHS*` flags will create holes for the C libraries to fill in, but that only works when those libraries' `-l` flags are given **after** the `-lHS*` flags; until now they were given before, which was wrong. This meant that Cabal's `--ld-options` flag and `ld-options` `.cabal` file field were pretty ineffective, unless you used the `--ld-option=--start-group` hack as (https://github.com/haskell/cabal/pull/5451#issuecomment-406761676) that convinces the classical linkers to not be dependent on the order of linker flags given. This commit fixes the problem by simply flipping the order, putting `-optl` flags at the end, after Haskell libraries. The code change is effectively only `args1 ++ args` -> `args ++ args1` but the commit also renames the variables for improved clarity. Simple way to test it: ghc --make Main.hs -fforce-recomp -v -optl-s on a `Main.hs` like: import qualified Data.Set as Set main = print $ Set.fromList "hello"
* Module hierarchy: StgToCmm (#13009)Sylvain Henry2019-09-1074-386/+285
| | | | | | Add StgToCmm module hierarchy. Platform modules that are used in several other places (NCG, LLVM codegen, Cmm transformations) are put into GHC.Platform.
* Replace queryCygwinTerminal with Win32's isMinTTYHandleRyan Scott2019-09-091-61/+11
| | | | | | | | | | | | `SysTools.Terminal.queryCygwinTerminal` now exists in the `Win32` library under the name `isMinTTYHandle` since `Win32-2.5.0.0`. (GHC 8.4.4 ships with `Win32-2.6.1.0`, so this is well within GHC's support window.) We can therefore get replace `queryCygwinTerminal` with `isMinTTYHandle` and delete quite a bit of code from `SysTools.Terminal` in the process. Along the way I needed to replace some uses of `#if defined x` with `#if defined(x)` to please the CI linters.
* Update FastString docstringsDaniel Gröber2019-09-091-8/+10
| | | | | | 1) FastStrings are always UTF-8 encoded now. 2) Clarify what is meant by "hashed" 3) Add mention of lazy z-enc
* Use lazyness for FastString's z-encoding memoizationDaniel Gröber2019-09-092-42/+38
| | | | | | | | | | | | | | | | | | | Having an IORef in FastString to memoize the z-encoded version is unecessary because there is this amazing thing Haskell can do natively, it's called "lazyness" :) We simply remove the UNPACK and strictness annotations from the constructor field corresponding to the z-encoding, making it lazy, and store the (pure) z-encoded string there. The only complication here is 'hasZEncoding' which allows cheking if a z-encoding was computed for a given string. Since this is only used for compiler performance statistics though it's not actually necessary to have the current per-string granularity. Instead I add a global IORef counter to the FastStringTable and use unsafePerformIO to increment the counter whenever a lazy z-encoding is forced.
* Fix GHC version guard for Int32Rep/Word32RepMoritz Kiefer2019-09-081-0/+4
| | | | | Those constructors have been added after GHC 8.8. The version guards in `binary` are correct, see https://github.com/kolmodin/binary/pull/167/files.
* Add a new flag -dno-typeable-binds for debuggingÖmer Sinan Ağacan2019-09-083-4/+21
| | | | | See the user manual entry -- this helps when debugging as generated Core gets smaller without these bindings.
* hadrian: fix _build/ghc-stage1 to make it callable from any directoryAlp Mestanogullari2019-09-071-2/+3
|
* Minor refactoring in deriveConstantsÖmer Sinan Ağacan2019-09-071-42/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Mainly we now generate this data PlatformConstants = PlatformConstants { pc_CONTROL_GROUP_CONST_291 :: Int, pc_STD_HDR_SIZE :: Int, pc_PROF_HDR_SIZE :: Int, pc_BLOCK_SIZE :: Int, } instead of data PlatformConstants = PlatformConstants { pc_platformConstants :: () , pc_CONTROL_GROUP_CONST_291 :: Int , pc_STD_HDR_SIZE :: Int , pc_PROF_HDR_SIZE :: Int , pc_BLOCK_SIZE :: Int ... } The first field has no use and according to (removed) comments it was to make code generator's work easier.. if anything this version is simpler because it has less repetition (the commas in strings are gone).
* Make sure all boolean settings entries use `YES` / `NO`John Ericson2019-09-058-35/+34
| | | | | | | | | Some where using `True` / `False`, a legacy of when they were in `Config.hs`. See #16914 / d238d3062a9858 for a similar problem. Also clean up the configure variables names for consistency and clarity while we're at it. "Target" makes clear we are talking about outputted code, not where GHC itself runs.
* Make the C-- O and C types constructors with DataKindsJohn Ericson2019-09-055-18/+31
| | | | | The tightens up the kinds a bit. I use type synnonyms to avoid adding promotion ticks everywhere.
* Few tweaks in -ddump-debug output, minor refactoringÖmer Sinan Ağacan2019-09-022-22/+17
| | | | | | | - Fixes crazy indentation in -ddump-debug output - We no longer dump empty sections in -ddump-debug when a code block does not have any generated debug info - Minor refactoring in Debug.hs and AsmCodeGen.hs
* Use C99 Fixed width types to avoid hack in base's configureJohn Ericson2019-09-015-29/+27
| | | | Define MD5Context in terms of `uint*_t` and don't use `HsFFI.h`.
* cap max stack size at 32 bit limit (#17019)Gershom Bazerman2019-09-011-1/+4
|
* Remove redundant special case in STG pretty-printerÖmer Sinan Ağacan2019-08-311-10/+0
| | | | | | | | | | | | | | | | | | | This special case existed for no reason, and made things inconsistent. Before Boolean.$bT :: Boolean.Boolean [GblId, Str=m, Unf=OtherCon []] = CAF_ccs \ u [] Boolean.$bT1; After Boolean.$bF :: Boolean.Boolean [GblId, Str=m, Unf=OtherCon []] = \u [] Boolean.$bF1; The cost-centre is now hidden when not profiling, as is the case with other types of closures.
* Add additional step to T16804Eric Wolf2019-08-316-198/+889
| | | | | | | | | | | | | | | | Add another small test step Use the same identifier name in different scopes and see, if ':uses' handles that. Add another test step to check wether local bindings with the same identifier name might get confused Add easier to understand test output Fix annotated lines from file correctly
* Remove HsUtils/userHsLTyVarBndrsVladislav Zavialov2019-08-301-12/+1
| | | | | This patch removes 'userHsLTyVarBndrs' and 'userHsTyVarBndrs' from HsUtils. These helper functions were not used anywhere.
* configure.ac: add --enable-numa switchSergei Trofimovich2019-08-301-2/+13
| | | | | | | | | | | | | Before the change ./configure detected numa support automatically withoun a nice way to disable autodetection. The change adds `--enable-numa` / `--disable-numa` switch to override the default. If `--enable-numa` is passed and `libnuma` is not present then configure will fail. Reported-by: Sergey Alirzaev Bug: https://github.com/gentoo-haskell/gentoo-haskell/issues/955 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Small optimization in the SRT algorithmÖmer Sinan Ağacan2019-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | Noticed by @simonmar in !1362: If the srtEntry is Nothing, then it should be safe to omit references to this SRT from other SRTs, even if it is a static function. When updating SRT map we don't omit references to static functions (see Note [Invalid optimisation: shortcutting]), but there's no reason to add an SRT entry for a static function if the function is not CAFFY. (Previously we'd add SRT entries for static functions even when they're not CAFFY) Using 9151b99e I checked sizes of all SRTs when building GHC and containers: - GHC: 583736 (HEAD), 581695 (this patch). 2041 less SRT entries. - containers: 2457 (HEAD), 2381 (this patch). 76 less SRT entries.
* gitlab-ci: Fix URL of Darwin's cabal-install tarballBen Gamari2019-08-292-1/+2
| | | | | This was inadvertently referring to the cabal-install-latest/ directory which is volatile.
* Fix LLVM version check yet againÖmer Sinan Ağacan2019-08-294-47/+52
| | | | | | | | | | | | | | | There were two problems with LLVM version checking: - The parser would only parse x and x.y formatted versions. E.g. 1.2.3 would be rejected. - The version check was too strict and would reject x.y formatted versions. E.g. when we support version 7 it'd reject 7.0 ("LLVM version 7.0") and only accept 7 ("LLVM version 7"). We now parse versions with arbitrarily deep minor numbering (x.y.z.t...) and accept versions as long as the major version matches the supported version (e.g. 7.1, 7.1.2, 7.1.2.3 ...).
* Remove Unused flag -ddump-shape [skip ci]luca2019-08-281-4/+0
|
* Balance parentheses in GHC 8.10.1 release notesRyan Scott2019-08-281-3/+3
| | | | [ci skip]
* Fix #17112Sebastian Graf2019-08-283-27/+54
| | | | | | | | | | | | | The `mkOneConFull` function of the pattern match checker used to try to guess the type arguments of the data type's type constructor by looking at the ambient type of the match. This doesn't work well for Pattern Synonyms, where the result type isn't even necessarily a TyCon application, and it shows in #11336 and #17112. Also the effort seems futile; why try to try hard when the type checker has already done the hard lifting? After this patch, we instead supply the type constructors arguments as an argument to the function and lean on the type-annotated AST.
* Return results of Cmm streams in backendsÖmer Sinan Ağacan2019-08-287-46/+72
| | | | | | | | | | | | | | | | | | | This generalizes code generators (outputAsm, outputLlvm, outputC, and the call site codeOutput) so that they'll return the return values of the passed Cmm streams. This allows accumulating data during Cmm generation and returning it to the call site in HscMain. Previously the Cmm streams were assumed to return (), so the code generators returned () as well. This change is required by !1304 and !1530. Skipping CI as this was tested before and I only updated the commit message. [skip ci]
* Remove redundant OPTIONS_GHC in BlockLayout.hsAndreas Klebinger2019-08-271-3/+0
|
* Some tweaks in GHC.Compact haddocksÖmer Sinan Ağacan2019-08-271-14/+17
|
* Some more documentation for typePrimRep1 stuffÖmer Sinan Ağacan2019-08-273-3/+14
| | | | [skip ci]
* configure.ac: fix '--disable-dwarf-debug'Sergei Trofimovich2019-08-231-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before the change ./configure --disable-dwarf-debug enabled DWARF debugging unconditionally. This happened due to use of 5-argument form of `AC_ARG_ENABLE` without actually checking the passed `$enableval` parameter: ``` AC_ARG_ENABLE(dwarf-unwind, [AC_HELP_STRING([--enable-dwarf-unwind], [Enable DWARF unwinding support in the runtime system via elfutils' libdw [default=no]])], [AC_CHECK_LIB(dw, dwfl_attach_state, [UseLibdw=YES], [AC_MSG_ERROR([Cannot find system libdw (required by --enable-dwarf-unwind)])])] [UseLibdw=NO] ) ``` Note: - `[UseLibdw=NO]` is called when `--{enable,disable}-dwarf-unwind` is not passed at all as a parameter (ok). - `[AC_CHECK_LIB(dw, dwfl_attach_state, [UseLibdw=YES],` is called for both: * `--enable-dwarf-unwind` being passed: `$enableval = "yes"` (ok). * --disable-dwarf-unwind` being passed: `$enableval = "no"` (bad). The change is to use 3-argument `AC_ARG_ENABLE` and check for passed value as `"$enable_dwarf_unwind" = "yes"`. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Use variable length encoding for Binary instances.Andreas Klebinger2019-08-231-95/+246
| | | | | | | | Use LEB128 encoding for Int/Word variants. This reduces the size of interface files significantly. (~19%). Also includes a few small optimizations to make unboxing work better that I have noticed while looking at the core.
* Make non-streaming LLVM and C backends streamingÖmer Sinan Ağacan2019-08-234-20/+19
| | | | | | | | | This adds a Stream.consume function, uses it in LLVM and C code generators, and removes the use of Stream.collect function which was used to collect streaming Cmm generation results into a list. LLVM and C backends now properly use streamed Cmm generation, instead of collecting Cmm groups into a list before generating LLVM/C code.
* Remove special case in SRT generation with -split-sectionsÖmer Sinan Ağacan2019-08-221-26/+5
| | | | | | | | | Previously we were using an empty ModuleSRTInfo for each Cmm group with -split-section. As far as I can see this has no benefits, and simplifying this makes another patch simpler (!1304). We also remove some outdated comments: we no longer generate one module-level SRT.
* base: Reintroduce fusion for scanrTDecki2019-08-222-1/+46
| | | | While avoiding #16943.
* Add documentation for Hadrian expressionsJames Foster2019-08-222-0/+334
| | | | | This commit adds documentation on Hadrian's 'Expr' type and references the documentation in hadrian/README.md
* Doc: add Haddocks for quotRemWord2 primopSylvain Henry2019-08-221-2/+2
|