ghc-hetmet.git
22 years ago[project @ 2001-10-16 14:44:51 by simonmar]
simonmar [Tue, 16 Oct 2001 14:44:51 +0000 (14:44 +0000)]
[project @ 2001-10-16 14:44:51 by simonmar]
Catch ^C exceptions at the top level of the interactive loop and
ignore them.

MERGE TO STABLE

22 years ago[project @ 2001-10-16 14:08:26 by simonmar]
simonmar [Tue, 16 Oct 2001 14:08:26 +0000 (14:08 +0000)]
[project @ 2001-10-16 14:08:26 by simonmar]
Clean tmp files between compilations, rather than all at the end.
This reduces the /tmp clutter if GHC dies messily (current values of
"messily" include segmentation fault and, sadly, heap overflow).

22 years ago[project @ 2001-10-16 14:02:01 by rrt]
rrt [Tue, 16 Oct 2001 14:03:12 +0000 (14:03 +0000)]
[project @ 2001-10-16 14:02:01 by rrt]
Comment dubious hack.

22 years ago[project @ 2001-10-16 13:31:56 by simonmar]
simonmar [Tue, 16 Oct 2001 13:31:56 +0000 (13:31 +0000)]
[project @ 2001-10-16 13:31:56 by simonmar]
Format some comments to 80 columns.

22 years ago[project @ 2001-10-16 13:29:35 by simonmar]
simonmar [Tue, 16 Oct 2001 13:29:35 +0000 (13:29 +0000)]
[project @ 2001-10-16 13:29:35 by simonmar]
Don't print the 'Loading package...' message for packages which don't
require any loading (gmp & rts in particular).

22 years ago[project @ 2001-10-16 13:25:00 by simonmar]
simonmar [Tue, 16 Oct 2001 13:25:00 +0000 (13:25 +0000)]
[project @ 2001-10-16 13:25:00 by simonmar]
- set the buffering mode on stdout & stderr to unbuffered in
  interactive mode

- fix some bugs in package linking: loading a package using the :set
  command wasn't using the same mechanism as the command-line package
  loading to avoid linking in dynamic libraries that are already
  linked into the GHCi binary.

- fix a compile error.

MERGE TO STABLE

22 years ago[project @ 2001-10-16 11:29:08 by simonmar]
simonmar [Tue, 16 Oct 2001 11:29:08 +0000 (11:29 +0000)]
[project @ 2001-10-16 11:29:08 by simonmar]
mention that you might need to add -lHSrts before any other libraries
on the linker command line, if another library has its own main() function.

22 years ago[project @ 2001-10-16 11:20:58 by rrt]
rrt [Tue, 16 Oct 2001 11:20:58 +0000 (11:20 +0000)]
[project @ 2001-10-16 11:20:58 by rrt]
Strip out \r on Windows. This should not be necessary as Perl should
read in text mode on a text mounted volume (under Cygwin).

22 years ago[project @ 2001-10-16 10:50:11 by simonmar]
simonmar [Tue, 16 Oct 2001 10:50:11 +0000 (10:50 +0000)]
[project @ 2001-10-16 10:50:11 by simonmar]
mention that identifiers beginning with a double underscore are to be
avoided in -fglasgow-exts mode.

22 years ago[project @ 2001-10-16 10:37:32 by simonpj]
simonpj [Tue, 16 Oct 2001 10:37:32 +0000 (10:37 +0000)]
[project @ 2001-10-16 10:37:32 by simonpj]
Fix the default-expansion code for HEAD; fixes cg050

22 years ago[project @ 2001-10-16 10:01:13 by simonmar]
simonmar [Tue, 16 Oct 2001 10:01:13 +0000 (10:01 +0000)]
[project @ 2001-10-16 10:01:13 by simonmar]
Explicitly sign- or zero-extend the result of a ccall up to the word
size if necessary.  Recent discussion on
glasgow-haskell-users@haskell.org suggests that this is the
responsibility of the caller rather than the callee.

We do it by wrapping the result in narrow{8,16,32}{Int,Word}# as
appropriate, at desugaring time, because this way we only have to do
it once instead of once per backend.  Furthermore the narrowing is
exposed to the simplifier which is generally a good thing.

22 years ago[project @ 2001-10-15 16:03:04 by simonpj]
simonpj [Mon, 15 Oct 2001 16:03:04 +0000 (16:03 +0000)]
[project @ 2001-10-15 16:03:04 by simonpj]
--------------------------
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.

22 years ago[project @ 2001-10-15 15:06:01 by simonpj]
simonpj [Mon, 15 Oct 2001 15:06:01 +0000 (15:06 +0000)]
[project @ 2001-10-15 15:06:01 by simonpj]
--------------------------
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

22 years ago[project @ 2001-10-15 15:05:17 by simonpj]
simonpj [Mon, 15 Oct 2001 15:05:17 +0000 (15:05 +0000)]
[project @ 2001-10-15 15:05:17 by simonpj]
Rename ifaceTyCls to ifaceTyThing (more consistent)

22 years ago[project @ 2001-10-15 15:03:48 by simonpj]
simonpj [Mon, 15 Oct 2001 15:03:48 +0000 (15:03 +0000)]
[project @ 2001-10-15 15:03:48 by simonpj]
Add comments re eta expansion

22 years ago[project @ 2001-10-15 15:03:24 by simonpj]
simonpj [Mon, 15 Oct 2001 15:03:24 +0000 (15:03 +0000)]
[project @ 2001-10-15 15:03:24 by simonpj]
Add comment for type of unsafeCoerce#

22 years ago[project @ 2001-10-13 20:47:43 by sof]
sof [Sat, 13 Oct 2001 20:47:43 +0000 (20:47 +0000)]
[project @ 2001-10-13 20:47:43 by sof]
When 'boot'ing, delay 'all' target a bit

