ghc-hetmet.git
21 years ago[project @ 2002-09-18 06:34:07 by mthomas]
mthomas [Wed, 18 Sep 2002 06:34:07 +0000 (06:34 +0000)]
[project @ 2002-09-18 06:34:07 by mthomas]
ifdefs for mingw32 to get rid of signal functions.

21 years ago[project @ 2002-09-17 14:26:50 by simonmar]
simonmar [Tue, 17 Sep 2002 14:26:50 +0000 (14:26 +0000)]
[project @ 2002-09-17 14:26:50 by simonmar]
Fix search-and-replace-o:  s/%lt/&lt

MERGE TO STABLE

21 years ago[project @ 2002-09-17 13:00:14 by simonpj]
simonpj [Tue, 17 Sep 2002 13:00:15 +0000 (13:00 +0000)]
[project @ 2002-09-17 13:00:14 by simonpj]
--------------------------------------
Another attempt to make unbound type
variables in RULES work right
--------------------------------------

Sigh.  I'm trying to find the unbound type variables on the LHS of a
RULE.  I thought I could just gather free vars, but that does not work
well on an un-zonked LHS, because a big lambda might bind a type variable
that looks different (pre-zonking) but isn't really.

Oh well, back to plan B which is more work but more robust.

Now the zonking phase (in TcHsSyn) arranges to zonk types in a different
way (zonkTypeCollecting) on a rule LHS than in ordinary expressions
(zonkTypeZapping).  This is less dependent on the exact form of the LHS
(good) but involves another mutable variable (not unclean, but it's sad
to have to admit that mutable variables do sometimes allow you to make
non-invasive changes).

21 years ago[project @ 2002-09-17 12:34:31 by simonmar]
simonmar [Tue, 17 Sep 2002 12:34:31 +0000 (12:34 +0000)]
[project @ 2002-09-17 12:34:31 by simonmar]
and for good measure, use STGCALL1 rather than a bare C call.

21 years ago[project @ 2002-09-17 12:33:08 by simonmar]
simonmar [Tue, 17 Sep 2002 12:33:08 +0000 (12:33 +0000)]
[project @ 2002-09-17 12:33:08 by simonmar]
remove bogus return too.

21 years ago[project @ 2002-09-17 12:32:40 by simonmar]
simonmar [Tue, 17 Sep 2002 12:32:40 +0000 (12:32 +0000)]
[project @ 2002-09-17 12:32:40 by simonmar]
NON_ENTERABLE_ENTRY_CODE() should really barf() rather than attempting
a clean shutdown.

MERGE TO STABLE

21 years ago[project @ 2002-09-17 12:20:15 by simonmar]
simonmar [Tue, 17 Sep 2002 12:20:15 +0000 (12:20 +0000)]
[project @ 2002-09-17 12:20:15 by simonmar]
The GC wasn't properly marking pending signal handlers, which could
lead to "EVACUATED object entered!" errors.  Also, a race occurs if a
signal arrives during GC.  Two fixes:

  (a) mark all pending signal handlers during GC, and
  (b) block signals during GC

MERGE TO STABLE

21 years ago[project @ 2002-09-17 12:11:44 by simonmar]
simonmar [Tue, 17 Sep 2002 12:11:45 +0000 (12:11 +0000)]
[project @ 2002-09-17 12:11:44 by simonmar]
The GC wasn't properly marking pending signal handlers, which could
lead to "EVACUATED object entered!" errors.  Also, a race occurs if a
signal arrives during GC.  Two fixes:

  (a) mark all pending signal handlers during GC, and
  (b) block signals during GC

MERGE TO STABLE

21 years ago[project @ 2002-09-17 10:08:48 by simonpj]
simonpj [Tue, 17 Sep 2002 10:08:51 +0000 (10:08 +0000)]
[project @ 2002-09-17 10:08:48 by simonpj]
Unbork head...ruleLhsTvs does not crash now

21 years ago[project @ 2002-09-17 09:25:07 by simonpj]
simonpj [Tue, 17 Sep 2002 09:25:07 +0000 (09:25 +0000)]
[project @ 2002-09-17 09:25:07 by simonpj]
CString import only for mingw32

21 years ago[project @ 2002-09-16 14:09:35 by simonmar]
simonmar [Mon, 16 Sep 2002 14:09:35 +0000 (14:09 +0000)]
[project @ 2002-09-16 14:09:35 by simonmar]
Type signatures may only be given for unqualified variables

21 years ago[project @ 2002-09-16 12:45:59 by simonpj]
simonpj [Mon, 16 Sep 2002 12:45:59 +0000 (12:45 +0000)]
[project @ 2002-09-16 12:45:59 by simonpj]
Silly bug in plusImportAvails [HEAD only]

21 years ago[project @ 2002-09-16 10:39:11 by chak]
chak [Mon, 16 Sep 2002 10:39:11 +0000 (10:39 +0000)]
[project @ 2002-09-16 10:39:11 by chak]
Well, I was apparently not up-to-date on the latest Haddock config magic.
Removed the last change, which forced the use of an external installation
of Haddock.

21 years ago[project @ 2002-09-16 10:16:14 by simonmar]
simonmar [Mon, 16 Sep 2002 10:16:14 +0000 (10:16 +0000)]
[project @ 2002-09-16 10:16:14 by simonmar]
Instead of trying to convert $(ALL_DIRS) into a colon-separated list
of directories to pass to the compiler with -i, put each directory in
its own -i option.  This is more robust, the previous method was
sensitive to extra spaces in the ALL_DIRS list.

