summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Simplify uniqAwaywip/uniqAwayBen Gamari2019-12-028-60/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This does two things: * Eliminate all uses of Unique.deriveUnique, which was quite easy to mis-use and extremely subtle. * Rename the previous "derived unique" notion to "local unique". This is possible because the only places where `uniqAway` can be safely used are those where local uniqueness (with respect to some InScopeSet) is sufficient. * Rework the implementation of VarEnv.uniqAway, as discussed in #17462. This should make the operation significantly more efficient than its previous iterative implementation.. Metric Decrease: T9872c T12227 T9233 T14683 T5030 T12545 hie002 Metric Increase: T9961
* Drop Uniquable constraint for AnnTargetBen Gamari2019-12-016-32/+60
| | | | | | This relied on deriveUnique, which was far too subtle to be safely applied. Thankfully the instance doesn't appear to be used so let's just drop it.
* users-guide: Add 8.12.1 release notesBen Gamari2019-12-012-0/+91
|
* Simpler Semigroup instance for InsideLam and InterestingCtxtSebastian Graf2019-11-301-6/+4
| | | | | This mirrors the definition of `(&&)` and `(||)` now, relieving the Simplifier of a marginal amount of pressure.
* Use Hadrian by default in validate script (#17527)Sylvain Henry2019-11-301-7/+9
|
* Remove HasSrcSpan (#17494)Vladislav Zavialov2019-11-3052-1599/+1440
| | | | | Metric Decrease: haddock.compiler
* Hadrian docs: Rename the second "validate" entry to "slow-validate" [ci skip]Sebastian Graf2019-11-301-1/+1
| | | | That would be in line with the implementation.
* Improve few Foreign.Marshal.Utils docsÖmer Sinan Ağacan2019-11-291-11/+21
| | | | | | | | In copyBytes and moveBytes mention which argument is source and which is destination. Also fixes some of the crazy indentation in the module and cleans trailing whitespace.
* Pass ModDetails with (partial) ModIface in HscStatusÖmer Sinan Ağacan2019-11-294-46/+51
| | | | | | | | | | (Partial) ModIface and ModDetails are generated at the same time, but they're passed differently: ModIface is passed in HscStatus consturctors while ModDetails is returned in a tuple. This refactors ModDetails passing so that it's passed around with ModIface in HscStatus constructors. This makes the code more consistent and hopefully easier to understand: ModIface and ModDetails are really very closely related. It makes sense to treat them the same way.
* Factor out HsSCC/HsCoreAnn/HsTickPragma into HsPragEwip/hs-pragVladislav Zavialov2019-11-2816-183/+169
| | | | | | | | | | | | | | | | | | | | | | | This is a refactoring with no user-visible changes (except for GHC API users). Consider the HsExpr constructors that correspond to user-written pragmas: HsSCC representing {-# SCC ... #-} HsCoreAnn representing {-# CORE ... #-} HsTickPragma representing {-# GENERATED ... #-} We can factor them out into a separate datatype, HsPragE. It makes the code a bit tidier, especially in the parser. Before this patch: hpc_annot :: { Located ( (([AddAnn],SourceText),(StringLiteral,(Int,Int),(Int,Int))), ((SourceText,SourceText),(SourceText,SourceText)) ) } After this patch: prag_hpc :: { Located ([AddAnn], HsPragE GhcPs) }
* Fix endian handling of LLVM backendStefan Schulze Frielinghaus2019-11-281-10/+4
| | | | | Get rid of CPP macro WORDS_BIGENDIAN which is not defined anymore, and replace it by DynFlag. This fixes partially #17337.
* Fix typos, using Wikipedia list of common typosBrian Wignall2019-11-28121-160/+160
|
* Reduce boolean blindness in OccInfo(OneOcc) #17482Philipp Krüger2019-11-285-56/+86
| | | | | | | | | | | | | * Transformed the type aliases `InterestingCxt`, `InsideLam` and `OneBranch` into data types. * Added Semigroup and Monoid instances for use in orOccInfo in OccurAnal.hs * Simplified some usage sites by using pattern matching instead of boolean algebra. Metric Increase: T12150 This increase was on a Mac-build of exactly 1%. This commit does *not* re-intruduce the asymptotic memory usage described in T12150.
* .gitmodules: tweak 'exception' URL to avoid redirection warningsSergei Trofimovich2019-11-271-1/+1
| | | | | | | | | | | Avoid initial close warning of form: ``` Cloning into 'exceptions'... warning: redirecting to https://gitlab.haskell.org/ghc/packages/exceptions.git/ ``` Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Fix @since annotations for isResourceVanishedError and friends (#17488)Ryan Scott2019-11-271-3/+3
|
* Whitespace-sensitive bang patterns (#1087, #17162)wip/whitespace-and-lookaheadVladislav Zavialov2019-11-27172-742/+937
| | | | | | | | | | | | | | | | | | This patch implements a part of GHC Proposal #229 that covers five operators: * the bang operator (!) * the tilde operator (~) * the at operator (@) * the dollar operator ($) * the double dollar operator ($$) Based on surrounding whitespace, these operators are disambiguated into bang patterns, lazy patterns, strictness annotations, type applications, splices, and typed splices. This patch doesn't cover the (-) operator or the -Woperator-whitespace warning, which are left as future work.
* Make warnings for TH splices opt-inSebastian Graf2019-11-2710-88/+168
| | | | | | | | | | | | | | | | | | | | | | | In #17270 we have the pattern-match checker emit incorrect warnings. The reason for that behavior is ultimately an inconsistency in whether we treat TH splices as written by the user (`FromSource :: Origin`) or as generated code (`Generated`). This was first reported in #14838. The current solution is to TH splices as `Generated` by default and only treat them as `FromSource` when the user requests so (-fenable-th-splice-warnings). There are multiple reasons for opt-in rather than opt-out: * It's not clear that the user that compiles a splice is the author of the code that produces the warning. Think of the situation where she just splices in code from a third-party library that produces incomplete pattern matches. In this scenario, the user isn't even able to fix that warning. * Gathering information for producing the warnings (pattern-match check warnings in particular) is costly. There's no point in doing so if the user is not interested in those warnings. Fixes #17270, but not #14838, because the proper solution needs a GHC proposal extending the TH AST syntax.
* Remove prefix arrow support for GADTs (#17211)Krzysztof Gogolewski2019-11-253-23/+0
| | | | | | | This reverts the change in #9096. The specialcasing done for prefix (->) is brittle and does not support VTA, type families, type synonyms etc.
* configure: Fix HAVE_C11_ATOMICS macroBen Gamari2019-11-241-1/+3
| | | | | | | | Previously we were using AC_DEFINE instead of AC_DEFINE_UNQUOTED, resulted in the variable not being interpolated. Fixes #17505.
* On FreeBSD 12 sys/sysctl.h requires sys/types.hViktor Dukhovni2019-11-241-0/+1
| | | | | | | | | | | | | | Else build fails with: In file included from ExecutablePath.hsc:42: /usr/include/sys/sysctl.h:1062:25: error: unknown type name 'u_int'; did you mean 'int'? int sysctl(const int *, u_int, void *, size_t *, const void *, size_t); ^~~~~ int compiling libraries/base/dist-install/build/System/Environment/ExecutablePath_hsc_make.c failed (exit code 1) Perhaps also also other FreeBSD releases, but additional include will no harm even if not needed.
* Fix typosBrian Wignall2019-11-2336-55/+54
|
* Bump exceptions submoduleÖmer Sinan Ağacan2019-11-231-0/+0
| | | | Adds a few files generated by GHC's configure script to .gitignore
* Stricten functions ins GHC.NaturalSebastian Graf2019-11-234-36/+63
| | | | | This brings `Natural` on par with `Integer` and fixes #17499. Also does some manual CSE for 0 and 1 literals.
* Packages: Don't use expectJustBen Gamari2019-11-231-5/+8
| | | | | Throw a slightly more informative error on failure. Motivated by the errors seen in !2160.
* rts: Consolidate spinlock implementationBen Gamari2019-11-231-47/+13
| | | | | Previously we had two distinct implementations: one with spinlock profiling and another without. This seems like needless duplication.
* Bump ghc version to 8.11Ben Gamari2019-11-232-1/+1
|
* Prevent -optc arguments from being duplicated in reverse order (#17471)Ryan Scott2019-11-235-3/+22
| | | | | | | | | | | | | | | | | This reverts a part of commit 7bc5d6c6578ab9d60a83b81c7cc14819afef32ba that causes all arguments to `-optc` (and `-optcxx`) to be passed twice to the C/C++ compiler, once in reverse order and then again in the correct order. While passing duplicate arguments is usually harmless it can cause breakage in this pattern, which is employed by Hackage libraries in the wild: ``` ghc Foo.hs foo.c -optc-D -optcFOO ``` As `FOO -D -D FOO` will cause compilers to error. Fixes #17471.
* Make CorePrep.tryEtaReducePrep and CoreUtils.tryEtaReduce line upMatheus Magalhães de Alcantara2019-11-232-20/+10
| | | | | | | Simon PJ says he prefers this fix to #17429 over banning eta-reduction for jumps entirely. Sure enough, this also works. Test case: simplCore/should_compile/T17429.hs
* Take care to not eta-reduce jumps in CorePrepMatheus Magalhães de Alcantara2019-11-233-2/+30
| | | | | | | | | | | | | | CorePrep already had a check to prevent it from eta-reducing Ids that respond true to hasNoBinding (foreign calls, constructors for unboxed sums and products, and Ids with compulsory unfoldings). It did not, however, consider join points as ids that 'must be saturated'. Checking whether the Id responds True to 'isJoinId' should prevent CorePrep from turning saturated jumps like the following (from #17429) into undersaturated ones: (\ eta_XP -> join { mapped_s1vo _ = lvl_s1vs } in jump mapped_s1vo eta_XP)
* rts: Expose interface for configuring EventLogWritersBen Gamari2019-11-2311-50/+195
| | | | | | This exposes a set of interfaces from the GHC API for configuring EventLogWriters. These can be used by consumers like [ghc-eventlog-socket](https://github.com/bgamari/ghc-eventlog-socket).
* Target the IsList instance for ZipList at base-4.14.0.0 (#17489)Ryan Scott2019-11-231-1/+3
| | | | | | | | This moves the changelog entry about the instance from `base-4.15.0.0` to `base-4.14.0.0`. This accomplishes part (1) from #17489. [ci skip]
* Fix typo in Note reference [skip ci]nineonine2019-11-231-6/+6
|
* Bump hsc2hs submodule againBen Gamari2019-11-231-0/+0
| | | | This fixes the Darwin build.
* Bump hsc2hs submoduleBen Gamari2019-11-211-0/+0
| | | | Including Phyx's backport of the process changes fixing #17480.
* Strip parentheses in expressions contexts in error messagesVladislav Zavialov2019-11-1916-27/+31
| | | | This makes error messages a tad less noisy.
* hpc: Fix encoding issues. Add test for and fix #17073Alexey Kuleshevich2019-11-198-33/+41
| | | | | | | | | | | | | * Make sure files are being read/written in UTF-8. Set encoding while writing HTML output. Also set encoding while writing and reading .tix files although we don't yet have a ticket complaining that this poses problems. * Set encoding in html header to utf8 * Upgrade to new version of 'hpc' library and reuse `readFileUtf8` and `writeFileUtf8` functions * Update git submodule for `hpc` * Bump up `hpc` executable version Co-authored-by: Ben Gamari <ben@smart-cactus.org>
* Use pointer equality in Eq/Ord for ThreadIdRoland Zumkeller2019-11-194-17/+29
| | | | | | | | | | Changes (==) to use only pointer equality. This is safe because two threads are the same iff they have the same id. Changes `compare` to check pointer equality first and fall back on ids only in case of inequality. See discussion in #16761.
* Changing Thread IDs from 32 bits to 64 bits.Roland Zumkeller2019-11-193-6/+6
|
* nonmoving: Drop redundant write barrier on stack underflowBen Gamari2019-11-191-10/+0
| | | | | | | | | | | | | Previously we would push stack-carried return values to the new stack on a stack overflow. While the precise reasoning for this barrier is unfortunately lost to history, in hindsight I suspect it was prompted by a missing barrier elsewhere (that has been since fixed). Moreover, there the redundant barrier is actively harmful: the stack may contain non-pointer values; blindly pushing these to the mark queue will result in a crash. This is precisely what happened in the `stack003` test. However, because of a (now fixed) deficiency in the test this crash did not trigger on amd64.
* testsuite: Increase width of stack003 testBen Gamari2019-11-191-5/+11
| | | | | | Previously the returned tuple seemed to fit in registers on amd64. This meant that non-moving collector bug would cause the test to fail on i386 yet not amd64.
* nonmoving: Fix handling on large object marking on 32-bitBen Gamari2019-11-191-4/+7
| | | | | | | | | Previously we would reset the pointer pointing to the object to be marked to the beginning of the block when marking a large object. This did no harm on 64-bit but on 32-bit it broke, e.g. `arr020`, since we align pinned ByteArray allocations such that the payload is 8 byte-aligned. This means that the object might not begin at the beginning of the block.,
* nonmoving: Rework mark queue representationBen Gamari2019-11-192-23/+18
| | | | | The previous representation needlessly limited the array length to 16-bits on 32-bit platforms.
* nonmoving: Fix incorrect masking in mark queue type testBen Gamari2019-11-191-2/+2
| | | | | | We were using TAG_BITS instead of TAG_MASK. This happened to work on 64-bit platforms where TAG_BITS==3 since we only use tag values 0 and 3. However, this broken on 32-bit platforms where TAG_BITS==2.
* nonmoving: Use correct info table pointer accessorBen Gamari2019-11-192-19/+7
| | | | | | | | | | | Previously we used INFO_PTR_TO_STRUCT instead of THUNK_INFO_PTR_TO_STRUCT when looking at a thunk. These two happen to be equivalent on 64-bit architectures due to alignment considerations however they are different on 32-bit platforms. This lead to #17487. To fix this we also employ a small optimization: there is only one thunk of type WHITEHOLE (namely stg_WHITEHOLE_info). Consequently, we can just use a plain pointer comparison instead of testing against info->type.
* rts: Add missing include of SymbolExtras.hBen Gamari2019-11-191-0/+1
| | | | This broke the Windows build.
* Properly account for libdw paths in make build systemBen Gamari2019-11-194-3/+14
| | | | Should finally fix #17255.
* Packages.hs: use O(n*log(n)) ordNub instead of O(n*n) nubÖmer Sinan Ağacan2019-11-191-6/+6
| | | | | As reported in #8173 in some environments package lists can get quite long, so we use more efficient ordNub instead of nub on package lists.
* Enable USE_PTHREAD_FOR_ITIMER also on FreeBSDViktor Dukhovni2019-11-191-0/+3
| | | | | | | | | | | If using a pthread instead of a timer signal is more reliable, and has no known drawbacks, then FreeBSD is also capable of supporting this mode of operation (tested on FreeBSD 12 with GHC 8.8.1, but no reason why it would not also work on FreeBSD 11 or GHC 8.6). Proposed by Kevin Zhang in: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241849
* Give seq a more precise type and remove magicBen Gamari2019-11-1911-170/+142
| | | | | | | | | | | | | | | | | | | | | `GHC.Prim.seq` previously had the rather plain type: seq :: forall a b. a -> b -> b However, it also had a special typing rule to applications where `b` is not of kind `Type`. Issue #17440 noted that levity polymorphism allows us to rather give it the more precise type: seq :: forall (r :: RuntimeRep) a (b :: TYPE r). a -> b -> b This allows us to remove the special typing rule that we previously required to allow applications on unlifted arguments. T9404 contains a non-Type application of `seq` which should verify that this works as expected. Closes #17440.
* desugar: Drop stale Note [Matching seqId]Ben Gamari2019-11-191-6/+0
| | | | | The need for this note vanished in eae703aa60f41fd232be5478e196b661839ec3de.