summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [TTG: Handling Source Locations] Foundation and Pat (Part 2)wip/shnajd-TTG-SrcLocsShayan-Najd2018-11-092-11/+13
| | | | - Fixing a bug
* RebasingShayan-Najd2018-11-081-0/+0
|
* Merge branch 'master' of git://github.com/ghc/ghc into wip/shnajd-TTG-SrcLocsShayan-Najd2018-11-0839-1896/+1188
|\
| * Fix #15845 by defining etaExpandFamInstLHS and using itRyan Scott2018-11-089-34/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Both #9692 and #14179 were caused by GHC being careless about using eta-reduced data family instance axioms. Each of those tickets were fixed by manually whipping up some code to eta-expand the axioms. The same sort of issue has now caused #15845, so I figured it was high time to factor out the code that each of these fixes have in common. This patch introduces the `etaExpandFamInstLHS` function, which takes a family instance's type variables, LHS types, and RHS type, and returns type variables and LHS types that have been eta-expanded if necessary, in the case of a data family instance. (If it's a type family instance, `etaExpandFamInstLHS` just returns the supplied type variables and LHS types unchanged). Along the way, I noticed that many references to `Note [Eta reduction for data families]` (in `FamInstEnv`) had slightly bitrotted (they either referred to a somewhat different name, or claimed that the Note lived in a different module), so I took the liberty of cleaning those up. Test Plan: make test TEST="T9692 T15845" Reviewers: goldfire, bgamari Reviewed By: goldfire Subscribers: rwbarton, carter GHC Trac Issues: #15845 Differential Revision: https://phabricator.haskell.org/D5294
| * testsuite: Save performance metrics in git notes.David Eichmann2018-11-0721-1737/+1020
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes the following improvement: - Automatically records test metrics (per test environment) so that the programmer need not supply nor update expected values in *.T files. - On expected metric changes, the programmer need only indicate the direction of change in the git commit message. - Provides a simple python tool "perf_notes.py" to compare metrics over time. Issues: - Using just the previous commit allows performance to drift with each commit. - Currently we allow drift as we have a preference for minimizing false positives. - Some possible alternatives include: - Use metrics from a fixed commit per test: the last commit that allowed a change in performance (else the oldest metric) - Or use some sort of aggregate since the last commit that allowed a change in performance (else all available metrics) - These alternatives may result in a performance issue (with the test driver) having to heavily search git commits/notes. - Run locally, performance tests will trivially pass unless the tests were run locally on the previous commit. This is often not the case e.g. after pulling recent changes. Previously, *.T files contain statements such as: ``` stats_num_field('peak_megabytes_allocated', (2, 1)) compiler_stats_num_field('bytes allocated', [(wordsize(64), 165890392, 10)]) ``` This required the programmer to give the expected values and a tolerance deviation (percentage). With this patch, the above statements are replaced with: ``` collect_stats('peak_megabytes_allocated', 5) collect_compiler_stats('bytes allocated', 10) ``` So that programmer must only enter which metrics to test and a tolerance deviation. No expected value is required. CircleCI will then run the tests per test environment and record the metrics to a git note for that commit and push them to the git.haskell.org ghc repo. Metrics will be compared to the previous commit. If they are different by the tolerance deviation from the *.T file, then the corresponding test will fail. By adding to the git commit message e.g. ``` # Metric (In|De)crease <metric(s)> <options>: <tests> Metric Increase ['bytes allocated', 'peak_megabytes_allocated'] \ (test_env='linux_x86', way='default'): Test012, Test345 Metric Decrease 'bytes allocated': Test678 Metric Increase: Test711 ``` This will allow the noted changes (letting the test pass). Note that by omitting metrics or options, the change will apply to all possible metrics/options (i.e. in the above, an increase for all metrics in all test environments is allowed for Test711) phabricator will use the message in the description Reviewers: bgamari, hvr Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #12758 Differential Revision: https://phabricator.haskell.org/D5059
| * Revert "CircleCI: Build DWARF-enabled Linux bindists"Ben Gamari2018-11-072-30/+0
| | | | | | | | This reverts commit 406978c478e4b14e677f396499420d7b8e5d21fd.
| * Revert "Multiple fixes / improvements for LLVM backend"Ben Gamari2018-11-075-67/+62
| | | | | | | | This reverts commit adcb5fb47c0942671d409b940d8884daa9359ca4.
| * Revert "Fix for T14251 on ARM"Ben Gamari2018-11-072-90/+39
| | | | | | | | This reverts commit d8495549ba9d194815c2d0eaee6797fc7c00756a.
| * [LlvmCodeGen] Fixes for Int8#/Word8#Michal Terepeta2018-11-072-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes two isssues: - Using bitcast for MO_XX_Conv Arguments to a bitcast must be of the same size. We should be using `trunc` and `zext` instead. - Using unsupported MO_*_QuotRem for LLVM The two primops `MO_*_QuotRem` are not supported by the LLVM backend, so we shouldn't use them for `Int8#`/`Word8#` (just as we do not use them for `Int#`/`Word#`). Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com> Test Plan: manually run tests with WAY=llvm Reviewers: bgamari, simonmar Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15864 Differential Revision: https://phabricator.haskell.org/D5304
| * CircleCI: Build DWARF-enabled Linux bindistsBen Gamari2018-11-072-0/+30
| |
| * Bump directory submodule to 1.3.3.1Ben Gamari2018-11-071-0/+0
| |
| * integer-gmp: Fix TBA in changelogBen Gamari2018-11-071-1/+1
| |
| * Actually add test for #15859.Richard Eisenberg2018-11-051-0/+13
| | | | | | | | Oops. Forgot to `git add`.
* | [TTG: Handling Source Locations] Foundation and PatShayan-Najd2018-11-0844-733/+967
|/ | | | | | | | | | | Trac Issue: #15495 This patch removes the ping-pong style from `HsPat` (only, for now), using the plan laid out at https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations (solution A). - the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced - some instances of `HasSrcSpan` are introduced - some constructors `L` are replaced with `cL` - some patterns `L` are replaced with `dL` view pattern - some type annotation are necessarily updated updated (e.g., `Pat p` --> `Pat (GhcPass p)`)
* Fix #15859 by checking, not assuming, an ArgFlagRichard Eisenberg2018-11-053-6/+11
| | | | | | | | We thought that visible dependent quantification was impossible in terms, but Iceland Jack discovered otherwise in #15859. This fixes an ASSERT failure that arose. test case: dependent/should_fail/T15859
* Fix for Trac #15611: Scope errors lie about what modules are imported.roland2018-11-0411-12/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For the error message: Not in scope X.Y Module X does not export Y No module named ‘X’ is imported: there are 2 cases, where we don't show the last "no module named is imported" line: 1. If the module X has been imported. 2. If the module X is the current module. There are 2 subcases: 2.1 If the unknown module name is in a input source file, then we can use the getModule function to get the current module name. 2.2 If the unknown module name has been entered by the user in GHCi, then the getModule function returns something like "interactive:Ghci1", and we have to check the current module in the last added entry of the HomePackageTable. Test Plan: make test TESTS="T15611a T15611b" Reviewers: monoidal, hvr, thomie, dfeuer, bgamari, DavidEichmann Reviewed By: monoidal, DavidEichmann Subscribers: rwbarton, carter GHC Trac Issues: #15611 Differential Revision: https://phabricator.haskell.org/D5284
* Add Int8# and Word8#Michal Terepeta2018-11-0244-186/+1282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first step of implementing: https://github.com/ghc-proposals/ghc-proposals/pull/74 The main highlights/changes: primops.txt.pp gets two new sections for two new primitive types for signed and unsigned 8-bit integers (Int8# and Word8 respectively) along with basic arithmetic and comparison operations. PrimRep/RuntimeRep get two new constructors for them. All of the primops translate into the existing MachOPs. For CmmCalls the codegen will now zero-extend the values at call site (so that they can be moved to the right register) and then truncate them back their original width. x86 native codegen needed some updates, since it wasn't able to deal with the new widths, but all the changes are quite localized. LLVM backend seems to just work. This is the second attempt at merging this, after the first attempt in D4475 had to be backed out due to regressions on i386. Bumps binary submodule. Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com> Test Plan: ./validate (on both x86-{32,64}) Reviewers: bgamari, hvr, goldfire, simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5258
* rts: Add FALLTHROUGH macroBen Gamari2018-11-028-17/+25
| | | | | | | | | | | | | | | | | | | Instead of using the GCC `/* fallthrough */` syntax we now use the `__attribute__((fallthrough))`, which Phyx says should be more portable than the former. Also adds a missing fallthrough annotation in the MachO linker, fixing #14613. Reviewers: erikd, simonmar Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #14613 Differential Revision: https://phabricator.haskell.org/D5292
* rts: Allow output filename of eventlog to be given by command-lineBen Gamari2018-11-028-29/+99
| | | | | | | | | | | | | | | This introduces the `+RTS -ol` flag, which allows user to specify the destination file for eventlog output. Test Plan: Validate with included test Reviewers: simonmar, erikd Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5293
* base: Improve haddocks for FunctorSimon Jakobi2018-11-021-2/+5
|
* base: Misc haddock fixesSimon Jakobi2018-11-023-14/+14
| | | | (cherry picked from commit ee545ff44e0ba9a165de40807548c75bf181dda3)
* Bump time submoduleBen Gamari2018-11-026-2/+2
|
* users-guide: Update link to Safe Coercions paperBen Gamari2018-11-021-1/+1
| | | | Fixes #15841.
* Move eta-reduced coaxiom compatibility handling quirks into FamInstEnv.mniip2018-11-015-23/+55
| | | | | | | | | | | | | | | | | | | | The quirk caused an issue where GHC concluded that 'D' is possibly unifiable with 'D a' (the two types could have the same kind if D is a data family). Test Plan: Ensure T9371 stays fixed. Introduce T15704 Reviewers: goldfire, bgamari Reviewed By: goldfire Subscribers: RyanGlScott, rwbarton, carter GHC Trac Issues: #15704 Differential Revision: https://phabricator.haskell.org/D5206
* Add built-in syntax suggestions, and refactor to allow library useMatthías Páll Gissurarson2018-11-0112-244/+341
| | | | | | | | | | | | | | | | | | | | | Summary: This change to the valid hole fits adds built-in syntax candidates (like (:) and []), so that they are checked in addition to what is in scope. The rest is merely a refactor and export of the functions used to find the valid hole fits, since there was interest at ICFP to use the valid hole fit machinery for additional uses. By exporting the `tcFilterHoleFits` function, this can now be done without having to rely on parsing the actual error message. Test Plan: Test for built-in syntax included Reviewers: bgamari Reviewed By: bgamari Subscribers: RyanGlScott, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5227
* hadrian: build ghc-iserv-prof in addition to ghc-iservAlp Mestanogullari2018-11-013-15/+33
| | | | | | | | | | | | | | | | | | | As it is required for 10+ tests. Hadrian didn't give us a chance to build a given executable in vanilla and profiling, simultaneously, under two different names. This patch implements support for this in general and applies it to ghc-iserv[-prof]. Test Plan: scc001 fails without this patch, passes with it. Reviewers: snowleopard, bgamari Reviewed By: bgamari Subscribers: simonpj, ndmitchell, simonmar, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5255
* users-guide: Fix formatting of eventlog format documentationBen Gamari2018-11-011-0/+7
| | | | | | | | | | | | Test Plan: Read it Reviewers: mpickering Reviewed By: mpickering Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5264
* Data.Maybe: add callstack for fromJust (Trac #15559)Fangyi Zhou2018-11-016-5/+20
| | | | | | | | | | | | | | | | | | | | | Per feature request, add `HasCallStack` to `fromJust` in `Data.Maybe` and use `error` instead of `errorWithoutStackTrace`. This allows `fromJust` to print call stacks when throwing the error. Also add a new test case for the behaviour, modify existing test cases for new signature Test Plan: New test cases Reviewers: hvr, bgamari Reviewed By: bgamari Subscribers: ulysses4ever, rwbarton, carter GHC Trac Issues: #15559 Differential Revision: https://phabricator.haskell.org/D5256
* Lower precedence for {-# UNPACK #-}Vladislav Zavialov2018-11-0117-45/+177
| | | | | | | | | | Test Plan: Validate Reviewers: goldfire, bgamari Subscribers: osa1, mpickering, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5221
* Don't lint erroneous programs.Richard Eisenberg2018-11-014-2/+20
| | | | | | | | | | newFamInst lints its types. This is good. But it's not so good when there have been errors and thus recovery tycons are about. So we now don't. Fixes #15796. Test case: typecheck/should_fail/T15796
* Actually fail in failIfEmitsConstraintsRichard Eisenberg2018-11-017-40/+1
| | | | | | | | | | | | The function TcHsType.failIfEmitsConstraints says that it fails. It even does so in its name. But it didn't! It *reported* constraints but didn't fail. Now it does. This is important in tcHsClsInstType; see the comments therein. This was discovered while looking at #15797, but that ticket requires visible kind application to exhibit the bug; the test case will come with the patch for #12045.
* Fix embarrassing, egregious bug in roles of (->)Richard Eisenberg2018-11-012-2/+2
| | | | | | | | | | | | | | Previously, I had inexplicably decided that (->)'s roles were all Representational. But, of course, its first two parameters are *dependent* RuntimeReps. All dependent parameters have a Nominal role, because all roles in kinds are Nominal. Fix is easy, but I have no idea how the world hasn't come crashing down before now. This was found while investigating #15801, which requires visible type application in types to observe. Hence, the test case will come with the main patch for #12045.
* Revert "Add a RTS option -xp to load PIC object anywhere in address space"Ben Gamari2018-10-309-151/+94
| | | | This reverts commit 5403a8636fe82f971234873564f3a05393b89b7a.
* Revert "Allocate bss section within proper range of other sections"Ben Gamari2018-10-3016-132/+76
| | | | | | | | This reverts commit e019ec94f12268dd92ea5d5204e9e57e7ebf10ca. This sadly breaks the external interpreter on i386. For instance, see https://circleci.com/gh/ghc/ghc/10925.
* Fix docs typo in Bitraversable composition lawMark Seemann2018-10-301-1/+1
| | | | (cherry picked from commit 7c2bcc00e22ca8cebd9ffb2ee1741a86a5c4ebb9)
* circleci: Store test results of slow validation buildsBen Gamari2018-10-301-0/+1
|
* Add second test case for #15592Ryan Scott2018-10-303-0/+16
| | | | | | This adds a program from https://ghc.haskell.org/trac/ghc/ticket/15592#comment:9 (which briefly refused to typecheck on GHC HEAD) as a test case.
* Revert "Bump time submodule"Ben Gamari2018-10-301-0/+0
| | | | This reverts commit 0bdbbd4a637b169aa7043e0d9898ad1ecd5d14ef.
* Bump time submoduleBen Gamari2018-10-291-0/+0
|
* Correctly detect GIT in a subtreeSylvain Henry2018-10-291-1/+1
| | | | | | | When we use a git subtree, .git is a file, not a directory. The script was already fixed for the commit ID but not for its date. PR: https://github.com/ghc/ghc/pull/212/
* circleci: Build with in-tree GMP on DarwinBen Gamari2018-10-291-1/+3
| | | | | | Fixes #15404. (cherry picked from commit 578012be13eb1548050d51c0a23bd1a98423f03e)
* Improve documentation for warning optionsNathan Collins2018-10-291-4/+11
| | | | | | | | | | | | | My main goal was to make it easy to discover how to reverse `-Werror`, since `Wno-error` doesn't work, and the fact that `-Wwarn` negates `-Werror` was only mentioned in the `-Wwarn` docs before. Other changes: - explain at the outset that some options control individual warnings while others control warning families. - explain at the outset that `-Wno-<wflag>` can be used to reverse `-W<wflag>`. This is no mentioned in two places, but I don't think that's a bad thing.
* Docs: clarify the interaction between throwSTM and catchSTM.Ian Denhardt2018-10-291-2/+12
| | | | | | | The previous doc comments were not terribly clear on what was or wasn't rolled back when an exception was caught in STM. This misunderstanding was the source of a bug in another project of mine, and folks on `#haskell` found it confusing as well.
* Fix sample code of -fprint-explicit-kinds, plus sample when disabling PolyKindsYuji Yamamoto2018-10-291-7/+10
| | | | | | | | | | - Although the sample is for `-fprint-explicit-kinds`, the sample code uses `-fprint-explicit-foralls` (but perhaps the output used to be correct one of `-fprint-explicit-kinds`). - Update the output with the recent version of GHC (ver. 8.4.3. I guess it doesn't change in GHC 8.6...) - Add more samples to clarify the difference of kinds, which tells effect of `-fprint-explicit-kinds` more clearly.
* users guide: Introduce :pragma: directiveBen Gamari2018-10-292-75/+158
|
* users guide: Mention :since: in editing-guideBen Gamari2018-10-291-0/+2
|
* Fix #15815 by parenthesizing the arguments to infix ~Ryan Scott2018-10-294-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An unfortunate consequence of commit b9483981d128f55d8dae3f434f49fa6b5b30c779 (`Remove HsEqTy and XEqTy`) is infix uses of `~` in TH quotes now desugar differently than before. In particular, we have that: ```haskell a ~ (Int -> Int) ``` Now desugars to: ```haskell HsOpTy a (~) (HsOpTy Int (->) Int) ``` Which GHC interprets as being: ```haskell a ~ Int -> Int ``` Or, equivalently: ```haskell (a ~ Int) -> Int ``` Which is different than what was intended! This is the cause of #15815. All of this has revealed that we likely need to renovate the way we desugar infix type operators to be more consistent with the treatment for infix expressions (see https://ghc.haskell.org/trac/ghc/ticket/15815#comment:5 for more on this.) Doing so would constitute a breaking change, however, so we will likely want to wait until another major GHC release to do this. In the meantime, this patch offers a non-invasive change to the way that infix uses of `~` are desugared. This makes the program in #15815 compile again by inserting extra `HsParTy`s around the arguments to `~` if they are lacking them. Test Plan: make test TEST=T15815 Reviewers: int-index, goldfire, bgamari Reviewed By: int-index Subscribers: int-e, rwbarton, carter GHC Trac Issues: #15815 Differential Revision: https://phabricator.haskell.org/D5274
* Add a test case for #15829Ryan Scott2018-10-292-0/+10
| | | | | | This happened to get fixed as a consequence of commit 5e45ad10ffca1ad175b10f6ef3327e1ed8ba25f3. This adds a test case to ensure that it stays fixed.
* Revert "Remove kind generalisation from tcRnType"Richard Eisenberg2018-10-292-6/+18
| | | | | | | | | This reverts commit 3a51abd04432ea3d13e4ea3c5a592f038bd57432. I had hit the wrong button when trying to validate the original commit... and ended up committing it prematurely instead. This reversion commit also updates the comments to explain why we kind-generalise.
* Test #15076 in dependent/should_compile/T15076*Richard Eisenberg2018-10-295-0/+55
|