(should fix the current nightly breakage on the HEAD)

21 years ago[project @ 2002-09-16 07:31:11 by simonpj]
simonpj [Mon, 16 Sep 2002 07:31:12 +0000 (07:31 +0000)]
[project @ 2002-09-16 07:31:11 by simonpj]
--------------------------------
   Quantify over unbound type vars in RULE lhs's
--------------------------------

-- We need to gather the type variables mentioned on the LHS so we can
-- quantify over them.  Example:
--   data T a = C
--
--   foo :: T a -> Int
--   foo C = 1
--
--   {-# RULES "myrule"  foo C = 1 #-}
--
-- After type checking the LHS becomes (foo a (C a))
-- and we do not want to zap the unbound tyvar 'a' to (), because
-- that limits the applicability of the rule.  Instead, we
-- want to quantify over it!

This commit fixes the problem, discovered by Manuel.  It uses a
free-variable finder for RULE lhs's (TcRule.ruleLhsTvs) which relies
on the fact that the LHS of a rule can only take ver forms
(c.f RnSource.validRuleLhs).

21 years ago[project @ 2002-09-16 07:09:24 by sof]
sof [Mon, 16 Sep 2002 07:09:24 +0000 (07:09 +0000)]
[project @ 2002-09-16 07:09:24 by sof]
copy in tools from a mingw dist tree

21 years ago[project @ 2002-09-16 07:08:26 by chak]
chak [Mon, 16 Sep 2002 07:08:26 +0000 (07:08 +0000)]
[project @ 2002-09-16 07:08:26 by chak]
Use external Haddock installation

21 years ago[project @ 2002-09-15 19:38:28 by lewie]
lewie [Sun, 15 Sep 2002 19:38:28 +0000 (19:38 +0000)]
[project @ 2002-09-15 19:38:28 by lewie]
Ergh!  Don't mix `%doc <relativepathname>' with `%doc <absolutepathname>'
where <absolutepathname> is the standard doc directory (i.e. the same place
where the <relativepathname> files will be copied).
The <relativepathname> version has the hidden side effect of removing
the contents of the doc directory first (and thus your carefully installed
files).  The whole distinction which makes a special case for relative
paths is a crock in the first place ;-)

21 years ago[project @ 2002-09-15 03:47:21 by lewie]
lewie [Sun, 15 Sep 2002 03:47:21 +0000 (03:47 +0000)]
[project @ 2002-09-15 03:47:21 by lewie]
Wibble!!

21 years ago[project @ 2002-09-15 00:00:09 by lewie]
lewie [Sun, 15 Sep 2002 00:00:09 +0000 (00:00 +0000)]
[project @ 2002-09-15 00:00:09 by lewie]
Update spec.  Fixes doc problems.  Worth merging to 5.04-branch.

21 years ago[project @ 2002-09-14 01:08:07 by dons]
dons [Sat, 14 Sep 2002 01:08:07 +0000 (01:08 +0000)]
[project @ 2002-09-14 01:08:07 by dons]
RTLD_{GLOBAL,NOW} should be HAVE_RTLD{GLOBAL,NOW}

21 years ago[project @ 2002-09-14 01:06:27 by dons]
dons [Sat, 14 Sep 2002 01:06:27 +0000 (01:06 +0000)]
[project @ 2002-09-14 01:06:27 by dons]
RTLD_{GLOBAL,NOW} should have been HAVE_RTLD{GLOBAL,NOW}

21 years ago[project @ 2002-09-13 16:09:26 by simonpj]
simonpj [Fri, 13 Sep 2002 16:09:26 +0000 (16:09 +0000)]
[project @ 2002-09-13 16:09:26 by simonpj]
Native code gen primpops (courtesy Julian)

21 years ago[project @ 2002-09-13 16:06:28 by simonpj]
simonpj [Fri, 13 Sep 2002 16:06:29 +0000 (16:06 +0000)]
[project @ 2002-09-13 16:06:28 by simonpj]
wibbles

21 years ago[project @ 2002-09-13 15:17:15 by simonpj]
simonpj [Fri, 13 Sep 2002 15:17:16 +0000 (15:17 +0000)]
[project @ 2002-09-13 15:17:15 by simonpj]
Ooops... forgot these droppings, sorry

21 years ago[project @ 2002-09-13 15:02:25 by simonpj]
simonpj [Fri, 13 Sep 2002 15:02:50 +0000 (15:02 +0000)]
[project @ 2002-09-13 15:02:25 by simonpj]
--------------------------------------
Make Template Haskell into the HEAD
--------------------------------------

This massive commit transfers to the HEAD all the stuff that
Simon and Tim have been doing on Template Haskell.  The
meta-haskell-branch is no more!

WARNING: make sure that you

  * Update your links if you are using link trees.
    Some modules have been added, some have gone away.

  * Do 'make clean' in all library trees.
    The interface file format has changed, and you can
    get strange panics (sadly) if GHC tries to read old interface files:
    e.g.  ghc-5.05: panic! (the `impossible' happened, GHC version 5.05):
  Binary.get(TyClDecl): ForeignType

  * You need to recompile the rts too; Linker.c has changed

However the libraries are almost unaltered; just a tiny change in
Base, and to the exports in Prelude.

NOTE: so far as TH itself is concerned, expression splices work
fine, but declaration splices are not complete.

---------------
The main change
---------------

The main structural change: renaming and typechecking have to be
interleaved, because we can't rename stuff after a declaration splice
until after we've typechecked the stuff before (and the splice
itself).

