1. 18 Aug, 2004 3 commits
    • simonmar's avatar
      [project @ 2004-08-18 13:14:21 by simonmar] · 77cfaa5c
      simonmar authored
      Add cmm directory
      77cfaa5c
    • simonmar's avatar
      [project @ 2004-08-18 10:07:29 by simonmar] · 831dbf15
      simonmar authored
      Remove extra semicolon; exposed by other recent changes.
      831dbf15
    • simonpj's avatar
      [project @ 2004-08-18 09:33:03 by simonpj] · 370765b2
      simonpj authored
      -------------------------------
      		Fix a fundep bug
      	-------------------------------
      
      		MERGE TO STABLE
      
      Big thank-you to Martin Sulzmann for finding this functional dependency bug.
      
      The new defn of FunDeps.Equation is:
      	type Equation = (TyVarSet, [(Type, Type)])
      Before it was (TyVarSet, Type, Type), so each pair of types was separately
      quantified (wrong).
      
      It's important that we have a *list* of pairs of types.  Consider
       	class C a b c | a -> b c where ...
      	instance C Int x x where ...
      Then, given the constraint (C Int Bool v) we should improve v to Bool,
      via the equation ({x}, [(Bool,x), (v,x)])
      This would not happen if the class had looked like
      	class C a b c | a -> b, a -> c
      
      
      Test in typecheck/should_compile/tc180
      370765b2
  2. 17 Aug, 2004 3 commits
    • simonmar's avatar
      [project @ 2004-08-17 16:00:58 by simonmar] · ca440e06
      simonmar authored
      - phases.xml: add documentation on <os>_TARGET_OS and <arch>_TARGET_ARCH
        symbols.
      
      - some fixes for editing in emacs
      ca440e06
    • simonpj's avatar
      [project @ 2004-08-17 15:23:47 by simonpj] · 59c796f8
      simonpj authored
      -------------------------------
      	Use merge-sort not quicksort
      	Nuke quicksort altogether
      	-------------------------------
      
      Quicksort has O(n**2) behaviour worst case, and this occasionally bites.
      In particular, when compiling large files consisting only of static data,
      we get loads of top-level delarations -- and that led to more than half the
      total compile time being spent in the strongly connected component analysis
      for the occurrence analyser.  Switching to merge sort completely solved the
      problem.
      
      I've nuked quicksort altogether to make sure this does not happen again.
      59c796f8
    • simonpj's avatar
      [project @ 2004-08-17 08:18:41 by simonpj] · c8898df0
      simonpj authored
      Typo in windows-specific code
      c8898df0
  3. 16 Aug, 2004 11 commits
    • simonpj's avatar
      [project @ 2004-08-16 16:26:51 by simonpj] · 2199f17d
      simonpj authored
      -------------------------------
      	Add instance information to :i
       	Get rid of the DeclPool
      	-------------------------------
      
      
      1.  Add instance information to :info command.  GHCi now prints out
          which instances a type or class belongs to, when you use :i
      
      2.  Tidy up printing of unqualified names in user output.
          Previously Outputable.PrintUnqualified was
      	type PrintUnqualified = Name -> Bool
          but it's now
      	type PrintUnqualified = ModuleName -> OccName -> Bool
          This turns out to be tidier even for Names, and it's now also usable
          when printing IfaceSyn stuff in GHCi, eliminating a grevious hack.
      
      3.  On the way to doing this, Simon M had the great idea that we could
          get rid of the DeclPool holding pen, which held declarations read from
          interface files but not yet type-checked.   We do this by eagerly
          populating the TypeEnv with thunks what, when poked, do the type
          checking.   This is just a logical continuation of lazy import
          mechanism we've now had for some while.
      
      The InstPool and RulePool still exist, but I plan to get rid of them in
      the same way.  The new scheme does mean that more rules get sucked in than
      before, because previously the TypeEnv was used to mean "this thing was needed"
      and hence to control which rules were sucked in.  But now the TypeEnv is
      populated more eagerly => more rules get sucked in.  However this problem
      will go away when I get rid of the Inst and Rule pools.
      
      I should have kept these changes separate, but I didn't.  Change (1)
      affects mainly
      	TcRnDriver, HscMain, CompMan, InteractiveUI
      whereas change (3) is more wide ranging.
      2199f17d
    • simonpj's avatar
      [project @ 2004-08-16 16:14:59 by simonpj] · 5938a5f3
      simonpj authored
      stg_interp_constr_entry and friends don't have info tables, so declare
      them using RTS_FUN() rather than RTS_ENTRY().
      5938a5f3
    • simonmar's avatar
      [project @ 2004-08-16 11:57:19 by simonmar] · 36fc368e
      simonmar authored
      Avoid casting lvalues; gcc 3.4 issues warnings for it.
      36fc368e
    • simonmar's avatar
      [project @ 2004-08-16 11:19:24 by simonmar] · e3d95da8
      simonmar authored
      Define <arch>_TARGET_ARCH and <os>_TARGET_OS by default when CPP'ing.
      This avoids the main reason for needing to #include config.h into
      Haskell source, so most files that previously just #include "config.h" can now
      
        #if __GLASGOW_HASKELL__ < 603
        #include "config.h"
        #endif
      e3d95da8
    • simonmar's avatar
      [project @ 2004-08-16 11:17:20 by simonmar] · d6174f50
      simonmar authored
      Add a config.h to ease the transition.  Now if you include config.h
      you get a warning instead of a failure:
      
      In file included from System/Posix/Internals.hs:24:
      /playpen/ghc/nightly/HEAD-cam-02-unx/i386-unknown-linux/ghc/includes/config.h:4: warning: #warning config.h is deprecated; please use ghcconfig.h instead
      d6174f50
    • simonmar's avatar
      [project @ 2004-08-16 10:59:37 by simonmar] · 5a19aad0
      simonmar authored
      config.h ==> ghcconfig.h
      5a19aad0
    • simonpj's avatar
      [project @ 2004-08-16 09:53:47 by simonpj] · 4e325538
      simonpj authored
      -------------------------------
      	Add instance information to :i
       	Get rid of the DeclPool
      	-------------------------------
      
      
      1.  Add instance information to :info command.  GHCi now prints out
          which instances a type or class belongs to, when you use :i
      
      2.  Tidy up printing of unqualified names in user output.
          Previously Outputable.PrintUnqualified was
      	type PrintUnqualified = Name -> Bool
          but it's now
      	type PrintUnqualified = ModuleName -> OccName -> Bool
          This turns out to be tidier even for Names, and it's now also usable
          when printing IfaceSyn stuff in GHCi, eliminating a grevious hack.
      
      3.  On the way to doing this, Simon M had the great idea that we could
          get rid of the DeclPool holding pen, which held declarations read from
          interface files but not yet type-checked.   We do this by eagerly
          populating the TypeEnv with thunks what, when poked, do the type
          checking.   This is just a logical continuation of lazy import
          mechanism we've now had for some while.
      
      The InstPool and RulePool still exist, but I plan to get rid of them in
      the same way.  The new scheme does mean that more rules get sucked in than
      before, because previously the TypeEnv was used to mean "this thing was needed"
      and hence to control which rules were sucked in.  But now the TypeEnv is
      populated more eagerly => more rules get sucked in.  However this problem
      will go away when I get rid of the Inst and Rule pools.
      
      I should have kept these changes separate, but I didn't.  Change (1)
      affects mainly
      	TcRnDriver, HscMain, CompMan, InteractiveUI
      whereas change (3) is more wide ranging.
      4e325538
    • simonpj's avatar
      [project @ 2004-08-16 09:51:20 by simonpj] · d32c5227
      simonpj authored
      Commments only
      d32c5227
    • simonpj's avatar
      [project @ 2004-08-16 09:41:19 by simonpj] · 228c4743
      simonpj authored
      Fix problem with :i for (:)
      228c4743
    • simonmar's avatar
      [project @ 2004-08-16 09:31:50 by simonmar] · 428d3450
      simonmar authored
      #ifdefery to work around change in name of config.h.
      428d3450
    • panne's avatar
      [project @ 2004-08-16 07:24:25 by panne] · 092d7917
      panne authored
      Correct DocBook XML now
      092d7917
  4. 15 Aug, 2004 1 commit
    • panne's avatar
      [project @ 2004-08-15 20:37:22 by panne] · b9de29ac
      panne authored
      Started to convert the users guide to DocBook XML. Not yet finished, there are
      still *tons* of misplaced indexterms, but some sensible documentation can
      already be generated.
      b9de29ac
  5. 13 Aug, 2004 9 commits
  6. 12 Aug, 2004 6 commits
  7. 10 Aug, 2004 1 commit
    • simonmar's avatar
      [project @ 2004-08-10 09:02:36 by simonmar] · c9a32c38
      simonmar authored
      Fix problem with inline foreign-call changes yesterday.  Foreign call
      args sometimes have to be modified using shimFCallArg - nowadays this
      is done at code generation time, whereas it used to be done at
      pretty-printing time.
      c9a32c38
  8. 09 Aug, 2004 4 commits
    • simonmar's avatar
      [project @ 2004-08-09 14:27:53 by simonmar] · 05881eca
      simonmar authored
      Two changes:
      
        - newly created or unblocked threads go to the back of the run
          queue.  This is fairer because it avoids possible starvation.
          Fixes problem with conc004 test going much slower with optimisation.
      
        - The context switch flag is only reset after a yield.  Previously,
          it was being reset before we ran a thread, which meant that a tick
          that arrived during GC would be lost, and a thread doing lots of
          GC could hog the CPU.  Now, GC is effectively counted as part of
          the last running thread's timeslice.
      
      MERGE TO STABLE.
      05881eca
    • simonmar's avatar
      [project @ 2004-08-09 13:19:29 by simonmar] · 46d88d87
      simonmar authored
      Allow case-of-unsafe-ccall to compile to straight-line code, like it
      used to.  This has already been fixed on the backend-hacking-branch,
      but I'm doing it here so that it can be merged into the STABLE branch,
      where it will help to work around a bug.
      
      The bug is in CgExpr.lhs:primRetUnboxedTuple, which picks temporaries
      to assign the result of a ccall to.  The Cg monad doesn't have a uniq
      supply (in the HEAD), so we always pick the same temporaries.  This
      leads to clashes in complex function with multiple ccalls.  Again,
      this is already fixed in the backend-hacking-branch.  I don't see an
      easy fix for this bug.
      
      The compilation of case-of-unsafe-ccall doesn't suffer from this
      problem, and it will help work around some cases of the bug, so I'm
      going to merge this onto the STABLE branch after some testing.
      46d88d87
    • simonmar's avatar
      [project @ 2004-08-09 12:35:02 by simonmar] · a8601d0e
      simonmar authored
      Fix scoped type variable example.
      a8601d0e
    • simonmar's avatar
      [project @ 2004-08-09 12:15:09 by simonmar] · dfd0efbe
      simonmar authored
      Put a "-- " before the location info, since the rest of the output
      looks like Haskell source.
      dfd0efbe
  9. 08 Aug, 2004 2 commits