ghc-hetmet.git
24 years ago[project @ 2000-04-04 15:22:39 by rrt]
rrt [Tue, 4 Apr 2000 15:22:39 +0000 (15:22 +0000)]
[project @ 2000-04-04 15:22:39 by rrt]
find changed to FIND, that Windows users may
ignore DOS find when PATH has gone astray.

24 years ago[project @ 2000-04-04 15:14:18 by rrt]
rrt [Tue, 4 Apr 2000 15:14:19 +0000 (15:14 +0000)]
[project @ 2000-04-04 15:14:18 by rrt]
Added FIND as a symbol so that it can be changed on OSes which have
different ideas as to what "find" should do.

24 years ago[project @ 2000-04-04 15:02:02 by simonmar]
simonmar [Tue, 4 Apr 2000 15:02:02 +0000 (15:02 +0000)]
[project @ 2000-04-04 15:02:02 by simonmar]
Restore debugging support that disappeared when the latest parallel
stuff was committed.

24 years ago[project @ 2000-04-04 13:40:27 by panne]
panne [Tue, 4 Apr 2000 13:40:27 +0000 (13:40 +0000)]
[project @ 2000-04-04 13:40:27 by panne]
Enable Bool in foreign import/export

24 years ago[project @ 2000-04-04 11:24:48 by sewardj]
sewardj [Tue, 4 Apr 2000 11:24:48 +0000 (11:24 +0000)]
[project @ 2000-04-04 11:24:48 by sewardj]
identToStr(): use whatIs(), not fst in switch.

24 years ago[project @ 2000-04-04 11:01:33 by simonmar]
simonmar [Tue, 4 Apr 2000 11:01:33 +0000 (11:01 +0000)]
[project @ 2000-04-04 11:01:33 by simonmar]
Fix the EOF condition in readChunk.

24 years ago[project @ 2000-04-04 10:04:47 by simonmar]
simonmar [Tue, 4 Apr 2000 10:04:47 +0000 (10:04 +0000)]
[project @ 2000-04-04 10:04:47 by simonmar]
- make the second ^C kill the program immediately (the first one tries
  to interrupt it safely by killing all the threads, running
  finalizers etc.).

- don't ignore SIGPIPE by default, the program can do this itself.

24 years ago[project @ 2000-04-04 07:55:24 by andy]
andy [Tue, 4 Apr 2000 07:55:24 +0000 (07:55 +0000)]
[project @ 2000-04-04 07:55:24 by andy]
Adding names of various primitives, as required by the extended libs.

24 years ago[project @ 2000-04-04 02:20:30 by andy]
andy [Tue, 4 Apr 2000 02:20:30 +0000 (02:20 +0000)]
[project @ 2000-04-04 02:20:30 by andy]
Using the new Prelude structure to handle prims.

24 years ago[project @ 2000-04-04 01:19:07 by andy]
andy [Tue, 4 Apr 2000 01:19:07 +0000 (01:19 +0000)]
[project @ 2000-04-04 01:19:07 by andy]
Making expressions inport Prelude, not PrimPrel,
fixing the implicit import Prelude back to the Haskell semantics.

24 years ago[project @ 2000-04-04 01:07:49 by andy]
andy [Tue, 4 Apr 2000 01:07:50 +0000 (01:07 +0000)]
[project @ 2000-04-04 01:07:49 by andy]
Adding in support for split Hugs Prelude.
There are now two preludes.
(1) PrimPrel - the Prelude defintions, and the extra magic datatypes.
(2) Prelude  - the external interface for Prelude.

24 years ago[project @ 2000-04-03 23:43:13 by andy]
andy [Mon, 3 Apr 2000 23:43:13 +0000 (23:43 +0000)]
[project @ 2000-04-03 23:43:13 by andy]
Fixing problem withn "Prelude> take.P" which was causing Hugs to crash.
The new abstraction for the Text segment was not being observed.

24 years ago[project @ 2000-04-03 19:39:17 by panne]
panne [Mon, 3 Apr 2000 19:39:17 +0000 (19:39 +0000)]
[project @ 2000-04-03 19:39:17 by panne]
Nuke evil #include

24 years ago[project @ 2000-04-03 17:27:10 by sewardj]
sewardj [Mon, 3 Apr 2000 17:27:10 +0000 (17:27 +0000)]
[project @ 2000-04-03 17:27:10 by sewardj]
Track recent renaming of True_static_closure ---> True_closure, etc,
and avoid segfault with filename extension handling.

24 years ago[project @ 2000-04-03 16:46:41 by simonpj]
simonpj [Mon, 3 Apr 2000 16:46:42 +0000 (16:46 +0000)]
[project @ 2000-04-03 16:46:41 by simonpj]
* Minor wibble to type checker error message

* Make error messages come out to stderr (I'd switched
  to stdout temporarily when fighting the Dreaded Stderr Bug
  and forgot to change back)

24 years ago[project @ 2000-04-03 16:28:08 by simonmar]
simonmar [Mon, 3 Apr 2000 16:28:08 +0000 (16:28 +0000)]
[project @ 2000-04-03 16:28:08 by simonmar]
Don't use MainRegTable to communicate Sp to stg_init, use a
dynamically-allocated Capability instead (works with SMP).

24 years ago[project @ 2000-04-03 16:26:01 by simonmar]
simonmar [Mon, 3 Apr 2000 16:26:01 +0000 (16:26 +0000)]
[project @ 2000-04-03 16:26:01 by simonmar]
eliminate warning

24 years ago[project @ 2000-04-03 16:22:51 by sewardj]
sewardj [Mon, 3 Apr 2000 16:22:51 +0000 (16:22 +0000)]
[project @ 2000-04-03 16:22:51 by sewardj]
Spotted this piece of ancient history and decided to delete it.

