summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Rearrange error msgs and add section markers (Trac #11014).Evan Laforge2015-11-24148-590/+690
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This puts the "Relevant bindings" section at the end. It uses a TcErrors.Report Monoid to divide messages by importance and then mappends them together. This is not the most efficient way since there are various intermediate Reports and list appends, but it probably doesn't matter since error messages shouldn't get that large, and are usually prepended. In practice, everything is `important` except `relevantBindings`, which is `supplementary`. ErrMsg's errMsgShortDoc and errMsgExtraInfo were extracted into ErrDoc, which has important, context, and suppelementary fields. Each of those three sections is marked with a bullet character, '•' on unicode terminals and '*' on ascii terminals. Since this breaks tons of tests, I also modified testlib.normalise_errmsg to strip out '•'s. --- Additional notes: To avoid prepending * to an empty doc, I needed to filter empty docs. This seemed less error-prone than trying to modify everyone who produces SDoc to instead produce Maybe SDoc. So I added `Outputable.isEmpty`. Unfortunately it needs a DynFlags, which is kind of bogus, but otherwise I think I'd need another Empty case for SDoc, and then it couldn't be a newtype any more. ErrMsg's errMsgShortString is only used by the Show instance, which is in turn only used by Show HscTypes.SourceError, which is in turn only needed for the Exception instance. So it's probably possible to get rid of errMsgShortString, but that would a be an unrelated cleanup. Fixes #11014. Test Plan: see above Reviewers: austin, simonpj, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: simonpj, nomeata, thomie Differential Revision: https://phabricator.haskell.org/D1427 GHC Trac Issues: #11014
* Implement new `-fwarn-noncanonical-monad-instances`Herbert Valerio Riedel2015-11-248-1/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | Warn about incoherent/non-canonical 'Applicative'/'Monad' instance declarations. Specifically the following invariants are checked: In 'Monad' instances declarations warn if the any of the following conditions does not hold: * If `return` is overridden it must be canonical (i.e. `return = pure`). * If `(>>)` is overridden it must be canonical (i.e. `(>>) = (*>)`). In 'Applicative' instance declarations: * Warn if 'pure' is defined backwards (i.e. `pure = return`). * Warn if '(*>)' is defined backwards (i.e. `(*>) = (>>)`). NB, this warning flag is not enabled via `-Wall` nor `-Wcompat`. This addresses #11128 Reviewers: quchen, austin, bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D1516
* Add `PrelNames.thenAName` for `Applicative(*>)`Herbert Valerio Riedel2015-11-242-12/+18
| | | | | | | | | | | This is needed to allow subsequent patches to refer to `*>`. While at it, this commit also groups together the `Applicative` definitions to reduce confusion. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D1513
* rts: Always export Libdw* symbolsBen Gamari2015-11-231-4/+0
| | | | | | | | | | | | | Otherwise we'll get link time failures as `base` always builds `GHC.ExecutionStack`. Test Plan: Validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1519
* Add the rest of the notes for Located RdrNameAlan Zimmerman2015-11-234-2/+18
|
* Add tests/monadfail/MakefileSimon Peyton Jones2015-11-231-0/+3
|
* Improve constraint-used-as-type error msgSimon Peyton Jones2015-11-238-43/+58
| | | | | | This responds to Trac #11112 by improving the error message when the kind checker discovers something of kind Constraint used when a type is expected
* Output source notes in extended DWARF DIEsBen Gamari2015-11-234-29/+125
| | | | | | | | In order to accomplish this we need to ensure that emit DIEs for all DebugBlocks, even those that have been optimized out, lest we end up with undefined symbols of parents at link time. Differential Revision: https://phabricator.haskell.org/D1279
* Dwarf: Ensure tick parentage is preservedBen Gamari2015-11-232-8/+45
| | | | Differential Revision: https://phabricator.haskell.org/D1387
* Support multiple debug output levelsBen Gamari2015-11-2311-23/+33
| | | | | | | | | We now only strip block information from DebugBlocks when compiling with `-g1`, intended to be used when only minimal debug information is desired. `-g2` is assumed when `-g` is passed without any integer argument. Differential Revision: https://phabricator.haskell.org/D1281
* base: Add Haskell interface to ExecutionStackBen Gamari2015-11-234-0/+287
| | | | Differential Revision: https://phabricator.haskell.org/D1198#40948
* rts: Add LibdwPool, a pool for libdw sessionsBen Gamari2015-11-236-1/+109
| | | | Differential Revision: https://phabricator.haskell.org/D1198#40948
* rts: Add simple resource poolBen Gamari2015-11-232-0/+234
|
* rts: Expose more libdw symbolsBen Gamari2015-11-234-19/+37
|
* Libdw: Fix initial register collection on i386Ben Gamari2015-11-231-1/+2
| | | | RIP-relative addressing isn't available on i386.
* Libdw: Fix build on 32-bit platformsBen Gamari2015-11-231-5/+6
| | | | | | The casting here is a bit tricky since Dwarf_Addr is always 64-bits. This means we first need to narrow to uintptr_t before casting to/from a pointer for compatibility on 32-bit architectures.
* Add a note explaining why every RdrName is LocatedAlan Zimmerman2015-11-231-0/+1
|
* Rip out Papi configure checkBen Gamari2015-11-231-7/+0
|
* build.mk.sample: Document meaning of WERRORBen Gamari2015-11-231-1/+2
| | | | | | | | | 31bcf9b62ceaed98bdd3b7605e68d315bcff0c8a changed the behavior of WERROR such that it would only apply to the stage 2 build. The reason for this was to avoid silly redundant imports and such breaking validation on different bootstrap compiler versions. Document the fact that WERROR now only applies to the stage 2 build.
* Make abstractVars deterministic in SetLevelBartosz Nitka2015-11-237-16/+94
| | | | | | | | | | | | | | | | | | | | This fixes a non-determinism bug where depending on the order of uniques allocated, the type variables would be in a different order when abstracted for the purpose of lifting out an expression. Test Plan: I've added a new testcase that reproduces the problem ./validate Reviewers: simonmar, austin, bgamari, simonpj Reviewed By: simonpj Subscribers: nomeata, thomie Differential Revision: https://phabricator.haskell.org/D1504 GHC Trac Issues: #4012
* ApiAnnotations: Make all RdrName occurences LocatedAlan Zimmerman2015-11-2339-258/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment the API Annotations can only be used on the ParsedSource, as there are changes made to the RenamedSource that prevent it from being used to round trip source code. It is possible to build a map from every Located Name in the RenamedSource from its location to the Name, which can then be used when resolved names are required when changing the ParsedSource. However, there are instances where the identifier is not located, specifically (GHC.VarPat name) (GHC.HsVar name) (GHC.UserTyVar name) (GHC.HsTyVar name) Replace each of the name types above with (Located name) Updates the haddock submodule. Test Plan: ./validate Reviewers: austin, goldfire, bgamari Reviewed By: bgamari Subscribers: goldfire, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1512 GHC Trac Issues: #11019
* New expected test output for 32 bit platformsErik de Castro Lopo2015-11-2312-0/+519
| | | | | | | | | | Test Plan: Test on Arm and PowerPc. Reviewers: bgamari, thomie, austin Differential Revision: https://phabricator.haskell.org/D1510 GHC Trac Issues: #11060
* Add comment to Parser.y re extra API AnnotationAlan Zimmerman2015-11-221-1/+17
| | | | Document extra AnnRarrow annotation on a HsFunTy
* Follow-up fix to 3e2a4eefbed7002437c3f (re #11109)Herbert Valerio Riedel2015-11-221-1/+1
| | | | | | | | | | | Using `:` as sed-`s`-expr separator is not a good idea on windows, as this can result in an expression like 's:@INSTALL@:$(subst ../install-sh,E:/msys64/home/foo/ghc/install-sh,@INSTALL@):g' (note the `E:/` drive component) Using `|` instead of `:` has less risk of collision with the substitution expression
* Remove accidentally added T10359 blobHerbert Valerio Riedel2015-11-222-0/+1
| | | | | | | | | | | This sneaked in via 2325bd4e0fad0e5872556c5a78d1a6a1873e7201 / D1468 / #4012 This is frustrating... we've added a useless 2.4MiB binary blob to our Git history which wastes *everyones* bandwidth for eternity (unless we truncate or rewrite history). We should add lint-checks and/or a pre-receive commit hook test to prevent this in future.
* Function definition in GHCiRoman Shatsov2015-11-2110-39/+123
| | | | | | | | | | | | | | | | | | This patch allows define and re-define functions in ghci. `let` is not required anymore (but can be used). Idea: If ghci input string can be parsed as statement then run it as statement else run it as declaration. Reviewers: mpickering, bgamari, austin Reviewed By: mpickering, bgamari, austin Subscribers: hvr, mpickering, dterei, thomie Differential Revision: https://phabricator.haskell.org/D1299 GHC Trac Issues: #7253
* Create a deterministic version of tyVarsOfTypeBartosz Nitka2015-11-2127-431/+610
| | | | | | | | | | | | | | | | | | | | | | | | I've run into situations where I need deterministic `tyVarsOfType` and this implementation achieves that and also brings an algorithmic improvement. Union of two `VarSet`s takes linear time the size of the sets and in the worst case we can have `n` unions of sets of sizes `(n-1, 1), (n-2, 1)...` making it quadratic. One reason why we need deterministic `tyVarsOfType` is in `abstractVars` in `SetLevels`. When we abstract type variables when floating we want them to be abstracted in deterministic order. Test Plan: harbormaster Reviewers: simonpj, goldfire, austin, hvr, simonmar, bgamari Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1468 GHC Trac Issues: #4012
* Add DVarSet - a deterministic set of VarsBartosz Nitka2015-11-215-12/+313
| | | | | | | | | | | | | | | | | | | | | | | This implements `DVarSet`, a deterministic set of Vars, with an interface very similar to `VarSet` with a couple of functions missing. I will need this in changes that follow, one of them will be about changing the type of the set of Vars that `RuleInfo` holds to make the free variable computation deterministic. Test Plan: ./validate I can add new tests if anyone wants me to. Reviewers: simonpj, simonmar, austin, bgamari Reviewed By: simonmar, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1487 GHC Trac Issues: #4012
* Suppress conflicting types for builtins warningsHerbert Valerio Riedel2015-11-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 4.0 and later warn about type-conflicting prototypes for built-in functions such as `strlen`. This is a problem for the via-c backend as it generates code such as typedef void *(*(*StgFunPtr)(void))(void); extern StgFunPtr strlen(); However, by using the `-fno-builtin` flag, GCC is told not to try to auto-detect such built-in functions and instead treat them as ordinary external functions. This also suppresses this warning. This address #7660 Test Plan: IIAM Reviewers: bgamari, austin Reviewed By: austin Subscribers: thomie, erikd Differential Revision: https://phabricator.haskell.org/D1506 GHC Trac Issues: #7660
* RtsFlags: Fix const warningBen Gamari2015-11-214-11/+18
| | | | | | | | | | Reviewers: austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1509
* Fix Windows builds after D1242Tamar Christina2015-11-211-1/+5
| | | | | | | | | | | | | | | | | | | | | | | Summary: Only use the merge_sections.ld linker script if SplitSections is enabled. I thought I had a way to make the linker script actually work on Windows and produce object files instead of image files (by using the "INSERT AFTER" linker script command to get the default script's output format setting), but that fix caused ghci to crash with an illegal instruction on startup. Gave up and made a simpler fix of just disabling this for normal builds, as it's only really relevant with SplitSections enabled anyway. Reviewers: austin, thomie, bgamari Reviewed By: austin, thomie Subscribers: Phyx, thomie Differential Revision: https://phabricator.haskell.org/D1505 GHC Trac Issues: #8405
* Follow-up fixup to c5d8162d230c373Herbert Valerio Riedel2015-11-201-1/+1
| | | | | | This was missing from c5d8162d230c373b2b49ec94d3f9a027ff6e2dd6 / D1501 for some reason causing the AIX detection to result in `OSUnknown` rather than `OSAIX`.
* base: Delete errant GHC/Stack.hscBen Gamari2015-11-202-133/+1
| | | | | | This was added in 8988be8561ce0857f3befd6ab3b6c29060685c0a, probably due to an incorrect merge resolution. The build system has been building `Stack.hs`.
* users-guide: Fix version numberBen Gamari2015-11-201-1/+1
| | | | | Previously used GhcVersion, which is apparently the version of the bootstrap compiler. ProjectVersion appears to be the thing to use here.
* user's guide: Fix some accidental triple-` quoteHerbert Valerio Riedel2015-11-204-5/+5
| | | | | | Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D1503
* ghci: don't let ctags/etags overwrite source filesAustin Seipp2015-11-206-6/+44
| | | | | | | | | | | | | A ource file which was accidently passed as parameter into `:ctags` or `:etags` can be overwritten by tag data. This patch updates documentation to avoid confusion in commands usage and prevents `collateAndWriteTags` from modifying existing source files. Reviewed By: thomie, bgamari, austin Differential Revision: https://phabricator.haskell.org/D1471 GHC Trac Issues: #10989
* Pattern Synonym DocumentationMatthew Pickering2015-11-192-27/+183
| | | | | | | | | | | | | | | | | | Summary: This patch adds documentation for record pattern synonyms (D1258) and bundling pattern synonyms with type constructors in export lists (D1152). There are also other small improvements motivated by #10900. Reviewers: goldfire, bgamari, austin Reviewed By: bgamari Subscribers: goldfire, thomie Differential Revision: https://phabricator.haskell.org/D1325 GHC Trac Issues: #10900
* Bump process submoduleBen Gamari2015-11-191-0/+0
|
* Unbreak Text.Read.Lex.lex on Unicode symbolsM Farkas-Dyck2015-11-191-4/+15
| | | | | | | | | | | | Reviewers: thomie, hvr, austin, bgamari Reviewed By: bgamari Subscribers: bgamari, thomie Differential Revision: https://phabricator.haskell.org/D1480 GHC Trac Issues: #10444
* Set AIX specific CFLAGS flagsHerbert Valerio Riedel2015-11-192-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | First of all, we need to use -mminimal-toc on IBM AIX AIX's XCOFF is limited to 16k entries in its TOC for 32bit compilation, which quickly overflows with GHC's code generation. Otoh, the Parser.hs module contains more entries than fit into a minimal-toc, so we need to switch back to `-mfull-toc` for that single module again. Then, we also need to set the `THREAD_SAFE` CPP #define in order to unlock the thread-safe `errno` which is essential for the threaded runtime. Depends on D1501 Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie, erikd Differential Revision: https://phabricator.haskell.org/D1502
* Make GHC aware of OSAIX and AixLDHerbert Valerio Riedel2015-11-194-1/+14
| | | | | | | | | | | | | | GHC needs to be aware of targetting AIX because AIX requires some special handling for the toolchain (similiar to Solaris) Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie, erikd Differential Revision: https://phabricator.haskell.org/D1501
* derivedConstants: Add support for AIXHerbert Valerio Riedel2015-11-191-2/+26
| | | | | | | | | | | | | | | On IBM AIX `nm` doesn't support reporting symbol sizes, so we need to resort to `objdump` instead, which has a peculiar output format on AIX. depends on D1499 Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: kgardas, thomie Differential Revision: https://phabricator.haskell.org/D1500
* Make `derivedConstants` more crosscompile-friendlyHerbert Valerio Riedel2015-11-193-13/+39
| | | | | | | | | | | | | | | | | | `derivedConstants` currently uses `System.Info.os` for decisions (which doesn't necessarily reflect the build-target), as well as hardcoding "/usr/bin/objdump" for openbsd. This patch auto-detects `objdump` similiar to how `nm` is detected via Autoconf as well as passing the target-os into `derivedConstants` via commandline. Reviewers: austin, kgardas, erikd, bgamari Reviewed By: kgardas, erikd, bgamari Subscribers: kgardas, thomie, erikd Differential Revision: https://phabricator.haskell.org/D1499
* Fix broken build-system when libffi uses install-shHerbert Valerio Riedel2015-11-191-0/+5
| | | | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1494 GHC Trac Issues: #11109
* Fix interaction of DuplicateRecordFields and GHC.GenericsAdam Gundry2015-11-194-2/+56
| | | | | | | | | | | | | | | | | | This prevents GHC.Generics from exposing mangled selector names when used on a datatype defined with DuplicateRecordFields enabled. Test Plan: New test overloadedrecflds_generics, which tests that both GHC.Generics and Data.Data use the correct field labels, not mangled names. Reviewers: kosmikus, simonpj, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1486
* Release Notes: Mention out-of-scope error message improvementsJoachim Breitner2015-11-191-0/+3
| | | | | | Summary: as implemented for #11071. Differential Revision: https://phabricator.haskell.org/D1498
* Mention "-XMonadFailDesugaring" in the docsDavid Luposchainsky2015-11-182-5/+6
| | | | | | | | Reviewers: austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1496
* Correct > to > in user's guideReid Barton2015-11-181-3/+3
| | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1497
* users-guide: Move <h1> outside of <a> tagBen Gamari2015-11-181-1/+1
| | | | | Otherwise the header extends across the entire body, increasing the chance that the user hits it instead of the "next" link below it.
* Fix inconsistent pretty-printing of type familiesMichał Sośnicki2015-11-1847-196/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | After the changes, the three functions used to print type families were identical, so they are refactored into one. Original RHSs of data instance declarations are recreated and printed in user error messages. RHSs containing representation TyCons are printed in the Coercion Axioms section in a typechecker dump. Add vbar to the list of SDocs exported by Outputable. Replace all text "|" docs with it. Fixes #10839 Reviewers: goldfire, jstolarek, austin, bgamari Reviewed By: jstolarek Subscribers: jstolarek, thomie Differential Revision: https://phabricator.haskell.org/D1441 GHC Trac Issues: #10839