* Combine the renamer and typecheker monads into one
(TcRnMonad, TcRnTypes)
  These two replace TcMonad and RnMonad

* Give them a single 'driver' (TcRnDriver).  This driver
  replaces TcModule.lhs and Rename.lhs

* The haskell-src library package has a module
Language/Haskell/THSyntax
  which defines the Haskell data type seen by the TH programmer.

* New modules:
hsSyn/Convert.hs  converts THSyntax -> HsSyn
deSugar/DsMeta.hs  converts HsSyn -> THSyntax

* New module typecheck/TcSplice type-checks Template Haskell splices.

-------------
Linking stuff
-------------

* ByteCodeLink has been split into
ByteCodeLink (which links)
ByteCodeAsm (which assembles)

* New module ghci/ObjLink is the object-code linker.

* compMan/CmLink is removed entirely (was out of place)
  Ditto CmTypes (which was tiny)

* Linker.c initialises the linker when it is first used (no need to call
  initLinker any more).  Template Haskell makes it harder to know when
  and whether to initialise the linker.

-------------------------------------
Gathering the LIE in the type checker
-------------------------------------

* Instead of explicitly gathering constraints in the LIE
tcExpr :: RenamedExpr -> TcM (TypecheckedExpr, LIE)
  we now dump the constraints into a mutable varabiable carried
  by the monad, so we get
tcExpr :: RenamedExpr -> TcM TypecheckedExpr

  Much less clutter in the code, and more efficient too.
  (Originally suggested by Mark Shields.)

-----------------
Remove "SysNames"
-----------------

Because the renamer and the type checker were entirely separate,
we had to carry some rather tiresome implicit binders (or "SysNames")
along inside some of the HsDecl data structures.  They were both
tiresome and fragile.

Now that the typechecker and renamer are more intimately coupled,
we can eliminate SysNames (well, mostly... default methods still
carry something similar).

-------------
Clean up HsPat
-------------

One big clean up is this: instead of having two HsPat types (InPat and
OutPat), they are now combined into one.  This is more consistent with
the way that HsExpr etc is handled; there are some 'Out' constructors
for the type checker output.

So:
HsPat.InPat --> HsPat.Pat
HsPat.OutPat --> HsPat.Pat
No 'pat' type parameter in HsExpr, HsBinds, etc

Constructor patterns are nicer now: they use
HsPat.HsConDetails
for the three cases of constructor patterns:
prefix, infix, and record-bindings

The *same* data type HsConDetails is used in the type
declaration of the data type (HsDecls.TyData)

Lots of associated clean-up operations here and there.  Less code.
Everything is wonderful.

21 years ago[project @ 2002-09-13 15:01:40 by simonpj]
simonpj [Fri, 13 Sep 2002 15:01:40 +0000 (15:01 +0000)]
[project @ 2002-09-13 15:01:40 by simonpj]
Make ghc-pkg independent of hslibs

21 years ago[project @ 2002-09-13 08:54:44 by simonpj]
simonpj [Fri, 13 Sep 2002 08:54:44 +0000 (08:54 +0000)]
[project @ 2002-09-13 08:54:44 by simonpj]
Correct comments

21 years ago[project @ 2002-09-11 10:14:53 by simonpj]
simonpj [Wed, 11 Sep 2002 10:14:53 +0000 (10:14 +0000)]
[project @ 2002-09-11 10:14:53 by simonpj]
Yet another correction to earlier commit..
*now* those rank-2 pattern matches should work

MERGE TO STABLE

21 years ago[project @ 2002-09-11 10:14:32 by simonpj]
simonpj [Wed, 11 Sep 2002 10:14:32 +0000 (10:14 +0000)]
[project @ 2002-09-11 10:14:32 by simonpj]
Remove bogus warning

21 years ago[project @ 2002-09-10 16:07:48 by simonmar]
simonmar [Tue, 10 Sep 2002 16:07:48 +0000 (16:07 +0000)]
[project @ 2002-09-10 16:07:48 by simonmar]
Tidy up error message for "funny global things"

21 years ago[project @ 2002-09-10 12:31:54 by simonmar]
simonmar [Tue, 10 Sep 2002 12:31:54 +0000 (12:31 +0000)]
[project @ 2002-09-10 12:31:54 by simonmar]
Put debugging output in #ifdef DEBUG

MERGE TO STABLE

21 years ago[project @ 2002-09-10 11:38:11 by simonpj]
simonpj [Tue, 10 Sep 2002 11:38:11 +0000 (11:38 +0000)]
[project @ 2002-09-10 11:38:11 by simonpj]
Remove redundant debug printing

21 years ago[project @ 2002-09-10 10:43:52 by simonmar]
simonmar [Tue, 10 Sep 2002 10:43:52 +0000 (10:43 +0000)]
[project @ 2002-09-10 10:43:52 by simonmar]
Fix a(nother) bug in the new THUNK_SELECTOR code.  Hopefully should
fix the crashes seen in the last few nightly builds.

