summaryrefslogtreecommitdiff
path: root/ghc/compiler/compMan
Commit message (Collapse)AuthorAgeFilesLines
...
* [project @ 2002-09-04 11:04:45 by simonmar]simonmar2002-09-041-1/+1
| | | | Exception => Control.Exception
* [project @ 2002-08-29 15:44:11 by simonmar]simonmar2002-08-292-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Housekeeping: - The main goal is to remove dependencies on hslibs for a bootstrapped compiler, leaving only a requirement that the packages base, haskell98 and readline are built in stage 1 in order to bootstrap. We're almost there: Posix is still required for signal handling, but all other dependencies on hslibs are now gone. Uses of Addr and ByteArray/MutableByteArray array are all gone from the compiler. PrimPacked defines the Ptr type for GHC 4.08 (which didn't have it), and it defines simple BA and MBA types to replace uses of ByteArray and MutableByteArray respectively. - Clean up import lists. HsVersions.h now defines macros for some modules which have moved between GHC versions. eg. one now imports 'GLAEXTS' to get at unboxed types and primops in the compiler. Many import lists have been sorted as per the recommendations in the new style guidelines in the commentary. I've built the compiler with GHC 4.08.2, 5.00.2, 5.02.3, 5.04 and itself, and everything still works here. Doubtless I've got something wrong, though.
* [project @ 2002-08-28 09:24:15 by simonmar]simonmar2002-08-281-2/+3
| | | | | | Fix braino in previous commit MERGE TO STABLE
* [project @ 2002-08-27 09:38:43 by simonmar]simonmar2002-08-271-3/+22
| | | | | | | | | - If the same module is defined in multiple "root" source files, then complain. Before, the compiler would silently ignore one of them. - Remove some unuseed imports MERGE TO STABLE
* [project @ 2002-08-27 09:34:20 by simonmar]simonmar2002-08-271-1/+1
| | | | | | | | | | | Fix a bug in the cleaning up of temporary files: we were wrongly cleaning the temporary pre-processed source files for stable modules, with the result that the compiler would panic the next time they were required. Reported ages ago by: Hal Duame. MERGE TO STABLE
* [project @ 2002-07-18 09:16:12 by simonmar]simonmar2002-07-181-1/+1
| | | | | | | | | | Back off from including the interface file version in the module init label - we might not recompile modules which depend on the current one, even if its version changes. Thanks to Sigbjorn for pointing this out. We still include the way, however, so we'll still catch cases of linking modules compiled in different ways.
* [project @ 2002-07-16 14:56:08 by simonmar]simonmar2002-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Implement a primitive failsafe mechanism for protecting against linking inconsistent object files. The idea is that if object files which were compiled in the wrong order (non-dependency order) or compiled in different ways (eg. profiled vs. non-profiled) are linked together, a link error will result. This is achieved by adding the module version and the way to the module init label. For example, previously the init label for a module Foo was named __stginit_Foo now it is named __stginit_Foo_<version>_<way> where <version> is the module version of Foo (same as the version in the interface file), and <way> is the current way (or empty). We also have to have a way to refer to the old plain init label, for using as the argument to shutdownHaskell() in a program using foreign exports. So the old label now points to a jump instruction which transfers control to the new init code.
* [project @ 2002-05-08 07:26:36 by sof]sof2002-05-081-2/+8
| | | | summarise{File}: filter out GHC.Prim from import lists
* [project @ 2002-05-07 00:46:09 by sof]sof2002-05-071-10/+14
| | | | | | | | | | | downsweep.getSummary: keep track of the module a particular ModuleName stems from, so that we can emit a better error message should the module be out of scope - e.g., sna$ ghc --make -iutil Foo.hs ghc.exe: chasing modules from: Foo.hs ghc.exe: can't find module `Xyzz' (while processing "util/Bar.hs") sna$
* [project @ 2002-05-01 17:56:52 by sof]sof2002-05-011-1/+1
| | | | mapM ~> mapM_
* [project @ 2002-05-01 09:30:04 by simonmar]simonmar2002-05-011-3/+4
| | | | | | | | | | | | | - When converting ModuleNames to Modules for use in the the module initialisation code, look them up in the IfaceTable(s) instead of calling findModule again. They are guaranteed to be in either the HomeIfaceTable or the PackageIfaceTable after the renamer, so this saves some trips to the filesystem. Also, move this code earlier in the compilation cycle to avoid holding on to the renamed syntax for too long (not sure if this makes a difference or not, but it definitely looked space-leakish before). - remove Util.unJust, it is a duplicate of Maybes.expectJust
* [project @ 2002-04-05 23:24:25 by sof]sof2002-04-051-1/+1
| | | | Friday afternoon pet peeve removal: define (Util.notNull :: [a] -> Bool) and use it
* [project @ 2002-03-27 16:48:47 by simonmar]simonmar2002-03-271-10/+14
| | | | | | | | | | | | | | Sigh, recompilation checking in --make mdoe has been badly broken for well, probably ever. The problem is that in GHCi mode there's a restriction on the use of object files, namely that an object file may only depend on other up-to-date object files in order to be up-to-date itself, because we don't have support for linking object code to interpreted code. Unfortunately we were applying this restriction to --make compilations too, with the result that far too much recompilation was happening. MERGE TO STABLE
* [project @ 2002-03-14 15:27:15 by simonpj]simonpj2002-03-141-2/+2
| | | | | | | | | | | | | | | | | | | ------------------------ Change GlobalName --> ExternalName LocalName -> InternalName ------------------------ For a long time there's been terminological confusion between GlobalName vs LocalName (property of a Name) GlobalId vs LocalId (property of an Id) I've now changed the terminology for Name to be ExternalName vs InternalName I've also added quite a bit of documentation in the Commentary.
* [project @ 2002-02-18 12:41:01 by sewardj]sewardj2002-02-182-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | Make foreign export dynamic work in GHCi. Main changes: * Allow literal labels to propagate through the bytecode generator and eventually be linked by the runtime linker. * Minor mods to driver plumbing so that GHCi produces the relevant *_stub.[ch] files, compiles them with gcc, and loads the resulting .o's * Dereference the stable pointer in the generated C stub, rather than passing it to a Haskell-world helper. This seems simpler and removes the need to have a H-world helper, which in turn means the stub .o doesn't refer to any H-world entities. This is important because our linker can't deal with mutual recursion between BCOs and loaded objects. Still ToDo: * Make it thread/GC safe. (Sigbjorn?) * Get rid of the bits of code in DsForeign which generate the Haskell helper. I had a go but it wasn't obvious how to do it, so have deferred.
* [project @ 2002-02-12 15:17:13 by simonmar]simonmar2002-02-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch over to the new hierarchical libraries --------------------------------------------- This commit reorganises our libraries to use the new hierarchical module namespace extension. The basic story is this: - fptools/libraries contains the new hierarchical libraries. Everything in here is "clean", i.e. most deprecated stuff has been removed. - fptools/libraries/base is the new base package (replacing "std") and contains roughly what was previously in std, lang, and concurrent, minus deprecated stuff. Things that are *not allowed* in libraries/base include: Addr, ForeignObj, ByteArray, MutableByteArray, _casm_, _ccall_, ``'', PrimIO For ByteArrays and MutableByteArrays we use UArray and STUArray/IOUArray respectively now. Modules previously called PrelFoo are now under fptools/libraries/GHC. eg. PrelBase is now GHC.Base. - fptools/libraries/haskell98 provides the Haskell 98 std. libraries (Char, IO, Numeric etc.) as a package. This package is enabled by default. - fptools/libraries/network is a rearranged version of the existing net package (the old package net is still available; see below). - Other packages will migrate to fptools/libraries in due course. NB. you need to checkout fptools/libraries as well as fptools/hslibs now. The nightly build scripts will need to be tweaked. - fptools/hslibs still contains (almost) the same stuff as before. Where libraries have moved into the new hierarchy, the hslibs version contains a "stub" that just re-exports the new version. The idea is that code will gradually migrate from fptools/hslibs into fptools/libraries as it gets cleaned up, and in a version or two we can remove the old packages altogether. - I've taken the opportunity to make some changes to the build system, ripping out the old hslibs Makefile stuff from mk/target.mk; the new package building Makefile code is in mk/package.mk (auto-included from mk/target.mk). The main improvement is that packages now register themselves at make boot time using ghc-pkg, and the monolithic package.conf in ghc/driver is gone. I've updated the standard packages but haven't tested win32, graphics, xlib, object-io, or OpenGL yet. The Makefiles in these packages may need some further tweaks, and they'll need pkg.conf.in files added. - Unfortunately all this rearrangement meant I had to bump the interface-file version and create a bunch of .hi-boot-6 files :-(
* [project @ 2002-01-25 16:46:53 by simonmar]simonmar2002-01-252-104/+126
| | | | | | | | | | | | In GHCi, if we are currently using a compiled version of a module and the user compiles a new version of the module, allow the new version to be linked in during a :reload. (as suggested by Koen Claessen). We can't go all the way and allow a newly compiled module to replace an existing interpreted version, because the version numbers in the interface file will be out-of-sync with our internal copy of the interface. To link in a newly compiled version of an interpreted module, you still have to do :load.
* [project @ 2002-01-24 16:55:35 by simonmar]simonmar2002-01-241-6/+27
| | | | | | | | | | | | | | | | | Add support for Hugs's :browse (or :b) command. There are two forms: - :b M (interpreted modules only) shows everything defined in M - the types of top-level functions, and definitions of classes and datatypes. - :b *M shows everything exported from module M. Available for both compiled and interpreted modules. The user interface is subject to change, but for now it is consistent with the new semantics of the :module command. The implementation is a little tricky, since for a package module we have to be sure to slurp in all the required declarations first.
* [project @ 2002-01-23 23:53:54 by sof]sof2002-01-231-1/+1
| | | | make it compile when GHCI aint
* [project @ 2002-01-23 16:50:46 by simonmar]simonmar2002-01-231-8/+29
| | | | | | | | | | | | - Implement an alternative :module syntax so we can play around with it. - Implement ':show bindings' and ':show modules' - Fix a bug whereby doing :info on a local binding would cause a panic (this needs to be merged to STABLE - the change is part of the patch to HscMain). - Some cleanups in InteractiveUI.hs
* [project @ 2002-01-23 11:11:13 by simonmar]simonmar2002-01-231-4/+17
| | | | | | | | | | Revert to running command-line statements in the context of the current thread, so that ^C exceptions get delivered to the right place. Now that a deadlock generates an exception this is not so bad, but it would be nice to do it the "right" way so I've left the old code in a comment for now.
* [project @ 2002-01-22 13:54:22 by simonmar]simonmar2002-01-221-13/+6
| | | | | | | | | | | | | | | | | | Deadlock is now an exception instead of a return status from rts_evalIO(). The current behaviour is as follows, and can be changed if necessary: in the event of a deadlock, the top main thread is taken from the main thread queue, and if it is blocked on an MVar or an Exception (for throwTo), then it receives a Deadlock exception. If it is blocked on a BLACKHOLE, we instead send it the NonTermination exception. Note that only the main thread gets the exception: it is the responsibility of the main thread to unblock other threads if necessary. There's a slight difference in the SMP build: *all* the main threads get an exception, because clearly none of them may make progress (compared to the non-SMP situation, where all but the top main thread are usually blocked).
* [project @ 2002-01-09 12:41:45 by simonmar]simonmar2002-01-091-73/+76
| | | | | | | | | | | | | | | | | | | | | | | First cut at enhancing the facilities for manipulating the scope in GHCi. The scope now consists of 1. the full top-level scope of zero or more interpreted modules 2. the exports from zero or more modules 3. the temporary bindings The sets 1 & 2 are manipulated using an extended :m command: eg :m +A will add module A to either set 1 or two depending on whether A is interpreted, and :m -A will remove it. The user interface may change, pending feedback from the punters on the mailing list. 'Prelude' is automatically added to the scope if set 1 is empty and set 2 doesn't already contain it. We now cache the GlobalRdrEnv for the current scope between evaluations in the InteractiveContext, and also the current PrintUnqualified setting (which also depends on the scope). Cvs: ----------------------------------------------------------------------
* [project @ 2002-01-04 16:02:03 by simonmar]simonmar2002-01-041-3/+3
| | | | | Some driver cleanups; in particular -fno-code should work in a more reasonable way (it is now a "mode flag" like -C, -c, --make etc.).
* [project @ 2002-01-04 09:35:42 by simonmar]simonmar2002-01-041-1/+1
| | | | oops, unb??rk the export list in the non-GHCI case.
* [project @ 2002-01-03 17:09:13 by simonmar]simonmar2002-01-031-44/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | - change the mi_globals field of ModIface to be (Maybe GlobalRdrEnv) from GlobalRdrEnv. The idea is that modules which we have compiled from source will have a complete GlobalRdrEnv in this field containing their top-level environments, whereas modules which we have loaded from object files (package modules and pre-compiled home modules) will have Nothing and we'll create a fake GlobalRdrEnv on demand from the export list. Previously we used to create the fake env all the time, but this way highlights the fact that we don't really have a proper GlobalRdrEnv for these modules (something we'd like to address at some point). - rename CompManager.cmLoadModule to cmLoadModules and make it take a DynFlags argument to be consistent with the rest of the CompManager interface. - split cmLoadModule into two parts: cmDepAnal which takes a list of filenames and returns a ModuleGraph, and cmLoadModules which takes the ModuleGraph and does the rest. This lets the consumer know whether the dependency analysis step fails before unloading any existing modules - i.e. if you :reload and a module is missing, you don't lose the modules that are already loaded (bug reported by MIchael Weber some time ago).
* [project @ 2001-10-25 11:47:03 by simonmar]simonmar2001-10-251-48/+27
| | | | | | | -Wall cleanup: - move some imports inside #ifdef GHCI - remove some unused bindings
* [project @ 2001-10-25 02:13:10 by sof]sof2001-10-251-17/+23
| | | | | | | | | | | | | | | | | | | | | | | | | - Pet peeve removal / code tidyup, replaced various sub-optimal uses of 'length' with something a bit better, i.e., replaced the following patterns * length as `cmpOp` length bs * length as `cmpOp` val -- incl. uses where val == 1 and val == 0 * {take,drop,splitAt} (length as) bs * length [ () | pat <- as ] with uses of misc Util functions. I'd be surprised if there's a noticeable reduction in running times as a result of these changes, but every little bit helps. [ The changes have been tested wrt testsuite/ - I'm seeing a couple of unexpected breakages coming from CorePrep, but I'm currently assuming that these are due to other recent changes. ] - compMan/CompManager.lhs: restored 4.08 compilability + some code cleanup. None of these changes are HEADworthy.
* [project @ 2001-10-23 11:42:21 by simonmar]simonmar2001-10-231-18/+74
| | | | | | | | | | Run statements typed at the prompt by calling into the RTS to create a new main thread. This acts as a (not-quite-sealed) sandbox, which lets us detect deadlock without causing GHCi itself to quit. Prelude> Concurrent.newEmptyMVar >>= Concurrent.takeMVar Deadlocked. Prelude>
* [project @ 2001-10-16 14:08:26 by simonmar]simonmar2001-10-161-6/+15
| | | | | | Clean tmp files between compilations, rather than all at the end. This reduces the /tmp clutter if GHC dies messily (current values of "messily" include segmentation fault and, sadly, heap overflow).
* [project @ 2001-08-29 18:12:19 by sof]sof2001-08-291-1/+1
| | | | emptyPLS: warning removal
* [project @ 2001-08-21 09:25:48 by simonmar]simonmar2001-08-211-8/+1
| | | | | | | | | | | | | Accept The Truth and disallow loading any home modules which don't have a source file. The reason is that the compilation manager can't figure out dependencies unless it has the source file to browse through - previously there was a half-hearted attempt to let you get away with just an object + interface file, but it didn't work in general. Better just to disallow it altogether. Note that this applies to --make too.
* [project @ 2001-08-17 16:06:30 by sof]sof2001-08-171-1/+1
| | | | | | - have SysTools.FileOption take a prefix that is not to be transformed (this is to accommodate MS-style cmd-line options of the kind: "/out=foo.obj") - have users of Finder.mkHomeModuleLocn catch up with recent change to its type.
* [project @ 2001-08-16 10:54:22 by simonmar]simonmar2001-08-161-3/+17
| | | | Include fixity info in the output from :info.
* [project @ 2001-08-16 05:06:44 by chak]chak2001-08-161-0/+2
| | | | Compile `cmInfoThing' only for GHCI
* [project @ 2001-08-15 14:40:24 by simonmar]simonmar2001-08-151-24/+34
| | | | Implement the :info command for GHCi.
* [project @ 2001-08-13 15:44:38 by simonmar]simonmar2001-08-132-16/+21
| | | | | The compilation manager now continues gracefully (by unloading all the modules) if the link step fails.
* [project @ 2001-08-03 07:44:47 by sof]sof2001-08-031-1/+1
| | | | | | Make dependency generation work a little bit better (stage1 goes through OK; yet to do a stage2, but thought I'd commit before I hit the sack).
* [project @ 2001-08-02 08:29:42 by simonmar]simonmar2001-08-021-0/+3
| | | | | oops, only import Exception.block when compiling GHCi (and we know we're bootstrapping)
* [project @ 2001-08-01 12:07:50 by simonmar]simonmar2001-08-012-109/+141
| | | | | | | | | | | | | | | | Signification cleanup & rewrite of CmLink. Fixes at least one bug: the PersistentLinkerState could sometimes get out of step with the RTS's idea of which modules were loaded, leading to an unloadObj failure when we try to unload the same module twice. This could happen if a ^C exception is received in the middle of a :load. Fixed by keeping the part of the linker's state that must match up with the RTS's internal state entirely private to CmLink, stored in a global variable. The operations in CmLink which manipulate this state are now wrapped by Exception.block, and so are safe from ^C exceptions.
* [project @ 2001-07-19 08:28:59 by andy]andy2001-07-191-0/+4
| | | | import of hscThing needs to be conditional on GHCi status.
* [project @ 2001-07-18 16:06:10 by rrt]rrt2001-07-181-4/+11
| | | | | | | | | | | Add support for Hugs's :info command. Doesn't work yet, but shouldn't interfere with anything else. Some of the files touched are just to correct out-of-date comments. Highlights are: hscThing: like hscStmt, but just gets info about a single identifier cmInfoThing: exposes hscThing's functionality to the outside world
* [project @ 2001-07-12 16:25:32 by sof]sof2001-07-121-1/+11
| | | | | | | | | ppFilesFromSummaries: to cope with recent driver changes, only report a file as being preprocessed if it differs from the source file(name). Fixes awfully bad breakage when using --make (source files were being deleted).
* [project @ 2001-06-29 15:10:14 by simonmar]simonmar2001-06-291-1/+7
| | | | | | | | | Change a '>' to '>=' when comparing the modification times of object & source files, to match make's behaviour and eliminate some unnecessary recompiles. This introduces some potential unsafety, but it was felt that the benefits in terms of unsurprising behaviour were worth it.
* [project @ 2001-06-27 11:14:07 by simonmar]simonmar2001-06-271-7/+8
| | | | | | Allow multiple targets to be specified on the command line for ghc --make and GHCi. Also implement :a command in GHCi (untested and undocumented so far).
* [project @ 2001-06-15 08:29:57 by simonpj]simonpj2001-06-153-21/+1
| | | | | | | | | | | | Some tidying up * Remove CmStaticInfo - GhciMode moves to HscTypes - The package stuff moves to new module main/Packages.lhs [put any package-related stuff in the new module] * Add Outputable.docToSDoc
* [project @ 2001-06-14 12:50:05 by simonpj]simonpj2001-06-142-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---------------------- Installation packaging ---------------------- GHC runs various system programs like cp, touch gcc, as, ld etc On Windows we plan to deliver these programs along with GHC, so we have to be careful about where to find them. This commit isolates all these dependencies in a single module main/SysTools.lhs Most of the #ifdefery for mingw has moved into this module. There's some documentation in SysTools.lhs Along the way I did lots of other cleanups. In particular * There is no more 'globbing' needed when calling runSomething * All file removal goes via the standard Directory.removeFile * TmpFiles.hs has gone; absorbed into SysTools * Some DynFlag stuff has moved from DriverFlags to CmdLineOpts Still to do: ** I'm a bit concerned that calling removeFile one at a time when deleting masses of split-object files is going to be rather slow ** GHC now expects to find split,mangle,unlit in libdir/extra-bin instead of just libdir So something needs to change in the Unix installation scripts ** The "ineffective C preprocessor" is a perversion and should die
* [project @ 2001-06-07 14:15:22 by simonmar]simonmar2001-06-071-3/+5
| | | | | | Don't force a module's {-# SOURCE #-} imports to have object linkables in order for the current module's object linkable to be considered valid (fixes some unnecessary recompilation with recursive modules).
* [project @ 2001-06-07 11:03:07 by simonmar]simonmar2001-06-071-8/+20
| | | | | | | | | | | | | | First part of support for hierarchical module names: - the Finder now searches all possible paths when looking for a source file or .hi file. I've removed the caching because now we have to search in subdirectories of each path option, and it was dubious whether the cache was actually helping. - the compilation manager now outputs a warning if it can't find the source for a given module, only the .hi file. Previously this caused a cryptic error message when we attempted to call getModificationTime on the non-existent source file.
* [project @ 2001-06-05 10:53:36 by sewardj]sewardj2001-06-051-19/+12
| | | | | | | Calculate the correct set of modules to link in the case of upsweep partial failure. MERGE INTO 5.00.2