summaryrefslogtreecommitdiff
path: root/compiler/main
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename PackageId to PackageKey, distinguishing it from Cabal's PackageId.Edward Z. Yang2014-07-2113-121/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, both Cabal and GHC defined the type PackageId, and we expected them to be roughly equivalent (but represented differently). This refactoring separates these two notions. A package ID is a user-visible identifier; it's the thing you write in a Cabal file, e.g. containers-0.9. The components of this ID are semantically meaningful, and decompose into a package name and a package vrsion. A package key is an opaque identifier used by GHC to generate linking symbols. Presently, it just consists of a package name and a package version, but pursuant to #9265 we are planning to extend it to record other information. Within a single executable, it uniquely identifies a package. It is *not* an InstalledPackageId, as the choice of a package key affects the ABI of a package (whereas an InstalledPackageId is computed after compilation.) Cabal computes a package key for the package and passes it to GHC using -package-name (now *extremely* misnamed). As an added bonus, we don't have to worry about shadowing anymore. As a follow on, we should introduce -current-package-key having the same role as -package-name, and deprecate the old flag. This commit is just renaming. The haddock submodule needed to be updated. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D79 Conflicts: compiler/main/HscTypes.lhs compiler/main/Packages.lhs utils/haddock
* Make 'ghc' a wired in package.Edward Z. Yang2014-07-211-0/+1
| | | | | | | | | | | | | | | | | | | | Summary: Previously, the GHC API was "semi" wired-in: it was installed with a version number, but that version number was hard-coded into the compiler and it wasn't really possible to install other copies of the GHC API. This patch makes the GHC API more similar to existing wired-in packages such as ghc-prim, and will be helpful when we start extending the amount of information passed to -package-name. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonmar, simonpj, hvr, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D78
* driver: use absolute paths in ld scripts (#7452)Austin Seipp2014-07-201-1/+3
| | | | | | Patch contributed by slowmo. Signed-off-by: Austin Seipp <austin@well-typed.com>
* main: detabify/unwhitespace PprTyThingAustin Seipp2014-07-201-15/+8
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Control CPP through settings file (#8683)Carter Tazio Schonwald2014-07-021-4/+4
| | | | | | | | | | | | | | | | Summary: Allow the CPP program and flag choices for GHC be configured via the the ghc settings file Test Plan: ran validate yesterday Reviewers: hvr, austin, mzero, simonmar Reviewed By: austin, mzero, simonmar Subscribers: mzero, simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D26
* Add -XBinaryLiterals language extension (re #9224)Herbert Valerio Riedel2014-06-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | Haskell2010 supports - base-10 (prefix-less), - base-8 (via `0[oO]`-prefix), and - base-16 (via `0[xX]`-prefix) integer literals. This commit adds syntax support for base-2 integer literals via the new `0[bB]` prefix. The use of a `0b` prefix for indicating binary literals is known from popular programming languages such as C++14, Perl, Python, Ruby, and Java. This syntax extension is disabled by default and can be enabled via the new `{-# LANGUAGE BinaryLiterals #-}` pragma and/or the new `-XBinaryLiterals` This new extensions requires to upgrade the `ExtsBitmap` type from `Word` to `Word64` as this adds a 33th flag which is not guaranteed to fit into a `Word`. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org> Differential Revision: https://phabricator.haskell.org/D22
* Revert "Make -fno-write-interface to all modes of GHC, not just -fno-code."Edward Z. Yang2014-06-272-6/+6
| | | | This reverts commit 05120ecd95b2ebf9b096a95304793cd78be9506e.
* Make -fno-write-interface to all modes of GHC, not just -fno-code.Edward Z. Yang2014-06-272-6/+6
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Add new flag -fwrite-interface for -fno-code.Edward Z. Yang2014-06-263-2/+10
| | | | | | | | | | | | | | | | | | | Summary: Normally, -fno-code does not generate interface files. However, if you want to use it to type check over multiple runs of GHC, you will need the interface files to check source files further down the dependency chain; -fwrite-interface does this for you. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: clean validate, and a new test-case Reviewers: simonpj Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D27
* Fix up b84748121e777dAustin Seipp2014-06-231-1/+1
| | | | | | I forgot to amend this to my last commit. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix #9047Austin Seipp2014-06-233-24/+33
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Simplify package dump for -v4Edward Z. Yang2014-06-221-4/+18
| | | | | | | | | | | | | | | | | | | | Summary: Previously, on -v4 and greater, we dumped out the entire package database, including lots of metadata that GHC doesn't really care about, and is guaranteed to correspond to the equivalent in the local/global package databases on disk. So, to make this output more useful, on -v4 we instead just print package IDs, and the exposed and trusted flags (E and T, which can be tweaked at runtime). Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: successful validate Reviewers: simonpj Subscribers: simonmar, relrod Differential Revision: https://phabricator.haskell.org/D24
* Update documentation to follow 2dc3b476aff28Edward Z. Yang2014-06-201-10/+5
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Some typos in commentsGabor Greif2014-06-111-1/+1
|
* Don't use showPass in the backend (#8973)Simon Marlow2014-06-082-9/+15
|
* Remove unused --run-cps/--run-cpsz optionsSimon Marlow2014-06-081-4/+0
|
* Only use UnicodeSytanx pretty printing if the locale supports itJoachim Breitner2014-06-062-10/+10
| | | | using the same check as for unicode quotes.
* Use UnicodeSyntax when printingJoachim Breitner2014-06-062-0/+5
| | | | | When printing Haskell source, and UnicodeSyntax is enabled, use the unicode sytax characters (#8959).
* Make DeriveTraversable imply DeriveFunctor/FoldableSjoerd Visscher2014-06-061-0/+3
| | | | Implements #9069
* Make the matcher and wrapper Ids in PatSyn into LocalIds, not GlobalIdsSimon Peyton Jones2014-06-062-37/+35
| | | | | | | | | | | | | | | | | | | | This was a serious bug, exposed by Trac #9175. The matcher and wrapper must be LocalIds, like record selectors and dictionary functions, for the reasons now documented in Note [Exported LocalIds] in Id.lhs In fixing this I found - PatSyn should have an Id inside it (apart from the wrapper and matcher) It should be a Name. Hence psId --> psName, with knock-on consequences - Tidying of PatSyns in TidyPgm was wrong - The keep-alive set in Desugar.deSugar (now) doesn't need pattern synonyms in it I also cleaned up the interface to PatSyn a little, so there's a tiny knock-on effect in Haddock; hence the haddock submodule update. It's very hard to make a test for this bug, so I haven't.
* Fix compilation of cmm files with -outputdir (Trac #9050)Yuras Shumovich2014-06-051-5/+2
|
* Subsume NullaryTypeClasses by MultiParamTypeClasses (#8993)Owen Stephens2014-06-041-1/+2
| | | | MPTC now also handles the nullary case
* Comments only (related to Trac #7730)Simon Peyton Jones2014-06-031-4/+40
|
* Do pretty-printing of TyThings via IfaceDecl (Trac #7730)Simon Peyton Jones2014-06-032-250/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All the initial work on this was done fy 'archblob' (fcsernik@gmail.com); thank you! I reviewed the patch, started some tidying, up and then ended up in a huge swamp of changes, not all of which I can remember now. But: * To suppress kind arguments when we have -fno-print-explicit-kinds, - IfaceTyConApp argument types are in a tagged list IfaceTcArgs * To allow overloaded types to be printed with =>, add IfaceDFunTy to IfaceType. * When printing data/type family instances for the user, I've made them print out an informative RHS, which is a new feature. Thus ghci> info T data family T a data instance T Int = T1 Int Int data instance T Bool = T2 * In implementation terms, pprIfaceDecl has just one "context" argument, of type IfaceSyn.ShowSub, which says - How to print the binders of the decl see note [Printing IfaceDecl binders] in IfaceSyn - Which sub-comoponents (eg constructors) to print * Moved FastStringEnv from RnEnv to OccName It all took a ridiculously long time to do. But it's done!
* Just formattingSimon Marlow2014-05-302-30/+47
|
* Remove deprecated -optdep optionsSimon Marlow2014-05-301-14/+0
|
* mkHiPath & mkObjPath didn't need to be in IOSimon Marlow2014-05-301-11/+9
|
* s/implict/implicit/iEdward Z. Yang2014-05-292-2/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Store IfExtNames for PatSyn matchers and wrappers in interface file.Dr. ERDI Gergo2014-05-272-10/+12
| | | | | | | This way, the Ids for the matchers/wrappers are reused by importing modules, and thus unfoldings are kept. Also updates haddock submodule to accomodate tweaks in PatSyn representation
* Refactoring around TyCon.isSynTyConSimon Peyton Jones2014-05-151-1/+1
| | | | | | | | | | * Document isSynTyCon better * Add isTypeSyonymTyCon for regular H98 type synonyms * Use isTypeSynonymTyCon rather than isSynTyCon where the former is really intended All arose as part of a bug I introduced when fixing Trac #9102, thinking that isSynTyCon meant H98 type syononyms.
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-1525-6/+46
| | | | | | | | | | | | | | | | | | In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
* Avoid trivial cases of NondecreasingIndentationHerbert Valerio Riedel2014-05-151-2/+2
| | | | | | | This cleanup allows the following refactoring commit to avoid adding a few `{-# LANGUAGE NondecreasingIndentation #-}` pragmas. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Refactor buildClass and mkDictSelId a bit, to avoid the no_unf argumentSimon Peyton Jones2014-05-081-1/+4
| | | | | No change in functionality, just a cleaner story, with the RHS for dictionary selectors being treated less specially than before.
* Modularise pretty-printing for forallsSimon Peyton Jones2014-05-061-6/+2
| | | | | | | | | See TypeRep.pprUserForAll. This just makes forall-printing a bit more consistent. In particular, I wasn't seeing the kind foralls when displaying a CoAxiom or CoAxBranch The output on T7939 is just possible a bit too verbose now, but even if so that's an error in the right direction.
* Remove external coreAustin Seipp2014-05-036-96/+27
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Print for-alls more often (Trac #9018)Simon Peyton Jones2014-04-281-7/+4
| | | | | | | | We now display the foralls of a type if any of the type variables is polykinded. This put kind polymorphism "in your face" a bit more often, but eliminates a lot of head scratching. The user manual reflects the new behaviour.
* ghc & docs: kill unused flagsAustin Seipp2014-04-211-10/+0
| | | | | | | | | | | | This removes the following, now defunct flags, which will not be recognized by GHC 7.10: -fwarn-lazy-unlifted-bindings -pgmm and -optm (used for the Mangler, long dead) -keep-raw-s-file & -keep-raw-s-files -monly[432]-reg-only Signed-off-by: Austin Seipp <austin@well-typed.com>
* Kill whitespace after cpp's `-I` flagHerbert Valerio Riedel2014-04-211-1/+1
| | | | | | This clean-up is in a similiar spirit as 574ef4293b8676. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* ghc: Do not add a space in '-U __PIC__'Austin Seipp2014-04-211-4/+4
| | | | | | | | | | | | | | | | GHC previously introduced a space here. However, this can in some cases be interpreted as "-U __PIC__" - note that in shell, the -U would still be recognized with an argument, but the argument would be " __PIC__", with a space in front, as opposed to the single string '__PIC__'. In practice most tools seem to handle this OK. But the Coverity Scan analysis tool does not: it errors on the fact that ' __PIC__' is an invalid CPP name to undefine. With this, it seems the Coverity analysis tool can easily analyze the entire GHC build. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Deprecate the AMP warnings.Austin Seipp2014-04-201-2/+2
| | | | | | | | Now that we're in development mode, Applicative will soon be a superclass of Monad in HEAD. So let's go ahead and deprecate the -fno-warn-amp flag, remove the checks, and tweak a few tests Signed-off-by: Austin Seipp <austin@well-typed.com>
* Normalize GHC Trac URLsHerbert Valerio Riedel2014-04-191-1/+1
| | | | | | | | | | | | | | Update several old http://hackage.haskell.org/trac/ghc URLs references to the current http://ghc.haskell.org/trac/ghc URLs. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Instead of tracking Origin in LHsBindsLR, track it in MatchGroupDr. ERDI Gergo2014-04-131-2/+2
|
* Fix #8641, creating directories when we have stubs.Edward Z. Yang2014-04-101-0/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Don't preprocess .s filesSimon Marlow2014-04-082-22/+26
| | | | | | | | | One important reason is that gcc 4.8.1 sometimes crashes: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60436 Another reason is that preprocessing assembly files unnecessarily slows down compilation.
* windows: Fix #8870Austin Seipp2014-04-041-2/+43
| | | | | | | | | | This bumps the amount of default reserved and committed stack for GHC executables to 8mb, to work around #8870. A proper fix should happen in 7.8.2 See note [Windows stack usage] in SysTools for the details. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Add flags to control memcpy and memset inliningJohan Tibell2014-03-261-4/+16
| | | | | | | This adds -fmax-inline-memcpy-insns and -fmax-inline-memset-insns. These flags control when we inline calls to memcpy/memset with statically known arguments. The flag naming style is taken from GCC and the same limit is used by both GCC and LLVM.
* Revert "Fix #8745 - GND is now -XSafe compatible."Austin Seipp2014-03-241-1/+4
| | | | | | | | | See #8827 - for now, we're making GND unsafe again. This also fixes the tests since they were originally not using the new unicode quote style we're using. This reverts commit a8a01e742434df11b830ab99af12d9045dfcbc4b.
* Simplify handling of the interactive package; fixes Trac #8831Simon Peyton Jones2014-03-232-13/+9
| | | | | | | | | | | | | | | | | | | | | This patch is really a fix to the big commint 73c08ab10e4077e18e459a1325996bff110360c3 Re-work the naming story for the GHCi prompt (Trac #8649) which introduced the 'interactive' package See Note [The interactive package] in HscTypes The original commit set both (a) The tcg_mod field of TcGblEnv to 'interactive:Ghci4' (say) (b) The thisPackage field of DynFlags to 'interactive' But the second step interacts badly with linking. :loaded modules are in the package set by 'thisPackage' (usually 'main'); if you change that, then we try to link package 'main', but can't find it, and that is what happened in #8831. The fix was simple: do (a) but not (b). I changed Note [The interactive package] in HscTypes to describe this.
* codeGen: inline allocation optimization for clone array primopsJohan Tibell2014-03-221-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | The inline allocation version is 69% faster than the out-of-line version, when cloning an array of 16 unit elements on a 64-bit machine. Comparing the new and the old primop implementations isn't straightforward. The old version had a missing heap check that I discovered during the development of the new version. Comparing the old and the new version would requiring fixing the old version, which in turn means reimplementing the equivalent of MAYBE_CG in StgCmmPrim. The inline allocation threshold is configurable via -fmax-inline-alloc-size which gives the maximum array size, in bytes, to allocate inline. The size does not include the closure header size. Allowing the same primop to be either inline or out-of-line has some implication for how we lay out heap checks. We always place a heap check around out-of-line primops, as they may allocate outside of our knowledge. However, for the inline primops we only allow allocation via the standard means (i.e. virtHp). Since the clone primops might be either inline or out-of-line the heap check layout code now consults shouldInlinePrimOp to know whether a primop will be inlined.
* TyposAustin Seipp2014-03-211-5/+5
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>