ghc-hetmet.git
23 years ago[project @ 2001-03-14 10:14:13 by rrt]
rrt [Wed, 14 Mar 2001 10:14:13 +0000 (10:14 +0000)]
[project @ 2001-03-14 10:14:13 by rrt]
Don't use /tmp.

23 years ago[project @ 2001-03-14 10:13:30 by rrt]
rrt [Wed, 14 Mar 2001 10:13:30 +0000 (10:13 +0000)]
[project @ 2001-03-14 10:13:30 by rrt]
Ban /tmp. TMPDIR r00lz!

23 years ago[project @ 2001-03-14 10:12:36 by rrt]
rrt [Wed, 14 Mar 2001 10:12:36 +0000 (10:12 +0000)]
[project @ 2001-03-14 10:12:36 by rrt]
Don't use /tmp. /tmp has bad karma!

23 years ago[project @ 2001-03-14 10:11:16 by rrt]
rrt [Wed, 14 Mar 2001 10:11:16 +0000 (10:11 +0000)]
[project @ 2001-03-14 10:11:16 by rrt]
/tmp -> TMPDIR (don't worry dudes, it's just a comment!)

23 years ago[project @ 2001-03-13 21:21:27 by qrczak]
qrczak [Tue, 13 Mar 2001 21:21:27 +0000 (21:21 +0000)]
[project @ 2001-03-13 21:21:27 by qrczak]
Add 'destruct :: Ptr a -> IO ()' method to class Storable. Thanks
Wojciech Moczydlowski <khaliff@astercity.net> for the suggestion.

It should free memory associated with the object (except the object
pointer itself). A default definition does nothing, but will be
non-trivial for some C structs.

The canonical ForeignPtr finalizer for a malloced data object would be
'destruct p >> free p'.

23 years ago[project @ 2001-03-13 17:46:56 by rrt]
rrt [Tue, 13 Mar 2001 17:46:56 +0000 (17:46 +0000)]
[project @ 2001-03-13 17:46:56 by rrt]
Use TMPDIR, not /tmp.

23 years ago[project @ 2001-03-13 17:30:57 by simonmar]
simonmar [Tue, 13 Mar 2001 17:30:57 +0000 (17:30 +0000)]
[project @ 2001-03-13 17:30:57 by simonmar]
update expected output

23 years ago[project @ 2001-03-13 17:16:52 by simonmar]
simonmar [Tue, 13 Mar 2001 17:19:07 +0000 (17:19 +0000)]
[project @ 2001-03-13 17:16:52 by simonmar]
update expected output

23 years ago[project @ 2001-03-13 17:12:43 by simonmar]
simonmar [Tue, 13 Mar 2001 17:12:43 +0000 (17:12 +0000)]
[project @ 2001-03-13 17:12:43 by simonmar]
update expected output

23 years ago[project @ 2001-03-13 17:08:36 by simonmar]
simonmar [Tue, 13 Mar 2001 17:08:36 +0000 (17:08 +0000)]
[project @ 2001-03-13 17:08:36 by simonmar]
fix up for GHCi

23 years ago[project @ 2001-03-13 16:57:34 by simonpj]
simonpj [Tue, 13 Mar 2001 16:57:34 +0000 (16:57 +0000)]
[project @ 2001-03-13 16:57:34 by simonpj]
Add error location for deriving failure errors

23 years ago[project @ 2001-03-13 16:04:07 by simonpj]
simonpj [Tue, 13 Mar 2001 16:04:07 +0000 (16:04 +0000)]
[project @ 2001-03-13 16:04:07 by simonpj]
Remove debug print

23 years ago[project @ 2001-03-13 15:53:52 by simonmar]
simonmar [Tue, 13 Mar 2001 15:53:52 +0000 (15:53 +0000)]
[project @ 2001-03-13 15:53:52 by simonmar]
unused imports

23 years ago[project @ 2001-03-13 15:45:26 by simonpj]
simonpj [Tue, 13 Mar 2001 15:45:26 +0000 (15:45 +0000)]
[project @ 2001-03-13 15:45:26 by simonpj]
Add beginning of docs for implicit params, and functional deps; I hope formatting is ok

23 years ago[project @ 2001-03-13 15:44:58 by simonpj]
simonpj [Tue, 13 Mar 2001 15:44:58 +0000 (15:44 +0000)]
[project @ 2001-03-13 15:44:58 by simonpj]
Remove docs for -funfolding-interface-threshold

23 years ago[project @ 2001-03-13 15:37:50 by simonmar]
simonmar [Tue, 13 Mar 2001 15:37:50 +0000 (15:37 +0000)]
[project @ 2001-03-13 15:37:50 by simonmar]
remove -funfolding-interface-threshold flag.

23 years ago[project @ 2001-03-13 15:22:54 by simonpj]
simonpj [Tue, 13 Mar 2001 15:22:54 +0000 (15:22 +0000)]
[project @ 2001-03-13 15:22:54 by simonpj]
Add 091