24 years ago[project @ 2000-04-03 15:56:51 by simonmar]
simonmar [Mon, 3 Apr 2000 15:56:51 +0000 (15:56 +0000)]
[project @ 2000-04-03 15:56:51 by simonmar]
remove this file, its contents have been moved into StgProf.h

24 years ago[project @ 2000-04-03 15:55:26 by simonmar]
simonmar [Mon, 3 Apr 2000 15:55:26 +0000 (15:55 +0000)]
[project @ 2000-04-03 15:55:26 by simonmar]
misc cleanups

24 years ago[project @ 2000-04-03 15:54:49 by simonmar]
simonmar [Mon, 3 Apr 2000 15:54:50 +0000 (15:54 +0000)]
[project @ 2000-04-03 15:54:49 by simonmar]
misc profiling cleanups

24 years ago[project @ 2000-04-03 15:52:53 by simonmar]
simonmar [Mon, 3 Apr 2000 15:52:53 +0000 (15:52 +0000)]
[project @ 2000-04-03 15:52:53 by simonmar]
Remove unnecessary #include.

24 years ago[project @ 2000-04-03 15:24:21 by rrt]
rrt [Mon, 3 Apr 2000 15:24:21 +0000 (15:24 +0000)]
[project @ 2000-04-03 15:24:21 by rrt]
Stopped getourtimeofday() being called under mingwin.
MBlock.c: changed one instance of 128 * 1024 * 1024 into SIZE_RESERVED_POOL
and added a TODO comment (bug in is_heap_alloced(), which won't work if
more than one megablock is ever allocated).

24 years ago[project @ 2000-04-03 13:48:37 by sewardj]
sewardj [Mon, 3 Apr 2000 13:48:37 +0000 (13:48 +0000)]
[project @ 2000-04-03 13:48:37 by sewardj]
Deal with MachWords, which recently have started appearing for unknown reasons.

24 years ago[project @ 2000-04-03 13:44:47 by simonmar]
simonmar [Mon, 3 Apr 2000 13:44:47 +0000 (13:44 +0000)]
[project @ 2000-04-03 13:44:47 by simonmar]
call __init_PrelMain instead of __init_Main.

24 years ago[project @ 2000-04-03 13:05:52 by sewardj]
sewardj [Mon, 3 Apr 2000 13:05:52 +0000 (13:05 +0000)]
[project @ 2000-04-03 13:05:52 by sewardj]
When generating native code, print the final result with printForAsm
rather than printForUser.  Why the former ever worked beats me.

24 years ago[project @ 2000-04-03 12:50:25 by simonmar]
simonmar [Mon, 3 Apr 2000 12:50:26 +0000 (12:50 +0000)]
[project @ 2000-04-03 12:50:25 by simonmar]
Finally retire the update analyser.

24 years ago[project @ 2000-04-03 12:47:08 by simonmar]
simonmar [Mon, 3 Apr 2000 12:47:57 +0000 (12:47 +0000)]
[project @ 2000-04-03 12:47:08 by simonmar]
don't mention non-existent RTS options.

24 years ago[project @ 2000-04-03 10:10:22 by panne]
panne [Mon, 3 Apr 2000 10:10:22 +0000 (10:10 +0000)]
[project @ 2000-04-03 10:10:22 by panne]
Declare `plusAddr` as infixl 5, allowing sensible expressions like
addr `plusAddr` 47 * 11     or      addr `plusAddr` 08 + 15

24 years ago[project @ 2000-04-03 09:52:28 by simonpj]
simonpj [Mon, 3 Apr 2000 09:52:30 +0000 (09:52 +0000)]
[project @ 2000-04-03 09:52:28 by simonpj]
* Make it so that recursive newtype declarations don't send
  GHC into an infinite loop.

newtype T = MkT T

  This happened because Type.repType looked throught newtypes,
  and that never stopped!  Now TcTyDecls.mkNewTyConRep does the job
  more carefully, and the result is cached in the TyCon itself.

* Improve the handling of type signatures & pragmas.  Previously a
  mis-placed (say) SPECIALISE instance pragmas could be silently
  ignored.

Both these changes involved moving quite a lot of stuff between modules.

24 years ago[project @ 2000-04-01 22:30:27 by andy]
andy [Sat, 1 Apr 2000 22:30:27 +0000 (22:30 +0000)]
[project @ 2000-04-01 22:30:27 by andy]
Initial revision

24 years ago[project @ 2000-03-31 04:13:27 by andy]
andy [Fri, 31 Mar 2000 04:13:27 +0000 (04:13 +0000)]
[project @ 2000-03-31 04:13:27 by andy]
Fixing a couple of problems with Quantified identifiers.

(1) The string building routine for Qid's was not using
    the new abstraction for showing names. The old abstraction
    worked most of the time in the new system, so was only
    getting tickled sometimes.
(2) Fixing the local module that top level expressions
    evaluate in. By importing quantified Prelude,
    this allows top level expressions like Prelude.take

And a trivial Makefile change.

24 years ago[project @ 2000-03-31 03:09:35 by hwloidl]
hwloidl [Fri, 31 Mar 2000 03:09:38 +0000 (03:09 +0000)]
[project @ 2000-03-31 03:09:35 by hwloidl]
Numerous changes in the RTS to get GUM-4.06 working (currently works with
parfib-ish programs). Most changes are isolated in the rts/parallel dir.

rts/parallel/:
  The most important changes are a rewrite of the (un-)packing code (Pack.c)
  and changes in LAGA, GALA table operations (Global.c) expecially in
  rebuilding the tables during GC.

rts/:
  Minor changes in Schedule.c, GC.c (interface to par specific root marking
  and evacuation), and lots of additions to Sanity.c (surprise ;-)
  Main.c change for startup: I use a new function rts_evalNothing to
  start non-main-PEs in a PAR || SMP setup (RtsAPI.c)

