1. 07 Feb, 2002 7 commits
    • simonpj's avatar
      [project @ 2002-02-07 14:06:00 by simonpj] · ad552fe2
      simonpj authored
      	Improve the "stragely-kinded tyvar" problem
      When the type checker finds a type variable with no binding,
      which means it can be instantiated with an arbitrary type, it
      usually instantiates it to Void.  Eg.
      	length []
      	length Void (Nil Void)
      But in really obscure programs, the type variable might have
      a kind other than *, so we need to invent a suitably-kinded type.
      This commit uses
      	Void for kind *
      	List for kind *->*
      	Tuple for kind *->...*->*
      which deals with most cases.  (Previously, it only dealt with
      kind *.)
      In the other cases, it just makes up a TyCon with a suitable
      kind.  If this gets into an interface file, anyone reading that
      file won't understand it.  This is fixable (by making the client
      of the interface file make up a TyCon too) but it is tiresome and
      never happens, so I am leaving it.
      Most of the added lines are comments.
    • simonpj's avatar
      [project @ 2002-02-07 12:51:47 by simonpj] · 5df7aa32
      simonpj authored
      	Slurp in a few more instance decls with ghc --make
      ghc --make wasn't slurping in quite enough instance decls.
      The relevant comment is in RnIfaces; the new part is marked.
      George Russel's Uniform showed this up.
      We slurp in an instance decl from the gated instance pool iff
      	all its gates are either in the gates of the module,
      	or are a previously-loaded tycon or class.
      The latter constraint is because there might have been an instance
      decl slurped in during an earlier compilation, like this:
      	instance Foo a => Baz (Maybe a) where ...
      In the module being compiled we might need (Baz (Maybe T)), where T
      is defined in this module, and hence we need (Foo T).  So @Foo@ becomes
      a gate.  But there's no way to 'see' that.
      NEW:  More generally, types might be involved as well:
      NEW:  	instance Foo2 T a => Baz2 a where ...
      NEW: Now we must treat T as a gate too, as well as Foo.  So the solution
      NEW: we adopt is:
      NEW: 	we simply treat all previously-loaded
      NEW: 	tycons and classes as gates.
      NEW: This gloss only affects ghc --make and ghc --interactive.
    • simonpj's avatar
      [project @ 2002-02-07 12:51:34 by simonpj] · 20f50b2a
      simonpj authored
      	Make TcType.match and TcUnify.uUnboundVar kind-aware
      George Russel had apparently-overlapping (ha) instance decls like
      	instance .. => C (a b) where
      	instance .. => C (x y) where
      But the a,b and x,y were different kinds!  Turned out that TcType.unify
      was kind-aware (so we didn't report a duplicate instance decl, but TcType.match
      was not (so we simply selected the wrong one, and got a mis-kinded constraint
      popping up from the ".."  part.  Very exciting to track down.
      I also make the ordinary unification kind-aware in the same way.  It's
      quite legitimate to attempt to unify, say,
      	(a b)    with     (c d)
      but the unification should fail if a's kind differs from c's.
      (There was a kind of debug warning before, but it's actually not an error
      in the compiler... so it should just make unification fail gracefully.)
    • simonpj's avatar
      [project @ 2002-02-07 12:50:00 by simonpj] · 35c63bfc
      simonpj authored
      Better pretty printing
    • simonmar's avatar
      [project @ 2002-02-07 10:20:05 by simonmar] · 54bab78d
      simonmar authored
      clean $(HC_OBJS) too
    • simonmar's avatar
      [project @ 2002-02-07 10:15:39 by simonmar] · ad38b443
      simonmar authored
      - update some comments
      - split up DERIVED_SRCS into separate variables so we can refer to
        them separately in the specification of the various CLEAN_FILES
      - only clean happy-generated files in maintainer-clean mode
    • sof's avatar
      [project @ 2002-02-07 06:33:20 by sof] · c2d67cab
      sof authored
      Little bit more doc on suspended_ccalling_threads
  2. 06 Feb, 2002 12 commits
    • sof's avatar
      [project @ 2002-02-06 20:52:51 by sof] · 1084e251
      sof authored
      unbreak stdcall handling (caused by recent change to Outputable instance for CCallConv)
    • simonpj's avatar
      [project @ 2002-02-06 15:54:23 by simonpj] · 979947f5
      simonpj authored
      Eliminate all vestiages of UsageTy, in preparation for
      	Keith's new version.  Hurrah!
      	Keith: LBVarInfo and usOnce,usMany are still there,
      	because I know you have eliminated LBVarInfo, and I didn't
      	want to cause unnecessary conflicts.
    • sewardj's avatar
      [project @ 2002-02-06 15:48:56 by sewardj] · 6e1e8a09
      sewardj authored
      x86 only: make %esp be 8-aligned before entering HC-world code.
      This avoids misalignment penalties for C doubles stored on the C
      stack.  A quick test using nofib/imaginary/rfib shows that getting
      this wrong increases run time by about 10% on our 1 GHz PIII.
    • keithw's avatar
      [project @ 2002-02-06 12:12:25 by keithw] · 37a47dd0
      keithw authored
      Merging the following onto the HEAD:
      |  +2 -4      fptools/ghc/compiler/rename/RnHsSyn.lhs
      | +10 -0     fptools/ghc/compiler/rename/RnSource.lhs
      Original comment (keithw):
      Remove derivings FVs from tyClDeclFVs, because they aren't needed by
      interface files.  Instead, we return these FVs from
    • simonmar's avatar
      [project @ 2002-02-06 11:41:01 by simonmar] · c19b2904
      simonmar authored
      Take into account the patchlevel when figuring out if we're
      bootstrapping or not.
    • sewardj's avatar
      [project @ 2002-02-06 11:34:01 by sewardj] · 6f3c1152
      sewardj authored
    • chak's avatar
      [project @ 2002-02-06 11:19:51 by chak] · 69a2acc3
      chak authored
      Add Julian to the author's list as he seems to shy to do it himself ;-)
    • sewardj's avatar
      [project @ 2002-02-06 11:13:47 by sewardj] · 70d68b08
      sewardj authored
      Clean up the AbsC -> AbsC translation of array operations.
      * MachOps MO_ReadOSBI and MO_WriteOSBI, which previously did
        array indexing, are gone.  We translate now just to plain
        memory references and explicit address computations.  This
        has the happy side effect that all MachOps now return exactly
        one result (previously it was 0 or 1), cleaning up various
        bits of code.
        As a result the Abstract C structure now contains an unneccessary
        restriction, which is that the result of a MachOp can only be
        assigned to a temporary.  This made sense when MachOps had variable
        numbers of results (0, 1 or 2, originally), but is no longer needed.
        MachOps applied to args could now be allowed to appear as
        arbitrary nodes in expression trees, but so far they are not.
      * Get rid of CAddrMode constructor CMem, since it is a special case of
        CVal with a RegRelative of CIndex.
      AbstractC is inconsistent and non-orthogonal.  The StixStmt + StixExpr
      combination expresses a large part of what AbstractC does in a cleaner
      and simpler way, IMO.
    • simonmar's avatar
      [project @ 2002-02-06 11:00:58 by simonmar] · 49fe2112
      simonmar authored
      Import lookupModuleEnv inside #ifdef GHCI
    • sof's avatar
      [project @ 2002-02-06 01:29:27 by sof] · 91fd2101
      sof authored
      - use task manager API to keep track of the number
        of tasks that are blocked waiting on the RTS lock.
      - comment updates/additions.
    • sof's avatar
      [project @ 2002-02-06 01:26:14 by sof] · 80c55dc7
      sof authored
      - in the threaded case, keep track of the number of
        tasks/threads that are currently waiting to enter
        the RTS.
      - taskStart():
           + only start up a new thread/task if there aren't
             any already waiting to gain RTS access.
           + honour thread/task limits (if any).
    • sof's avatar
      [project @ 2002-02-06 01:21:40 by sof] · 7f906dc8
      sof authored
      make stat_getElapsedTime(), SMP-only again
  3. 05 Feb, 2002 10 commits
    • sewardj's avatar
      [project @ 2002-02-05 16:56:38 by sewardj] · 0fee0e07
      sewardj authored
      [non-code-change] complaint --> compliant
    • keithw's avatar
      [project @ 2002-02-05 16:44:37 by keithw] · 6eaccd1a
      keithw authored
      Generalise types of minusUFM and intersectUFM_C (this was applied long
      ago to FiniteMap, IIRC).
      Untested: I haven't got a build tree handy, so please shoot me if this
      2-line change to two type signatures is type-incorrect.  Sorry!
    • simonpj's avatar
      [project @ 2002-02-05 15:42:04 by simonpj] · e6601808
      simonpj authored
      A bunch of related fixes concerning 'main'
      * Arrange that 'main' doesn't need to be defined in module Main;
        it can be imported.
      * The typechecker now injects a binding
      	Main.$main = PrelTopHandler.runMain main
        So the runtime system now calls Main.$main, not PrelMain.main.
        With z-encoding, this look like
      * The function
        	PrelTopHandler.runMain :: IO a -> IO ()
        wraps the programmer's 'main' in an exception-cacthing wrapper.
      * PrelMain.hs and Main.hi-boot are both removed from lib/std, along
        with multiple lines of special case handling in lib/std/Makefile.
        This is a worthwhile cleanup.
      * Since we now pick up whatever 'main' is in scope, the ranamer gets
        in on the act (RnRnv.checkMain).  There is a little more info to
        get from the renamer to the typechecker, so I've defined a new type
        Rename.RnResult (c.f. TcModule.TcResult)
      * With GHCi, it's now a warning, not an error, to omit the binding
        of main (RnEnv.checkMain)
      * It would be easy to add a flag "-main-is foo"; the place to use
        that information is in RnEnv.checkMain.
      On the way I made a new type,
      	type HscTypes.FixityEnv = NameEnv Fixity
      and used it in various places I'd tripped over
    • simonpj's avatar
      [project @ 2002-02-05 15:37:01 by simonpj] · fcd0dea6
      simonpj authored
      add renamer stuff
    • simonpj's avatar
      [project @ 2002-02-05 15:34:32 by simonpj] · 5b9d0e0f
      simonpj authored
      Add a bit of renamer documentation
    • simonpj's avatar
      [project @ 2002-02-05 15:02:23 by simonpj] · c43a63d3
      simonpj authored
      Imports only
    • simonpj's avatar
      [project @ 2002-02-05 14:46:26 by simonpj] · f50b860a
      simonpj authored
      Imports only
    • simonpj's avatar
      [project @ 2002-02-05 14:43:35 by simonpj] · 144e841e
      simonpj authored
      Imports and comments only
    • simonpj's avatar
      [project @ 2002-02-05 14:39:24 by simonpj] · c7eeb711
      simonpj authored
      Imports only
    • simonmar's avatar
      [project @ 2002-02-05 10:06:24 by simonmar] · 84a29fdd
      simonmar authored
      Fix bad bugs in deleteAllThreds: we were looping through the thread
      queues calling deleteThread() on each thread as we go, but calling
      deleteThread() has the side effect of removing the thread from the
      relevant queue, so we would end up breaking out of the loop after
      processing only a single thread.
      This may fix problems like "resurrectThreads: thread blocked in a
      strange way" seen after pressing ^C.
      Aside: we really shouldn't be using deleteThread() at all, since it
      doesn't give the thread a chance to clean up & release locks.  To be
      well-behaved a program has to catch ^C itself at the moment.
  4. 04 Feb, 2002 11 commits