1. 17 Oct, 2001 11 commits
    • simonpj's avatar
      [project @ 2001-10-17 15:38:43 by simonpj] · f342fa9e
      simonpj authored
      Add comments
      f342fa9e
    • simonmar's avatar
      [project @ 2001-10-17 15:19:24 by simonmar] · 7be8839e
      simonmar authored
      Add missing CONSTR_NOCAF_STATIC case to the THUNK_SELECTOR evacuation
      code.  Strange that we've never seen this before...
      7be8839e
    • simonmar's avatar
      [project @ 2001-10-17 14:24:52 by simonmar] · e06fd3a8
      simonmar authored
      Comment out a bogus assertion, and add a comment to describe why it
      isn't necessarily true (see the comment for details).
      e06fd3a8
    • simonmar's avatar
      [project @ 2001-10-17 14:17:11 by simonmar] · 43ff6195
      simonmar authored
      Fix a small performance bug.  In mkAlts, when calculating the
      impossible constructors, we were looking at the unfolding for the case
      binder instead of the scrutinee, with the result that we sometimes
      didn't notice that a DEFAULT case could be resolved into a specific
      pattern.
      43ff6195
    • simonpj's avatar
      [project @ 2001-10-17 13:16:03 by simonpj] · 7a5920b3
      simonpj authored
      -------------------------------------------
        	Desugar bindings into Rec groups more often
      		[Part 2]
        	-------------------------------------------
      
      	** MERGE PLEASE **
      
      	  [I forgot the unlifted case.]
      
        In rather obscure cases (involving functional dependencies)
        it is possible to get an AbsBinds [] [] (no tyvars, no dicts)
        which nevertheless has some "dictionary bindings".  These
        come out of the typechecker in non-dependency order, so we
        need to Rec them just in case.
      
        It turns out to be a bit awkward.  The smallest fix is
        to make dsLet always make a Rec; brutal but correct.
      7a5920b3
    • simonmar's avatar
      [project @ 2001-10-17 13:13:36 by simonmar] · 3b9d7c81
      simonmar authored
      Add a comment about assumptions that we make about the result of
      etaExpand.
      3b9d7c81
    • simonmar's avatar
      [project @ 2001-10-17 13:12:56 by simonmar] · 93436263
      simonmar authored
      Use the smart constructor mkNote instead of the dumb constructor
      (Note) when rebuilding the expression after eta expansion.  This is
      necessary to avoid invalidating some assumptions we make about the
      output of etaExpand in CorePrep, in particular that there aren't any
      lambda expressions inside an SCC note.
      93436263
    • simonpj's avatar
      [project @ 2001-10-17 11:50:38 by simonpj] · 670e5f97
      simonpj authored
      --------------------------
      	nullAddr# fix for the HEAD
      	  [missed one file]
      	--------------------------
      
      	*** DO NOT MERGE ***
      
      nullAddr# is simply a name for (Lit nullAddrLit).  Up
      to now it has been a PrimOp with the rather stange type
      	nullAddr# :: Int# -> Addr#
      which discards its argument.  (I think the problem with
      nullary primops is to do with the top-level bindings in
      PrelPrimOpWrappers.)   And there was a RULE in PrelRules
      to rewrite
      	nullAddr _ ==> nullAddrLit
      
      It's excessive to make it a PrimOp.  We can just treat it
      like unsafeCoerce#, which is made in MkId.lhs.   So I've
      done that, and given it the more sensible type
      	nullAddr# :: Addr#
      
      I fixed all the occurrences I could find.
      670e5f97
    • simonpj's avatar
      [project @ 2001-10-17 11:26:04 by simonpj] · fd94f663
      simonpj authored
      -------------------------------------------
      	nullAddr# fix for the HEAD
      	-------------------------------------------
      
      	*** DO NOT MERGE ***
      
      nullAddr# is simply a name for (Lit nullAddrLit).  Up
      to now it has been a PrimOp with the rather stange type
      	nullAddr# :: Int# -> Addr#
      which discards its argument.  (I think the problem with
      nullary primops is to do with the top-level bindings in
      PrelPrimOpWrappers.)   And there was a RULE in PrelRules
      to rewrite
      	nullAddr _ ==> nullAddrLit
      
      It's excessive to make it a PrimOp.  We can just treat it
      like unsafeCoerce#, which is made in MkId.lhs.   So I've
      done that, and given it the more sensible type
      	nullAddr# :: Addr#
      
      I fixed all the occurrences I could find.
      fd94f663
    • simonpj's avatar
      [project @ 2001-10-17 11:05:36 by simonpj] · 95e31ad5
      simonpj authored
      -------------------------------------------
      	Desugar bindings into Rec groups more often
      	-------------------------------------------
      
      In rather obscure cases (involving functional dependencies)
      it is possible to get an AbsBinds [] [] (no tyvars, no dicts)
      which nevertheless has some "dictionary bindings".  These
      come out of the typechecker in non-dependency order, so we
      need to Rec them just in case.
      
      It turns out to be a bit awkward.  The smallest fix is
      to make dsLet always make a Rec; brutal but correct.
      95e31ad5
    • simonpj's avatar
      [project @ 2001-10-17 10:35:34 by simonpj] · 5afd840f
      simonpj authored
      -------------------------------
      	Fix type-synonym arity checking
      	-------------------------------
      
      	*** MERGE TO STABLE BRANCH ***
      
      The newish stuff on checking types (checkValidType etc)
      didn't detect an un-saturated, but *kind-correct* type
      synonym occurrence.  Example:
      
      	type A i = i
      	type B = A
      
      Result: crash.  Fix is rather easy.
      
      Thanks to Thomas Hallgren.
      5afd840f
  2. 16 Oct, 2001 15 commits
  3. 15 Oct, 2001 5 commits
    • simonpj's avatar
      [project @ 2001-10-15 16:03:04 by simonpj] · 5e65c9fe
      simonpj authored
      --------------------------
      	Tidy up arity propagation (the saga continues)
      	--------------------------
      
      Turns out that it's not as easy as I thought.
      
      The code generator was assuming that (not . isLocalName) was enough to
      identify an imported thing (whose CgInfo should be right), but that's
      not true.  Needs more thought.
      
      Meanwhile, I've made the code generator a bit more sensible about how
      it looks things up.  But there's still a problem for GHCi: the
      unfoldings in the TypeEnv won't have CgIdInfo stuff.  Sigh.  Thinks.
      5e65c9fe
    • simonpj's avatar
      [project @ 2001-10-15 15:06:01 by simonpj] · 713b32a5
      simonpj authored
      --------------------------
      	Tidy up arity propagation
      	--------------------------
      
      Due to excessive complexity, correct arity information was getting
      lost on the way to interface files.  As a result, a function that had
      CPR info __S SLm (say), was getting arity 0, and this confused the (old)
      CPR analyser ("lub of function and HasCPR").
      
      I hope this fixes the above error (which showed up somewhere in
      compiling Edison), but I'm going to commit it right now anyway.
      Meanwhile I'll recompile Edison too.
      
      
      Details
      ~~~~~~~
      Digging out the rather obscure cause made me tidy up the CgInfo stuff.
      The story is now
      
      * The CgInfo field of an Id gets attached to the Id *only* in
        the TypeEnv of the ModuleDetails, during CoreTidy.
      
        This ModuleDetails stuff is used
      	a) to generate the interface file
      	b) to import into other modules in GHCi
      
      * No CgInfo field is in the CoreBindings which are passed
        downsteam to CorePrep and thence CodeGen.  Quite right too...
        it's the downstream stuff that *generates* the CgInfo.
      
      * But the Arity field *is* now passed on through CoreTidy
        (like strictness info) since it is usefully used by CorePrep.
      
      * On the way I simplified the ArityInfo field of an IdInfo
        to simply
      		Arity
        instead of
      		Maybe Arity
      713b32a5
    • simonpj's avatar
      [project @ 2001-10-15 15:05:17 by simonpj] · c4854c78
      simonpj authored
      Rename ifaceTyCls to ifaceTyThing (more consistent)
      c4854c78
    • simonpj's avatar
      [project @ 2001-10-15 15:03:48 by simonpj] · 3d5a3720
      simonpj authored
      Add comments re eta expansion
      3d5a3720
    • simonpj's avatar
      [project @ 2001-10-15 15:03:24 by simonpj] · 97bef2ce
      simonpj authored
      Add comment for type of unsafeCoerce#
      97bef2ce
  4. 13 Oct, 2001 5 commits
  5. 12 Oct, 2001 3 commits
  6. 11 Oct, 2001 1 commit
    • sof's avatar
      [project @ 2001-10-11 23:52:51 by sof] · 41d3a213
      sof authored
      Robustified handling of paths, allowing both / and \ to be recognised
      as path separators under Win32 -- ghc-5.02-win32 has a bug where
      it will barf when invoked as follows:
      
         c:\dot\net> ghc -c c:\dot\net\foo.hs -odir c:\dot\net\output
      
      i.e., a DOS-style input filename together with the use of -odir. (5.02
      constructs an illegal path for the -o argument to the assembler).
      
      Branch mergers: go wild
      41d3a213