22 years ago[project @ 2001-10-13 20:46:24 by sof]
sof [Sat, 13 Oct 2001 20:46:24 +0000 (20:46 +0000)]
[project @ 2001-10-13 20:46:24 by sof]
In defn of CPP, include @CPPFLAGS@ on RHS.

22 years ago[project @ 2001-10-13 20:44:52 by sof]
sof [Sat, 13 Oct 2001 20:44:52 +0000 (20:44 +0000)]
[project @ 2001-10-13 20:44:52 by sof]
Add explanatory comment as to why a pair of win32-specific options
are filtered out of CC_OPTS.

22 years ago[project @ 2001-10-13 20:26:13 by sof]
sof [Sat, 13 Oct 2001 20:26:13 +0000 (20:26 +0000)]
[project @ 2001-10-13 20:26:13 by sof]
Added FPTOOLS_FIND_FIND.

On Win32 boxes, rejects the MS 'find' utility and continues
searching for GNU find. On non-Win32 boxes, equal to
AC_PATH_PROG(FindCmd, find)

22 years ago[project @ 2001-10-13 16:02:47 by sof]
sof [Sat, 13 Oct 2001 16:02:47 +0000 (16:02 +0000)]
[project @ 2001-10-13 16:02:47 by sof]
- unpackProgName: recognise '/' and '\\' as path separators under Win32.
- donated in-house version of basename, it's cool (== doesn't use reverse).

22 years ago[project @ 2001-10-12 18:44:52 by sof]
sof [Fri, 12 Oct 2001 18:44:52 +0000 (18:44 +0000)]
[project @ 2001-10-12 18:44:52 by sof]
Robustified:

- 'make clean' followed by 'make all' should now work
  as expected.
- 'make boot' now forces 'depend' and 'all' to fire (not
  the other way around).

22 years ago[project @ 2001-10-12 14:28:08 by rrt]
rrt [Fri, 12 Oct 2001 14:29:11 +0000 (14:29 +0000)]
[project @ 2001-10-12 14:28:08 by rrt]
Update "make install" settings for Windows.

22 years ago[project @ 2001-10-12 14:27:28 by rrt]
rrt [Fri, 12 Oct 2001 14:27:28 +0000 (14:27 +0000)]
[project @ 2001-10-12 14:27:28 by rrt]
Changes to installation locations of various files on Windows.

22 years ago[project @ 2001-10-11 23:52:51 by sof]
sof [Thu, 11 Oct 2001 23:52:52 +0000 (23:52 +0000)]
[project @ 2001-10-11 23:52:51 by sof]
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

22 years ago[project @ 2001-10-11 22:27:04 by sof]
sof [Thu, 11 Oct 2001 22:27:05 +0000 (22:27 +0000)]
[project @ 2001-10-11 22:27:04 by sof]
- removed Win32-only IOErrorType.ComError
- added IOErrorType.(DynIOError Dynamic.Dynamic)

  Propagating dynamically-typed exceptions as Exception.DynException
  isn't always the right thing to do
  [ why? You cannot catch them with IO.catch & you don't get the
    'infrastructure' that IOError offers, so you're forced to
    reinvent that wheel for each dynamic exception.
  ]
- removed IOExts.isComError  :: IOError -> Bool
- added IOExts.isDynIOError  :: IOError -> Bool
- added IOExts.getDynIOError :: IOError -> Dynamic.Dynamic
- documented IOExts changes.

22 years ago[project @ 2001-10-11 16:44:10 by simonpj]
simonpj [Thu, 11 Oct 2001 16:44:10 +0000 (16:44 +0000)]
[project @ 2001-10-11 16:44:10 by simonpj]
Add special ILX case for Coerce

22 years ago[project @ 2001-10-11 14:31:45 by sewardj]
sewardj [Thu, 11 Oct 2001 14:31:45 +0000 (14:31 +0000)]
[project @ 2001-10-11 14:31:45 by sewardj]
Correctly handle unboxed tuples when converting DEFAULT alts to
  unboxed tuple constructors in case args.  (I'm sure this could
  be worded better).  Branch and HEAD have drifted too far apart
  for easy common commit for this, so is committed seperately for
  ghc-5-02-branch.

22 years ago[project @ 2001-10-10 23:18:43 by sof]
sof [Wed, 10 Oct 2001 23:18:43 +0000 (23:18 +0000)]
[project @ 2001-10-10 23:18:43 by sof]
Remove HDirect/COM package.

22 years ago[project @ 2001-10-10 23:17:14 by sof]
sof [Wed, 10 Oct 2001 23:17:14 +0000 (23:17 +0000)]
[project @ 2001-10-10 23:17:14 by sof]
savePackageConfig: Robustified - remove existing .old file before saving
away new. In case of failure, print out a msg detailing what files were
involved.