includes/:
  Updated GranSim macros in PrimOps.h.

lib/std:
  Few changes in PrelHandle.c etc replacing ForeignObj by Addr in a PAR
  setup (we still don't support ForeignObjs or WeakPtrs in GUM).
  Typically use
    #define FILE_OBJECT     Addr
  when dealing with files.

hslibs/lang/:
  Same as above (in Foreign(Obj).lhs, Weak.lhs, IOExts.lhs etc).

-- HWL

24 years ago[project @ 2000-03-30 16:23:56 by simonpj]
simonpj [Thu, 30 Mar 2000 16:23:57 +0000 (16:23 +0000)]
[project @ 2000-03-30 16:23:56 by simonpj]
* Remove the unnecessary CPR parameter to mkUnfolding and friends

* Make sure that even trivial wrappers have a __inline__
  (this was causing lots of 'substWorker' DEBUG messages)

* Nuke demand info when the unfolding is a value
  (see notes with IdInfo.setUnfoldingInfo)

* Add an update-in-place test to the 'interesting context'
  predicate in SimplUtils.

24 years ago[project @ 2000-03-30 16:07:53 by simonmar]
simonmar [Thu, 30 Mar 2000 16:07:53 +0000 (16:07 +0000)]
[project @ 2000-03-30 16:07:53 by simonmar]
Support AP_UPDs/PAPs larger than a block in size.  It turned out not
to be too hard to do this.  This fixes George Russell's bug ("hsc:
fatal error: scavenge: stack frame").

24 years ago[project @ 2000-03-30 15:35:13 by simonmar]
simonmar [Thu, 30 Mar 2000 15:35:13 +0000 (15:35 +0000)]
[project @ 2000-03-30 15:35:13 by simonmar]
Add an ASSERT to catch a known bug: when allocating an AP_UPD in
raiseAsync, if the object is larger than a block in size then all
sorts of things can go wrong.

24 years ago[project @ 2000-03-30 14:12:42 by rrt]
rrt [Thu, 30 Mar 2000 14:12:42 +0000 (14:12 +0000)]
[project @ 2000-03-30 14:12:42 by rrt]
Filter out PrelHugs in all ways for building DLLs.

24 years ago[project @ 2000-03-30 14:11:34 by rrt]
rrt [Thu, 30 Mar 2000 14:11:34 +0000 (14:11 +0000)]
[project @ 2000-03-30 14:11:34 by rrt]
Added subl clause to epilogue munging.

24 years ago[project @ 2000-03-30 14:09:44 by rrt]
rrt [Thu, 30 Mar 2000 14:09:44 +0000 (14:09 +0000)]
[project @ 2000-03-30 14:09:44 by rrt]
Added rules for building GMP as a DLL. N.B. GMP is not actually used
yet as a DLL; this remains to be added to the build system.

24 years ago[project @ 2000-03-30 14:08:43 by rrt]
rrt [Thu, 30 Mar 2000 14:08:43 +0000 (14:08 +0000)]
[project @ 2000-03-30 14:08:43 by rrt]
Removed __init_PrelMain, which shouldn't be in here.

24 years ago[project @ 2000-03-30 13:46:54 by simonpj]
simonpj [Thu, 30 Mar 2000 13:46:54 +0000 (13:46 +0000)]
[project @ 2000-03-30 13:46:54 by simonpj]
Document hoisting foralls

24 years ago[project @ 2000-03-30 12:04:13 by simonmar]
simonmar [Thu, 30 Mar 2000 12:04:13 +0000 (12:04 +0000)]
[project @ 2000-03-30 12:04:13 by simonmar]
update for extra parameter to startupHaskell().

24 years ago[project @ 2000-03-30 12:03:30 by simonmar]
simonmar [Thu, 30 Mar 2000 12:03:31 +0000 (12:03 +0000)]
[project @ 2000-03-30 12:03:30 by simonmar]
HEADS UP!!!

change the type of startupHaskell():

   void startupHaskell  ( int argc, char *argv[], void *init_root );

the extra parameter is a pointer to the initialisation function for
the root module in the program.  eg., Main.c now passes __init_Main for
this parameter.  It can be left as NULL if there is no root module.

This interface may need to be revised, since in some circumstances
there may be more than one "root module".

Sigbjorn: H/Direct will need some changes to stay in sync here.

24 years ago[project @ 2000-03-30 10:37:09 by simonmar]
simonmar [Thu, 30 Mar 2000 10:37:09 +0000 (10:37 +0000)]
[project @ 2000-03-30 10:37:09 by simonmar]
Remove this file, it moved to ghc/rts.  (sigh, I thought I removed it
already, but apparently not).

24 years ago[project @ 2000-03-30 10:36:15 by simonmar]
simonmar [Thu, 30 Mar 2000 10:36:15 +0000 (10:36 +0000)]
[project @ 2000-03-30 10:36:15 by simonmar]
Replace _static_closures with _closures.

24 years ago[project @ 2000-03-30 09:04:34 by andy]
andy [Thu, 30 Mar 2000 09:04:34 +0000 (09:04 +0000)]
[project @ 2000-03-30 09:04:34 by andy]
Wibble One.

24 years ago[project @ 2000-03-30 09:02:12 by andy]
andy [Thu, 30 Mar 2000 09:02:12 +0000 (09:02 +0000)]
[project @ 2000-03-30 09:02:12 by andy]
Fixing bug with import privileged clashing with import hidden.
This caused a rather nasty name-leak, where catch from the prelude
was being given the type of catch from Exceptions.

Now, when you use import privileged Prelude (...) you also
need to do import Prelude, allowing you the option of
import Prelude hiding (...).

A bucket load of wibbles will follow in various libraries,
implementing this restriction.

24 years ago[project @ 2000-03-29 08:59:28 by simonmar]
simonmar [Wed, 29 Mar 2000 08:59:28 +0000 (08:59 +0000)]
[project @ 2000-03-29 08:59:28 by simonmar]
freezeDoubleArray ==> freezeByteArray

24 years ago[project @ 2000-03-29 08:58:04 by simonmar]
simonmar [Wed, 29 Mar 2000 08:58:04 +0000 (08:58 +0000)]
[project @ 2000-03-29 08:58:04 by simonmar]
freeze<blah>Array ==> freezeByteArray

24 years ago[project @ 2000-03-28 14:29:13 by simonmar]
simonmar [Tue, 28 Mar 2000 14:29:13 +0000 (14:29 +0000)]
[project @ 2000-03-28 14:29:13 by simonmar]
The new itimer stuff is NON_POSIX_SOURCE, and further protect it with
HAVE_SETITIMER.  Fixes building on Solaris again.

24 years ago[project @ 2000-03-28 13:19:28 by simonmar]
simonmar [Tue, 28 Mar 2000 13:19:28 +0000 (13:19 +0000)]
[project @ 2000-03-28 13:19:28 by simonmar]
Remove extra \end{code}

24 years ago[project @ 2000-03-28 13:18:49 by simonmar]
simonmar [Tue, 28 Mar 2000 13:18:49 +0000 (13:18 +0000)]
[project @ 2000-03-28 13:18:49 by simonmar]
Don't use "ccall" as a variable name; it confuses the interface file
parser in 4.06.  This bug has been fixed in 4.07.

24 years ago[project @ 2000-03-28 11:49:06 by rrt]
rrt [Tue, 28 Mar 2000 11:49:06 +0000 (11:49 +0000)]
[project @ 2000-03-28 11:49:06 by rrt]
Replaced $(HC_OPTS) in mkdependhs rule whence I had inadvertently removed
it along with the odir filter in which it sat.

24 years ago[project @ 2000-03-28 11:21:23 by rrt]
rrt [Tue, 28 Mar 2000 11:21:23 +0000 (11:21 +0000)]
[project @ 2000-03-28 11:21:23 by rrt]
Used new SplitObjs setting, and removed patsubst hack (no longer needed,
thank goodness).

24 years ago[project @ 2000-03-28 11:09:31 by rrt]
rrt [Tue, 28 Mar 2000 11:09:31 +0000 (11:09 +0000)]
[project @ 2000-03-28 11:09:31 by rrt]
Added SplitObjs for when -split-objs is being used. Removed -split-objs and
-odir from GhcLibHcOpts. -odir shouldn't be needed any more in any case.

Changed order of recursive makes so that recursive make happens before make
in the current directory. This helps when building hslibs as DLLs, where
the cbits DLLs need to be made before the main DLLs.

24 years ago[project @ 2000-03-28 11:07:19 by rrt]
rrt [Tue, 28 Mar 2000 11:07:19 +0000 (11:07 +0000)]
[project @ 2000-03-28 11:07:19 by rrt]
Added SplitObjs and removed -split-objs from GhcLibHcOpts.

24 years ago[project @ 2000-03-28 10:20:55 by andy]
andy [Tue, 28 Mar 2000 10:20:56 +0000 (10:20 +0000)]
[project @ 2000-03-28 10:20:55 by andy]
Restoring Hugs ability to accept the -98/+98 and -h<heap> options.

24 years ago[project @ 2000-03-28 10:10:17 by andy]
andy [Tue, 28 Mar 2000 10:10:17 +0000 (10:10 +0000)]
[project @ 2000-03-28 10:10:17 by andy]
Making STG Hugs compile again after the recent RTS checking.

24 years ago[project @ 2000-03-28 08:52:28 by simonmar]
simonmar [Tue, 28 Mar 2000 08:52:29 +0000 (08:52 +0000)]
[project @ 2000-03-28 08:52:28 by simonmar]
Replace freeze{Char,Int,Word,Float,Double}Array with freezeByteArray
(using sizeofByteArray and a foreign import of C's memcpy()).

24 years ago[project @ 2000-03-28 08:51:09 by simonmar]
simonmar [Tue, 28 Mar 2000 08:51:09 +0000 (08:51 +0000)]
[project @ 2000-03-28 08:51:09 by simonmar]
remove redundant import.

24 years ago[project @ 2000-03-28 08:49:56 by simonmar]
simonmar [Tue, 28 Mar 2000 08:49:56 +0000 (08:49 +0000)]
[project @ 2000-03-28 08:49:56 by simonmar]
We weren't releasing the memory associated with dead file objects
(including the possibly large buffer).  This commit fixes that.

24 years ago[project @ 2000-03-28 08:48:44 by simonmar]
simonmar [Tue, 28 Mar 2000 08:48:44 +0000 (08:48 +0000)]
[project @ 2000-03-28 08:48:44 by simonmar]
ANSIfy function defn

24 years ago[project @ 2000-03-27 16:22:09 by simonpj]
simonpj [Mon, 27 Mar 2000 16:22:11 +0000 (16:22 +0000)]
[project @ 2000-03-27 16:22:09 by simonpj]
Fix a bug in import listing in interface files that meant we lost track of
interface files.  This fixes the problem that led Sven to add lots of
import PprType() decls.  I've removed them all again!

24 years ago[project @ 2000-03-27 13:24:12 by simonpj]
simonpj [Mon, 27 Mar 2000 13:24:14 +0000 (13:24 +0000)]
[project @ 2000-03-27 13:24:12 by simonpj]
a) Move Unfolding and UnfoldingGuidance to CoreSyn
   As a result, remove several SOURCE imports
   Shrink CoreSyn.hi-boot considerably
   Delete CoreUnfold.hi-boot altogether

b) Add CoreUtils.exprIsConApp_maybe
   Use in PrelRules to fix a bug in the dataToTag rule