23 years ago[project @ 2001-03-13 14:59:56 by simonmar]
simonmar [Tue, 13 Mar 2001 14:59:56 +0000 (14:59 +0000)]
[project @ 2001-03-13 14:59:56 by simonmar]
fix Happy test.

23 years ago[project @ 2001-03-13 14:58:25 by simonpj]
simonpj [Tue, 13 Mar 2001 14:58:28 +0000 (14:58 +0000)]
[project @ 2001-03-13 14:58:25 by simonpj]
----------------
Nuke ClassContext
----------------

This commit tidies up a long-standing inconsistency in GHC.
The context of a class or instance decl used to be restricted
to predicates of the form
C t1 .. tn
with
type ClassContext = [(Class,[Type])]

but everywhere else in the compiler we used

type ThetaType = [PredType]
where PredType can be any sort of constraint (= predicate).

The inconsistency actually led to a crash, when compiling
class (?x::Int) => C a where {}

I've tidied all this up by nuking ClassContext altogether, and using
PredType throughout.  Lots of modified files, but all in
more-or-less trivial ways.

I've also added a check that the context of a class or instance
decl doesn't include a non-inheritable predicate like (?x::Int).

Other things

 * rename constructor 'Class' from type TypeRep.Pred to 'ClassP'
   (makes it easier to grep for)

 * rename constructor HsPClass  => HsClassP
      HsPIParam => HsIParam

23 years ago[project @ 2001-03-13 14:18:47 by simonmar]
simonmar [Tue, 13 Mar 2001 14:18:47 +0000 (14:18 +0000)]
[project @ 2001-03-13 14:18:47 by simonmar]
re-instate an ASSERT that was temporarily commented out.

23 years ago[project @ 2001-03-13 14:17:16 by simonmar]
simonmar [Tue, 13 Mar 2001 14:17:16 +0000 (14:17 +0000)]
[project @ 2001-03-13 14:17:16 by simonmar]
Fix let-no-escapes again.

23 years ago[project @ 2001-03-13 12:50:29 by simonmar]
simonmar [Tue, 13 Mar 2001 12:50:33 +0000 (12:50 +0000)]
[project @ 2001-03-13 12:50:29 by simonmar]
Some rearrangements that Simon & I have been working on recently:

    - CoreSat is now CorePrep, and is a general "prepare-for-code-
      generation" pass.  It does cloning, saturation of constructors &
      primops, A-normal form, and a couple of other minor fiddlings.

    - CoreTidy no longer does cloning, and minor fiddlings.  It doesn't
      need the unique supply any more, so that's removed.

    - CoreToStg now collects CafInfo and the list of CafRefs for each
      binding.  The SRT pass is much simpler now.

    - IdInfo now has a CgInfo field for "code generator info".  It currently
      contains arity (the actual code gen arity which affects the calling
      convention as opposed to the ArityInfo which is a measure of how
      many arguments the Id can be applied to before it does any work), and
      CafInfo.

      Previously we overloaded the ArityInfo field to contain both
      codegen arity and simplifier arity.  Things are cleaner now.

    - CgInfo is collected by CoreToStg, and passed back into CoreTidy in
      a loop.  The compiler will complain rather than going into a black
      hole if the CgInfo is pulled on too early.

    - Worker info in an interface file now comes with arity info attached.
      Previously the main arity info was overloaded for this purpose, but
      it lead to a few hacks in the compiler, this tidies things up somewhat.

Bottom line: we removed several fragilities, and tidied up a number of
things.  Code size should be smaller, but we'll see...

23 years ago[project @ 2001-03-12 16:33:56 by simonpj]
simonpj [Mon, 12 Mar 2001 16:33:56 +0000 (16:33 +0000)]
[project @ 2001-03-12 16:33:56 by simonpj]
Make a better CPR wrapper when profiling is in use

23 years ago[project @ 2001-03-12 14:59:32 by sewardj]
sewardj [Mon, 12 Mar 2001 14:59:32 +0000 (14:59 +0000)]
[project @ 2001-03-12 14:59:32 by sewardj]
Fix overenthusiatic import GCing, I presume.

23 years ago[project @ 2001-03-12 14:06:46 by simonpj]
simonpj [Mon, 12 Mar 2001 14:06:47 +0000 (14:06 +0000)]
[project @ 2001-03-12 14:06:46 by simonpj]
----------------
First cut at ILX
----------------

This commit puts the ILX .NET code generator into the head.
It's entirely untested, mind you.

Some changes to the Module/Package strutures, mainly of a
naming variety.  In particular:

Package ===> PackageConfig

23 years ago[project @ 2001-03-12 14:06:38 by simonpj]
simonpj [Mon, 12 Mar 2001 14:06:38 +0000 (14:06 +0000)]
[project @ 2001-03-12 14:06:38 by simonpj]
Remove -funfolding-interface-threshold