21 years ago[project @ 2002-09-10 09:26:24 by simonmar]
simonmar [Tue, 10 Sep 2002 09:26:24 +0000 (09:26 +0000)]
[project @ 2002-09-10 09:26:24 by simonmar]
Add notes on how to build a .a file to the docs, as requested by Koen
Claessen.

21 years ago[project @ 2002-09-09 14:04:37 by simonpj]
simonpj [Mon, 9 Sep 2002 14:04:37 +0000 (14:04 +0000)]
[project @ 2002-09-09 14:04:37 by simonpj]
Sigh! forgot one case!  MERGE TO STABLE

21 years ago[project @ 2002-09-09 13:49:08 by simonpj]
simonpj [Mon, 9 Sep 2002 13:49:08 +0000 (13:49 +0000)]
[project @ 2002-09-09 13:49:08 by simonpj]
Cosmetics only

21 years ago[project @ 2002-09-09 13:48:35 by simonpj]
simonpj [Mon, 9 Sep 2002 13:48:35 +0000 (13:48 +0000)]
[project @ 2002-09-09 13:48:35 by simonpj]
Correction to earlier commit.. *now* those rank-2 pattern matches should work

MERGE TO STABLE

21 years ago[project @ 2002-09-09 13:48:01 by simonpj]
simonpj [Mon, 9 Sep 2002 13:48:01 +0000 (13:48 +0000)]
[project @ 2002-09-09 13:48:01 by simonpj]
The body of a for-all should be of kind *

MERGE TO STABLE

21 years ago[project @ 2002-09-09 12:57:47 by simonpj]
simonpj [Mon, 9 Sep 2002 12:57:48 +0000 (12:57 +0000)]
[project @ 2002-09-09 12:57:47 by simonpj]
--------------------------------
Fix rank-2 pattern-match failure
--------------------------------

This fixes the failure when you have a rank-2 type sig
matching a data type pattern.  Thus

data T a = T1 | T2 a

f :: (forall x. T x) -> Int
f T1 = ...

This crashes GHC 5.04

21 years ago[project @ 2002-09-09 12:55:52 by simonpj]
simonpj [Mon, 9 Sep 2002 12:55:53 +0000 (12:55 +0000)]
[project @ 2002-09-09 12:55:52 by simonpj]
--------------------------------------
Attach inline pragmas to class methods
--------------------------------------

This fix makes INLINE pragmas on method bindings (in class
or instance decls) work properly.

It seems to have been hanging around in my tree for some time.
To be on the safe side, let's not merge this into 5.04.1, although
it should be fine (an an improvement).

21 years ago[project @ 2002-09-09 12:50:26 by simonpj]
simonpj [Mon, 9 Sep 2002 12:50:26 +0000 (12:50 +0000)]
[project @ 2002-09-09 12:50:26 by simonpj]
Formatting only

21 years ago[project @ 2002-09-09 12:18:09 by simonpj]
simonpj [Mon, 9 Sep 2002 12:18:09 +0000 (12:18 +0000)]
[project @ 2002-09-09 12:18:09 by simonpj]
Formatting only

21 years ago[project @ 2002-09-09 12:11:44 by simonmar]
simonmar [Mon, 9 Sep 2002 12:11:44 +0000 (12:11 +0000)]
[project @ 2002-09-09 12:11:44 by simonmar]
Make sure we get the compiler's own Pretty library when we #include
../utils/ghc-pkg/Package.hs.

21 years ago[project @ 2002-09-09 12:10:01 by simonmar]
simonmar [Mon, 9 Sep 2002 12:10:01 +0000 (12:10 +0000)]
[project @ 2002-09-09 12:10:01 by simonmar]
Urk, the 'import Pretty' in this module was a bit of a hack; when
compiled as part of the standalone ghc-pkg tool it referred to the
Pretty library from the util package, but when compiled as part of the
compiler it referred to the compiler's own Pretty module.  Hack around
this.

21 years ago[project @ 2002-09-09 11:44:13 by simonmar]
simonmar [Mon, 9 Sep 2002 11:44:13 +0000 (11:44 +0000)]
[project @ 2002-09-09 11:44:13 by simonmar]
Build without hslibs on GHC >= 5.04

21 years ago[project @ 2002-09-09 11:39:42 by simonmar]
simonmar [Mon, 9 Sep 2002 11:39:43 +0000 (11:39 +0000)]
[project @ 2002-09-09 11:39:42 by simonmar]
Build without hslibs on GHC >= 5.04

21 years ago[project @ 2002-09-09 11:32:37 by simonmar]
simonmar [Mon, 9 Sep 2002 11:32:38 +0000 (11:32 +0000)]
[project @ 2002-09-09 11:32:37 by simonmar]
Build without hslibs on GHC >= 5.04

21 years ago[project @ 2002-09-07 12:07:53 by panne]
panne [Sat, 7 Sep 2002 12:07:53 +0000 (12:07 +0000)]
[project @ 2002-09-07 12:07:53 by panne]
Tentative fix for the recent blkcnt_t trouble

21 years ago[project @ 2002-09-06 17:56:40 by panne]
panne [Fri, 6 Sep 2002 17:56:47 +0000 (17:56 +0000)]
[project @ 2002-09-06 17:56:40 by panne]
Nuke the unsupported hslibs version of HOpenGL on the HEAD, too. Now
we are only left with two versions, which I think is OK: A stable one
(not in the fptools repository, but on my web site) and a cool, but
*very* incomplete one (currently only GLUT) for bleeding edge people
in the hierarchical libraries parts of the repository.