22 years ago[project @ 2001-10-10 17:25:15 by sof]
sof [Wed, 10 Oct 2001 17:25:15 +0000 (17:25 +0000)]
[project @ 2001-10-10 17:25:15 by sof]
- fixed awfully bad bug in allocation of new argv vector, it
  did:

      malloc(sizeof(char) * (argc + 1 + 1));

  where it should have done:

      malloc(sizeof(char*) * (argc + 1 + 1));

  [ This one is the cause of one or two 5.02 bug reports
    that are now starting to trickle in. As a stopgap
    measure (and since I'm to blame for this one, really),
    I've put up a replacement ghci.exe wrapper at

      http://www.galconn.com/~sof/ghci.zip
  ]

- added some (currently disabled) debug print code.

22 years ago[project @ 2001-10-10 17:17:44 by ken]
ken [Wed, 10 Oct 2001 17:17:44 +0000 (17:17 +0000)]
[project @ 2001-10-10 17:17:44 by ken]
Pass the "-mieee" flag to gcc, so that we get IEEE floating-point.
(Fixed: pass the flag all the time, not just when compiling HC files.)
MERGE TO STABLE

22 years ago[project @ 2001-10-09 08:31:15 by sof]
sof [Tue, 9 Oct 2001 08:31:15 +0000 (08:31 +0000)]
[project @ 2001-10-09 08:31:15 by sof]
FPTOOLS_CC_FLAG: fixed bug that prevented cygwin-based GCCen from working

22 years ago[project @ 2001-10-08 14:22:43 by simonmar]
simonmar [Mon, 8 Oct 2001 14:22:43 +0000 (14:22 +0000)]
[project @ 2001-10-08 14:22:43 by simonmar]
Turn the error message about package mismatch into a warning.  This is
really harmless at the moment (only fatal with DLLs), but really gets
in the way when you want to build a package and also use it directly
with the appropriate -i/-l flags.

22 years ago[project @ 2001-10-08 13:24:53 by simonmar]
simonmar [Mon, 8 Oct 2001 13:24:53 +0000 (13:24 +0000)]
[project @ 2001-10-08 13:24:53 by simonmar]
Don't panic when an out-of-range optimisation level is requested.

22 years ago[project @ 2001-10-04 14:21:07 by rrt]
rrt [Thu, 4 Oct 2001 14:21:07 +0000 (14:21 +0000)]
[project @ 2001-10-04 14:21:07 by rrt]
Track reality somewhat on the ILX front.

22 years ago[project @ 2001-10-04 14:19:26 by rrt]
rrt [Thu, 4 Oct 2001 14:19:26 +0000 (14:19 +0000)]
[project @ 2001-10-04 14:19:26 by rrt]
Move PrelGHC.ilx.real to PrelGHC.ilx.pp, for consistency with other such
files. Actually, the "preprocessing" just consists of copying it to
PrelGHC.ilx; it's done because ILX files aren't precious, and we don't want
it being deleted.

22 years ago[project @ 2001-10-04 10:48:19 by simonpj]
simonpj [Thu, 4 Oct 2001 10:48:19 +0000 (10:48 +0000)]
[project @ 2001-10-04 10:48:19 by simonpj]
More healing

22 years ago[project @ 2001-10-04 08:35:24 by simonpj]
simonpj [Thu, 4 Oct 2001 08:35:26 +0000 (08:35 +0000)]
[project @ 2001-10-04 08:35:24 by simonpj]
Heal the HEAD

22 years ago[project @ 2001-10-03 16:20:57 by simonpj]
simonpj [Wed, 3 Oct 2001 16:20:57 +0000 (16:20 +0000)]
[project @ 2001-10-03 16:20:57 by simonpj]
Add comments, and nuke strictness info in CoreTidy if totally boring

22 years ago[project @ 2001-10-03 15:30:57 by rrt]
rrt [Wed, 3 Oct 2001 15:30:57 +0000 (15:30 +0000)]
[project @ 2001-10-03 15:30:57 by rrt]
Dear Sigbjorn,

next time you turn an

if...endif

into an

if...else..endif

remember to check the sense of the test. Sometimes, it needs to be reversed
(there was in this case a hint in the surrounding code).

Love,

Reuben.

22 years ago[project @ 2001-10-03 13:59:22 by simonpj]
simonpj [Wed, 3 Oct 2001 13:59:22 +0000 (13:59 +0000)]
[project @ 2001-10-03 13:59:22 by simonpj]
wibbles only

22 years ago[project @ 2001-10-03 13:58:50 by simonpj]
simonpj [Wed, 3 Oct 2001 13:58:51 +0000 (13:58 +0000)]
[project @ 2001-10-03 13:58:50 by simonpj]
---------------------
Clear up infelicities
---------------------
CorePrep, CoreUtils, SimplUtils
LiberateCase (wibbles only)

* Previously CorePrep was floating LocalIds to top level, which
  breaks the invariant that after CorePrep all top level Ids are
  GlobalIds.  But it didn't really need to, and this pass makes it
  so.  It's much tidier now.

* Make CorePrep do eta expansion on partial applications
x = foldr f y  ==>   x = \ys -> foldr f y ys
  (This used to be done in the simplifier, but now the
  simplifier only eta expands where there is at least one
  lambda already.)

* Omit CoreUtils.etaReduce.  (Never called.)

* Improve CoreUtils.etaExpand, so that it doesn't add gratuitous
  beta redexes.

22 years ago[project @ 2001-10-03 13:58:13 by simonpj]
simonpj [Wed, 3 Oct 2001 13:58:13 +0000 (13:58 +0000)]
[project @ 2001-10-03 13:58:13 by simonpj]
----------------------------------------------
Output curried functions for data constructors
----------------------------------------------
(incomplete)

The idea here is to output code for the *curried* version of
the worker of a data constructor, so that the worker can be
treated as a first-class citizen elsewhere in the compiler.
In particular, it doesn't need to be a "hasNoBinding" thing,
which are the subject of a number of nasty hacks.

These changes only do the business for the code gen route
via AbstractC.  Remaining to do: the byte code generator.

Idea: move the byte-code gen to STG code, and inject the
curried data-constructor workers at the STG stage.

I hope the changes here won't make
anything stop working.  For now, constructor
workers remain "hasNoBinding" things.

CgConTbls, CodeGen, CoreTidy, CoreToStg

22 years ago[project @ 2001-10-03 13:57:42 by simonmar]
simonmar [Wed, 3 Oct 2001 13:57:42 +0000 (13:57 +0000)]
[project @ 2001-10-03 13:57:42 by simonmar]
Tidy up ghc/includes/Constants and related things.

Now all the constants that the compiler needs to know, such as header
size, update frame size, info table size and so on are generated
automatically into a header file, DeriviedConstants.h, by a small C
program in the same way as NativeDefs.h.  The C code in the RTS is
expected to use sizeof() directly (it already does).

Also tidied up the constants in MachDeps.h - all the constants
representing the sizes of various types are named SIZEOF_<foo>, to
match the constants defined in config.h.  PrelStorable.lhs now doesn't
contain any special knowledge about GHC's conventions as regards the
size of certain types, this is all in MachDeps.h.

22 years ago[project @ 2001-10-03 13:57:33 by simonpj]
simonpj [Wed, 3 Oct 2001 13:57:33 +0000 (13:57 +0000)]
[project @ 2001-10-03 13:57:33 by simonpj]
-------------------------------------------
Don't bomb out on inlining big constructors
-------------------------------------------

The unfolder bombs out if the expression get too big; no point in
computing its exact size when it's vast.  But for *constructors*
applied to a lot of args, it's worth keeping going, because we
get a big *disount* too
$fFooInt = :CFoo a1 a2 a3 ... a50

We want to keep the inlining for $fFooInt in interface files, so
that importing guys can do the selection.

Solution: only bomb out when size-discount gets too big.

22 years ago[project @ 2001-10-03 10:18:31 by rrt]
rrt [Wed, 3 Oct 2001 10:18:31 +0000 (10:18 +0000)]
[project @ 2001-10-03 10:18:31 by rrt]
This file shouldn't be in the repository any more (there's a
PrelGHC.hi-boot.pp).