23 years ago[project @ 2001-03-09 14:44:15 by simonmar]
simonmar [Fri, 9 Mar 2001 14:44:15 +0000 (14:44 +0000)]
[project @ 2001-03-09 14:44:15 by simonmar]
infix declarations for unknown identifiers aren't allowed (contrary to
what GHC thinks).

23 years ago[project @ 2001-03-08 18:05:31 by qrczak]
qrczak [Thu, 8 Mar 2001 18:05:31 +0000 (18:05 +0000)]
[project @ 2001-03-08 18:05:31 by qrczak]
s/setIdGlobalDetails/sedGlobalIdDetails/, and import it.

23 years ago[project @ 2001-03-08 18:03:34 by qrczak]
qrczak [Thu, 8 Mar 2001 18:03:34 +0000 (18:03 +0000)]
[project @ 2001-03-08 18:03:34 by qrczak]
Fix names imported from Id.

23 years ago[project @ 2001-03-08 13:42:17 by simonmar]
simonmar [Thu, 8 Mar 2001 13:42:17 +0000 (13:42 +0000)]
[project @ 2001-03-08 13:42:17 by simonmar]
add expected output

23 years ago[project @ 2001-03-08 13:41:31 by simonmar]
simonmar [Thu, 8 Mar 2001 13:41:31 +0000 (13:41 +0000)]
[project @ 2001-03-08 13:41:31 by simonmar]
update for blocking putMVar

23 years ago[project @ 2001-03-08 13:33:23 by simonpj]
simonpj [Thu, 8 Mar 2001 13:33:23 +0000 (13:33 +0000)]
[project @ 2001-03-08 13:33:23 by simonpj]
Add NameEnv!

23 years ago[project @ 2001-03-08 12:07:38 by simonpj]
simonpj [Thu, 8 Mar 2001 12:07:43 +0000 (12:07 +0000)]
[project @ 2001-03-08 12:07:38 by simonpj]
--------------------
A major hygiene pass
--------------------

1. The main change here is to

Move what was the "IdFlavour" out of IdInfo,
and into the varDetails field of a Var

   It was a mess before, because the flavour was a permanent attribute
   of an Id, whereas the rest of the IdInfo was ephemeral.  It's
   all much tidier now.

   Main places to look:

   Var.lhs Defn of VarDetails
   IdInfo.lhs Defn of GlobalIdDetails

   The main remaining infelicity is that SpecPragmaIds are right down
   in Var.lhs, which seems unduly built-in for such an ephemeral thing.
   But that is no worse than before.

2. Tidy up the HscMain story a little.  Move mkModDetails from MkIface
   into CoreTidy (where it belongs more nicely)

   This was partly forced by (1) above, because I didn't want to make
   DictFun Ids into a separate kind of Id (which is how it was before).
   Not having them separate means we have to keep a list of them right
   through, rather than pull them out of the bindings at the end.

3. Add NameEnv as a separate module (to join NameSet).