21 years ago[project @ 2002-09-06 14:40:28 by simonmar]
simonmar [Fri, 6 Sep 2002 14:40:28 +0000 (14:40 +0000)]
[project @ 2002-09-06 14:40:28 by simonmar]
Disallow ForeignObj as well as ForeignPtr FFI arguments

21 years ago[project @ 2002-09-06 14:35:42 by simonmar]
simonmar [Fri, 6 Sep 2002 14:35:45 +0000 (14:35 +0000)]
[project @ 2002-09-06 14:35:42 by simonmar]
Finally separate the compiler from hslibs.

Mainly import wibbles, and use the new POSIX library when
bootstrapping.

21 years ago[project @ 2002-09-06 14:34:13 by simonmar]
simonmar [Fri, 6 Sep 2002 14:34:15 +0000 (14:34 +0000)]
[project @ 2002-09-06 14:34:13 by simonmar]
Partial rewrite of the POSIX library.

The main purpose of this sweep is to remove the last dependencies of
the compiler on hslibs.  When I've committed the associated compiler
changes, only the 'base' package will be required to bootstrap the
compiler.  Additionally to build GHCi, the 'readline' and 'unix'
packages will be required.

The new POSIX library lives mostly in libraries/unix, with a few bits
required for compiler bootstrapping in libraries/base.  The 'base'
package is mostly free of hsc2hs code to make bootstrapping from HC
files easier, but the 'unix' package will use hsc2hs liberally.

The old POSIX library continues to provide more-or-less the same
interface as before, although some of the types are more correct now
(previously lots of POSIX types were just mapped to Int).  The new
interface is largely the same as the old, except that some new
functionality from the latest POSIX spec has been added (eg. symbolic
links).

So far, the new POSIX library has signal support, directory/file
operations and lots of stuff from unistd.h.  The module names are:

  System.Posix
The main dude, exports everything

  System.Posix.Types
All the POSIX types, using the same naming scheme as
        Foreign.C.Types, Eg. CUid, COff, etc.  Many of these types
        were previously exported by GHC.Posix.

        Additionally exports the "nicer" names used by the old POSIX
library for compatibility (eg. ProcessID == CPid, FileMode ==
CMode, etc.)

All reasonable instances are derived for these types.

  System.Posix.Signals
Signal support, contains most of which was in PosixProcPrim before.
The RTS interface to the signal handling support has been
rationalised slightly.

  System.Posix.Directory
  Directory support, most were in PosixFiles before.

  System.Posix.Files
File operations, most were in PosixFiles before.

  System.Posix.Unistd
(for want of a better name) Miscellaneous bits that mostly come
from the unistd.h header file.  PosixProcEnv before.

The rest of the library should pan out like so:

  System.Posix.IO
  System.Posix.Error   (maybe)
  System.Posix.Process
  System.Posix.Terminal

(I've no doubt broken Win32 support, but I'm checking the build at the moment).

21 years ago[project @ 2002-09-06 14:00:25 by simonmar]
simonmar [Fri, 6 Sep 2002 14:00:25 +0000 (14:00 +0000)]
[project @ 2002-09-06 14:00:25 by simonmar]
Remove ForeignObj and ForeignPtr keys

21 years ago[project @ 2002-09-06 13:58:58 by simonmar]
simonmar [Fri, 6 Sep 2002 13:58:58 +0000 (13:58 +0000)]
[project @ 2002-09-06 13:58:58 by simonmar]
Remove foreignPtrTyCon and foreignObjTyCon

21 years ago[project @ 2002-09-06 13:52:21 by simonmar]
simonmar [Fri, 6 Sep 2002 13:52:21 +0000 (13:52 +0000)]
[project @ 2002-09-06 13:52:21 by simonmar]
Disallow ForeignPtr as an FFI argument type.

21 years ago[project @ 2002-09-06 13:51:38 by simonmar]
simonmar [Fri, 6 Sep 2002 13:51:38 +0000 (13:51 +0000)]
[project @ 2002-09-06 13:51:38 by simonmar]
Disallow 'ForeignPtr' as an FFI argument type.  It has been deprecated
for some time (withForeignPtr is the approved way to pass a
ForeignPtr).  The changes I'm about to make to ForeignPtr will stop it
working anyhow.

21 years ago[project @ 2002-09-06 09:56:12 by simonmar]
simonmar [Fri, 6 Sep 2002 09:56:12 +0000 (09:56 +0000)]
[project @ 2002-09-06 09:56:12 by simonmar]
Selector Thunk Fix, take II.

The previous version didn't deal well with selector thunks which point
to more selector thunks, and on closer inspection the method was
flawed.  Now I've introduced a function

StgClosure *eval_selector_thunk( int field, StgClosure * )

which evaluates a selector thunk returning its value, in from-space,
if possible.  It blackholes the thunk during evaluation.  It might
recursively evaluate more selector thunks, but it does this in a
bounded way and updates the thunks with indirections (NOT forwarding
pointers) after evaluation.

This cleans things up somewhat, and I believe it deals properly with
both types of selector-thunk loops that arise.

MERGE TO STABLE