c) Fix boolean polarity error in Simplify.lhs

24 years ago[project @ 2000-03-27 13:23:49 by simonpj]
simonpj [Mon, 27 Mar 2000 13:23:50 +0000 (13:23 +0000)]
[project @ 2000-03-27 13:23:49 by simonpj]
Improve the error messages given when a definition isn't polymorphic enough.
In paticular, for this program:

    let v = runST (newSTRef True)
    in
    runST (readSTRef v)

we get the message

    Inferred type is less polymorphic than expected
Quantified type variable `s' escapes
It is reachable from the type variable(s) `a'
  which are free in the signature
    Signature type:     forall s. ST s a
    Type to generalise: ST s (STRef s Bool)
    When checking an expression type signature
    In the first argument of `runST', namely `(newSTRef True)'
    In the right-hand side of a pattern binding: runST (newSTRef True)

24 years ago[project @ 2000-03-27 08:58:37 by simonpj]
simonpj [Mon, 27 Mar 2000 08:58:37 +0000 (08:58 +0000)]
[project @ 2000-03-27 08:58:37 by simonpj]
Fix sig for guard in module header

24 years ago[project @ 2000-03-27 08:50:15 by simonmar]
simonmar [Mon, 27 Mar 2000 08:50:15 +0000 (08:50 +0000)]
[project @ 2000-03-27 08:50:15 by simonmar]
Don't treat 'ccall' and 'stdcall' as reserved words.  This fixes
another problem with bootstrapping.

