summaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* ghc allow --show-options and --interactive togetherwip/mergeLennart Kolmodin2014-11-204-580/+644
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously --show-options showed all options that GHC accepts. Now, it'll only show the options that have effect in non-interactive modes. This change also adds support for using --interactive together with --show-options, making it show all options that have effect in the interactive mode. The CmdLineParser is updated to know about ghc modes, and then each flag is annotated with which mode it has effect. This fixes #9259. Test Plan: Try out --show-options with --interactive on the command line. With and without --interactive should give different results. Reviewers: austin Reviewed By: austin Subscribers: jstolarek, thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D337 GHC Trac Issues: #9259 Conflicts: compiler/main/DynFlags.hs
* Revert change to alias handling in ppLlvmGlobal introduced in d87fa34, which ↵Luke Iannini2014-11-201-1/+1
| | | | | | requires LLVM 3.6. Signed-off-by: Austin Seipp <austin@well-typed.com>
* AST changes to prepare for API annotations, for #9628Alan Zimmerman2014-11-2043-612/+856
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: AST changes to prepare for API annotations Add locations to parts of the AST so that API annotations can then be added. The outline of the whole process is captured here https://ghc.haskell.org/trac/ghc/wiki/GhcAstAnnotations Test Plan: sh ./validate Reviewers: austin, simonpj Reviewed By: simonpj Subscribers: thomie, goldfire, carter Differential Revision: https://phabricator.haskell.org/D426 GHC Trac Issues: #9628 Conflicts: compiler/parser/RdrHsSyn.hs
* Implement #5462 (deriving clause for arbitrary classes)Jose Pedro Magalhaes2014-11-204-25/+99
| | | | | | | | | | | | | | Summary: (this has been submitted on behalf on @dreixel) Reviewers: simonpj, hvr, austin Reviewed By: simonpj, austin Subscribers: goldfire, thomie, carter, dreixel Differential Revision: https://phabricator.haskell.org/D476 GHC Trac Issues: #5462
* Add flag `-fwarn-missing-exported-sigs`Eric Seidel2014-11-203-10/+33
| | | | | | | | | | | | | | | | | | | Summary: add `-fwarn-missing-exported-sigs` to only warn about missing signatures if the name is exported Test Plan: validate, see testsuite/tests/warnings/should_compile/T2526.hs Reviewers: ezyang, austin, thomie Reviewed By: austin, thomie Subscribers: ezyang, thomie, carter Differential Revision: https://phabricator.haskell.org/D482 GHC Trac Issues: #2526 Conflicts: docs/users_guide/7.10.1-notes.xml
* Fix #9209, by reporting an error instead of panicking on bad splices.Richard Eisenberg2014-11-202-31/+41
|
* Kill trailing whitespaceJan Stolarek2014-11-203-27/+27
|
* Split SynTyCon to SynonymTyCon and FamilyTyConJan Stolarek2014-11-2028-342/+489
| | | | | | | | | | | | | | This patch refactors internal representation of type synonyms and type families by splitting them into two separate data constructors of TyCon data type. The main motivation is is that some fields make sense only for type synonyms and some make sense only for type families. This will be even more true with the upcoming injective type families. There is also some refactoring of names to keep the naming constistent. And thus tc_kind field has become tyConKind and tc_roles has become tcRoles. Both changes are not visible from the outside of TyCon module. Updates haddock submodule Reviewers: simonpj Differential Revision: https://phabricator.haskell.org/D508 GHC Trac Issues: #9812
* Implement typechecker pluginsAdam Gundry2014-11-2015-108/+544
| | | | | | | | | | | | | | | | | | | | Summary: See https://ghc.haskell.org/trac/ghc/wiki/Plugins/TypeChecker This is based on work by Iavor Diatchki and Eric Seidel. Test Plan: validate Reviewers: simonpj, austin Reviewed By: austin Subscribers: gridaphobe, yav, thomie, carter Differential Revision: https://phabricator.haskell.org/D489 Conflicts: docs/users_guide/7.10.1-notes.xml
* Add support for pattern synonym type signatures.Dr. ERDI Gergo2014-11-2012-259/+415
| | | | | | | | | | | | Syntax is of the form pattern P :: (Prov b) => (Req a) => a -> b -> Int -> T a which declares a pattern synonym called `P`, with argument types `a`, `b`, and `Int`, and result type `T a`, with provided context `(Prov b)` and required context `(Req a)`. The Haddock submodule is also updated to use this new syntax in generated docs.
* Update shift/reduce conflict number in parserDr. ERDI Gergo2014-11-201-0/+12
|
* Make calling conventions in template haskell Syntax.hs consistent with those ↵Luite Stegeman2014-11-193-26/+39
| | | | | | | | | | | | | | | | | | in ghc ForeignCall.hs this impliments #9703 from ghc trac Test Plan: still needs tests Reviewers: cmsaperstein, ekmett, goldfire, austin Reviewed By: goldfire, austin Subscribers: goldfire, thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D353 GHC Trac Issues: #9703
* ghc generates more user-friendly error messagesMike Izbicki2014-11-193-1/+54
| | | | | | | | | | Test Plan: Compiled ghc fine. Opened ghci and fed it invalid code. It gave the improved error messages in response. Reviewers: austin Subscribers: thomie, simonpj, spacekitteh, rwbarton, simonmar, carter Differential Revision: https://phabricator.haskell.org/D201
* arm64: 64bit iOS and SMP support (#7942)Luke Iannini2014-11-199-1/+23
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* compiler/main: fixes #9776Carlos Tomé2014-11-191-1/+2
| | | | | | | | | | | | | | Test Plan: test T9776 under tests/driver Reviewers: jstolarek, austin Reviewed By: jstolarek, austin Subscribers: jstolarek, thomie, carter Differential Revision: https://phabricator.haskell.org/D503 GHC Trac Issues: #9776
* use correct word size for shiftRightLogical and removeOp32Luite Stegeman2014-11-191-16/+26
| | | | | | | | | | | | | | | | | | | | | | Summary: shiftRightLogical used a host sized Word for the intermediate value, which would produce the wrong result when cross compiling to a target with a different word size than the host. removeOp32 used the preprocessor to bake in word size assumptions, rather than getting the target word size from DynFlags Test Plan: validate Reviewers: hvr, rwbarton, carter, austin Reviewed By: austin Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D502 GHC Trac Issues: #9736
* make TcRnMonad.lhs respect -ddump-to-fileGreg Weber2014-11-194-40/+69
| | | | | | | | | | | | | | | | | | | | | Summary: allows things such as: -ddump-to-file -ddump-splices Test Plan: compile with flags -ddump-to-file -ddump-splices verify that it does output an extra file Try out other flags. I noticed that with -ddump-tc there is some output going to file and some to stdout. Reviewers: hvr, austin Reviewed By: austin Subscribers: simonpj, thomie, carter Differential Revision: https://phabricator.haskell.org/D460 GHC Trac Issues: #9126
* Allow -dead_strip linking on platforms with .subsections_via_symbolsMoritz Angermann2014-11-195-19/+26
| | | | | | | | | | | | | | | | | Summary: This allows to link objects produced with the llvm code generator to be linked with -dead_strip. This applies to at least the iOS cross compiler and OS X compiler. Signed-off-by: Moritz Angermann <moritz@lichtzwerge.de> Test Plan: Create a ffi library and link it with -dead_strip. If the resulting binary does not crash, the patch works as advertised. Reviewers: rwbarton, simonmar, hvr, dterei, mzero, ezyang, austin Reviewed By: dterei, ezyang, austin Subscribers: thomie, mzero, simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D206
* Turn CoreWriter into a newtype; fix commentDavid Feuer2014-11-191-8/+11
| | | | | | | | | | | | | | | Summary: Turn CoreWriter into a newtype. A comment claimed something is forced before returning, but it's actually not. Change comment to match reality. Reviewers: xich, simonpj, ezyang, austin Reviewed By: ezyang, austin Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D453
* Implement new Foldable methods for HsPatSynDetailsDavid Feuer2014-11-191-1/+20
| | | | | | | | | | | | Summary: Also explicitly define foldl1 and foldr1, which should generally work better with list-specific versions. Reviewers: austin Reviewed By: austin Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D430
* Refactor: use System.FilePath.splitSearchPathThomas Miedema2014-11-192-27/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: To address #2521 ("Trailing colon on GHC_PACKAGE_PATH doesn't work with ghc-pkg"), we were using a custom version of splitSearchPath (e4f46f5de). This solution however caused issue #9698 ("GHC_PACKAGE_PATH should be more lenient for empty paths"). This patch reverts back to System.FilePath.splitSearchPath (fixes #9698) and adresses (#2521) by testing for a trailing search path separators explicitly (instead of implicitly using empty search path elements). Empty paths are now allowed (ignored on Windows, interpreted as current directory on Posix systems), and trailing path separator still tack on the user and system package databases. Also update submodule filepath, which has a version of splitSearchPath which handles quotes in the same way as our custom version did. Test Plan: $ GHC_PACKAGE_PATH=/::/home: ./ghc-pkg list ... db stack: ["/",".","/home","<userdb>","<systemdb>"] ... Reviewers: austin Reviewed By: austin Subscribers: thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D414 GHC Trac Issues: #2521, #9698
* Support for "with" renaming syntax, and output a feature flag.Edward Z. Yang2014-11-182-22/+20
| | | | | | | | | | | | | | | | | | | Summary: - Feature flag indicates to Cabal that we support thinning and renaming as it needs. - Support -package "base with (Foo as Bar)" which brings the ordinary modules into scope, as well as adding the renamings to scope. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D485
* When outputting list of available instances, sort it.Edward Z. Yang2014-11-182-2/+18
| | | | | | | | | | | | | | | | | Summary: The intent of this commit is to make test suite cases more stable, so that it doesn't matter what order we load interface files in, the test output doesn't change. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D484
* Comments onlySimon Peyton Jones2014-11-183-22/+6
|
* Fix detection of GNU gold linker if invoked via gcc with parametersSebastian Dröge2014-11-181-2/+5
| | | | | | | | | | | Previously the linker was called without any commandline parameters to detect whether bfd or gold is used. However the -fuse-ld parameter can be used to switch between gold and bfd and should be taken into account here. Trac #9336 Signed-off-by: Austin Seipp <austin@well-typed.com>
* Disable AVX for LLVM 3.2 by default (#9391)Peter Wortmann2014-11-181-5/+11
| | | | | | | | | Due to a bug LLVM generates a C-like frame pointer prelude for functions that use AVX instructions. This causes programs using the GHC calling convention to crash, therefore we simply disable them. People that want to use AVX should consider upgrading to a more current LLVM version. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Update comment about C helper for foreign exports (#9713)Bertram Felgenhauer2014-11-181-2/+6
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Outputable instance for IfaceVectInfoMateusz Kowalczyk2014-11-181-0/+10
|
* Whitespace onlyMateusz Kowalczyk2014-11-181-8/+8
|
* Add a note why tcGetInstEnvs is duplicated.Edward Z. Yang2014-11-171-1/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Remove optimized package lookup, simplifying code.Edward Z. Yang2014-11-171-49/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: A while back when I was refactoring the package code, I tried to solve a performance problem by introducing a fastpath for module lookups. Well, it turned out the performance problem was unrelated, but I kept the optimization because it seemed vaguely useful. In this commit, I remove the optimization because I don't really think it's buying us much and it increased code complexity. ToDo: Inline mkModuleToPkgConfGeneric into mkModuleToPkgConfAll Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin Reviewed By: austin Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D434
* Adding dedicated Show instances for SrcSpan/SrcLocAlan Zimmerman2014-11-171-3/+17
| | | | | | | | | | | | | | | | | | | Summary: The derived Show instances for SrcSpan and SrcLoc are very verbose. This patch replaces them with hand-made ones which use positional syntax for the record constructors, rather than exhaustively listing each one. Test Plan: sh ./validate Reviewers: austin Reviewed By: austin Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D445
* Docs onlyEdward Z. Yang2014-11-175-12/+31
| | | | | | | | | | | | | | Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: n/a Reviewers: austin, Mikolaj Reviewed By: austin, Mikolaj Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D446
* Generalize exposed-modules field in installed package databaseEdward Z. Yang2014-11-152-14/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Instead of recording exposed-modules and reexported-modules as seperate fields in the installed package database, this commit merges them into a single field (exposed-modules). The motivation for this change is in preparation for the inclusion of *signatures* into the installed package database, which may also be reexported. Merging the representation means that we can treat reexports uniformly, no matter if they're a normal module or a signature. This commit adds a stub for signatures, but that code isn't wired up to anything yet. Contains Cabal submodule update to accommodate these changes. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, duncan, austin Subscribers: thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D421
* Partially revert 475dd93efaAustin Seipp2014-11-141-2/+1
| | | | | | | This introduces ./validate failures for Windows right now, so in the mean time let's just back this flag out as a default -Wall flag. Signed-off-by: Austin Seipp <austin@well-typed.com>
* When calling the success continuation of a matcher, pass existential tyvarsDr. ERDI Gergo2014-11-131-3/+3
| | | | as type arguments, not value arguments
* nlHsTyApps: for applying a function both on type- and term-level argumentsDr. ERDI Gergo2014-11-131-1/+4
|
* Apply compulsory unfoldings during desugaring, except for `seq` which is ↵Dr. ERDI Gergo2014-11-131-1/+21
| | | | | | special. See Note [Unfolding while desugaring] for the rationale.
* If pattern synonym is bidirectional and its type is some unboxed type T#,Dr. ERDI Gergo2014-11-139-87/+173
| | | | | generate a worker function of type Void# -> T#, and redirect the wrapper (via a compulsory unfolding) to the worker. Fixes #9732.
* Fix typo in panic messageDr. ERDI Gergo2014-11-131-1/+1
|
* Add `--fwarn-trustworthy-safe` to `-Wall`David Terei2014-11-121-1/+2
| | | | | Update submodule haskell2010, haskell98, hoop, hpc and stm to fix new warnings.
* Add in `-fwarn-trustworthy-safe` flag.David Terei2014-11-122-57/+106
| | | | | This warns when a module marked as `-XTrustworthy` could have been inferred as safe instead.
* Remove a stray Trustworthy flag in ghc.David Terei2014-11-121-1/+0
|
* Fix #9404 by removing tcInfExpr.Richard Eisenberg2014-11-125-49/+76
| | | | | | See the ticket for more info about the new algorithm. This is a small simplification, unifying the treatment of type checking in a few similar situations.
* Fix #9788 by giving `coerce` the right type.Richard Eisenberg2014-11-121-11/+8
| | | | | No test case added, as the original mistake is just one level up from a typo.
* Fix #9204 by outputting extra info on boot file mismatch.Richard Eisenberg2014-11-121-48/+134
| | | | [skip ci] -- testsuite wibbles are in next commit
* Fix #9064 by adding support for generic default signatures to TH.Richard Eisenberg2014-11-123-15/+27
|
* Fix #8100, by adding StandaloneDerivD to TH's Dec type.Richard Eisenberg2014-11-122-20/+43
|
* Remove unboxed Int# fields from NameFlavour (#9527)Richard Eisenberg2014-11-121-4/+2
|
* Fix #9066.Richard Eisenberg2014-11-123-28/+57
| | | | | | | | | | When splicing in a fixity declaration, look for both term-level things and type-level things. This requires some changes elsewhere in the code to allow for more flexibility when looking up Exact names, which can be assigned the wrong namespace during fixity declaration conversion. See the ticket for more info.