Why is it only me that notices these phantom leftovers? Why don't they cause
problems for other people?

22 years ago[project @ 2001-10-03 09:56:18 by sewardj]
sewardj [Wed, 3 Oct 2001 09:56:18 +0000 (09:56 +0000)]
[project @ 2001-10-03 09:56:18 by sewardj]
In the interactive FFI, handle f-i'd fns which return char.

22 years ago[project @ 2001-10-03 09:43:11 by rrt]
rrt [Wed, 3 Oct 2001 09:43:11 +0000 (09:43 +0000)]
[project @ 2001-10-03 09:43:11 by rrt]
Remove import of unDosifyPath, and the comment saying that it is used.

22 years ago[project @ 2001-10-03 09:20:20 by simonmar]
simonmar [Wed, 3 Oct 2001 09:20:20 +0000 (09:20 +0000)]
[project @ 2001-10-03 09:20:20 by simonmar]
minor wibble: use Maybe.isJust rather than maybeToBool

22 years ago[project @ 2001-10-03 08:16:49 by simonmar]
simonmar [Wed, 3 Oct 2001 08:16:49 +0000 (08:16 +0000)]
[project @ 2001-10-03 08:16:49 by simonmar]
Don't print the "compilation IS NOT required" in quiet mode (-v0).

22 years ago[project @ 2001-10-02 22:30:47 by sof]
sof [Tue, 2 Oct 2001 22:30:47 +0000 (22:30 +0000)]
[project @ 2001-10-02 22:30:47 by sof]
field: robustify - give a parse error (rather than p-match failure)
if LHS isn't known.

22 years ago[project @ 2001-10-02 16:15:10 by simonpj]
simonpj [Tue, 2 Oct 2001 16:15:10 +0000 (16:15 +0000)]
[project @ 2001-10-02 16:15:10 by simonpj]
Wibble in eqString

22 years ago[project @ 2001-10-02 15:27:15 by sewardj]
sewardj [Tue, 2 Oct 2001 15:27:15 +0000 (15:27 +0000)]
[project @ 2001-10-02 15:27:15 by sewardj]
Fix spurious sp increment in RET_{VEC_}_SMALL printing code.

MERGE TO STABLE

22 years ago[project @ 2001-10-02 11:48:28 by simonpj]
simonpj [Tue, 2 Oct 2001 11:48:28 +0000 (11:48 +0000)]
[project @ 2001-10-02 11:48:28 by simonpj]
Dont try to float unboxed things to top level

22 years ago[project @ 2001-10-02 11:09:55 by simonmar]
simonmar [Tue, 2 Oct 2001 11:09:55 +0000 (11:09 +0000)]
[project @ 2001-10-02 11:09:55 by simonmar]
Add a FAQ entry about using getContents in GHCi.

22 years ago[project @ 2001-10-01 15:42:42 by simonpj]
simonpj [Mon, 1 Oct 2001 15:42:42 +0000 (15:42 +0000)]
[project @ 2001-10-01 15:42:42 by simonpj]
ILX ifdefery

22 years ago[project @ 2001-10-01 14:40:33 by rrt]
rrt [Mon, 1 Oct 2001 14:40:33 +0000 (14:40 +0000)]
[project @ 2001-10-01 14:40:33 by rrt]
Various updates to track the state of GHC and ILX.

22 years ago[project @ 2001-10-01 14:34:51 by rrt]
rrt [Mon, 1 Oct 2001 14:34:51 +0000 (14:34 +0000)]
[project @ 2001-10-01 14:34:51 by rrt]
Track reality a bit.

22 years ago[project @ 2001-10-01 14:28:37 by rrt]
rrt [Mon, 1 Oct 2001 14:28:37 +0000 (14:28 +0000)]
[project @ 2001-10-01 14:28:37 by rrt]
Implement -keep-il-file.

22 years ago[project @ 2001-10-01 14:01:42 by rrt]
rrt [Mon, 1 Oct 2001 14:01:42 +0000 (14:01 +0000)]
[project @ 2001-10-01 14:01:42 by rrt]
Implement -keep-il-file

22 years ago[project @ 2001-10-01 13:57:13 by rrt]
rrt [Mon, 1 Oct 2001 13:57:13 +0000 (13:57 +0000)]
[project @ 2001-10-01 13:57:13 by rrt]
Add -keep-il-file.

22 years ago[project @ 2001-10-01 13:45:43 by rrt]
rrt [Mon, 1 Oct 2001 13:45:43 +0000 (13:45 +0000)]
[project @ 2001-10-01 13:45:43 by rrt]
PrelGHC.dll -> PrelGHC.i_o, and a few other corrections to follow
changes to ILX.