24 years ago[project @ 2000-03-27 08:46:15 by simonmar]
simonmar [Mon, 27 Mar 2000 08:46:15 +0000 (08:46 +0000)]
[project @ 2000-03-27 08:46:15 by simonmar]
rearrange tokens to be in roughly the same order as everywhere else.

24 years ago[project @ 2000-03-25 12:38:40 by panne]
panne [Sat, 25 Mar 2000 12:38:41 +0000 (12:38 +0000)]
[project @ 2000-03-25 12:38:40 by panne]
Adding a bunch of `import PprType ()' to make 4.07 compile itself.
Strangely enough, compilation with 4.06 worked without these, so
this is probably only fighting the symptoms of something deeper,
and somebody should have a look at it. But for now, I simply need
a bootstrapping 4.07...

24 years ago[project @ 2000-03-24 17:49:29 by simonpj]
simonpj [Fri, 24 Mar 2000 17:49:31 +0000 (17:49 +0000)]
[project @ 2000-03-24 17:49:29 by simonpj]
a) Small wibbles to do with inlining and floating

b) Implement Ralf's request, so that one can write

type F = forall a. a -> a

f :: Int -> F
f = ...

   The for-alls inside F are hoisted out to the top of
   the type signature for f.  This applies uniformly to
   all user-written types

24 years ago[project @ 2000-03-24 15:19:29 by sewardj]
sewardj [Fri, 24 Mar 2000 15:19:29 +0000 (15:19 +0000)]
[project @ 2000-03-24 15:19:29 by sewardj]
For INTERPRETER, track recent changes of _static_closure ==> _closure.

24 years ago[project @ 2000-03-24 14:51:50 by sewardj]
sewardj [Fri, 24 Mar 2000 14:51:50 +0000 (14:51 +0000)]
[project @ 2000-03-24 14:51:50 by sewardj]
Win32 signal wibbles.

24 years ago[project @ 2000-03-24 14:32:03 by sewardj]
sewardj [Fri, 24 Mar 2000 14:32:03 +0000 (14:32 +0000)]
[project @ 2000-03-24 14:32:03 by sewardj]
Reimplement interrupt handling in a way compatible with the
revised module chaser, etc.

24 years ago[project @ 2000-03-24 12:36:43 by sewardj]
sewardj [Fri, 24 Mar 2000 12:36:43 +0000 (12:36 +0000)]
[project @ 2000-03-24 12:36:43 by sewardj]
Fix various bugs with module chasing and reloading.

24 years ago[project @ 2000-03-24 11:54:28 by panne]
panne [Fri, 24 Mar 2000 11:54:28 +0000 (11:54 +0000)]
[project @ 2000-03-24 11:54:28 by panne]
Once again a missing import for Outputable, this time for Type.

24 years ago[project @ 2000-03-24 11:17:31 by panne]
panne [Fri, 24 Mar 2000 11:17:31 +0000 (11:17 +0000)]
[project @ 2000-03-24 11:17:31 by panne]
Added missing import for Outputable Kind.

24 years ago[project @ 2000-03-24 10:43:33 by simonmar]
simonmar [Fri, 24 Mar 2000 10:43:33 +0000 (10:43 +0000)]
[project @ 2000-03-24 10:43:33 by simonmar]
fix parse error

24 years ago[project @ 2000-03-24 09:19:31 by simonpj]
simonpj [Fri, 24 Mar 2000 09:19:31 +0000 (09:19 +0000)]
[project @ 2000-03-24 09:19:31 by simonpj]
Add missing Literal.lhs

24 years ago[project @ 2000-03-23 17:46:59 by simonpj]
simonpj [Thu, 23 Mar 2000 17:46:59 +0000 (17:46 +0000)]
[project @ 2000-03-23 17:46:59 by simonpj]
Remove the .so suffixes in the foreign imports

24 years ago[project @ 2000-03-23 17:45:17 by simonpj]
simonpj [Thu, 23 Mar 2000 17:45:33 +0000 (17:45 +0000)]
[project @ 2000-03-23 17:45:17 by simonpj]
This utterly gigantic commit is what I've been up to in background
mode in the last couple of months.  Originally the main goal
was to get rid of Con (staturated constant applications)
in the CoreExpr type, but one thing led to another, and I kept
postponing actually committing.   Sorry.

Simon, 23 March 2000

I've tested it pretty thoroughly, but doubtless things will break.

Here are the highlights

* Con is gone; the CoreExpr type is simpler
* NoRepLits have gone
* Better usage info in interface files => less recompilation
* Result type signatures work
* CCall primop is tidied up
* Constant folding now done by Rules
* Lots of hackery in the simplifier
* Improvements in CPR and strictness analysis

Many bug fixes including

* Sergey's DoCon compiles OK; no loop in the strictness analyser
* Volker Wysk's programs don't crash the CPR analyser

I have not done much on measuring compilation times and binary sizes;
they could have got worse.  I think performance has got significantly
better, though, in most cases.

Removing the Con form of Core expressions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The big thing is that

  For every constructor C there are now *two* Ids:

C is the constructor's *wrapper*. It evaluates and unboxes arguments
before calling $wC.  It has a perfectly ordinary top-level defn
in the module defining the data type.

$wC is the constructor's *worker*.  It is like a primop that simply
allocates and builds the constructor value.  Its arguments are the
actual representation arguments of the constructor.
Its type may be different to C, because:
- useless dict args are dropped
- strict args may be flattened

  For every primop P there is *one* Id, its (curried) Id

  Neither contructor worker Id nor the primop Id have a defminition anywhere.
  Instead they are saturated during the core-to-STG pass, and the code generator
  generates code for them directly. The STG language still has saturated
  primops and constructor applications.

* The Const type disappears, along with Const.lhs.  The literal part
  of Const.lhs reappears as Literal.lhs.  Much tidying up in here,
  to bring all the range checking into this one module.

* I got rid of NoRep literals entirely.  They just seem to be too much trouble.

* Because Con's don't exist any more, the funny C { args } syntax
  disappears from inteface files.

Parsing
~~~~~~~
* Result type signatures now work
f :: Int -> Int = \x -> x
-- The Int->Int is the type of f

g x y :: Int = x+y
-- The Int is the type of the result of (g x y)

Recompilation checking and make
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* The .hi file for a modules is not touched if it doesn't change.  (It used to
  be touched regardless, forcing a chain of recompilations.)  The penalty for this
  is that we record exported things just as if they were mentioned in the body of
  the module.  And the penalty for that is that we may recompile a module when
  the only things that have changed are the things it is passing on without using.
  But it seems like a good trade.

* -recomp is on by default

Foreign declarations
~~~~~~~~~~~~~~~~~~~~
* If you say
foreign export zoo :: Int -> IO Int
  then you get a C produre called 'zoo', not 'zzoo' as before.
  I've also added a check that complains if you export (or import) a C
  procedure whose name isn't legal C.

Code generation and labels
~~~~~~~~~~~~~~~~~~~~~~~~~~
* Now that constructor workers and wrappers have distinct names, there's
  no need to have a Foo_static_closure and a Foo_closure for constructor Foo.
  I nuked the entire StaticClosure story.  This has effects in some of
  the RTS headers (i.e. s/static_closure/closure/g)

Rules, constant folding
~~~~~~~~~~~~~~~~~~~~~~~
* Constant folding becomes just another rewrite rule, attached to the Id for the
  PrimOp.   To achieve this, there's a new form of Rule, a BuiltinRule (see CoreSyn.lhs).
  The prelude rules are in prelude/PrelRules.lhs, while simplCore/ConFold.lhs has gone.

* Appending of constant strings now works, using fold/build fusion, plus
  the rewrite rule
unpack "foo" c (unpack "baz" c n)  =  unpack "foobaz" c n
  Implemented in PrelRules.lhs

* The CCall primop is tidied up quite a bit.  There is now a data type CCall,
  defined in PrimOp, that packages up the info needed for a particular CCall.
  There is a new Id for each new ccall, with an big "occurrence name"
{__ccall "foo" gc Int# -> Int#}
  In interface files, this is parsed as a single Id, which is what it is, really.

Miscellaneous
~~~~~~~~~~~~~
* There were numerous places where the host compiler's
  minInt/maxInt was being used as the target machine's minInt/maxInt.
  I nuked all of these; everything is localised to inIntRange and inWordRange,
  in Literal.lhs

* Desugaring record updates was broken: it didn't generate correct matches when
  used withe records with fancy unboxing etc.  It now uses matchWrapper.

* Significant tidying up in codeGen/SMRep.lhs

* Add __word, __word64, __int64 terminals to signal the obvious types
  in interface files.  Add the ability to print word values in hex into
  C code.

* PrimOp.lhs is no longer part of a loop.  Remove PrimOp.hi-boot*

Types
~~~~~
* isProductTyCon no longer returns False for recursive products, nor
  for unboxed products; you have to test for these separately.
  There's no reason not to do CPR for recursive product types, for example.
  Ditto splitProductType_maybe.

Simplification
~~~~~~~~~~~~~~~
* New -fno-case-of-case flag for the simplifier.  We use this in the first run
  of the simplifier, where it helps to stop messing up expressions that
  the (subsequent) full laziness pass would otherwise find float out.
  It's much more effective than previous half-baked hacks in inlining.

  Actually, it turned out that there were three places in Simplify.lhs that
  needed to know use this flag.

* Make the float-in pass push duplicatable bindings into the branches of
  a case expression, in the hope that we never have to allocate them.
  (see FloatIn.sepBindsByDropPoint)

* Arrange that top-level bottoming Ids get a NOINLINE pragma
  This reduced gratuitous inlining of error messages.
  But arrange that such things still get w/w'd.

* Arrange that a strict argument position is regarded as an 'interesting'
  context, so that if we see
foldr k z (g x)
  then we'll be inclined to inline g; this can expose a build.

* There was a missing case in CoreUtils.exprEtaExpandArity that meant
  we were missing some obvious cases for eta expansion
  Also improve the code when handling applications.

* Make record selectors (identifiable by their IdFlavour) into "cheap" operations.
  [The change is a 2-liner in CoreUtils.exprIsCheap]
  This means that record selection may be inlined into function bodies, which
  greatly improves the arities of overloaded functions.

* Make a cleaner job of inlining "lone variables".  There was some distributed
  cunning, but I've centralised it all now in SimplUtils.analyseCont, which
  analyses the context of a call to decide whether it is "interesting".

* Don't specialise very small functions in Specialise.specDefn
  It's better to inline it.  Rather like the worker/wrapper case.

* Be just a little more aggressive when floating out of let rhss.
  See comments with Simplify.wantToExpose
  A small change with an occasional big effect.

* Make the inline-size computation think that
case x of I# x -> ...
  is *free*.

CPR analysis
~~~~~~~~~~~~
* Fix what was essentially a bug in CPR analysis.  Consider

letrec f x = let g y = let ... in f e1
     in
     if ... then (a,b) else g x

  g has the CPR property if f does; so when generating the final annotated
  RHS for f, we must use an envt in which f is bound to its final abstract
  value.  This wasn't happening.  Instead, f was given the CPR tag but g
  wasn't; but of course the w/w pass gives rotten results in that case!!
  (Because f's CPR-ness relied on g's.)

  On they way I tidied up the code in CprAnalyse.  It's quite a bit shorter.

  The fact that some data constructors return a constructed product shows
  up in their CPR info (MkId.mkDataConId) not in CprAnalyse.lhs

Strictness analysis and worker/wrapper
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* BIG THING: pass in the demand to StrictAnal.saExpr.  This affects situations
  like
f (let x = e1 in (x,x))
  where f turns out to have strictness u(SS), say.  In this case we can
  mark x as demanded, and use a case expression for it.

  The situation before is that we didn't "know" that there is the u(SS)
  demand on the argument, so we simply computed that the body of the let
  expression is lazy in x, and marked x as lazily-demanded.  Then even after
  f was w/w'd we got

let x = e1 in case (x,x) of (a,b) -> $wf a b

  and hence

let x = e1 in $wf a b

  I found a much more complicated situation in spectral/sphere/Main.shade,
  which improved quite a bit with this change.

* Moved the StrictnessInfo type from IdInfo to Demand.  It's the logical
  place for it, and helps avoid module loops

* Do worker/wrapper for coerces even if the arity is zero.  Thus:
stdout = coerce Handle (..blurg..)
  ==>
wibble = (...blurg...)
stdout = coerce Handle wibble
  This is good because I found places where we were saying
case coerce t stdout of { MVar a ->
...
case coerce t stdout of { MVar b ->
...
  and the redundant case wasn't getting eliminated because of the coerce.

24 years ago[project @ 2000-03-23 16:01:16 by simonmar]
simonmar [Thu, 23 Mar 2000 16:01:16 +0000 (16:01 +0000)]
[project @ 2000-03-23 16:01:16 by simonmar]
Work around the slightly deranged way we deal with thunks and
MIN_UPD_SIZE at the moment.

24 years ago[project @ 2000-03-23 15:53:22 by rrt]
rrt [Thu, 23 Mar 2000 15:53:22 +0000 (15:53 +0000)]
[project @ 2000-03-23 15:53:22 by rrt]
Stopped PrelHugs being compiled into HSprel.dll, and stopped using
-split-objs when building libraries as DLLs.

24 years ago[project @ 2000-03-23 14:54:20 by sewardj]
sewardj [Thu, 23 Mar 2000 14:54:21 +0000 (14:54 +0000)]
[project @ 2000-03-23 14:54:20 by sewardj]
Make Hugs compile on Win32 again after recent changes.  Also, rename
prelude.h to hugsbasictypes.h to avoid conflicts with includes/Prelude.h.

24 years ago[project @ 2000-03-23 14:30:13 by simonmar]
simonmar [Thu, 23 Mar 2000 14:30:13 +0000 (14:30 +0000)]
[project @ 2000-03-23 14:30:13 by simonmar]
Fix GCing of SEQ_FRAMES, CATCH_FRAMES and STOP_FRAMES when the closure
header size is more than one word (eg. with profiling on).

Hans: you may need to check this w.r.t. PAR & GRAN.

24 years ago[project @ 2000-03-23 13:13:29 by simonmar]
simonmar [Thu, 23 Mar 2000 13:13:29 +0000 (13:13 +0000)]
[project @ 2000-03-23 13:13:29 by simonmar]
Avoid loops in CCS graph.

24 years ago[project @ 2000-03-23 12:22:04 by sewardj]
sewardj [Thu, 23 Mar 2000 12:22:05 +0000 (12:22 +0000)]
[project @ 2000-03-23 12:22:04 by sewardj]
In interface files, don't forget to mention the names of modules imported
via hi-boot files.  This is needed so that Hugs can use the import decls
in interface files to safely overestimate the dependency sets which it will
encounter when linking object code.

24 years ago[project @ 2000-03-23 12:19:22 by sewardj]
sewardj [Thu, 23 Mar 2000 12:19:22 +0000 (12:19 +0000)]
[project @ 2000-03-23 12:19:22 by sewardj]
Allow clients of the linker library (object.[ch]) to specify, portably,
symbols they wish to ignore in calls to ocGetNames().  Use this modification
to support ignoring the multiple occurrences of ghc_cc_ID.

24 years ago[project @ 2000-03-23 12:02:38 by simonmar]
simonmar [Thu, 23 Mar 2000 12:02:38 +0000 (12:02 +0000)]
[project @ 2000-03-23 12:02:38 by simonmar]
Don't wake up threads if the select() was interrupted by a signal.

24 years ago[project @ 2000-03-23 10:53:26 by sewardj]
sewardj [Thu, 23 Mar 2000 10:53:26 +0000 (10:53 +0000)]
[project @ 2000-03-23 10:53:26 by sewardj]
storage.h needs to see a machine-dependant file-timestamp type for
use in Module symbol table entries -- hence this file.

24 years ago[project @ 2000-03-23 09:33:17 by simonmar]
simonmar [Thu, 23 Mar 2000 09:33:17 +0000 (09:33 +0000)]
[project @ 2000-03-23 09:33:17 by simonmar]
update expected output

24 years ago[project @ 2000-03-23 09:32:36 by simonmar]
simonmar [Thu, 23 Mar 2000 09:32:36 +0000 (09:32 +0000)]
[project @ 2000-03-23 09:32:36 by simonmar]
Add a few more test cases.

24 years ago[project @ 2000-03-23 09:32:13 by simonmar]
simonmar [Thu, 23 Mar 2000 09:32:13 +0000 (09:32 +0000)]
[project @ 2000-03-23 09:32:13 by simonmar]
Disable some of the special cases in remInteger and quotInteger, which
turned out to be wrong.

24 years ago[project @ 2000-03-22 18:17:12 by sewardj]
sewardj [Wed, 22 Mar 2000 18:17:12 +0000 (18:17 +0000)]
[project @ 2000-03-22 18:17:12 by sewardj]
Zap outdated ifdeffery.

24 years ago[project @ 2000-03-22 18:14:22 by sewardj]
sewardj [Wed, 22 Mar 2000 18:14:23 +0000 (18:14 +0000)]
[project @ 2000-03-22 18:14:22 by sewardj]
Initial commit of major changes to module chasing and storage management:

* Total reimplementation of module chasing (see achieveTargetModules
  in hugs.c).  Build, maintain and use module dependency graphs
  to decide what needs reloading when.  The old mechanism with a
  stack of scripts, etc, is gone forever.  All the rest of these points
  are in support of the module-chasing change:

* The result of parsing a module is now a parse tree, rather than a
  half-baked parse tree and a bunch of side-effects.  Hooray!

* Redo symbol tables for Names, Tycons, Classes, Instances and
  Modules.  They are now dynamically expandable, doubling in size
  automatically when full, and use a freelist system to keep track
  of available slots.

* Allow arbitrary modules to be deleted from the system.  The
  main honcho here is nukeModule().

* Not strictly necessary, but ... unify the address space for all
  compile-time entities.  See revised whatIs().  Text is part of
  the unified address space.  This is very convenient for debugging.
  print() can now print practically anything.  Generally simplify
  storage management as much as possible, and zap the years of
  elaborate hacks needed to make Hugs work well in 16-bit systems.
  Added a load of sanity-checking support to storage.[ch].

* We don't support project files any more.  They were useful for a
  while, but no longer seem relevant.

* Nuked a large bunch of irrelevant options in rts/options.h.

As of this commit, the system can load and chase modules, both in
standalone and combined modes.  The :l (load), :a (also), :r (refresh),
:i (info), :t (show type) and :m (set eval module) commands appear
to work.  There are also several temporary limitations which will
be fixed soon:

* Anything to do with external editors, etc, doesn't work.

* The downward-closure-of-object-code (if M is object, all
  modules below M must be too) is not enforced nor checked for.
  It needs to be.

* Module M _must_ reside in M.hs/M.o (sigh).  To be fixed.

* Error handling is probably flaky, and interrupt handling
  very likely is.

* Error messages don't have line numbers.  (A 5-minute fix).

* Progress messages are all at sea; needs re-thinking now that
  the order in which things are done is radically different.

* Compile-time GC is temporarily disabled whilst I figure out how
  to stress-test the GC.

* Freed-up symbol table entries are never re-entered on the free
  lists -- a debugging measure.

* :% is given a bad type in combined mode.  To be investigated.

24 years ago[project @ 2000-03-22 14:29:54 by simonmar]
simonmar [Wed, 22 Mar 2000 14:29:54 +0000 (14:29 +0000)]
[project @ 2000-03-22 14:29:54 by simonmar]
another -u: __init_PrelMain

24 years ago[project @ 2000-03-22 13:45:54 by simonpj]
simonpj [Wed, 22 Mar 2000 13:45:54 +0000 (13:45 +0000)]
[project @ 2000-03-22 13:45:54 by simonpj]
Make Enum for Ratio behave like the Report says

24 years ago[project @ 2000-03-22 12:30:52 by rrt]
rrt [Wed, 22 Mar 2000 12:30:52 +0000 (12:30 +0000)]
[project @ 2000-03-22 12:30:52 by rrt]
Removed obsolete comment.

24 years ago[project @ 2000-03-22 12:15:46 by rrt]
rrt [Wed, 22 Mar 2000 12:15:46 +0000 (12:15 +0000)]
[project @ 2000-03-22 12:15:46 by rrt]
Changed __init_Main to __init_PrelMain in line with changes elsewhere.

24 years ago[project @ 2000-03-22 12:01:57 by rrt]
rrt [Wed, 22 Mar 2000 12:01:57 +0000 (12:01 +0000)]
[project @ 2000-03-22 12:01:57 by rrt]
Stopped PrelMain.dll_o being built with -split-objs (filter this out from
argument list)

24 years ago[project @ 2000-03-21 17:41:02 by simonmar]
simonmar [Tue, 21 Mar 2000 17:41:02 +0000 (17:41 +0000)]
[project @ 2000-03-21 17:41:02 by simonmar]
What happened to gcc's "uninitialised variable" warnings when I needed
them?