summaryrefslogtreecommitdiff
path: root/compiler/main/GhcMake.hs
Commit message (Collapse)AuthorAgeFilesLines
* ghc --make: add nicer names to RTS threads (threaded IO manager, make workers)Sergei Trofimovich2014-08-041-0/+14
| | | | | | | | | | | | | | | | | | | | Summary: The patch names most of RTS threads and ghc (the tool) threads. It makes nicer debug and eventlog output for ghc itself. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: ran debugged ghc under '+RTS -Ds' Reviewers: simonmar, austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D101
* Rename PackageId to PackageKey, distinguishing it from Cabal's PackageId.Edward Z. Yang2014-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-151-1/+1
| | | | | | | | | | | | | | | | | | 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.
* Cleaned up Maybes.lhsBaldur Blöndal2014-02-131-2/+2
|
* Always re-summarise modules when -fforce-recomp is setPatrick Palka2013-11-221-2/+4
| | | | Fixes #8526
* Load all modules before reporting errors (#8322)Joachim Breitner2013-11-021-106/+119
| | | | | | Instead of reporting only one "module not found"" error. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix ./validate with GHC 7.6 as bootstrap compiler.Austin Seipp2013-09-091-0/+4
| | | | | | | | | 7.6 deprecated the Control.Concurrent.QSem module (to be removed later,) but according to Patrick it was actually un-deprecated. As a result, validate fails if your bootstrap compiler is 7.6, since it throws a DEPRECATED warning. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Retain boot modules in getModLoopPatrick Palka2013-08-301-3/+3
| | | | | | | | | | | | The parallel upsweep needs to know about _all_ the modules that make up a module loop in order to correctly determine a module's external loop dependencies. Otherwise, incorrect dependency information may be computed, resulting in an eventual deadlock during compilation. So don't filter boot modules in getModLoop, and instead have its callers filter them when needed. Following this change, GHC could compile itself via --make -O2 -j. Yay!
* Rename DynFlags.parUpsweepNum to parMakeCountPatrick Palka2013-08-301-1/+1
|
* Merge branch 'master' into ghc-parmake-gsocPatrick Palka2013-08-301-1/+1
|\ | | | | | | | | | | Conflicts: compiler/main/DynFlags.hs compiler/utils/FastString.lhs
| * Rework how iOS does linking (#8127)Austin Seipp2013-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | iOS has some particular constraints about how applications can be built: * We must generate a static library (.a) since XCode does the final link. * We need to carefully give the right set of arguments to libtool in the case we're generating an archive. * Dynamic linking isn't supported. * It can only be done on OS X. This patch cleans up all of the above. We add a new flag `-staticlib` (only supported on Darwin) that allows us to produce archive files using libtool, and a -pgmlibtool flag to control which 'libtool' executable to use. This fixes #8127. I believe this is the last piece missing from the iOS cross compiler. Authored-by: Luke Iannini <lukexi@me.com> Authored-by: Maxwell Swadling <maxwellswadling@gmail.com> Authored-by: Stephen Blackheath <...@blacksapphire.com> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* | Pass a DynFlags argument explicitly to typecheckLoopPatrick Palka2013-08-271-6/+5
| | | | | | | | | | | | In the parallel upsweep, typecheckLoop has to use a different DynFlags than the one in its HscEnv argument so that the debug message in typecheckLoop will be outputted in order.
* | Properly handle import loops in the parallel upsweepPatrick Palka2013-08-261-48/+132
| |
* | Implement the parallel upsweep (#910)Patrick Palka2013-08-261-3/+351
|/ | | | | | | | | | | | The parallel upsweep is the parallel counterpart to the default sequential upsweep. It attempts to compile modules in parallel by subdividing the work of the upsweep into parts that can be executed concurrently by multiple Haskell threads. In order to enable the parallel upsweep, the user has to pass the -jN flag to GHC, where N is an optional number denoting the number of jobs, or modules, to compile in parallel, like with GNU make. In GHC this just sets the number of capabilities to N.
* Fix many ASSERT uses under Clang.Austin Seipp2013-06-181-2/+1
| | | | | | Clang doesn't like whitespace between macro and arguments. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Refactor the pipeline/hsc interactionIan Lynagh2013-03-071-4/+4
| | | | | It would probably still benefit from some tidying up, but it's now much more opaque, with the control flow easier to understand.
* Change a few throwGhcException uses to throwGhcExceptionIOIan Lynagh2013-01-301-1/+1
|
* Update a commentIan Lynagh2013-01-111-2/+2
|
* Replace all uses of ghcError with throwGhcException and purge ghcError.Erik de Castro Lopo2012-11-301-2/+2
|
* Fix #7231: don't unload stable modules when there is an error laterSimon Marlow2012-11-271-5/+12
|
* Some alpha renamingIan Lynagh2012-10-161-4/+4
| | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
* When dynamic-by-default, don't use the GHCi linkerIan Lynagh2012-10-131-1/+3
| | | | We instead link objects into a temporary DLL and dlopen that
* Pass DynFlags down to mk_err_msgIan Lynagh2012-06-121-25/+27
|
* checkStability: respect -fforce-recomp (#6105)Simon Marlow2012-05-221-2/+4
|
* Read the source file timestamp *before* preprocessing (#6106)Simon Marlow2012-05-221-13/+12
|
* Clean up GhcMake a littleDavid Terei2012-03-231-282/+266
|
* Tabs -> SpacesDavid Terei2012-03-231-463/+455
|
* GHCi: add :seti, for options that apply only at the prompt (#3217)Simon Marlow2012-03-011-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GHCi now maintains two DynFlags: one that applies to whole modules loaded with :load, and one that applies to things typed at the prompt (expressions, statements, declarations, commands). The :set command modifies both DynFlags. This is for backwards compatibility: users won't notice any difference. The :seti command applies only to the interactive DynFlags. Additionally, I made a few changes to ":set" (with no arguments): * Now it only prints out options that differ from the defaults, rather than the whole list. * There is a new variant, ":set -a" to print out all options (the old behaviour). * It also prints out language options. e.g. Prelude> :set options currently set: none. base language is: Haskell2010 with the following modifiers: -XNoDatatypeContexts -XNondecreasingIndentation GHCi-specific dynamic flag settings: other dynamic, non-language, flag settings: -fimplicit-import-qualified warning settings: ":seti" (with no arguments) does the same as ":set", but for the interactive options. It also has the "-a" option. The interactive DynFlags are kept in the InteractiveContext, and copied into the HscEnv at the appropriate points (all in HscMain). There are some new GHC API operations: -- | Set the 'DynFlags' used to evaluate interactive expressions. setInteractiveDynFlags :: GhcMonad m => DynFlags -> m () -- | Get the 'DynFlags' used to evaluate interactive expressions. getInteractiveDynFlags :: GhcMonad m => m DynFlags -- | Sets the program 'DynFlags'. setProgramDynFlags :: GhcMonad m => DynFlags -> m [PackageId] -- | Returns the program 'DynFlags'. getProgramDynFlags :: GhcMonad m => m DynFlags Note I have not completed the whole of the plan outlined in #3217 yet: when in the context of a loaded module we don't take the interactive DynFlags from that module. That needs some more refactoring and thinking about, because we'll need to save and restore the original interactive DynFlags. This solves the immediate problem that people are having with the new flag checking in 7.4.1, because now it is possible to set language options in ~/.ghci that do not affect loaded modules and thereby cause recompilation.
* Switch to using the time package, rather than old-timeIan Lynagh2012-01-141-10/+10
|
* Allow full constraint solving under a for-all (Trac #5595)Simon Peyton Jones2011-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main idea is that when we unify forall a. t1 ~ forall a. t2 we get constraints from unifying t1~t2 that mention a. We are producing a coercion witnessing the equivalence of the for-alls, and inside *that* coercion we need bindings for the solved constraints arising from t1~t2. We didn't have way to do this before. The big change is that here's a new type TcEvidence.TcCoercion, which is much like Coercion.Coercion except that there's a slot for TcEvBinds in it. This has a wave of follow-on changes. Not deep but broad. * New module TcEvidence, which now contains the HsWrapper TcEvBinds, EvTerm etc types that used to be in HsBinds * The typechecker works exclusively in terms of TcCoercion. * The desugarer converts TcCoercion to Coercion * The main payload is in TcUnify.unifySigmaTy. This is the function that had a gross hack before, but is now beautiful. * LCoercion is gone! Hooray. Many many fiddly changes in conssequence. But it's nice.
* Use -fwarn-tabs when validatingIan Lynagh2011-11-041-0/+7
| | | | | We only use it for "compiler" sources, i.e. not for libraries. Many modules have a -fno-warn-tabs kludge for now.
* commentSimon Marlow2011-10-101-0/+3
|
* Implement a findCycle function in Digraph,Simon Peyton Jones2011-07-221-42/+25
| | | | | | | | | | | | | | and use it to report module loops nicely This fixes Trac #5307. Now we get Module imports form a cycle: module `M8' (.\M8.hs) imports `M1' (M1.hs) which imports `M9' (.\M9.hs-boot) which imports `M8' (.\M8.hs) And the algorithm is linear time.
* Fix #481: use a safe recompilation check when Template Haskell isSimon Marlow2011-07-201-11/+12
| | | | | | | | | | | | | | | | being used. We now track whether a module used any TH splices in the ModIface (and at compile time in the TcGblEnv and ModGuts). If a module used TH splices last time it was compiled, then we ignore the results of the normal recompilation check and recompile anyway, *unless* the module is "stable" - that is, none of its dependencies (direct or indirect) have changed. The stability test is pretty important - otherwise ghc --make would always recompile TH modules even if nothing at all had changed, but it does require some extra plumbing to get this information from GhcMake into HscMain. test in driver/recomp009
* Restore home-package-plugin functionalityMax Bolingbroke2011-06-301-3/+3
|
* SafeHaskell: Disable certain ghc extensions in Safe.David Terei2011-06-171-1/+1
| | | | | | | | | | This patch disables the use of some GHC extensions in Safe mode and also the use of certain flags. Some are disabled completely while others are only allowed on the command line and not in source PRAGMAS. We also check that Safe imports are indeed importing a Safe or Trustworthy module.
* Improve the reporting of module cycles, to give a nice message like thisSimon Peyton Jones2011-06-131-15/+48
| | | | | | | | | | Module imports form a cycle: module `Foo4' imports `Foo' which imports `Foo2' which imports `Foo3' which imports `Foo4' as requested by Bryan Richter
* Formatting wibble in GhcMake.hsDavid Terei2011-04-261-6/+3
|
* Merge _stub.o files into the main .o file (Fixes #3687 and #706)Simon Marlow2011-04-051-14/+27
| | | | | | | | | | | | | | Now GHC still generates the _stub.c files, but the object file is automatically merged into the main .o file for a module. This means that build systems (including GHC's own) no longer need to worry about looking for _stub.o files and including them when linking. I had to do lots of refactoring in DriverPipeline to make this work; now there's a monad to carry around all the information, and everything is a lot tidier. The _stub.c is now created as a temporary file and removed after compilation (unless the -keep-tmp-files flag is on).
* remove ^Ms; comment updatesSimon Marlow2011-04-051-1463/+1465
|
* Split main/GHC into GHC and GhcMakesimonpj@microsoft.com2011-01-251-0/+1463
There are two things going on in main/GHC.hs. * It's the root module of the GHC package * It contains lots of stuff for --make It is also gigantic (2.7k lines) This patch splits it into two * GHC.hs is the root module for the GHC package (1.3k lines) * GhcMake.hs contains the stuff for --make (1.4k lines) Happily the functional split divided it almost exactly in half. This is a pure refactoring. There should be no behavioural change.