summaryrefslogtreecommitdiff
path: root/ghc/compiler/main
Commit message (Collapse)AuthorAgeFilesLines
...
* [project @ 2004-01-26 10:04:42 by simonmar]simonmar2004-01-261-3/+6
| | | | Fix error message printing
* [project @ 2004-01-23 13:55:28 by simonmar]simonmar2004-01-234-40/+105
| | | | | | | | | | | | | | | | | | Some small steps in the direction of making GHC useable as a library: - The ErrMsg type is now richer: we keep the location info and the PrintUnqualified separate until the message is printed out, and messages have a short summary and "extra info", where the extra info is used for things like the context info in the typechecker (stuff that you don't normally want to see in a more visual setting, where the context is obvious because you're looking at the code). - hscMain now takes an extra argument of type (Messages -> IO ()), which says what to do with the error messages. In normal usage, we just pass ErrUtils.printErrorsAndWarnings, but eg. a development environment will want to do something different. The direction we need to head in is for hscMain to *never* do any output to stdout/stderr except via abstractions like this.
* [project @ 2004-01-15 14:43:17 by igloo]igloo2004-01-151-1/+1
| | | | Split Template Haskell out to its own package and update docs and tests.
* [project @ 2004-01-12 14:36:28 by simonpj]simonpj2004-01-121-8/+2
| | | | Wibbles to exporting types abstractly
* [project @ 2004-01-09 12:41:12 by simonmar]simonmar2004-01-092-1/+3
| | | | Add (missing?) -pgmdll option. Remove duplicate -pgmP option.
* [project @ 2004-01-05 14:54:06 by simonmar]simonmar2004-01-051-16/+24
| | | | | | | | Fix bug in genOutputFilenameFunc: the -keep-blah-files options weren't being considered for the final phase. Upshot: -keep-hc-files wasn't working in --make mode (see driver060 & driver061 tests). MERGE TO STABLE
* [project @ 2004-01-05 12:11:42 by simonpj]simonpj2004-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | --------------------------------------- Don't expose constructors as vigorously --------------------------------------- GHC used to expose the constructors of a data type in the interface file, even if (a) we were not optimising, and (b) the constructors are not exported. In practice this isn't really necessary, and it's bad because it forces too much recompilation. I've been meaning to fix this for some while. Now the data cons are hidden, even in the interface file, if both (a) and (b) are true. That means less interface file wobbling. Mind you, the interface file still changes, because the to/from functions for generic type classes change their types. But provided you don't use them, you'll get "compilation not required". We could play the same game for classes (by hiding their class ops) but that'd mean we'd have to change the data type for IfaceClassDecl, and I can't be bothered to do that today. It's unusual to have a class which exports none of its methods anyway. On the way, I changed the representation of tcg_exports and mg_exports (from Avails to NameSet), but that should be externally invisible.
* [project @ 2003-12-17 17:29:28 by sof]sof2003-12-171-8/+14
| | | | merge rev. 1.106.2.3
* [project @ 2003-12-10 14:15:16 by simonmar]simonmar2003-12-106-99/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add accurate source location annotations to HsSyn ------------------------------------------------- Every syntactic entity in HsSyn is now annotated with a SrcSpan, which details the exact beginning and end points of that entity in the original source file. All honest compilers should do this, and it was about time GHC did the right thing. The most obvious benefit is that we now have much more accurate error messages; when running GHC inside emacs for example, the cursor will jump to the exact location of an error, not just a line somewhere nearby. We haven't put a huge amount of effort into making sure all the error messages are accurate yet, so there could be some tweaking still needed, although the majority of messages I've seen have been spot-on. Error messages now contain a column number in addition to the line number, eg. read001.hs:25:10: Variable not in scope: `+#' To get the full text span info, use the new option -ferror-spans. eg. read001.hs:25:10-11: Variable not in scope: `+#' I'm not sure whether we should do this by default. Emacs won't understand the new error format, for one thing. In a more elaborate editor setting (eg. Visual Studio), we can arrange to actually highlight the subexpression containing an error. Eventually this information will be used so we can find elements in the abstract syntax corresponding to text locations, for performing high-level editor functions (eg. "tell me the type of this expression I just highlighted"). Performance of the compiler doesn't seem to be adversely affected. Parsing is still quicker than in 6.0.1, for example. Implementation: This was an excrutiatingly painful change to make: both Simon P.J. and myself have been working on it for the last three weeks or so. The basic changes are: - a new datatype SrcSpan, which represents a beginning and end position in a source file. - To reduce the pain as much as possible, we also defined: data Located e = L SrcSpan e - Every datatype in HsSyn has an equivalent Located version. eg. type LHsExpr id = Located (HsExpr id) and pretty much everywhere we used to use HsExpr we now use LHsExpr. Believe me, we thought about this long and hard, and all the other options were worse :-) Additional changes/cleanups we made at the same time: - The abstract syntax for bindings is now less arcane. MonoBinds and HsBinds with their built-in list constructors have gone away, replaced by HsBindGroup and HsBind (see HsSyn/HsBinds.lhs). - The various HsSyn type synonyms have now gone away (eg. RdrNameHsExpr, RenamedHsExpr, and TypecheckedHsExpr are now HsExpr RdrName, HsExpr Name, and HsExpr Id respectively). - Utilities over HsSyn are now collected in a new module HsUtils. More stuff still needs to be moved in here. - MachChar now has a real Char instead of an Int. All GHC versions that can compile GHC now support 32-bit Chars, so this was a simplification.
* [project @ 2003-11-27 09:30:54 by simonmar]simonmar2003-11-271-1/+1
| | | | | Having tightened up GHC's syntax w.r.t. Haskell 98, it appears that GHC itself was making use of the more lax syntax.
* [project @ 2003-11-17 14:41:03 by simonmar]simonmar2003-11-171-10/+13
| | | | Add an export list; GC dead code.
* [project @ 2003-11-17 14:40:33 by simonmar]simonmar2003-11-171-2/+1
| | | | GC export list.
* [project @ 2003-11-17 14:31:55 by simonmar]simonmar2003-11-171-9/+0
| | | | GC dead code.
* [project @ 2003-11-17 14:23:30 by simonmar]simonmar2003-11-172-22/+4
| | | | | | GC some dead code. In some places, I left useful-looking but currently unused definitions in place, surrounded by #ifdef UNUSED ... #endif.
* [project @ 2003-11-14 17:30:54 by simonmar]simonmar2003-11-141-52/+0
| | | | This file was used once; it isn't now.
* [project @ 2003-11-10 12:04:25 by simonpj]simonpj2003-11-102-2/+5
| | | | Better error message for ghc --show-iface, with no file supplied
* [project @ 2003-11-06 17:09:50 by simonpj]simonpj2003-11-061-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------ Major increment for Template Haskell ------------------------------------ 1. New abstract data type "Name" which appears where String used to be. E.g. data Exp = VarE Name | ... 2. New syntax 'x and ''T, for quoting Names. It's rather like [| x |] and [t| T |] respectively, except that a) it's non-monadic: 'x :: Name b) you get a Name not an Exp or Type 3. reify is an ordinary function reify :: Name -> Q Info New data type Info which tells what TH knows about Name 4. Local variables work properly. So this works now (crashed before): f x = $( [| x |] ) 5. THSyntax is split up into three modules: Language.Haskell.TH TH "clients" import this Language.Haskell.TH.THSyntax data type declarations and internal stuff Language.Haskell.TH.THLib Support library code (all re-exported by TH), including smart constructors and pretty printer 6. Error reporting and recovery are in (not yet well tested) report :: Bool {- True <=> fatal -} -> String -> Q () recover :: Q a -> Q a -> Q a 7. Can find current module currentModule :: Q String Much other cleaning up, needless to say.
* [project @ 2003-11-06 10:31:55 by simonmar]simonmar2003-11-062-32/+33
| | | | Add a separate --help message for GHCi.
* [project @ 2003-11-01 01:01:18 by sof]sof2003-11-011-2/+4
| | | | | | | | Maintain order of 'objs' when adding them to v_Ld_inputs. Fixes ghc-6.x linking bug when .a's are given explicitly on the command-line. merge to stable.
* [project @ 2003-10-27 14:03:59 by simonpj]simonpj2003-10-271-4/+1
| | | | Remove unused function dontAddErrLoc
* [project @ 2003-10-22 14:31:09 by simonmar]simonmar2003-10-225-35/+45
| | | | | | | | | | - In GHCi & Template Haskell, give a warning for things mentioned on the command line that we don't recognise, and then ignore them. In batch mode, these are still passed to the linker as before. - Clean up & rename the filename-suffix recognising functions in DriverPhases. There's probably a better place for these, but I've left them where they are for now.
* [project @ 2003-10-21 11:42:30 by simonmar]simonmar2003-10-211-44/+43
| | | | | | Change the filename policies (again). Now the interface file and object file always follow the source file unless the -odir or -hidir options are specified.
* [project @ 2003-10-16 10:19:27 by simonpj]simonpj2003-10-161-2/+3
| | | | | | | | When type-checking an interface in --make, when the source file hasn't changed, we must bring into scope all the things defined in the interface. This was breaking --make badly. The epicentre here is TcIface.typecheckIface
* [project @ 2003-10-10 09:39:33 by simonpj]simonpj2003-10-101-19/+11
| | | | Make rule importing work properly
* [project @ 2003-10-09 11:58:39 by simonpj]simonpj2003-10-0911-2707/+650
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------- GHC heart/lung transplant ------------------------- This major commit changes the way that GHC deals with importing types and functions defined in other modules, during renaming and typechecking. On the way I've changed or cleaned up numerous other things, including many that I probably fail to mention here. Major benefit: GHC should suck in many fewer interface files when compiling (esp with -O). (You can see this with -ddump-rn-stats.) It's also some 1500 lines of code shorter than before. ** So expect bugs! I can do a 3-stage bootstrap, and run ** the test suite, but you may be doing stuff I havn't tested. ** Don't update if you are relying on a working HEAD. In particular, (a) External Core and (b) GHCi are very little tested. But please, please DO test this version! ------------------------ Big things ------------------------ Interface files, version control, and importing declarations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * There is a totally new data type for stuff that lives in interface files: Original names IfaceType.IfaceExtName Types IfaceType.IfaceType Declarations (type,class,id) IfaceSyn.IfaceDecl Unfoldings IfaceSyn.IfaceExpr (Previously we used HsSyn for type/class decls, and UfExpr for unfoldings.) The new data types are in iface/IfaceType and iface/IfaceSyn. They are all instances of Binary, so they can be written into interface files. Previous engronkulation concering the binary instance of RdrName has gone away -- RdrName is not an instance of Binary any more. Nor does Binary.lhs need to know about the ``current module'' which it used to, which made it specialised to GHC. A good feature of this is that the type checker for source code doesn't need to worry about the possibility that we might be typechecking interface file stuff. Nor does it need to do renaming; we can typecheck direct from IfaceSyn, saving a whole pass (module TcIface) * Stuff from interface files is sucked in *lazily*, rather than being eagerly sucked in by the renamer. Instead, we use unsafeInterleaveIO to capture a thunk for the unfolding of an imported function (say). If that unfolding is every pulled on, TcIface will scramble over the unfolding, which may in turn pull in the interface files of things mentioned in the unfolding. The External Package State is held in a mutable variable so that it can be side-effected by this lazy-sucking-in process (which may happen way later, e.g. when the simplifier runs). In effect, the EPS is a kind of lazy memo table, filled in as we suck things in. Or you could think of it as a global symbol table, populated on demand. * This lazy sucking is very cool, but it can lead to truly awful bugs. The intent is that updates to the symbol table happen atomically, but very bad things happen if you read the variable for the table, and then force a thunk which updates the table. Updates can get lost that way. I regret this subtlety. One example of the way it showed up is that the top level of TidyPgm (which updates the global name cache) to be much more disciplined about those updates, since TidyPgm may itself force thunks which allocate new names. * Version numbering in interface files has changed completely, fixing one major bug with ghc --make. Previously, the version of A.f changed only if A.f's type and unfolding was textually different. That missed changes to things that A.f's unfolding mentions; which was fixed by eagerly sucking in all of those things, and listing them in the module's usage list. But that didn't work with --make, because they might have been already sucked in. Now, A.f's version changes if anything reachable from A.f (via interface files) changes. A module with unchanged source code needs recompiling only if the versions of any of its free variables changes. [This isn't quite right for dictionary functions and rules, which aren't mentioned explicitly in the source. There are extensive comments in module MkIface, where all version-handling stuff is done.] * We don't need equality on HsDecls any more (because they aren't used in interface files). Instead we have a specialised equality for IfaceSyn (eqIfDecl etc), which uses IfaceEq instead of Bool as its result type. See notes in IfaceSyn. * The horrid bit of the renamer that tried to predict what instance decls would be needed has gone entirely. Instead, the type checker simply sucks in whatever instance decls it needs, when it needs them. Easy! Similarly, no need for 'implicitModuleFVs' and 'implicitTemplateHaskellFVs' etc. Hooray! Types and type checking ~~~~~~~~~~~~~~~~~~~~~~~ * Kind-checking of types is far far tidier (new module TcHsTypes replaces the badly-named TcMonoType). Strangely, this was one of my original goals, because the kind check for types is the Right Place to do type splicing, but it just didn't fit there before. * There's a new representation for newtypes in TypeRep.lhs. Previously they were represented using "SourceTypes" which was a funny compromise. Now they have their own constructor in the Type datatype. SourceType has turned back into PredType, which is what it used to be. * Instance decl overlap checking done lazily. Consider instance C Int b instance C a Int These were rejected before as overlapping, because when seeking (C Int Int) one couldn't tell which to use. But there's no problem when seeking (C Bool Int); it can only be the second. So instead of checking for overlap when adding a new instance declaration, we check for overlap when looking up an Inst. If we find more than one matching instance, we see if any of the candidates dominates the others (in the sense of being a substitution instance of all the others); and only if not do we report an error. ------------------------ Medium things ------------------------ * The TcRn monad is generalised a bit further. It's now based on utils/IOEnv.lhs, the IO monad with an environment. The desugarer uses the monad too, so that anything it needs can get faulted in nicely. * Reduce the number of wired-in things; in particular Word and Integer are no longer wired in. The latter required HsLit.HsInteger to get a Type argument. The 'derivable type classes' data types (:+:, :*: etc) are not wired in any more either (see stuff about derivable type classes below). * The PersistentComilerState is now held in a mutable variable in the HscEnv. Previously (a) it was passed to and then returned by many top-level functions, which was painful; (b) it was invariably accompanied by the HscEnv. This change tidies up top-level plumbing without changing anything important. * Derivable type classes are treated much more like 'deriving' clauses. Previously, the Ids for the to/from functions lived inside the TyCon, but now the TyCon simply records their existence (with a simple boolean). Anyone who wants to use them must look them up in the environment. This in turn makes it easy to generate the to/from functions (done in types/Generics) using HsSyn (like TcGenDeriv for ordinary derivings) instead of CoreSyn, which in turn means that (a) we don't have to figure out all the type arguments etc; and (b) it'll be type-checked for us. Generally, the task of generating the code has become easier, which is good for Manuel, who wants to make it more sophisticated. * A Name now says what its "parent" is. For example, the parent of a data constructor is its type constructor; the parent of a class op is its class. This relationship corresponds exactly to the Avail data type; there may be other places we can exploit it. (I made the change so that version comparison in interface files would be a bit easier; but in fact it tided up other things here and there (see calls to Name.nameParent). For example, the declaration pool, of declararations read from interface files, but not yet used, is now keyed only by the 'main' name of the declaration, not the subordinate names. * New types OccEnv and OccSet, with the usual operations. OccNames can be efficiently compared, because they have uniques, thanks to the hashing implementation of FastStrings. * The GlobalRdrEnv is now keyed by OccName rather than RdrName. Not only does this halve the size of the env (because we don't need both qualified and unqualified versions in the env), but it's also more efficient because we can use a UniqFM instead of a FiniteMap. Consequential changes to Provenance, which has moved to RdrName. * External Core remains a bit of a hack, as it was before, done with a mixture of HsDecls (so that recursiveness and argument variance is still inferred), and IfaceExprs (for value declarations). It's not thoroughly tested. ------------------------ Minor things ------------------------ * DataCon fields dcWorkId, dcWrapId combined into a single field dcIds, that is explicit about whether the data con is a newtype or not. MkId.mkDataConWorkId and mkDataConWrapId are similarly combined into MkId.mkDataConIds * Choosing the boxing strategy is done for *source* type decls only, and hence is now in TcTyDecls, not DataCon. * WiredIn names are distinguished by their n_sort field, not by their location, which was rather strange * Define Maybes.mapCatMaybes :: (a -> Maybe b) -> [a] -> [b] and use it here and there * Much better pretty-printing of interface files (--show-iface) Many, many other small things. ------------------------ File changes ------------------------ * New iface/ subdirectory * Much of RnEnv has moved to iface/IfaceEnv * MkIface and BinIface have moved from main/ to iface/ * types/Variance has been absorbed into typecheck/TcTyDecls * RnHiFiles and RnIfaces have vanished entirely. Their work is done by iface/LoadIface * hsSyn/HsCore has gone, replaced by iface/IfaceSyn * typecheck/TcIfaceSig has gone, replaced by iface/TcIface * typecheck/TcMonoType has been renamed to typecheck/TcHsType * basicTypes/Var.hi-boot and basicTypes/Generics.hi-boot have gone altogether
* [project @ 2003-10-02 19:20:59 by sof]sof2003-10-021-3/+5
| | | | | | | Extend -Werror's scope to also include the desugarer. Note: -Werror doesn't give you the union of warnings from the renamer, TC and desugarer before bailing out, but one pass at a time.
* [project @ 2003-09-29 11:03:29 by simonmar]simonmar2003-09-291-1/+6
| | | | | oops, we need to include -fignore-interface-pragmas and -fomit-interface-pragmas in the default set of options.
* [project @ 2003-09-24 13:04:45 by simonmar]simonmar2003-09-242-3/+1
| | | | | | The concensus seems to be that 'with' should go away now, after its customary period of deprecation. Hugs has already removed it, so we're following suit.
* [project @ 2003-09-23 16:52:44 by sof]sof2003-09-231-2/+2
| | | | | If the user explicitly did an instances-only import, i.e., "import Foo ()", don't emit an unused-import warning.
* [project @ 2003-09-23 14:32:57 by simonmar]simonmar2003-09-238-285/+275
| | | | | | | | | | | | | | | | - Convert many of the optimisation options into dynamic options (that is, they can be mentioned in {-# OPTIONS #-} pragmas). - Add a new way to specify constructor-field unboxing on a selective basis. To tell the compiler to unbox a constructor field, do this: data T = T !!Int and GHC will store that field unboxed if possible. If it isn't possible (say, because the field has a sum type) then the annotation is ignored. The -funbox-strict-fields flag is now a dynamic flag, and has the same effect as replacing all the '!' annotations with '!!'.
* [project @ 2003-09-16 13:03:37 by simonmar]simonmar2003-09-163-22/+4
| | | | | | | | | | | | | Legacy Removal ~~~~~~~~~~~~~~ The following features have been consigned to the bit bucket: _ccall_ _casm_ ``....'' (lit-lits) the CCallable class the CReturnable class
* [project @ 2003-09-10 16:44:03 by simonmar]simonmar2003-09-104-27/+19
| | | | | | | | | | | | | New flags for individual syntax extensions: -fth enables template haskell -fimplicit-params enables implicit parameters These extensions are still implied by -fglasgow-exts, but they can now be switched off individually with -fno-th and -fno-implicit-params respectively. Also, -fno-ffi now works as expected. I cleaned up the interface to the lexer a bit while I was here.
* [project @ 2003-09-08 11:52:24 by simonmar]simonmar2003-09-082-44/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the handwritten lexer with one generated by Alex. YOU NOW NEED ALEX (v 2.0 or later) TO COMPILE GHC FROM CVS. Highlights: - Faster than the previous lexer (about 10% of total parse time, depending on the token mix). - More correct than the previous lexer: a couple of minor wibbles in the syntax were fixed. - Completely accurate source spans for each token are now collected. This information isn't used yet, but it will be used to give much more accurate error messages in the future. - SrcLoc now contains a column field as well as a line number, although this is currently ignored when printing out SrcLocs. - StringBuffer is now based on a ByteArray# rather than a Ptr, which means that StringBuffers are now garbage collected. Previously StringBuffers were hardly ever released, so a GHCi session would leak space as more source files were loaded in. - Code size reduction: Lexer.x is about the same size as the old Lex.lhs, but StringBuffer.lhs is significantly shorter and simpler. Sadly I wasn't able to get rid of parser/Ctypes.hs (yet).
* [project @ 2003-09-04 11:08:46 by simonmar]simonmar2003-09-043-10/+22
| | | | | | | | | | | | | | Add a new command-line flag -e EXPR, which runs ghc in interactive mode and evaluates EXPR only before exiting. Also, the lexer now ignores lines beginning with "#!". This is so that we can use ghc as a scripting language with Unix-style scripts beginning with #! /usr/local/bin/ghc -e main (well, it's not quite that simple, but I'll leave the details for the more enterprising hackers).
* [project @ 2003-08-29 16:00:25 by simonmar]simonmar2003-08-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | Initial x86-64 (aka amd64) support. Unregisterised it works perfectly. Registerised, I think it's almost there, except that I seem to be running into the known codegen bug in GCC with register variables (bug #7871 in the gcc bugzilla), which means registerised support is basically hosed until the GCC folks can get their act together. We get 8 more registers on amd64, but only 2 more callee-saves registers. The calling convention seems to pass args in registers by default, using the previously-callee-saves %rsi and %rdi as two of the new arg registers. I think GHCi should work, since we already have 64-bit ELF support thanks to Mat Chapman's work on the IA64 port. I haven't tried GHCi, though. The native code generator should be a breeze, because it's so similar to plain x86.
* [project @ 2003-08-27 13:28:01 by panne]panne2003-08-271-4/+8
| | | | Added short option -V for long option --version
* [project @ 2003-08-22 16:38:51 by sof]sof2003-08-221-2/+2
| | | | mkHomeModLocation: basename has to be equal to module name, not just suffix
* [project @ 2003-08-20 20:51:15 by krc]krc2003-08-201-1/+1
| | | | Oops. Should import Directory instead of System.Directory.
* [project @ 2003-08-20 18:48:20 by sof]sof2003-08-201-3/+3
| | | | my_prefix_match ~> Util.maybePrefixMatch
* [project @ 2003-08-20 15:11:06 by simonmar]simonmar2003-08-201-2/+4
| | | | After removing temp files, reset the list of temporary files to empty.
* [project @ 2003-08-20 15:07:56 by simonmar]simonmar2003-08-203-14/+7
| | | | | Use Util.maybePrefixMatch instead of DriverUtil.my_prefix_match, and remove the latter.
* [project @ 2003-08-19 22:09:09 by krc]krc2003-08-191-1/+1
| | | | | | | | External Core programs sometimes contain newtype declarations with no data constructors. GHC expected every newtype declaration to have at least one data constructor, so it would previously fail with an "empty list" error if you tried to compile such a program. These declarations are handled properly now.
* [project @ 2003-08-19 22:03:04 by krc]krc2003-08-191-1/+7
| | | | | | Changed outputForeignStubs to check whether stub files from a previous compilation still exist (in the case where no new stubs exist). This is necessary to compile External Core programs that require these stubs.
* [project @ 2003-08-11 08:53:39 by simonmar]simonmar2003-08-111-2/+2
| | | | Revert part of previous commit that sneaked in by accident.
* [project @ 2003-08-08 16:46:51 by simonmar]simonmar2003-08-081-3/+3
| | | | Fix string gap.
* [project @ 2003-07-23 16:19:48 by simonmar]simonmar2003-07-231-3/+1
| | | | | | | | There's no need to pass -u Main_zdmain_closure to the linker, indeed this causes problems when there isn't a Main_zdmain_closure (eg. linking a C program using GHC). merge to STABLE
* [project @ 2003-07-23 14:05:51 by simonmar]simonmar2003-07-231-4/+4
| | | | | Always create directories for the .o file, not just when using the compilation manager.
* [project @ 2003-07-21 15:14:18 by ross]ross2003-07-211-5/+5
| | | | | | | | | | | | | | | | | | | | Check for unknown flags before (rather than after) checking -o and -ohi flags, avoiding confusing behaviour like % ghc -bad-option -c x.hs ghc-6.0: unrecognised flags: -bad-option % ghc -bad-option -c x.hs -ohi x.hi ghc-6.0: -ohi can only be used when compiling a single source file Usage: For basic information, try the `--help' option. % ghc -bad-option -c x.hs -o x.o ghc-6.0: can't apply -o to multiple source files Usage: For basic information, try the `--help' option. (looks better with scores of flags) please merge to STABLE
* [project @ 2003-07-21 14:28:02 by simonmar]simonmar2003-07-211-2/+2
| | | | Comment out the warning about filenames not matching module names.
* [project @ 2003-07-18 13:18:06 by simonmar]simonmar2003-07-183-16/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revision to the filename policy changes of yesterday. This fixes the broken stage2 and library builds. The new story is this: A Haskell source filename should take the form <path>/<basename>.<extension> where <path> is any directory <basename> is the name of the module, with dots replaced by slashes. <extension> is ".hs" or ".lhs". given a source filename in this form, GHC will produce object and interface files named respectively: <hidir>/<basename>.<hisuf> <odir>/<basename>.<osuf> where <hidir> is the value of the -hidir flag, if one was given, or the value of <path> from the source file otherwise. <odir> the same, for the -odir flag. <osuf> the object suffix (settable with the -osuf flag) <hisuf> the hi suffix (settable with the -hisuf flag) For example, if I have a module A.B.C, in source file foo/A/B/C.hs, then GHC will create foo/A/B/C.hi and foo/A/B/C.o. If GHC is given a source filename which is *not* of the form <path>/<basename>.<extension>, then it uses a different strategy. This happens if the filename does not follow the module name. In this case, GHC will set <path> to be the directory in which the source file resides, and <basename> to the module name with dots replaced by slashes, and then use the rules above. For example, if we put module A.B.C in foo/bar/baz.hs, then GHC will produce foo/bar/A/B/C.o and foo/bar/A/B/C.hi.