1. 14 Mar, 2002 1 commit
  2. 13 Mar, 2002 7 commits
  3. 12 Mar, 2002 12 commits
    • simonmar's avatar
      [project @ 2002-03-12 16:48:52 by simonmar] · c50d5acc
      simonmar authored
      Fix a bug in the native code generator's handling of floating-point
      arguments to ccalls: it wasn't correctly promoting float arguments to
      doubles.  Amazingly this has gone undetected for quite a while.
      
      Fixes bug #523996.
      c50d5acc
    • simonmar's avatar
      [project @ 2002-03-12 16:45:59 by simonmar] · d0bf18ef
      simonmar authored
      Forced commit: note that the previous revision also improved the error
      message for a compiler stack overflow slightly.
      d0bf18ef
    • simonmar's avatar
      [project @ 2002-03-12 16:40:57 by simonmar] · 2bc259ae
      simonmar authored
      eek!  Somehow, I managed to make -fvia-C the default on the HEAD and
      nobody noticed for two months.
      2bc259ae
    • simonpj's avatar
      [project @ 2002-03-12 15:55:26 by simonpj] · 72c2f581
      simonpj authored
      ------------------------
      	Fix a type-invariant bug
      	------------------------
      
      We need to call Type.mkGenTyConApp from Type.mkAppTy, in
      case there's a partially applied type synonym.  Explanation
      with Type.mkAppTy.  All part of GHC's rather liberal treatment
      of type synonyms.
      
      Shown up by a program from Ralf Laemmel:
      
      	type Generic i o = forall x. i x -> o x
      	type Id x = x
      	comb :: Generic Id Id
      
      Test is typecheck/should_compile/tc149.hs
      72c2f581
    • simonmar's avatar
      [project @ 2002-03-12 15:28:25 by simonmar] · a03714e2
      simonmar authored
      Add a magic number to the beginning of interface files (0x1face :-) to
      avoid trying to read old text-style interfaces as binary (the usual
      result is an attempt to allocate a ByteArray larger than the available
      memory size and an obscure crash).
      a03714e2
    • simonmar's avatar
      [project @ 2002-03-12 13:57:11 by simonmar] · 5eedab2c
      simonmar authored
      If we are in a deadlock situation but there are signal handlers
      installed, pause() instead of reporting deadlock.  One of the signal
      handlers may allow the process to continue after being triggered.
      
      Fixes bug #525772.
      
      I've made a half-hearted attempt to clean up the deadlock code in the
      scheduler, it now looks slightly better.
      5eedab2c
    • simonmar's avatar
      [project @ 2002-03-12 11:50:02 by simonmar] · f762be1b
      simonmar authored
      Main threads are now not kept alive artificially, so it is possible
      for a main thread to be sent the BlockedOnDeadMVar exception.  Main
      threads are no longer GC roots.
      
      This involved cleaning up the weak pointer processing somewhat, and
      separating the processing of real weak pointers from the processing of
      the all_threads list (which can be thought of as "weaker pointers": a
      finalizer can keep a blocked thread alive, but not vice-versa).  The
      new story is described in a detailed comment in GC.c.
      
      One interesting consequence is that it's much harder to get a Deadlock
      exception now - many deadlock situations involving main threads will
      turn into BlockedOnDeadMVar situations instead.  For example, if there
      are a group of threads in a circular deadlock, then they will all be
      sent BlockedOnDeadMVar simultaneously, whereas before if one of them
      was the main thread it would be sent Deadlock.  It's really hard to
      get Deadlock now - you have to somehow keep an MVar independently
      reachable, eg. by using a StablePtr.
      f762be1b
    • simonmar's avatar
      [project @ 2002-03-12 10:41:48 by simonmar] · 44aa6bcb
      simonmar authored
      When deciding whether the source for a module is unchanged, don't look
      at the file referred to in the argument of '-o' unless it really is
      the object file for this compilation (it might be the binary instead).
      
      MERGE TO STABLE
      44aa6bcb
    • simonmar's avatar
      [project @ 2002-03-12 10:37:31 by simonmar] · 81834778
      simonmar authored
      - Fix brokenness in foreign export.
      - Remove some unused imports.
      81834778
    • simonmar's avatar
      [project @ 2002-03-12 09:23:01 by simonmar] · 9bd50a0d
      simonmar authored
      - Add quotes around invocation of ${WithGhc-ghc}, in case the pathname
        has spaces in (bug #528810).
      
      - remove now-unused definition of is_gcc_v3.
      9bd50a0d
    • simonpj's avatar
      [project @ 2002-03-12 09:13:08 by simonpj] · 65f44e38
      simonpj authored
      -----------
      	Fix mkSynTy
      	-----------
      
      Fix a nasty and long-lived bug in mkSynTy which meant that in:
      
      	newtype A a = A a
      	type B = A
      	f :: B Double
      
      the type (B Double) wasn't regarded properly as (A Double).  This bug
      has lasted for a long time because the type inference engine is fairly
      forgiving about missing the invariant that a TyConApp always looks
      like one right at the top level.  In fact, it's so forgiving that I
      don't know how to tickle this bug into showing up.  (It showed up in
      5.02, becuase the context-simplification for 'deriving' is done by a
      different engine as all the other context simplification.)
      
      Still, the invariant should hold, and this fix makes it so.
      65f44e38
    • simonpj's avatar
      [project @ 2002-03-12 09:12:57 by simonpj] · 49c84dec
      simonpj authored
      Comments
      49c84dec
  4. 11 Mar, 2002 3 commits
    • simonmar's avatar
      [project @ 2002-03-11 13:56:49 by simonmar] · 4ba40d2d
      simonmar authored
      import openFileEx and IOModeEx(..)
      4ba40d2d
    • simonmar's avatar
      [project @ 2002-03-11 11:17:01 by simonmar] · 4d46f8cc
      simonmar authored
      Add a warning about booting from .hc files on GHC 5.xx, and recommend
      using 4.08.2 instead.
      4d46f8cc
    • simonmar's avatar
      [project @ 2002-03-11 10:55:11 by simonmar] · b274236c
      simonmar authored
      Re-instate ifeq "$(way)" "" around the rule for recursively descending
      into SUBDIRS that I removed a while back.  This will fix a bug in
      nofib whereby if NoFibWays is set to anything then we do O(n^2)
      traversals of the tree, but it also means you can't sit at the top of
      the tree and say 'make way=p' to just build profiling libraries (which
      was the reason I made the change in the first place).  We'll have to
      find another way to do this.
      b274236c
  5. 08 Mar, 2002 6 commits
    • simonpj's avatar
      [project @ 2002-03-08 16:03:13 by simonpj] · 7fc19edc
      simonpj authored
      Documentation for more liberal class-method types
      7fc19edc
    • simonmar's avatar
      [project @ 2002-03-08 16:00:39 by simonmar] · e9acdb5b
      simonmar authored
      Make this compile with various GHC versions (hopefully)
      e9acdb5b
    • simonpj's avatar
      [project @ 2002-03-08 15:51:19 by simonpj] · 3b6febd6
      simonpj authored
      wibble
      3b6febd6
    • simonpj's avatar
      [project @ 2002-03-08 15:50:53 by simonpj] · a170160c
      simonpj authored
      --------------------------------------
      	Lift the class-method type restriction
      	--------------------------------------
      
      Haskell 98 prohibits class method types to mention constraints on the
      class type variable, thus:
      
        class Seq s a where
          fromList :: [a] -> s a
          elem     :: Eq a => a -> s a -> Bool
      
      The type of 'elem' is illegal in Haskell 98, because it contains the
      constraint 'Eq a', which constrains only the class type variable (in
      this case 'a').
      
      This commit lifts the restriction.  The way we do that is to do a full
      context reduction (tcSimplifyCheck) step for each method separately in
      TcClassDcl.tcMethodBind, rather than doing a single context reduction
      for the whole group of method bindings.
      
      As a result, I had to reorganise the code a bit, and tidy up.
      a170160c
    • simonpj's avatar
      [project @ 2002-03-08 15:47:18 by simonpj] · 4593b105
      simonpj authored
      ------------------------
      	Kill Type.splitRepFunTys
      	------------------------
      
      splitRepFunTys was a Bad Function that split up a function type
      looking through even recursive newtypes.  Alas, it diverged if
      when we had a recursive newtype with a function whose result was
      the newtype itself.
      
      I've replaced it with ordinary splitFunTys, plus a new function
      Type.dropForAlls, which does what you would expect.
      4593b105
    • simonpj's avatar
      [project @ 2002-03-08 15:42:12 by simonpj] · 354f17ec
      simonpj authored
      Read and write interfaces in binary mode; important for Win32
      354f17ec
  6. 07 Mar, 2002 1 commit
  7. 06 Mar, 2002 5 commits
  8. 05 Mar, 2002 5 commits
    • sof's avatar
      [project @ 2002-03-05 21:05:59 by sof] · 95210818
      sof authored
      make it compile with 5.02
      95210818
    • simonmar's avatar
      [project @ 2002-03-05 14:30:51 by simonmar] · ae9bb984
      simonmar authored
      GHC.Prim is always excluded from ghc -M now.
      ae9bb984
    • simonmar's avatar
      [project @ 2002-03-05 14:18:53 by simonmar] · caac75c6
      simonmar authored
      Generate the contents of the GHC.Prim interface file automatically
      from the list of available PrimOps and various other wired-in things.
      
      Two main benefits from this:
      
        - There's one fewer places to edit when adding a new primop.
      
        - It's one less reason to need the interface file parser, and
          now we no longer need the (short-lived) --compile-iface option
          so I've removed it.
      caac75c6
    • simonmar's avatar
      [project @ 2002-03-05 11:22:44 by simonmar] · 027168af
      simonmar authored
      revert previous commit
      027168af
    • simonmar's avatar
      [project @ 2002-03-05 09:05:23 by simonmar] · 06f35bd5
      simonmar authored
      [ forgot to add this file the first time around... ]
      
      Binary Interface Files - stage 1
      --------------------------------
      
      This commit changes the default interface file format from text to
      binary, in order to improve compilation performace.
      
      To view an interface file, use 'ghc --show-iface Foo.hi'.
      
      utils/Binary.hs is the basic Binary I/O library, based on the nhc98
      binary I/O library but much stripped-down and working in terms of
      bytes rather than bits, and with some special features for GHC: it
      remembers which Module is being emitted to avoid dumping too many
      qualified names, and it keeps track of a "dictionary" of FastStrings
      so that we don't dump the same FastString more than once into the
      binary file.  I'll make a generic version of this for the libraries at
      some point.
      
      main/BinIface.hs contains most of the Binary instances.  Some
      instances are in the same module as the data type (RdrName, Name,
      OccName in particular).  Most instances were generated using a
      modified version of DrIFT, which I'll commit later.  However, editing
      them by hand isn't hard (certainly easier than modifying
      ParseIface.y).
      
      The first thing in a binary interface is the interface version, so
      nice error messages will be generated if the binary format changes and
      you still have old interfaces lying around.  The version also now
      includes the "way" as an extra sanity check.
      
      Other changes
      -------------
      
      I don't like the way FastStrings contain both hashed strings (with
      O(1) comparison) and literal C strings (with O(n) comparison).  So as
      a first step to separating these I made serveral "literal" type
      strings into hashed strings.  SLIT() still generates a literal, and
      now FSLIT() generates a hashed string.  With DEBUG on, you'll get a
      warning if you try to compare any SLIT()s with anything, and the
      compiler will fall over if you try to dump any literal C strings into
      an interface file (usually indicating a use of SLIT() which should be
      FSLIT()).
      
      mkSysLocal no longer re-encodes its FastString argument each time it
      is called.
      
      I also fixed the -pgm options so that the argument can now optionally
      be separted from the option.
      
      Bugfix: PrelNames declared Names for several comparison primops, eg.
      eqCharName, eqIntName etc. but these had different uniques from the
      real primop names.  I've moved these to PrimOps and defined them using
      mkPrimOpIdName instead, and deleted some for which we don't have real
      primops (Manuel: please check that things still work for you after
      this change).
      06f35bd5