21 years ago[project @ 2002-09-06 01:00:04 by ken]
ken [Fri, 6 Sep 2002 01:00:04 +0000 (01:00 +0000)]
[project @ 2002-09-06 01:00:04 by ken]
perl made uglier to work around the perl 5.7/5.8 bug documented at
http://bugs6.perl.org/rt2/Ticket/Display.html?id=1760 and illustrated
by the seg fault of perl -e '("x\n" x 5000) =~ /(.*\n)+/'

MERGE TO STABLE

21 years ago[project @ 2002-09-05 16:26:33 by simonmar]
simonmar [Thu, 5 Sep 2002 16:26:33 +0000 (16:26 +0000)]
[project @ 2002-09-05 16:26:33 by simonmar]
Fix for infinite loop when there is a THUNK_SELECTOR which eventually
refers to itself, such as might be generated by code like

let x = (fst x, snd x) in ...

At the same time, I re-enabled the code to traverse multiple selector
thunks with bounded depth, because I believe it now works.

MERGE TO STABLE (but test thoroughly in the HEAD first, this is
fragile stuff)

21 years ago[project @ 2002-09-05 10:25:01 by simonmar]
simonmar [Thu, 5 Sep 2002 10:25:01 +0000 (10:25 +0000)]
[project @ 2002-09-05 10:25:01 by simonmar]
In code style, print negative floating point literals in parentheses
to avoid interacting with surrounding syntax.

Fixes SourceForge bug #604849

MERGE TO STABLE

21 years ago[project @ 2002-09-05 08:58:55 by simonmar]
simonmar [Thu, 5 Sep 2002 08:58:56 +0000 (08:58 +0000)]
[project @ 2002-09-05 08:58:55 by simonmar]
Remove RtsAPIDeprec.c, since this is causing grief.  The upshot (I
think) is that you won't be able to do foreign import "wrapper" with
an Addr in the type.

21 years ago[project @ 2002-09-04 11:19:48 by simonmar]
simonmar [Wed, 4 Sep 2002 11:19:48 +0000 (11:19 +0000)]
[project @ 2002-09-04 11:19:48 by simonmar]
Disallow 'foreign import stdcall "wrapper"' when compiling via the
NCG.

MERGE TO STABLE

21 years ago[project @ 2002-09-04 11:06:19 by simonmar]
simonmar [Wed, 4 Sep 2002 11:06:19 +0000 (11:06 +0000)]
[project @ 2002-09-04 11:06:19 by simonmar]
Import fixups

21 years ago[project @ 2002-09-04 11:04:45 by simonmar]
simonmar [Wed, 4 Sep 2002 11:04:45 +0000 (11:04 +0000)]
[project @ 2002-09-04 11:04:45 by simonmar]
Exception => Control.Exception