4. Remove unnecessary {-# SOURCE #-} imports from FieldLabel.

23 years ago[project @ 2001-03-08 11:59:02 by simonpj]
simonpj [Thu, 8 Mar 2001 11:59:02 +0000 (11:59 +0000)]
[project @ 2001-03-08 11:59:02 by simonpj]
-------------------------
Remove function coercions
-------------------------

    (coerce (T1->T2) (S1->S2) F) E
  ===>
    coerce T2 S2 (F (coerce S1 T1 E))

This is a generally good transformation, but it
still doesn't solve the problem I was after.  Consider

  newtype T = MkT (Int -> Int)

  p :: T->T;   p = ...
  q :: T;      q = ...

  foo :: T
  {-# INLINE foo #-}
  foo = p $ q

  f = \y -> ...((coerce (Int->Int) foo) 3)...

Trouble is, foo doesn't see the argument because of the coerce, so it
thinks it's a lone variable and doesn't inline.

Another problem is that since $ ins't inlined into foo's RHS, foo
looks like a redex, which we are reluctant to inline inside a lambda,
even with an INLINE pragma.  Maybe we should be bolder?

Anyway, this commit is an improvement to Simplify, but the story is not
over!

23 years ago[project @ 2001-03-08 11:44:16 by simonmar]
simonmar [Thu, 8 Mar 2001 11:44:16 +0000 (11:44 +0000)]
[project @ 2001-03-08 11:44:16 by simonmar]
remove cyclic dependency

23 years ago[project @ 2001-03-08 09:50:18 by simonmar]
simonmar [Thu, 8 Mar 2001 09:50:18 +0000 (09:50 +0000)]
[project @ 2001-03-08 09:50:18 by simonmar]
rearrange slightly to make this compile again.

23 years ago[project @ 2001-03-07 15:49:23 by sewardj]
sewardj [Wed, 7 Mar 2001 15:49:24 +0000 (15:49 +0000)]
[project @ 2001-03-07 15:49:23 by sewardj]
Driver and infrastructure files (.T's) for the new test framework.

23 years ago[project @ 2001-03-07 12:35:50 by simonpj]
simonpj [Wed, 7 Mar 2001 12:35:50 +0000 (12:35 +0000)]
[project @ 2001-03-07 12:35:50 by simonpj]
Remove DOS Ctrl-Ms

23 years ago[project @ 2001-03-07 10:28:40 by rrt]
rrt [Wed, 7 Mar 2001 10:28:40 +0000 (10:28 +0000)]
[project @ 2001-03-07 10:28:40 by rrt]
Import v_TmpDir.

23 years ago[project @ 2001-03-07 10:27:43 by rrt]
rrt [Wed, 7 Mar 2001 10:27:43 +0000 (10:27 +0000)]
[project @ 2001-03-07 10:27:43 by rrt]
On mingwin, remove CRs from input file, to prevent problems when
reading from unmounted partitions. (This shouldn't be a problem, but
it is; this fix makes the mangler a bit more robust anyway.)

23 years ago[project @ 2001-03-07 10:23:03 by rrt]
rrt [Wed, 7 Mar 2001 10:23:03 +0000 (10:23 +0000)]
[project @ 2001-03-07 10:23:03 by rrt]
Make Windows path mangling of FPTOOLS_TOP_ABS work.

23 years ago[project @ 2001-03-06 15:59:11 by simonmar]
simonmar [Tue, 6 Mar 2001 15:59:11 +0000 (15:59 +0000)]
[project @ 2001-03-06 15:59:11 by simonmar]
undo accidental change

23 years ago[project @ 2001-03-06 15:58:47 by simonmar]
simonmar [Tue, 6 Mar 2001 15:58:47 +0000 (15:58 +0000)]
[project @ 2001-03-06 15:58:47 by simonmar]
changes to build new ParsePkgConf module

23 years ago[project @ 2001-03-06 15:00:25 by rrt]
rrt [Tue, 6 Mar 2001 15:00:25 +0000 (15:00 +0000)]
[project @ 2001-03-06 15:00:25 by rrt]
Use TMPDIR, not /tmp.

23 years ago[project @ 2001-03-06 11:23:46 by simonmar]
simonmar [Tue, 6 Mar 2001 11:23:46 +0000 (11:23 +0000)]
[project @ 2001-03-06 11:23:46 by simonmar]
- Add a Happy parser for the package config file.  This is faster and
  compiles to less code than the derived Read instance we had before.

- Add a source_dirs field to the package spec.  This isn't used by
  GHC, because we currently assume all packages are compiled.  It could
  be used by Hugs, though.

- Make unspecified fields of type [String] default to the empty list
  in a package spec.

23 years ago[project @ 2001-03-06 10:13:35 by simonmar]
simonmar [Tue, 6 Mar 2001 10:13:35 +0000 (10:13 +0000)]
[project @ 2001-03-06 10:13:35 by simonmar]
import wibbles

23 years ago[project @ 2001-03-06 07:58:43 by simonpj]
simonpj [Tue, 6 Mar 2001 07:58:43 +0000 (07:58 +0000)]
[project @ 2001-03-06 07:58:43 by simonpj]
Fix minor bug in SpecConstr; failed to deal with DEFAULT case

23 years ago[project @ 2001-03-05 15:37:25 by simonpj]
simonpj [Mon, 5 Mar 2001 15:37:25 +0000 (15:37 +0000)]
[project @ 2001-03-05 15:37:25 by simonpj]
Exploit the 1-shot lambda HACK in etaExpandArity

We often find code like

f :: Int -> IO ()
f = \ x -> case ... of
p1 -> \s -> ...rhs1...
p2 -> \s -> ...rhs2...

where the \s is a state transformer lambda.  Almost invariably
these \s things are one-shot; that is, we virtually never say

let
   h = f 3
in
h >> h >> h

In this case we'd be much better off eta-expanding f, to

f :: Int -> IO ()
f = \ x \ s -> case ... of
   p1 -> ...rhs1...
   p2 -> ...rhs2...

GHC already has a MAJOR HACK in

Id.isOneShotLambda

which declares that any \s::State# T is a one-shot lambda.  It's
almost always true, and it makes a big difference.

This commit simply makes use of isOneShotLambda to improve the
results of CoreUtils.etaExpandArity.  Which has the desired effect.

There isn't a flag to control the MAJOR HACK yet.  Maybe there should be.

Anyway, some of Manuel's array code should improve a lot.

23 years ago[project @ 2001-03-05 12:46:16 by simonpj]
simonpj [Mon, 5 Mar 2001 12:46:16 +0000 (12:46 +0000)]
[project @ 2001-03-05 12:46:16 by simonpj]
Print debug uniques consistently in base64

23 years ago[project @ 2001-03-05 12:45:45 by simonpj]
simonpj [Mon, 5 Mar 2001 12:45:45 +0000 (12:45 +0000)]
[project @ 2001-03-05 12:45:45 by simonpj]
Improve SpecConstr

This commit fixes SpecConstr so that it can see the effect of
enclosing case expressions properly.  That's what the "cons" field
in ScEnv is for.

As a result, consider this function:

  data AccessPath = Cont  AccessPath
  | Value Int

  demandAll n ap@(Cont (Value (I# i1)))
    = case n of
0     -> i1
other -> i1 +# demandAll (n-1) ap

SpecConstr now successfully compiles it to this:

  $s$wdemandAll
    = \ i1 :: PrelGHC.Int# sc :: PrelGHC.Int# ->
      case sc of ds {
0 -> i1;
__DEFAULT -> PrelGHC.+# i1 (Foo.$s$wdemandAll i1 (PrelGHC.-# ds 1))
      }

with the rule

 "SC:$wdemandAll1" __forall i1 :: PrelGHC.Int# ,
    sc :: PrelGHC.Int# .
Foo.$wdemandAll sc (Foo.$wCont (Foo.$wValue (PrelBase.$wI# i1)))
= Foo.$s$wdemandAll i1 sc ;

23 years ago[project @ 2001-03-05 12:19:37 by simonpj]
simonpj [Mon, 5 Mar 2001 12:19:37 +0000 (12:19 +0000)]
[project @ 2001-03-05 12:19:37 by simonpj]
Better dump of transformation rules

23 years ago[project @ 2001-03-05 12:18:43 by simonpj]
simonpj [Mon, 5 Mar 2001 12:18:43 +0000 (12:18 +0000)]
[project @ 2001-03-05 12:18:43 by simonpj]
Remove debug trace

23 years ago[project @ 2001-03-05 12:18:21 by simonpj]
simonpj [Mon, 5 Mar 2001 12:18:21 +0000 (12:18 +0000)]
[project @ 2001-03-05 12:18:21 by simonpj]
Make error message more helpful

23 years ago[project @ 2001-03-05 12:18:05 by simonpj]
simonpj [Mon, 5 Mar 2001 12:18:05 +0000 (12:18 +0000)]
[project @ 2001-03-05 12:18:05 by simonpj]
Remove dead isSysOcc

23 years ago[project @ 2001-03-05 10:34:44 by simonpj]
simonpj [Mon, 5 Mar 2001 10:34:44 +0000 (10:34 +0000)]
[project @ 2001-03-05 10:34:44 by simonpj]
Add a test that Hugs-Feb-2001 fails

23 years ago[project @ 2001-03-05 10:29:00 by simonmar]
simonmar [Mon, 5 Mar 2001 10:29:00 +0000 (10:29 +0000)]
[project @ 2001-03-05 10:29:00 by simonmar]
remove cruft

23 years ago[project @ 2001-03-05 10:06:27 by simonmar]
simonmar [Mon, 5 Mar 2001 10:06:27 +0000 (10:06 +0000)]
[project @ 2001-03-05 10:06:27 by simonmar]
small rearrangement

23 years ago[project @ 2001-03-05 10:05:58 by simonmar]
simonmar [Mon, 5 Mar 2001 10:05:58 +0000 (10:05 +0000)]
[project @ 2001-03-05 10:05:58 by simonmar]
fix -fgenerics

23 years ago[project @ 2001-03-05 00:07:23 by qrczak]
qrczak [Mon, 5 Mar 2001 00:07:23 +0000 (00:07 +0000)]
[project @ 2001-03-05 00:07:23 by qrczak]
Use custom parser monad instead of Parsec. It remembers the text which
has been parsed, so it needs not to be reconstructed after parsing.

Operators containing '--' are now handled correctly. '#' triggers
special processing only if it's not a part of an operator, i.e. if
a varsym token is exactly a single '#'.

Backslash-newline pairs in C lexical world are now handled correctly
(removed at an early stage).

Option --keep replaced with --no-compile (stop after writing *.hs_make.c).

23 years ago[project @ 2001-03-04 11:18:03 by qrczak]
qrczak [Sun, 4 Mar 2001 11:18:03 +0000 (11:18 +0000)]
[project @ 2001-03-04 11:18:03 by qrczak]
Fix #{stuff} parsing when stuff contains end of line.

23 years ago[project @ 2001-03-04 08:31:13 by qrczak]
qrczak [Sun, 4 Mar 2001 08:31:13 +0000 (08:31 +0000)]
[project @ 2001-03-04 08:31:13 by qrczak]
Properly clean PrelPrimopWrappers for all ways.

23 years ago[project @ 2001-03-03 02:50:04 by chak]
chak [Sat, 3 Mar 2001 02:50:04 +0000 (02:50 +0000)]
[project @ 2001-03-03 02:50:04 by chak]
Slightly more compact ppr for Core (makes it easier to read large functions).

23 years ago[project @ 2001-03-02 17:35:20 by simonmar]
simonmar [Fri, 2 Mar 2001 17:35:20 +0000 (17:35 +0000)]
[project @ 2001-03-02 17:35:20 by simonmar]
Fix :type again, by resurrecting typecheckExpr.  Now the expression
doesn't get the monomorphism restriction applied to it.

23 years ago[project @ 2001-03-02 16:15:53 by simonmar]
simonmar [Fri, 2 Mar 2001 16:15:53 +0000 (16:15 +0000)]
[project @ 2001-03-02 16:15:53 by simonmar]
ASSERT in updateWithIndirection() that we haven't already updated this
object with an indirection, and fix two places in the RTS where this
could happen.

The problem only occurs when we're in a black-hole-style loop, and
there are multiple update frames on the stack pointing to the same
object (this is possible because of lazy black-holing).  Both stack
squeezing and asynchronous exception raising walk down the stack and
remove update frames, updating their contents with indirections.  If
we don't protect against multiple updates, the mutable list in the old
generation may get into a bogus state.

23 years ago[project @ 2001-03-02 16:12:18 by simonmar]
simonmar [Fri, 2 Mar 2001 16:12:18 +0000 (16:12 +0000)]
[project @ 2001-03-02 16:12:18 by simonmar]
Add a new closure flag, IND, to identify indirections.

23 years ago[project @ 2001-03-02 14:36:16 by simonmar]
simonmar [Fri, 2 Mar 2001 14:36:16 +0000 (14:36 +0000)]
[project @ 2001-03-02 14:36:16 by simonmar]
Add some ASSERT()s so we can catch updates where updatee==target.

23 years ago[project @ 2001-03-02 14:28:44 by simonmar]
simonmar [Fri, 2 Mar 2001 14:28:44 +0000 (14:28 +0000)]
[project @ 2001-03-02 14:28:44 by simonmar]
Yet another good bug (I'm on a roll today! :-)

When squeezing update frames, make sure the updatee pointers aren't
identical before updating one to point to the other.  This is mostly
harmless, but in one example I have caused the program to go into an
infinite loop rather than fall down a black hole.

To be merged into the 4.08 branch.

23 years ago[project @ 2001-03-02 14:26:40 by simonmar]
simonmar [Fri, 2 Mar 2001 14:26:40 +0000 (14:26 +0000)]
[project @ 2001-03-02 14:26:40 by simonmar]
Another good bug: the stack check in the AP_UPD entry code was wrong.
This one is a definite source of crashes.

To be merged into the 4.08 branch.

23 years ago[project @ 2001-03-02 14:25:04 by simonmar]
simonmar [Fri, 2 Mar 2001 14:25:04 +0000 (14:25 +0000)]
[project @ 2001-03-02 14:25:04 by simonmar]
A good bug: detectBlackHoles wasn't checking for ThreadRelocated,
which is why we sometimes get "no threads to run: infinite loop or
deadlock?" when we should get a NonTermination exception.

To be merged into the 4.08 branch.

23 years ago[project @ 2001-03-02 10:52:15 by simonmar]
simonmar [Fri, 2 Mar 2001 10:52:15 +0000 (10:52 +0000)]
[project @ 2001-03-02 10:52:15 by simonmar]
Don't context switch on the timer if the flag +RTS -C0 is given.  This
gives us reliable/repeatable runs with -C0 (I've been running with a
similar change for months now, debugging is virtually impossible
without it).

23 years ago[project @ 2001-03-01 21:39:36 by qrczak]
qrczak [Thu, 1 Mar 2001 21:39:36 +0000 (21:39 +0000)]
[project @ 2001-03-01 21:39:36 by qrczak]
Let ':t \x->x' work by putting a space before the expression.

23 years ago[project @ 2001-03-01 20:32:51 by qrczak]
qrczak [Thu, 1 Mar 2001 20:32:51 +0000 (20:32 +0000)]
[project @ 2001-03-01 20:32:51 by qrczak]
#{stuff} is equivalent to #stuff except that it's self-delimited and
thus needs not to be placed at the end of line or in some brackets.

23 years ago[project @ 2001-03-01 19:10:16 by qrczak]
qrczak [Thu, 1 Mar 2001 19:10:16 +0000 (19:10 +0000)]
[project @ 2001-03-01 19:10:16 by qrczak]
Mark fromInt and toInt as deprecated.

23 years ago[project @ 2001-03-01 17:10:06 by simonpj]
simonpj [Thu, 1 Mar 2001 17:10:07 +0000 (17:10 +0000)]
[project @ 2001-03-01 17:10:06 by simonpj]
Improve IdInfo substitution

To get rules to work nicely, we need to make rules for recursive functions
active in the RHS of the very recursive function itself.  This can be
done nicely: the change is to move the calls to simplIdInfo in Simplify
to an earlier place.

The second thing is that when doing simple expression substitution
in a rule (which we do during simplification for rules attached to an Id)
we were zapping the occurrence info carefully pinned on the rule binders
when the rule was put into the Id's rules.  This in turn meant that
the simplifer ran more iterations than necessary when rules were fired.
(Andrew Tolmach discovered this.)

So I tidied up the interface to Subst a little.  The relevant functions
that have changed are
simplBndr, simplBndrs, simplLetId, simplIdInfo,
substAndCloneId, substAndCloneIds, substAndCloneRecIds,

There are consequential changes in other modules, but it compiles
at least the whole standard libraries happily, and the codegen tests,
so I'm reasonably confident in it.  But watch out for new strange
happenings.

23 years ago[project @ 2001-03-01 17:09:54 by simonpj]
simonpj [Thu, 1 Mar 2001 17:09:54 +0000 (17:09 +0000)]
[project @ 2001-03-01 17:09:54 by simonpj]
Add comments

23 years ago[project @ 2001-03-01 17:08:31 by simonpj]
simonpj [Thu, 1 Mar 2001 17:08:31 +0000 (17:08 +0000)]
[project @ 2001-03-01 17:08:31 by simonpj]
Formatting only

23 years ago[project @ 2001-03-01 17:07:49 by simonpj]
simonpj [Thu, 1 Mar 2001 17:07:49 +0000 (17:07 +0000)]
[project @ 2001-03-01 17:07:49 by simonpj]
Simplify between LiberateCase and SpecConstr

23 years ago[project @ 2001-03-01 17:06:53 by simonpj]
simonpj [Thu, 1 Mar 2001 17:07:13 +0000 (17:07 +0000)]
[project @ 2001-03-01 17:06:53 by simonpj]
Add comment

23 years ago[project @ 2001-03-01 16:56:44 by simonpj]
simonpj [Thu, 1 Mar 2001 16:56:44 +0000 (16:56 +0000)]
[project @ 2001-03-01 16:56:44 by simonpj]
Move import

23 years ago[project @ 2001-03-01 16:07:46 by simonmar]
simonmar [Thu, 1 Mar 2001 16:07:46 +0000 (16:07 +0000)]
[project @ 2001-03-01 16:07:46 by simonmar]
don't get $! from Util

23 years ago[project @ 2001-03-01 15:59:51 by simonmar]
simonmar [Thu, 1 Mar 2001 15:59:51 +0000 (15:59 +0000)]
[project @ 2001-03-01 15:59:51 by simonmar]
use foldl' for addListToFM and delListFromFM

23 years ago[project @ 2001-03-01 15:58:28 by simonmar]
simonmar [Thu, 1 Mar 2001 15:58:28 +0000 (15:58 +0000)]
[project @ 2001-03-01 15:58:28 by simonmar]
add foldl',  a strict foldl

23 years ago[project @ 2001-03-01 15:51:46 by simonpj]
simonpj [Thu, 1 Mar 2001 15:51:46 +0000 (15:51 +0000)]
[project @ 2001-03-01 15:51:46 by simonpj]
Sub-wibble 2 (sigh)

23 years ago[project @ 2001-03-01 15:42:31 by simonpj]
simonpj [Thu, 1 Mar 2001 15:42:31 +0000 (15:42 +0000)]
[project @ 2001-03-01 15:42:31 by simonpj]
Sub-wibble

23 years ago[project @ 2001-03-01 15:36:35 by simonmar]
simonmar [Thu, 1 Mar 2001 15:36:35 +0000 (15:36 +0000)]
[project @ 2001-03-01 15:36:35 by simonmar]
forgot one file.

23 years ago[project @ 2001-03-01 15:36:20 by simonmar]
simonmar [Thu, 1 Mar 2001 15:36:21 +0000 (15:36 +0000)]
[project @ 2001-03-01 15:36:20 by simonmar]
The beginnings of a GHCi test suite.

23 years ago[project @ 2001-03-01 15:35:29 by simonpj]
simonpj [Thu, 1 Mar 2001 15:35:29 +0000 (15:35 +0000)]
[project @ 2001-03-01 15:35:29 by simonpj]
Fix interface-file syntax wibble (when printing both rules and deprecations)

23 years ago[project @ 2001-03-01 15:06:52 by simonpj]
simonpj [Thu, 1 Mar 2001 15:06:52 +0000 (15:06 +0000)]
[project @ 2001-03-01 15:06:52 by simonpj]
Improve rule matching even more

Manuel discovered that given

  {-# RULES "fst over sndSnd" forall v. fst (sndSnd v) = fst v #-}

  sndSnd :: (a, (b, c)) -> (a, c)
  sndSnd (x, (y, z)) = (x, z)

the rule gets a type, which is too specialised, namely

  {-## __R "fst over sndSnd" __forall {@ a1 v :: (a1, ((), ()))}
   fst @ a1 @ () (sndSnd @ a1 @ () @ () v) = fst @ a1 @ ((), ()) v ;

This was because TcRules wasn't quantifying over enough type variables.

This commit fixes the problem.
The test is in tests/simplCore/should_run/simplrun002

23 years ago[project @ 2001-03-01 14:27:22 by simonmar]
simonmar [Thu, 1 Mar 2001 14:27:22 +0000 (14:27 +0000)]
[project @ 2001-03-01 14:27:22 by simonmar]
don't needlessly duplicate a binder.

23 years ago[project @ 2001-03-01 14:26:44 by simonmar]
simonmar [Thu, 1 Mar 2001 14:26:44 +0000 (14:26 +0000)]
[project @ 2001-03-01 14:26:44 by simonmar]
define the "$Interactive" module.

23 years ago[project @ 2001-03-01 14:26:00 by simonmar]
simonmar [Thu, 1 Mar 2001 14:26:01 +0000 (14:26 +0000)]
[project @ 2001-03-01 14:26:00 by simonmar]
GHCi fixes:

  - expressions are now compiled in a pseudo-module "$Interactive",
    which avoids some problems with storage of demand-loaded declarations.

  - compilation manager now detects when it needs to read the interace
    for a module, even if it is already compiled.  GHCi never demand-loads
    interfaces now.

  - (from Simon PJ) fix a problem with the recompilation checker, which
    meant that modules were sometimes not recompiled when they should
    have been.

  - ByteCodeGen/Link: move linker related stuff into ByteCodeLink.

23 years ago[project @ 2001-03-01 13:44:33 by simonmar]
simonmar [Thu, 1 Mar 2001 13:44:33 +0000 (13:44 +0000)]
[project @ 2001-03-01 13:44:33 by simonmar]
fix an ASSERT: the isDeadBinder predicate can't be used here, because
all the Ids have been cloned with empty IdInfo.

23 years ago[project @ 2001-03-01 13:06:54 by simonmar]
simonmar [Thu, 1 Mar 2001 13:06:54 +0000 (13:06 +0000)]
[project @ 2001-03-01 13:06:54 by simonmar]
fix a couple of foreign imports

23 years ago[project @ 2001-03-01 12:25:32 by rrt]
rrt [Thu, 1 Mar 2001 12:25:33 +0000 (12:25 +0000)]
[project @ 2001-03-01 12:25:32 by rrt]
Apply stat fix for mingw. It's ugly, it's implausible, but it seems to work.
Unlike Cygwin...(missing no. 3).

23 years ago[project @ 2001-03-01 09:23:40 by qrczak]
qrczak [Thu, 1 Mar 2001 09:23:40 +0000 (09:23 +0000)]
[project @ 2001-03-01 09:23:40 by qrczak]
Uncomment {-# SPECIALISE instance Eq  [Char] #-}
          {-# SPECIALISE instance Ord [Char] #-}
Remove explicit (<), (<=), (>), (>=) in instance Ord [a].
eqString is defined as (==) instead of vice versa.

ghc generates good specialized code for these automatically.

23 years ago[project @ 2001-02-28 17:57:52 by simonmar]
simonmar [Wed, 28 Feb 2001 17:57:52 +0000 (17:57 +0000)]
[project @ 2001-02-28 17:57:52 by simonmar]
Compiling a module outside of a running GHCi and expecting GHCi to
pick it up when you do ':r' ain't gonna work.

We thought it would, but there's a problem with module versions and
the recompilation machinery, namely that the outside compiler doesn't
know about the versions being used internally in the running GHCi.

The "right" solution is to implement a ':compile' command in GHCi, but
we aren't going to do that before the release.

This commit disables the picking up of newly compiled modules, until
you do a full load (i.e. :load).

23 years ago[project @ 2001-02-28 17:17:55 by simonpj]
simonpj [Wed, 28 Feb 2001 17:17:55 +0000 (17:17 +0000)]
[project @ 2001-02-28 17:17:55 by simonpj]
Improve rule matching

When doing constraint simplification on the LHS of a rule,
we *don't* want to do superclass commoning up.  Consider

fromIntegral :: (Integral a, Num b) => a -> b
{-# RULES "foo"  fromIntegral = id :: Int -> Int #-}

Here, a=b=Int, and Num Int is a superclass of Integral Int. But we *dont*
want to get

forall dIntegralInt.
fromIntegral Int Int dIntegralInt (scsel dIntegralInt) = id Int

because the scsel (super class selection) will mess up matching.
Instead we want

forall dIntegralInt, dNumInt.
fromIntegral Int Int dIntegralInt dNumInt = id Int

TcSimplify.tcSimplifyToDicts is the relevant function, but I had
to generalise the main simplification loop a little (adding the
type WantSCs).

23 years ago[project @ 2001-02-28 14:24:46 by sewardj]
sewardj [Wed, 28 Feb 2001 14:24:46 +0000 (14:24 +0000)]
[project @ 2001-02-28 14:24:46 by sewardj]
Don't do a prototype for tcSetAttr if !HAVE_TERMIOS_H.

23 years ago[project @ 2001-02-28 14:23:55 by sewardj]
sewardj [Wed, 28 Feb 2001 14:23:55 +0000 (14:23 +0000)]
[project @ 2001-02-28 14:23:55 by sewardj]
Correctly #include <windows.h>.

23 years ago[project @ 2001-02-28 12:12:43 by simonmar]
simonmar [Wed, 28 Feb 2001 12:12:43 +0000 (12:12 +0000)]
[project @ 2001-02-28 12:12:43 by simonmar]
oops, don't export cmTypeOfName when !GHCI.