22 years ago[project @ 2001-10-01 13:38:50 by rrt]
rrt [Mon, 1 Oct 2001 13:38:50 +0000 (13:38 +0000)]
[project @ 2001-10-01 13:38:50 by rrt]
Reflect reality ever-so-slightly better.

22 years ago[project @ 2001-10-01 13:30:27 by rrt]
rrt [Mon, 1 Oct 2001 13:30:27 +0000 (13:30 +0000)]
[project @ 2001-10-01 13:30:27 by rrt]
Remove unused import.

22 years ago[project @ 2001-10-01 13:28:40 by rrt]
rrt [Mon, 1 Oct 2001 13:28:40 +0000 (13:28 +0000)]
[project @ 2001-10-01 13:28:40 by rrt]
Removed unused imports.

22 years ago[project @ 2001-10-01 13:13:38 by rrt]
rrt [Mon, 1 Oct 2001 13:13:38 +0000 (13:13 +0000)]
[project @ 2001-10-01 13:13:38 by rrt]
Get rid of \rs at the end of lines in prescripts and postscripts to
work around Windows dodginess.

22 years ago[project @ 2001-10-01 13:10:53 by simonmar]
simonmar [Mon, 1 Oct 2001 13:10:53 +0000 (13:10 +0000)]
[project @ 2001-10-01 13:10:53 by simonmar]
Export run_queue_hd to the dynamic linker; TkHaskell has a grotesque
hack which requires it.