21 years ago[project @ 2002-09-04 10:00:45 by simonmar]
simonmar [Wed, 4 Sep 2002 10:00:46 +0000 (10:00 +0000)]
[project @ 2002-09-04 10:00:45 by simonmar]
Recent changes to simplify PrimRep had introduced a bug: the heap
check code was assuming that anything with PtrRep representation was
enterable.  This isn't the case for the unpointed primitive types
(eg. ByteArray#), resulting in the ARR_WORDS crash in last night's
build.

This bug isn't in STABLE.

21 years ago[project @ 2002-09-03 15:34:11 by simonmar]
simonmar [Tue, 3 Sep 2002 15:34:11 +0000 (15:34 +0000)]
[project @ 2002-09-03 15:34:11 by simonmar]
Exception => Control.Exception
GlaExts => GHC.Exts

21 years ago[project @ 2002-09-03 15:32:16 by simonmar]
simonmar [Tue, 3 Sep 2002 15:33:10 +0000 (15:33 +0000)]
[project @ 2002-09-03 15:32:16 by simonmar]
GlaExts => GHC.Exts

21 years ago[project @ 2002-09-03 15:14:54 by simonmar]
simonmar [Tue, 3 Sep 2002 15:14:54 +0000 (15:14 +0000)]
[project @ 2002-09-03 15:14:54 by simonmar]
GlaExts => GLAEXTS

21 years ago[project @ 2002-09-03 14:39:06 by simonmar]
simonmar [Tue, 3 Sep 2002 14:39:06 +0000 (14:39 +0000)]
[project @ 2002-09-03 14:39:06 by simonmar]
Just hit a problem caused by gcc 3.1+: it uses instructions like

movl %esi, 4(%esp)

in the prologue, which the mangler wasn't expecting.  This might fix
problems that other people have been seeing with gcc 3.1 on x86.

MERGE TO STABLE

21 years ago[project @ 2002-09-03 14:07:03 by simonmar]
simonmar [Tue, 3 Sep 2002 14:07:03 +0000 (14:07 +0000)]
[project @ 2002-09-03 14:07:03 by simonmar]
stg_sig_install: restore the old signal mask at the end, rather than
unconditionally unblocking the signal we just installed the handler for.

21 years ago[project @ 2002-09-03 11:27:33 by simonpj]
simonpj [Tue, 3 Sep 2002 11:27:33 +0000 (11:27 +0000)]
[project @ 2002-09-03 11:27:33 by simonpj]
More comments

21 years ago[project @ 2002-09-02 16:39:19 by simonpj]
simonpj [Mon, 2 Sep 2002 16:39:19 +0000 (16:39 +0000)]
[project @ 2002-09-02 16:39:19 by simonpj]
Wibble in demand analyser; no need to merge

21 years ago[project @ 2002-09-02 16:38:24 by simonpj]
simonpj [Mon, 2 Sep 2002 16:38:24 +0000 (16:38 +0000)]
[project @ 2002-09-02 16:38:24 by simonpj]
Fix an obscure bug in an optimisation for 'coerce' which
wasn't taking account of the possiblity of type arguments.

MERGE TO STABLE

21 years ago[project @ 2002-09-02 16:37:13 by simonpj]
simonpj [Mon, 2 Sep 2002 16:37:13 +0000 (16:37 +0000)]
[project @ 2002-09-02 16:37:13 by simonpj]
Fix an obscure bug in the creation of default methods for class
ops with higher-rank type.   See the comments with
TcClassDcl.mkDefMethRhs

Test is should_compile/tc161

MERGE TO STABLE

21 years ago[project @ 2002-09-02 16:31:34 by simonpj]
simonpj [Mon, 2 Sep 2002 16:31:34 +0000 (16:31 +0000)]
[project @ 2002-09-02 16:31:34 by simonpj]
Do not specialise functions that take implicit parameters.
The specialisation mechanism doesn't work for them, because
their implicit args are not driven by their type args (unlike
the implicit dictionary parameters)

MERGE TO STABLE

21 years ago[project @ 2002-09-02 13:06:30 by simonmar]
simonmar [Mon, 2 Sep 2002 13:06:30 +0000 (13:06 +0000)]
[project @ 2002-09-02 13:06:30 by simonmar]
revert part of previous commit; looks like it was accidental

21 years ago[project @ 2002-09-01 00:34:21 by mthomas]
mthomas [Sun, 1 Sep 2002 00:34:21 +0000 (00:34 +0000)]
[project @ 2002-09-01 00:34:21 by mthomas]
Foreign does not export C.String so CString and peekCString are undefined.

21 years ago[project @ 2002-08-30 15:17:00 by simonpj]
simonpj [Fri, 30 Aug 2002 15:17:00 +0000 (15:17 +0000)]
[project @ 2002-08-30 15:17:00 by simonpj]
Add notes about linear implicit parameters

21 years ago[project @ 2002-08-30 12:21:16 by simonmar]
simonmar [Fri, 30 Aug 2002 12:21:16 +0000 (12:21 +0000)]
[project @ 2002-08-30 12:21:16 by simonmar]
oops, 'make Foo.s' in ghc/rts was completely busted

MERGE TO STABLE

21 years ago[project @ 2002-08-30 09:14:02 by simonmar]
simonmar [Fri, 30 Aug 2002 09:14:02 +0000 (09:14 +0000)]
[project @ 2002-08-30 09:14:02 by simonmar]
Remove unused import of PrelPack (should fix the build again)

21 years ago[project @ 2002-08-29 15:44:11 by simonmar]
simonmar [Thu, 29 Aug 2002 15:44:23 +0000 (15:44 +0000)]
[project @ 2002-08-29 15:44:11 by simonmar]
Housekeeping:

  - The main goal is to remove dependencies on hslibs for a
    bootstrapped compiler, leaving only a requirement that the
    packages base, haskell98 and readline are built in stage 1 in
    order to bootstrap.  We're almost there: Posix is still required
    for signal handling, but all other dependencies on hslibs are now
    gone.

    Uses of Addr and ByteArray/MutableByteArray array are all gone
    from the compiler.  PrimPacked defines the Ptr type for GHC 4.08
    (which didn't have it), and it defines simple BA and MBA types to
    replace uses of ByteArray and MutableByteArray respectively.

  - Clean up import lists.  HsVersions.h now defines macros for some
    modules which have moved between GHC versions.  eg. one now
    imports 'GLAEXTS' to get at unboxed types and primops in the
    compiler.

    Many import lists have been sorted as per the recommendations in
    the new style guidelines in the commentary.

I've built the compiler with GHC 4.08.2, 5.00.2, 5.02.3, 5.04 and
itself, and everything still works here.  Doubtless I've got something
wrong, though.

21 years ago[project @ 2002-08-29 13:38:45 by simonpj]
simonpj [Thu, 29 Aug 2002 13:38:45 +0000 (13:38 +0000)]
[project @ 2002-08-29 13:38:45 by simonpj]
Fix eta-expansion bug, which led to an infinite loop in
CoreUtils.etaExpand. This showed up when compiling FranTk.

MERGE TO STABLE

21 years ago[project @ 2002-08-29 12:57:34 by simonmar]
simonmar [Thu, 29 Aug 2002 12:57:34 +0000 (12:57 +0000)]
[project @ 2002-08-29 12:57:34 by simonmar]
Add notes about DEBUG and GHCI.

21 years ago[project @ 2002-08-29 11:52:42 by simonmar]
simonmar [Thu, 29 Aug 2002 11:52:42 +0000 (11:52 +0000)]
[project @ 2002-08-29 11:52:42 by simonmar]
update (readline has moved)

21 years ago[project @ 2002-08-29 11:47:46 by simonmar]
simonmar [Thu, 29 Aug 2002 11:47:46 +0000 (11:47 +0000)]
[project @ 2002-08-29 11:47:46 by simonmar]
Add a ToDo note.

21 years ago[project @ 2002-08-28 19:28:02 by ken]
ken [Wed, 28 Aug 2002 19:28:02 +0000 (19:28 +0000)]
[project @ 2002-08-28 19:28:02 by ken]
Further mangler changes to get ghc working with gcc 3.04 on the Alpha.
Jeff Lewis: "The compiler was sometimes emitting the $..ng label for a symbol
before the regular label.  This really confused the mangler, and it completely
scrambled the file."

21 years ago[project @ 2002-08-28 16:02:51 by simonmar]
simonmar [Wed, 28 Aug 2002 16:02:52 +0000 (16:02 +0000)]
[project @ 2002-08-28 16:02:51 by simonmar]
Add the beginnings of the "Coding Style Guidelines" for ghc/compiler.

21 years ago[project @ 2002-08-28 13:02:51 by simonmar]
simonmar [Wed, 28 Aug 2002 13:02:51 +0000 (13:02 +0000)]
[project @ 2002-08-28 13:02:51 by simonmar]
Remove duplicate sched_belch() call from raiseAsync().

21 years ago[project @ 2002-08-28 11:29:42 by simonpj]
simonpj [Wed, 28 Aug 2002 11:29:42 +0000 (11:29 +0000)]
[project @ 2002-08-28 11:29:42 by simonpj]
Add notes about data types

21 years ago[project @ 2002-08-28 09:24:15 by simonmar]
simonmar [Wed, 28 Aug 2002 09:24:15 +0000 (09:24 +0000)]
[project @ 2002-08-28 09:24:15 by simonmar]
Fix braino in previous commit

MERGE TO STABLE

21 years ago[project @ 2002-08-27 09:38:43 by simonmar]
simonmar [Tue, 27 Aug 2002 09:38:43 +0000 (09:38 +0000)]
[project @ 2002-08-27 09:38:43 by simonmar]
- If the same module is defined in multiple "root" source files, then
  complain.  Before, the compiler would silently ignore one of them.

- Remove some unuseed imports

MERGE TO STABLE

21 years ago[project @ 2002-08-27 09:34:20 by simonmar]
simonmar [Tue, 27 Aug 2002 09:34:20 +0000 (09:34 +0000)]
[project @ 2002-08-27 09:34:20 by simonmar]
Fix a bug in the cleaning up of temporary files: we were wrongly
cleaning the temporary pre-processed source files for stable modules,
with the result that the compiler would panic the next time they were
required.

Reported ages ago by: Hal Duame.

MERGE TO STABLE

21 years ago[project @ 2002-08-27 09:12:53 by simonmar]
simonmar [Tue, 27 Aug 2002 09:12:53 +0000 (09:12 +0000)]
[project @ 2002-08-27 09:12:53 by simonmar]
Replace "Funny global thing" with a better error message, as suggested
by Alastair Reid.  The message is:

  Warning: retaining unknown function `$_' in output from C compiler

("unknown function" is a bit vague, but I couldn't come up with an
alternative that wasn't misleading).

21 years ago[project @ 2002-08-23 20:59:29 by sof]
sof [Fri, 23 Aug 2002 20:59:29 +0000 (20:59 +0000)]
[project @ 2002-08-23 20:59:29 by sof]
bring write() proto into scope

21 years ago[project @ 2002-08-21 22:06:02 by ken]
ken [Wed, 21 Aug 2002 22:06:03 +0000 (22:06 +0000)]
[project @ 2002-08-21 22:06:02 by ken]
Use __DISCARD__ to prevent overly aggressive optimization by certain
gcc versions on the Alpha.  Thanks to Jeffrey Lewis!

21 years ago[project @ 2002-08-21 16:02:58 by simonmar]
simonmar [Wed, 21 Aug 2002 16:02:58 +0000 (16:02 +0000)]
[project @ 2002-08-21 16:02:58 by simonmar]
Add link to Mark Jones' paper on functional dependencies, in lieu of
real documentation.

21 years ago[project @ 2002-08-21 12:58:56 by simonmar]
simonmar [Wed, 21 Aug 2002 12:58:56 +0000 (12:58 +0000)]
[project @ 2002-08-21 12:58:56 by simonmar]
fromInt ==> fromIntegral

21 years ago[project @ 2002-08-21 10:44:26 by simonmar]
simonmar [Wed, 21 Aug 2002 10:44:26 +0000 (10:44 +0000)]
[project @ 2002-08-21 10:44:26 by simonmar]
Oops, string literals were using mkFastStringNarrow instead of
mkFastString, with the result that characters >= 256 were being
truncated modulo 256.

MERGE TO STABLE

21 years ago[project @ 2002-08-20 10:32:48 by simonmar]
simonmar [Tue, 20 Aug 2002 10:32:48 +0000 (10:32 +0000)]
[project @ 2002-08-20 10:32:48 by simonmar]
Fix a buglet in CorePrep:  an expression such as

case __coerce (\x -> e) :: T of { ... }

would be left as is, but the lambda expression should really be
abstracted as a let (causes a panic later in srtExpr; shown up by
the dynamic001 test).  There was a missing call to deLam in the case
for Case expressions in corePrepExprFloat.

In addition, I made a new version of deLam, deLamFloat, which can
float any bindings generated.  This helps to generate slightly cleaner
code in the above case (the binding is floated out of the scrutinee).

Also: GC unused imports while I'm here.