22 years ago[project @ 2001-10-01 11:36:28 by simonmar]
simonmar [Mon, 1 Oct 2001 11:36:29 +0000 (11:36 +0000)]
[project @ 2001-10-01 11:36:28 by simonmar]
Allow default RTS options to be specified by linking in an object file
which defines the symbol `ghc_rts_opts' to point to a string of RTS
options.

This is preferred to using defaultsHook(), if possible.  Perhaps we
could remove defaultsHook().

(won't work with DLL's; if we ever ressurrect them we'll
have to deal with this somehow).

22 years ago[project @ 2001-10-01 11:09:02 by simonmar]
simonmar [Mon, 1 Oct 2001 11:09:02 +0000 (11:09 +0000)]
[project @ 2001-10-01 11:09:02 by simonmar]
Actually bomb out with an error message if the maximum heap size is
smaller than the minimum allocation area size.

22 years ago[project @ 2001-10-01 10:52:36 by simonmar]
simonmar [Mon, 1 Oct 2001 10:52:36 +0000 (10:52 +0000)]
[project @ 2001-10-01 10:52:36 by simonmar]
Fix a bug in the heap size calculation, where a negative result wasn't
noticed because we're working with unsigned types.  We now explicitly
test that the heap has enough room for the minimum allocation area
size, otherwise a heap overflow is reported.

22 years ago[project @ 2001-10-01 09:45:38 by simonpj]
simonpj [Mon, 1 Oct 2001 09:45:38 +0000 (09:45 +0000)]
[project @ 2001-10-01 09:45:38 by simonpj]
---------------------------
Match rules before inlining
---------------------------

This commit fulfils a long-standing wish by Manuel that RULES
matching occurs before inlining.  So if a RULE matches, it'll
get used, even if the function can also be inlined.

It's a bit dodgy to actually rely on this, because maybe the rule
doesn't match *yet* but will do after a bit more transformation.
But it does help with things like class operations.  Class ops are
simply selectors which pick a method out of a dictionary, so they
are inlined rather vigorously.  But we might want a RULE for a
class method (e.g. (==) [Char] = eqString), and such rules would
practically never fire if inlining took priority.

22 years ago[project @ 2001-10-01 09:41:28 by simonpj]
simonpj [Mon, 1 Oct 2001 09:41:28 +0000 (09:41 +0000)]
[project @ 2001-10-01 09:41:28 by simonpj]
Stuff to make a RULE work for
eqString "foo" "foo" = True
(etc.)  The rule is of course a BuiltinRule in PrelRules

22 years ago[project @ 2001-10-01 09:40:26 by simonpj]
simonpj [Mon, 1 Oct 2001 09:40:26 +0000 (09:40 +0000)]
[project @ 2001-10-01 09:40:26 by simonpj]
Add a rule for equality on strings

22 years ago[project @ 2001-10-01 09:26:27 by simonpj]
simonpj [Mon, 1 Oct 2001 09:26:27 +0000 (09:26 +0000)]
[project @ 2001-10-01 09:26:27 by simonpj]
Fix a long-standing lossage of rules attached to class operations
(A one-line fix to SimplCore.updateBinders.)

22 years ago[project @ 2001-09-28 23:41:00 by sof]
sof [Fri, 28 Sep 2001 23:41:00 +0000 (23:41 +0000)]
[project @ 2001-09-28 23:41:00 by sof]
Rename 'doDiscard' to 'lexPragma', and make it EOF-resistant.
As was, it would run off the end of a StringBuffer (and SIGSEGV,
most likely) if a pragma wasn't properly closed.

22 years ago[project @ 2001-09-28 23:36:50 by sof]
sof [Fri, 28 Sep 2001 23:36:50 +0000 (23:36 +0000)]
[project @ 2001-09-28 23:36:50 by sof]
Provide finer-grained control for turning off mk/target.mk's
'all', 'boot' and 'install' rules. i.e., instead of having
the variable NO_ALL_TARGETS control the defnition of rules
for all three, NO_ALL_TARGET, NO_BOOT_TARGET, and NO_INSTALL_TARGET
lets you individually control which ones you don't want.

Sub-projects (GC and HDirect, for example) have the need
to turn off the 'boot' rule, which is what motivated this
change.

22 years ago[project @ 2001-09-28 10:59:50 by rrt]
rrt [Fri, 28 Sep 2001 10:59:50 +0000 (10:59 +0000)]
[project @ 2001-09-28 10:59:50 by rrt]
Tweaks to the 5.02 InstallShield to improve presentation and the range of
help files available.

22 years ago[project @ 2001-09-27 23:10:52 by sof]
sof [Thu, 27 Sep 2001 23:10:52 +0000 (23:10 +0000)]
[project @ 2001-09-27 23:10:52 by sof]
Inline BasicTypes.CompilerPhase tysyn to workaround
Outputable <--> BasicTypes module loop.

22 years ago[project @ 2001-09-27 09:49:46 by rrt]
rrt [Thu, 27 Sep 2001 09:49:46 +0000 (09:49 +0000)]
[project @ 2001-09-27 09:49:46 by rrt]
Add note that it's possible to move the Windows GHC tree around if you want
to (e.g. to get it on a path without spaces).

22 years ago[project @ 2001-09-26 16:27:04 by simonpj]
simonpj [Wed, 26 Sep 2001 16:27:04 +0000 (16:27 +0000)]
[project @ 2001-09-26 16:27:04 by simonpj]
Wibble

22 years ago[project @ 2001-09-26 16:22:04 by simonpj]
simonpj [Wed, 26 Sep 2001 16:22:04 +0000 (16:22 +0000)]
[project @ 2001-09-26 16:22:04 by simonpj]
Specialise reduce

22 years ago[project @ 2001-09-26 16:19:28 by simonpj]
simonpj [Wed, 26 Sep 2001 16:19:30 +0000 (16:19 +0000)]
[project @ 2001-09-26 16:19:28 by simonpj]
------------------
Simon's big commit
------------------
[ These files seem to have been left out for some reason ]

This commit, which I don't think I can sensibly do piecemeal, consists
of the things I've been doing recently, mainly directed at making
Manuel, George, and Marcin happier with RULES.

Reogranise the simplifier
~~~~~~~~~~~~~~~~~~~~~~~~~
1. The simplifier's environment is now an explicit parameter.  This
makes it a bit easier to figure out where it is going.

2. Constructor arguments can now be arbitrary expressions, except
when the application is the RHS of a let(rec).  This makes it much
easier to match rules like

RULES
    "foo"  f (h x, g y) = f' x y

In the simplifier, it's Simplify.mkAtomicArgs that ANF-ises a
constructor application where necessary.  In the occurrence analyser,
there's a new piece of context info (OccEncl) to say whether a
constructor app is in a place where it should be in ANF.  (Unless
it knows this it'll give occurrence info which will inline the
argument back into the constructor app.)

3. I'm experimenting with doing the "float-past big lambda" transformation
in the full laziness pass, rather than mixed in with the simplifier (was
tryRhsTyLam).

4.  Arrange that
case (coerce (S,T) (x,y)) of ...
will simplify.  Previous it didn't.
A local change to CoreUtils.exprIsConApp_maybe.

5. Do a better job in CoreUtils.exprEtaExpandArity when there's an
error function in one branch.

Phase numbers, RULES, and INLINE pragmas
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1.  Phase numbers decrease from N towards zero (instead of increasing).
This makes it easier to add new earlier phases, which is what users want
to do.

2.  RULES get their own phase number, N, and are disabled in phases before N.

e.g.  {-# RULES "foo" [2] forall x y.  f (x,y) = f' x y #-}

Note the [2], which says "only active in phase 2 and later".

3.  INLINE and NOINLINE pragmas have a phase number to.  This is now treated
in just the same way as the phase number on RULE; that is, the Id is not inlined
in phases earlier than N.  In phase N and later the Id *may* be inlined, and
here is where INLINE and NOINLINE differ: INLNE makes the RHS look small, so
as soon as it *may* be inlined it probably *will* be inlined.

The syntax of the phase number on an INLINE/NOINLINE pragma has changed to be
like the RULES case (i.e. in square brackets).  This should also make sure
you examine all such phase numbers; many will need to change now the numbering
is reversed.

Inlining Ids is no longer affected at all by whether the Id appears on the
LHS of a rule.  Now it's up to the programmer to put a suitable INLINE/NOINLINE
pragma to stop it being inlined too early.

Implementation notes:

*  A new data type, BasicTypes.Activation says when a rule or inline pragma
is active.   Functions isAlwaysActive, isNeverActive, isActive, do the
obvious thing (all in BasicTypes).

* Slight change in the SimplifierSwitch data type, which led to a lot of
simplifier-specific code moving from CmdLineOpts to SimplMonad; a Good Thing.

* The InlinePragma in the IdInfo of an Id is now simply an Activation saying
when the Id can be inlined.  (It used to be a rather bizarre pair of a
Bool and a (Maybe Phase), so this is much much easier to understand.)

* The simplifier has a "mode" environment switch, replacing the old
black list.  Unfortunately the data type decl has to be in
CmdLineOpts, because it's an argument to the CoreDoSimplify switch

    data SimplifierMode = SimplGently | SimplPhase Int

Here "gently" means "no rules, no inlining".   All the crucial
inlining decisions are now collected together in SimplMonad
(preInlineUnconditionally, postInlineUnconditionally, activeInline,
activeRule).

Specialisation
~~~~~~~~~~~~~~
1.  Only dictionary *functions* are made INLINE, not dictionaries that
have no parameters.  (This inline-dictionary-function thing is Marcin's
idea and I'm still not sure whether it's a good idea.  But it's definitely
a Bad Idea when there are no arguments.)

2.  Be prepared to specialise an INLINE function: an easy fix in
Specialise.lhs

But there is still a problem, which is that the INLINE wins
at the call site, so we don't use the specialised version anyway.
I'm still unsure whether it makes sense to SPECIALISE something
you want to INLINE.

Random smaller things
~~~~~~~~~~~~~~~~~~~~~~

* builtinRules (there was only one, but may be more) in PrelRules are now
  incorporated.   They were being ignored before...

* OrdList.foldOL -->  OrdList.foldrOL, OrdList.foldlOL

* Some tidying up of the tidyOpenTyVar, tidyTyVar functions.  I've
  forgotten exactly what!

22 years ago[project @ 2001-09-26 15:12:33 by simonpj]
simonpj [Wed, 26 Sep 2001 15:12:37 +0000 (15:12 +0000)]
[project @ 2001-09-26 15:12:33 by simonpj]
------------------
Simon's big commit
------------------

This commit, which I don't think I can sensibly do piecemeal, consists
of the things I've been doing recently, mainly directed at making
Manuel, George, and Marcin happier with RULES.

Reogranise the simplifier
~~~~~~~~~~~~~~~~~~~~~~~~~
1. The simplifier's environment is now an explicit parameter.  This
makes it a bit easier to figure out where it is going.

2. Constructor arguments can now be arbitrary expressions, except
when the application is the RHS of a let(rec).  This makes it much
easier to match rules like

RULES
    "foo"  f (h x, g y) = f' x y

In the simplifier, it's Simplify.mkAtomicArgs that ANF-ises a
constructor application where necessary.  In the occurrence analyser,
there's a new piece of context info (OccEncl) to say whether a
constructor app is in a place where it should be in ANF.  (Unless
it knows this it'll give occurrence info which will inline the
argument back into the constructor app.)

3. I'm experimenting with doing the "float-past big lambda" transformation
in the full laziness pass, rather than mixed in with the simplifier (was
tryRhsTyLam).

4.  Arrange that
case (coerce (S,T) (x,y)) of ...
will simplify.  Previous it didn't.
A local change to CoreUtils.exprIsConApp_maybe.

5. Do a better job in CoreUtils.exprEtaExpandArity when there's an
error function in one branch.

Phase numbers, RULES, and INLINE pragmas
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1.  Phase numbers decrease from N towards zero (instead of increasing).
This makes it easier to add new earlier phases, which is what users want
to do.

2.  RULES get their own phase number, N, and are disabled in phases before N.

e.g.  {-# RULES "foo" [2] forall x y.  f (x,y) = f' x y #-}

Note the [2], which says "only active in phase 2 and later".

3.  INLINE and NOINLINE pragmas have a phase number to.  This is now treated
in just the same way as the phase number on RULE; that is, the Id is not inlined
in phases earlier than N.  In phase N and later the Id *may* be inlined, and
here is where INLINE and NOINLINE differ: INLNE makes the RHS look small, so
as soon as it *may* be inlined it probably *will* be inlined.

The syntax of the phase number on an INLINE/NOINLINE pragma has changed to be
like the RULES case (i.e. in square brackets).  This should also make sure
you examine all such phase numbers; many will need to change now the numbering
is reversed.

Inlining Ids is no longer affected at all by whether the Id appears on the
LHS of a rule.  Now it's up to the programmer to put a suitable INLINE/NOINLINE
pragma to stop it being inlined too early.

Implementation notes:

*  A new data type, BasicTypes.Activation says when a rule or inline pragma
is active.   Functions isAlwaysActive, isNeverActive, isActive, do the
obvious thing (all in BasicTypes).

* Slight change in the SimplifierSwitch data type, which led to a lot of
simplifier-specific code moving from CmdLineOpts to SimplMonad; a Good Thing.

* The InlinePragma in the IdInfo of an Id is now simply an Activation saying
when the Id can be inlined.  (It used to be a rather bizarre pair of a
Bool and a (Maybe Phase), so this is much much easier to understand.)

* The simplifier has a "mode" environment switch, replacing the old
black list.  Unfortunately the data type decl has to be in
CmdLineOpts, because it's an argument to the CoreDoSimplify switch

    data SimplifierMode = SimplGently | SimplPhase Int

Here "gently" means "no rules, no inlining".   All the crucial
inlining decisions are now collected together in SimplMonad
(preInlineUnconditionally, postInlineUnconditionally, activeInline,
activeRule).

Specialisation
~~~~~~~~~~~~~~
1.  Only dictionary *functions* are made INLINE, not dictionaries that
have no parameters.  (This inline-dictionary-function thing is Marcin's
idea and I'm still not sure whether it's a good idea.  But it's definitely
a Bad Idea when there are no arguments.)

2.  Be prepared to specialise an INLINE function: an easy fix in
Specialise.lhs

But there is still a problem, which is that the INLINE wins
at the call site, so we don't use the specialised version anyway.
I'm still unsure whether it makes sense to SPECIALISE something
you want to INLINE.

Random smaller things
~~~~~~~~~~~~~~~~~~~~~~

* builtinRules (there was only one, but may be more) in PrelRules are now
  incorporated.   They were being ignored before...

* OrdList.foldOL -->  OrdList.foldrOL, OrdList.foldlOL

* Some tidying up of the tidyOpenTyVar, tidyTyVar functions.  I've
  forgotten exactly what!

22 years ago[project @ 2001-09-26 15:11:50 by simonpj]
simonpj [Wed, 26 Sep 2001 15:11:51 +0000 (15:11 +0000)]
[project @ 2001-09-26 15:11:50 by simonpj]
-------------------------------
Code generation and SRT hygiene
-------------------------------

This is a big tidy up commit.  I don't think it breaks anything,
but it certainly makes the code clearer (to me).

I'm not certain that you can use it without sucking in my other
big commit... they come from the same tree.

Core-to-STG, live variables and Static Reference Tables (SRTs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I did a big tidy-up of the live-variable computation in CoreToStg.
The key idea is that the live variables consist of two parts:
dynamic live vars
static live vars (CAFs)

These two always travel round together, but they were always
treated separately by the code until now. Now it's a new data type:

type LiveInfo = (StgLiveVars,  -- Dynamic live variables;
-- i.e. ones with a nested (non-top-level) binding
 CafSet) -- Static live variables;
-- i.e. top-level variables that are CAFs or refer to them

There's lots of documentation in CoreToStg.

Code generation
~~~~~~~~~~~~~~~
Arising from this, I found that SRT labels were stored in
a LambdaFormInfo during code generation, whereas they *ought*
to be in the ClosureInfo (which in turn contains a LambdaFormInfo).

This led to lots of changes in ClosureInfo, and I took the opportunity
to make it into a labelled record.

Similarly, I made the data type in AbstractC a bit more explicit:

  -- C_SRT is what StgSyn.SRT gets translated to...
  -- we add a label for the table, and expect only the 'offset/length' form

data C_SRT = NoC_SRT
   | C_SRT CLabel !Int{-offset-} !Int{-length-}

(Previously there were bottoms lying around.)

22 years ago[project @ 2001-09-26 13:42:50 by chak]
chak [Wed, 26 Sep 2001 13:42:50 +0000 (13:42 +0000)]
[project @ 2001-09-26 13:42:50 by chak]
- split documentation off into a separate package
- adapt to new docbook setup in RH7.1

22 years ago[project @ 2001-09-26 11:44:30 by rrt]
rrt [Wed, 26 Sep 2001 11:44:30 +0000 (11:44 +0000)]
[project @ 2001-09-26 11:44:30 by rrt]
Make the print stylesheet generate a TOC for sets (so the PDF manual
has a front TOC indicating that it contains both the user's guide and
libraries guide).

A simple question with a simple answer; how refreshing.

22 years ago[project @ 2001-09-26 10:38:02 by simonmar]
simonmar [Wed, 26 Sep 2001 10:38:02 +0000 (10:38 +0000)]
[project @ 2001-09-26 10:38:02 by simonmar]
ENODEV should really be an UnsupportedOperation, not NoSuchThing.

22 years ago[project @ 2001-09-26 10:35:41 by simonmar]
simonmar [Wed, 26 Sep 2001 10:35:41 +0000 (10:35 +0000)]
[project @ 2001-09-26 10:35:41 by simonmar]
A failure while trying to set O_NONBLOCK on a file descriptor should
be a non-fatal error.  It turns out that on FreeBSD it is an error
(ENODEV) to try to set O_NONBLOCK on /dev/null.

MERGE TO STABLE

22 years ago[project @ 2001-09-26 09:41:26 by simonmar]
simonmar [Wed, 26 Sep 2001 09:41:26 +0000 (09:41 +0000)]
[project @ 2001-09-26 09:41:26 by simonmar]
Let's try that last commit again, and get it right this time...

22 years ago[project @ 2001-09-26 09:16:00 by simonmar]
simonmar [Wed, 26 Sep 2001 09:16:00 +0000 (09:16 +0000)]
[project @ 2001-09-26 09:16:00 by simonmar]
When skipping a nested comment, keep track of the source location of
the comment opener, so that we can report it in an error message
rather than reporting the line at the end of the file.

Also noticed a couple of ineficiencies in the nested comment code, so
fixed those too.

22 years ago[project @ 2001-09-26 08:59:42 by simonmar]
simonmar [Wed, 26 Sep 2001 08:59:42 +0000 (08:59 +0000)]
[project @ 2001-09-26 08:59:42 by simonmar]
Add the text about ForeignPtr vs. Ptr

22 years ago[project @ 2001-09-25 20:16:19 by sof]
sof [Tue, 25 Sep 2001 20:16:19 +0000 (20:16 +0000)]
[project @ 2001-09-25 20:16:19 by sof]
Stick with trad. function syntax in prev commit; avoids unnecessary Perl versioning issues

22 years ago[project @ 2001-09-25 18:08:47 by ken]
ken [Tue, 25 Sep 2001 18:08:48 +0000 (18:08 +0000)]
[project @ 2001-09-25 18:08:47 by ken]
Pass the "-mieee" flag to gcc, so that we get IEEE floating-point.
MERGE TO STABLE

22 years ago[project @ 2001-09-25 15:24:14 by rrt]
rrt [Tue, 25 Sep 2001 15:24:14 +0000 (15:24 +0000)]
[project @ 2001-09-25 15:24:14 by rrt]
Remove mention of building guide (no longer shipped with binary dist
on Windows), and add set.html target (need to make HTML docs).

22 years ago[project @ 2001-09-25 13:00:41 by simonmar]
simonmar [Tue, 25 Sep 2001 13:00:41 +0000 (13:00 +0000)]
[project @ 2001-09-25 13:00:41 by simonmar]
Fix the mangle rule since the definition of GHC_MANGLER changed

MERGE TO STABLE

22 years ago[project @ 2001-09-25 11:46:33 by simonmar]
simonmar [Tue, 25 Sep 2001 11:46:33 +0000 (11:46 +0000)]
[project @ 2001-09-25 11:46:33 by simonmar]
Mention the use of the -no-hs-main flag when talking about linking
programs where main() is not provided by GHC.

22 years ago[project @ 2001-09-25 10:39:21 by simonmar]
simonmar [Tue, 25 Sep 2001 10:39:21 +0000 (10:39 +0000)]
[project @ 2001-09-25 10:39:21 by simonmar]
- don't omit "test" dirs from the source distribution
- remove some backslashes from the sed commands to make them work here

22 years ago[project @ 2001-09-24 22:29:02 by gla]
gla [Mon, 24 Sep 2001 22:29:02 +0000 (22:29 +0000)]
[project @ 2001-09-24 22:29:02 by gla]

22 years ago[project @ 2001-09-24 22:28:12 by gla]
gla [Mon, 24 Sep 2001 22:28:12 +0000 (22:28 +0000)]
[project @ 2001-09-24 22:28:12 by gla]
Added a diagram showing the biography of a closure.
Made minor changes to a few paragraphs and footnotes.