ghc-hetmet.git
20 years ago[project @ 2004-01-09 12:09:23 by simonmar]
simonmar [Fri, 9 Jan 2004 12:09:23 +0000 (12:09 +0000)]
[project @ 2004-01-09 12:09:23 by simonmar]
Remove extra space in 'Not in scope' error message.

20 years ago[project @ 2004-01-08 15:26:44 by simonmar]
simonmar [Thu, 8 Jan 2004 15:26:44 +0000 (15:26 +0000)]
[project @ 2004-01-08 15:26:44 by simonmar]
delayzh: Round *up* to nearest tick, not down

20 years ago[project @ 2004-01-08 11:53:29 by simonpj]
simonpj [Thu, 8 Jan 2004 11:53:29 +0000 (11:53 +0000)]
[project @ 2004-01-08 11:53:29 by simonpj]
---------------------------------------
Fix a long-standing CSE bug with unboxed tuples
  ---------------------------------------

Merge to stable

Consider
        case f x of
  (# a,b #) -> if a>0
       then f x -- CSE opportunity
       else (# b,a #)

 GHC 6.2's CSE pass wrongly optimised this to:

case f x of t
  (# a,b #) -> if a>0 then
  t -- WRONG
else (# b,a #)

(Wrong because we aren't allowed to mention a case binder for
an unboxed-tuple case.)

This commit fixes the problem.

20 years ago[project @ 2004-01-08 10:45:33 by simonmar]
simonmar [Thu, 8 Jan 2004 10:45:33 +0000 (10:45 +0000)]
[project @ 2004-01-08 10:45:33 by simonmar]
Fix warning message about missing Main module to refer to take into
account the -main-is flag.

20 years ago[project @ 2004-01-08 10:34:02 by simonmar]
simonmar [Thu, 8 Jan 2004 10:34:02 +0000 (10:34 +0000)]
[project @ 2004-01-08 10:34:02 by simonmar]
If a -main-is flag was given, with a module name, use *that* module
name rather than Main when deciding whether to link in batch mode or
not.

MERGE TO STABLE

20 years ago[project @ 2004-01-06 18:50:22 by panne]
panne [Tue, 6 Jan 2004 18:50:22 +0000 (18:50 +0000)]
[project @ 2004-01-06 18:50:22 by panne]
Removed unused macros

20 years ago[project @ 2004-01-06 18:39:12 by panne]
panne [Tue, 6 Jan 2004 18:39:13 +0000 (18:39 +0000)]
[project @ 2004-01-06 18:39:12 by panne]
Cleaned up libm detection

20 years ago[project @ 2004-01-06 17:20:51 by panne]
panne [Tue, 6 Jan 2004 17:20:52 +0000 (17:20 +0000)]
[project @ 2004-01-06 17:20:51 by panne]
Use new FP_CHECK_FUNC macro instead of the slightly obscure FPTOOLS_TRY_LINK_NOWARN

20 years ago[project @ 2004-01-06 10:45:22 by simonmar]
simonmar [Tue, 6 Jan 2004 10:45:22 +0000 (10:45 +0000)]
[project @ 2004-01-06 10:45:22 by simonmar]
Replace -ddump-all and -ddump-most with -v5 and -v4 respectively.

20 years ago[project @ 2004-01-05 17:32:35 by simonmar]
simonmar [Mon, 5 Jan 2004 17:32:35 +0000 (17:32 +0000)]
[project @ 2004-01-05 17:32:35 by simonmar]
Instead of grabbing the handle to the executable by calling
dlopen(NULL,...), use RTLD_DEFAULT as the handle to lookup symbols if
it is available.  It seems that RTLD_DEFAULT may be required on
certain systems, although I'm not sure it is available everywhere, so
I've left the old code as fallback in case it isn't available.

20 years ago[project @ 2004-01-05 15:15:26 by igloo]
igloo [Mon, 5 Jan 2004 15:15:27 +0000 (15:15 +0000)]
[project @ 2004-01-05 15:15:26 by igloo]
Use pprint rather than show . ppr to get String representations of TH
datastructures. Also moved pprint out of the class as we never want to
override it.

20 years ago[project @ 2004-01-05 14:54:06 by simonmar]
simonmar [Mon, 5 Jan 2004 14:54:06 +0000 (14:54 +0000)]
[project @ 2004-01-05 14:54:06 by simonmar]
Fix bug in genOutputFilenameFunc: the -keep-blah-files options weren't
being considered for the final phase.  Upshot: -keep-hc-files wasn't
working in --make mode (see driver060 & driver061 tests).

MERGE TO STABLE

20 years ago[project @ 2004-01-05 12:11:42 by simonpj]
simonpj [Mon, 5 Jan 2004 12:11:44 +0000 (12:11 +0000)]
[project @ 2004-01-05 12:11:42 by simonpj]
---------------------------------------
  Don't expose constructors as vigorously
  ---------------------------------------

GHC used to expose the constructors of a data type in the interface file,
even if (a) we were not optimising, and (b) the constructors are not exported.

In practice this isn't really necessary, and it's bad because it forces too
much recompilation.  I've been meaning to fix this for some while.

Now the data cons are hidden, even in the interface file, if both (a) and (b)
are true.  That means less interface file wobbling.

Mind you, the interface file still changes, because the to/from functions for
generic type classes change their types.  But provided you don't use them, you'll
get "compilation not required".

We could play the same game for classes (by hiding their class ops) but that'd
mean we'd have to change the data type for IfaceClassDecl, and I can't be
bothered to do that today.  It's unusual to have a class which exports none
of its methods anyway.

On the way, I changed the representation of tcg_exports and mg_exports (from
Avails to NameSet), but that should be externally invisible.

20 years ago[project @ 2004-01-05 10:41:04 by simonpj]
simonpj [Mon, 5 Jan 2004 10:41:05 +0000 (10:41 +0000)]
[project @ 2004-01-05 10:41:04 by simonpj]
Fix globaliseId wibble which was killing ghci

20 years ago[project @ 2004-01-05 10:40:41 by simonpj]
simonpj [Mon, 5 Jan 2004 10:40:41 +0000 (10:40 +0000)]
[project @ 2004-01-05 10:40:41 by simonpj]
Trim imports

20 years ago[project @ 2004-01-05 09:35:39 by simonpj]
simonpj [Mon, 5 Jan 2004 09:35:39 +0000 (09:35 +0000)]
[project @ 2004-01-05 09:35:39 by simonpj]
Buglet in desugaring instance declarations

20 years ago[project @ 2004-01-05 09:35:00 by simonpj]
simonpj [Mon, 5 Jan 2004 09:35:00 +0000 (09:35 +0000)]
[project @ 2004-01-05 09:35:00 by simonpj]
Pretty-print wibbles following Ians changes to TH libs

20 years ago[project @ 2004-01-05 08:20:39 by simonpj]
simonpj [Mon, 5 Jan 2004 08:20:40 +0000 (08:20 +0000)]
[project @ 2004-01-05 08:20:39 by simonpj]
Dont report deprecations arising from uses in the export list

20 years ago[project @ 2004-01-04 01:48:04 by igloo]
igloo [Sun, 4 Jan 2004 01:48:07 +0000 (01:48 +0000)]
[project @ 2004-01-04 01:48:04 by igloo]
Split the pretty-printer out - pprint will now give you pretty much
anything you are likely to want to pretty-print as a String. For a Doc
you need (to_HPJ_Doc . ppr), which could be made nicer if it is widely
used.

Also took the opportunity to do a bit of module renaming and fixed the
odd typo here and there.

20 years ago[project @ 2003-12-31 16:55:17 by simonpj]
simonpj [Wed, 31 Dec 2003 16:55:17 +0000 (16:55 +0000)]
[project @ 2003-12-31 16:55:17 by simonpj]
point to bash, not sh

20 years ago[project @ 2003-12-31 08:23:25 by simonpj]
simonpj [Wed, 31 Dec 2003 08:23:27 +0000 (08:23 +0000)]
[project @ 2003-12-31 08:23:25 by simonpj]
-----------------------------
        Improve deprecation reporting
-----------------------------

[PS: the 1.31 commit of basicTypes/RdrName.lhs
 also belongs in this commit.]

Up to now, deprecated functions are only reported when imported
from the module defining them, but not when re-exporting.  This
seems wrong -- often a "root" module gathers exports from sub-modules.

It turned out that there was a structural problem: the deprectaions
were getting put in the GlobalRdrEnv, and it simply doesn't have
the defining-module's interface to hand.

So this commit removes gre_deprec from GRE, and moves deprecation
reporting from the individual occurrences (RnEnv.lookupGreRn) to
RnNames.reportUnusedNames.  In many ways this is a better place for it,
because there we get a global view of the entire module.  For example,
repeated use of a single deprecated thing will only give rise to one
warning instead of multiple warnings.

So here's what we now get:

  Foo.hs:3:0:
    Warning: Deprecated use of Variable `withObject'
     (imported from Foreign.Marshal, but defined in Foreign.Marshal.Utils)
     use `with' instead

20 years ago[project @ 2003-12-31 08:21:52 by simonpj]
simonpj [Wed, 31 Dec 2003 08:22:36 +0000 (08:22 +0000)]
[project @ 2003-12-31 08:21:52 by simonpj]
Trim imports

20 years ago[project @ 2003-12-30 20:51:24 by simonpj]
simonpj [Tue, 30 Dec 2003 20:51:24 +0000 (20:51 +0000)]
[project @ 2003-12-30 20:51:24 by simonpj]
Fix imports

20 years ago[project @ 2003-12-30 20:24:21 by simonpj]
simonpj [Tue, 30 Dec 2003 20:24:21 +0000 (20:24 +0000)]
[project @ 2003-12-30 20:24:21 by simonpj]
Typo

20 years ago[project @ 2003-12-30 16:29:17 by simonpj]
simonpj [Tue, 30 Dec 2003 16:29:27 +0000 (16:29 +0000)]
[project @ 2003-12-30 16:29:17 by simonpj]
----------------------------
        Re-do kind inference (again)
----------------------------

   [WARNING: interface file binary representation has
   (as usual) changed slightly; recompile your libraries!]

Inspired by the lambda-cube, for some time GHC has used
type Kind = Type
That is, kinds were represented by the same data type as types.

But GHC also supports unboxed types and unboxed tuples, and these
complicate the kind system by requiring a sub-kind relationship.
Notably, an unboxed tuple is acceptable as the *result* of a
function but not as an *argument*.  So we have the following setup:

 ?
/ \
       /   \
      ??   (#)
     /  \
            *   #

where *    [LiftedTypeKind]   means a lifted type
#    [UnliftedTypeKind] means an unlifted type
(#)  [UbxTupleKind]     means unboxed tuple
??   [ArgTypeKind]      is the lub of *,#
?    [OpenTypeKind] means any type at all

In particular:

  error :: forall a:?. String -> a
  (->)  :: ?? -> ? -> *
  (\(x::t) -> ...) Here t::?? (i.e. not unboxed tuple)

All this has beome rather difficult to accommodate with Kind=Type, so this
commit splits the two.

  * Kind is a distinct type, defined in types/Kind.lhs

  * IfaceType.IfaceKind disappears: we just re-use Kind.Kind

  * TcUnify.unifyKind is a distinct unifier for kinds

  * TyCon no longer needs KindCon and SuperKindCon variants

  * TcUnify.zapExpectedType takes an expected Kind now, so that
    in TcPat.tcMonoPatBndr we can express that the bound variable
    must have an argTypeKind (??).

The big change is really that kind inference is much more systematic and
well behaved.  In particular, a kind variable can unify only with a
"simple kind", which is built from * and (->).  This deals neatly
with awkward questions about how we can combine sub-kinding with type
inference.

Lots of small consequential changes, especially to the kind-checking
plumbing in TcTyClsDecls.  (We played a bit fast and loose before, and
now we have to be more honest, in particular about how kind inference
works for type synonyms.  They can have kinds like (* -> #), so

This cures two long-standing SourceForge bugs

* 753777 (tcfail115.hs), which used erroneously to pass,
  but crashed in the code generator
      type T a = Int -> (# Int, Int #)
      f :: T a -> T a
      f t = \x -> case t x of r -> r

* 753780 (tc167.hs), which used erroneously to fail
      f :: (->) Int# Int#

Still, the result is not entirely satisfactory.  In particular

* The error message from tcfail115 is pretty obscure

* SourceForge bug 807249 (Instance match failure on openTypeKind)
  is not fixed.  Alas.

20 years ago[project @ 2003-12-30 14:05:46 by simonpj]
simonpj [Tue, 30 Dec 2003 14:05:47 +0000 (14:05 +0000)]
[project @ 2003-12-30 14:05:46 by simonpj]
Import trimming

20 years ago[project @ 2003-12-28 13:09:43 by panne]
panne [Sun, 28 Dec 2003 13:09:43 +0000 (13:09 +0000)]
[project @ 2003-12-28 13:09:43 by panne]
Added prototype for initAdjustor

20 years ago[project @ 2003-12-28 13:02:46 by panne]
panne [Sun, 28 Dec 2003 13:02:46 +0000 (13:02 +0000)]
[project @ 2003-12-28 13:02:46 by panne]
Warning police + a little cleanup of #ifdefs relating to execPage. Added two
TODOs on the way (an adjustor spanning two pages + calling initAdjustor at RTS
startup). Note that execPage is still disabled (why?).

20 years ago[project @ 2003-12-23 10:10:53 by simonmar]
simonmar [Tue, 23 Dec 2003 10:10:53 +0000 (10:10 +0000)]
[project @ 2003-12-23 10:10:53 by simonmar]
Add performMajorGC

20 years ago[project @ 2003-12-22 16:27:10 by simonmar]
simonmar [Mon, 22 Dec 2003 16:27:10 +0000 (16:27 +0000)]
[project @ 2003-12-22 16:27:10 by simonmar]
Fix threaded RTS problem that is currently causing the conc007 test to
loop indefinitely.  Comment from the source regarding this change:

/* Major bogosity:
 *
 * In the threaded RTS, we can't set the virtual timer because the
 * thread which has the virtual timer might be sitting waiting for a
 * capability, and the virtual timer only ticks in CPU time.
 *
 * So, possible solutions:
 *
 * (1) tick in realtime.  Not very good, because this ticker is used for
 *     profiling, and this will give us unreliable time profiling
 *     results.  Furthermore, this requires picking a single OS thread
 *     to be the timekeeper, which is a bad idea because the thread in
 *     question might just be making a temporary call into Haskell land.
 *
 * (2) save/restore the virtual timer around excursions into STG land.
 *     Sounds great, but I tried it and the resolution of the virtual timer
 *     isn't good enough (on Linux) - most of our excursions fall
 *     within the timer's resolution and we never make any progress.
 *
 * (3) have a virtual timer in every OS thread.  Might be reasonable,
 *     because most of the time there is only ever one of these
 *     threads running, so it approximates a single virtual timer.
 *     But still quite bogus (and I got crashes when I tried this).
 *
 * For now, we're using (1), but this needs a better solution. --SDM
 */

20 years ago[project @ 2003-12-19 10:41:14 by simonmar]
simonmar [Fri, 19 Dec 2003 10:41:14 +0000 (10:41 +0000)]
[project @ 2003-12-19 10:41:14 by simonmar]
Fix DEBUG & !RTS_SUPPORTS_THREADS build (bogus assertion failure)

20 years ago[project @ 2003-12-19 10:39:54 by simonpj]
simonpj [Fri, 19 Dec 2003 10:39:54 +0000 (10:39 +0000)]
[project @ 2003-12-19 10:39:54 by simonpj]
Accept unboxed tuples in type signatures

20 years ago[project @ 2003-12-19 10:34:51 by simonpj]
simonpj [Fri, 19 Dec 2003 10:34:52 +0000 (10:34 +0000)]
[project @ 2003-12-19 10:34:51 by simonpj]
---------------------------------------
  Precise locations for duplicate imports
  ---------------------------------------

As a displacment activity I added reporting for duplicate imports
And more precise locations for the imports themselves.  For example:

  module T where

  import Maybe (isJust,isJust)
  import Maybe (isJust)

gives

Foo.hs:
    Warning: `isJust' is imported more than once:
       imported from Maybe at Foo.hs:4:16-21
       imported from Maybe at Foo.hs:3:23-28
       imported from Maybe at Foo.hs:3:16-21

20 years ago[project @ 2003-12-18 21:37:56 by panne]
panne [Thu, 18 Dec 2003 21:37:56 +0000 (21:37 +0000)]
[project @ 2003-12-18 21:37:56 by panne]
Patch from Andres Loeh: Generate the *.raw-hs files with the inplace
GHC, otherwise one runs into a "fixed-point" problem where only
documentation known to the bootstrapping GHC could be built.

20 years ago[project @ 2003-12-18 21:34:31 by panne]
panne [Thu, 18 Dec 2003 21:34:31 +0000 (21:34 +0000)]
[project @ 2003-12-18 21:34:31 by panne]
Synched with latest changes in Hugs' aclocal.m4 (wglGetProcAddress
fiddling)

20 years ago[project @ 2003-12-18 13:29:23 by simonmar]
simonmar [Thu, 18 Dec 2003 13:29:23 +0000 (13:29 +0000)]
[project @ 2003-12-18 13:29:23 by simonmar]
Optimisation in awaitEvent(): reset the abandonRequestWait() signal if
it isn't needed (compensates for not using PulseEvent() in
abandonRequestWait(), see AsyncIO.c for details).

Code cleanup in awaitEvent(): don't test the various exit conditions twice.

20 years ago[project @ 2003-12-18 13:27:27 by simonmar]
simonmar [Thu, 18 Dec 2003 13:27:27 +0000 (13:27 +0000)]
[project @ 2003-12-18 13:27:27 by simonmar]
Fix some threaded RTS bugs:

 - in awaitRequests(), it was possible to return immediately even
   though wait was set to rtsTrue.  This lead to a busy wait loop,
   so I've disabled that case (see code for details).

 - using PulseEvent in abandonRequestWait() wasn't the right thing,
   because it exposed a race condition.  Again, see the comment in
   the code for details.

20 years ago[project @ 2003-12-18 12:24:59 by simonmar]
simonmar [Thu, 18 Dec 2003 12:24:59 +0000 (12:24 +0000)]
[project @ 2003-12-18 12:24:59 by simonmar]
Add missing 'continue' after 'passCapability'

20 years ago[project @ 2003-12-18 10:46:49 by simonmar]
simonmar [Thu, 18 Dec 2003 10:46:49 +0000 (10:46 +0000)]
[project @ 2003-12-18 10:46:49 by simonmar]
- make --disable-foo work for each of the --enable options
- tidyup: use AC_HELP_STRING everywhere

20 years ago[project @ 2003-12-18 09:55:17 by simonmar]
simonmar [Thu, 18 Dec 2003 09:55:17 +0000 (09:55 +0000)]
[project @ 2003-12-18 09:55:17 by simonmar]
no_glu is spelled no_GLU, and similarly for no_GLUT

20 years ago[project @ 2003-12-18 09:32:07 by simonmar]
simonmar [Thu, 18 Dec 2003 09:32:07 +0000 (09:32 +0000)]
[project @ 2003-12-18 09:32:07 by simonmar]
Undo part of previous merge: the HEAD doesn't export saved_termios (it
is accessed by functions in RtsStartup instead).

20 years ago[project @ 2003-12-17 17:29:28 by sof]
sof [Wed, 17 Dec 2003 17:29:28 +0000 (17:29 +0000)]
[project @ 2003-12-17 17:29:28 by sof]
merge rev. 1.106.2.3

20 years ago[project @ 2003-12-17 17:18:27 by sof]
sof [Wed, 17 Dec 2003 17:18:27 +0000 (17:18 +0000)]
[project @ 2003-12-17 17:18:27 by sof]
merge rev. 1.128.2.11

20 years ago[project @ 2003-12-17 12:17:18 by simonmar]
simonmar [Wed, 17 Dec 2003 12:17:18 +0000 (12:17 +0000)]
[project @ 2003-12-17 12:17:18 by simonmar]
Fix up following changes to the Capability API.  (strange, I'm *sure*
I tested this stuff...)

20 years ago[project @ 2003-12-17 11:43:13 by simonpj]
simonpj [Wed, 17 Dec 2003 11:43:13 +0000 (11:43 +0000)]
[project @ 2003-12-17 11:43:13 by simonpj]
---------------------------------
  Gate in a few more instance decls
  ---------------------------------

When we have
instance T a where...

we need to suck in the instance decl rather more aggressively than we
were.  (A case I hadn't thought of because it only happens with
undecideable instances.)

20 years ago[project @ 2003-12-17 11:29:40 by simonpj]
simonpj [Wed, 17 Dec 2003 11:29:42 +0000 (11:29 +0000)]
[project @ 2003-12-17 11:29:40 by simonpj]
-----------------------------------------------------
  Fix a subtle loop in the context-reduction machinery
  ----------------------------------------------------

This bug was provoked by a recent change: when trying to prove
a constraint C, TcSimplify.reduce now adds C to the database before
trying to prove C, thus building recursive dictionaries.

Two bugs
a) If we add C's superclasses (which we were) we can now build a
   bogusly-recursive dictionary (see Note [SUPERCLASS-LOOP]).
   Solution: in reduce, add C only (via addIrred NoSCs) and then
   later use addWanted to add its definition plus SCs.

b) Since we can have recursive definitions, the superclass-loop
   handling machinery (findAllDeps) must carry its visited-set
   with it (which it was not doing before)

The main file is TcSimplify; but I modified a bunch of others to
take advantage of new function extendVarSetList

20 years ago[project @ 2003-12-17 08:38:14 by panne]
panne [Wed, 17 Dec 2003 08:38:14 +0000 (08:38 +0000)]
[project @ 2003-12-17 08:38:14 by panne]
To get wglGetProcAddress on Windows, we have to link with
opengl32.dll, too, even when we are using Cygwin with X11.

20 years ago[project @ 2003-12-16 16:24:55 by simonpj]
simonpj [Tue, 16 Dec 2003 16:25:16 +0000 (16:25 +0000)]
[project @ 2003-12-16 16:24:55 by simonpj]
--------------------
Towards type splices
--------------------

Starts the move to supporting type splices, by making
HsExpr.HsSplice a separate type of its own, and adding
HsSpliceTy constructor to HsType.

20 years ago[project @ 2003-12-16 16:24:42 by simonpj]
simonpj [Tue, 16 Dec 2003 16:24:42 +0000 (16:24 +0000)]
[project @ 2003-12-16 16:24:42 by simonpj]
Trim exports

20 years ago[project @ 2003-12-16 16:24:24 by simonpj]
simonpj [Tue, 16 Dec 2003 16:24:24 +0000 (16:24 +0000)]
[project @ 2003-12-16 16:24:24 by simonpj]
Typo in comment

20 years ago[project @ 2003-12-16 16:23:25 by simonpj]
simonpj [Tue, 16 Dec 2003 16:23:25 +0000 (16:23 +0000)]
[project @ 2003-12-16 16:23:25 by simonpj]
Fix newtype deriving for Enum

20 years ago[project @ 2003-12-16 16:21:42 by simonpj]
simonpj [Tue, 16 Dec 2003 16:21:42 +0000 (16:21 +0000)]
[project @ 2003-12-16 16:21:42 by simonpj]
Remove unused parameter to groupAvails

20 years ago[project @ 2003-12-16 16:19:29 by simonpj]
simonpj [Tue, 16 Dec 2003 16:19:29 +0000 (16:19 +0000)]
[project @ 2003-12-16 16:19:29 by simonpj]
Dont report bindings beginning with _ as unused

20 years ago[project @ 2003-12-16 16:19:04 by simonpj]
simonpj [Tue, 16 Dec 2003 16:19:04 +0000 (16:19 +0000)]
[project @ 2003-12-16 16:19:04 by simonpj]
Rule selection test was exactly backwards

20 years ago[project @ 2003-12-16 16:18:08 by simonpj]
simonpj [Tue, 16 Dec 2003 16:18:08 +0000 (16:18 +0000)]
[project @ 2003-12-16 16:18:08 by simonpj]
Clarify newtype deriving documentation

20 years ago[project @ 2003-12-16 16:17:49 by simonpj]
simonpj [Tue, 16 Dec 2003 16:17:49 +0000 (16:17 +0000)]
[project @ 2003-12-16 16:17:49 by simonpj]
Clarify warn-unused-bindings documention

20 years ago[project @ 2003-12-16 14:27:31 by simonpj]
simonpj [Tue, 16 Dec 2003 14:27:31 +0000 (14:27 +0000)]
[project @ 2003-12-16 14:27:31 by simonpj]
comments only

20 years ago[project @ 2003-12-16 13:27:31 by simonmar]
simonmar [Tue, 16 Dec 2003 13:27:32 +0000 (13:27 +0000)]
[project @ 2003-12-16 13:27:31 by simonmar]
Clean up Capability API
~~~~~~~~~~~~~~~~~~~~~~~

- yieldToReturningWorker() is now yieldCapability(), and performs all
  kinds of yielding (both to returning workers and passing to other
  OS threads).  yieldCapabiltiy() does *not* re-acquire a capability.

- waitForWorkCapabilty() is now waitForCapability().

- releaseCapbility() also releases the capability when passing to
  another OS thread.  It is the only way to release a capability (apart
  from yieldCapability(), which calls releaseCapability() internally).

- passCapability() and passCapabilityToWorker() now do not release the
  capability.  They just set a flag to indicate where the capabiliy
  should go when it it next released.

Other cleanups:

  - Removed all the SMP stuff from Schedule.c.  It had extensive bitrot,
    and was just obfuscating the code.  If it is ever needed again,
    it can be resurrected from CVS.

  - Removed some other dead code in Schedule.c, in an attempt to make
    this file more manageable.

20 years ago[project @ 2003-12-16 13:19:01 by simonmar]
simonmar [Tue, 16 Dec 2003 13:19:13 +0000 (13:19 +0000)]
[project @ 2003-12-16 13:19:01 by simonmar]
ANSIfy

20 years ago[project @ 2003-12-15 16:45:23 by simonmar]
simonmar [Mon, 15 Dec 2003 16:45:23 +0000 (16:45 +0000)]
[project @ 2003-12-15 16:45:23 by simonmar]
Add assertion.

20 years ago[project @ 2003-12-15 16:43:45 by simonmar]
simonmar [Mon, 15 Dec 2003 16:43:45 +0000 (16:43 +0000)]
[project @ 2003-12-15 16:43:45 by simonmar]
Debugging output wibble

20 years ago[project @ 2003-12-15 16:23:54 by simonmar]
simonmar [Mon, 15 Dec 2003 16:23:54 +0000 (16:23 +0000)]
[project @ 2003-12-15 16:23:54 by simonmar]
Fix a deadlock: an OS thread returning from a C call could enter
grabReturnCapability, grabbing the capability that was in the process
of being passed to another thread via passCapability.  This leads to a
deadlock shortly afterward, because the passCapability flag is still
set, so a normal worker won't pick up the capability when it is
released.

Fix (not sure if this is the best fix, though): don't grab the
capability in grabReturnCapability() if passCapabilty is set.

20 years ago[project @ 2003-12-15 14:31:48 by simonmar]
simonmar [Mon, 15 Dec 2003 14:31:48 +0000 (14:31 +0000)]
[project @ 2003-12-15 14:31:48 by simonmar]
Fix locking bug in awaitEvent(): in one code path it could return with
sched_lock unlocked.

20 years ago[project @ 2003-12-15 14:28:39 by simonmar]
simonmar [Mon, 15 Dec 2003 14:28:39 +0000 (14:28 +0000)]
[project @ 2003-12-15 14:28:39 by simonmar]
Fix bogosity in implementation of ACQUIRE_LOCK/RELEASE_LOCK on Win32.
These functions were essentially doing nothing, due to a missing
dereference on the argument.

I've rewritten them as inlines (to catch type errors) and added some
checking of the return values, which should help catch errors like
this in the future.

20 years ago[project @ 2003-12-12 16:35:19 by simonmar]
simonmar [Fri, 12 Dec 2003 16:35:21 +0000 (16:35 +0000)]
[project @ 2003-12-12 16:35:19 by simonmar]
Tidyup:

  - make debugging output from the scheduler more consistent,
    especially for the threaded RTS.

  - a few style fixes

20 years ago[project @ 2003-12-11 11:24:17 by simonmar]
simonmar [Thu, 11 Dec 2003 11:24:17 +0000 (11:24 +0000)]
[project @ 2003-12-11 11:24:17 by simonmar]
parser/Parser.y needs to be in EXTRA_SRCS, because the build system
can't find it otherwise.

20 years ago[project @ 2003-12-11 11:23:24 by simonmar]
simonmar [Thu, 11 Dec 2003 11:23:24 +0000 (11:23 +0000)]
[project @ 2003-12-11 11:23:24 by simonmar]
Hacking in the .pp suffix rule: leave #include directives in place.

20 years ago[project @ 2003-12-11 09:36:46 by simonmar]
simonmar [Thu, 11 Dec 2003 09:36:46 +0000 (09:36 +0000)]
[project @ 2003-12-11 09:36:46 by simonmar]
Add +RTS -K2m to SRC_HAPPY_OPTS, to work around perf. problems in the HEAD.

20 years ago[project @ 2003-12-10 17:35:48 by simonmar]
simonmar [Wed, 10 Dec 2003 17:35:48 +0000 (17:35 +0000)]
[project @ 2003-12-10 17:35:48 by simonmar]
oops, forgot a reverse

20 years ago[project @ 2003-12-10 17:29:26 by simonmar]
simonmar [Wed, 10 Dec 2003 17:29:26 +0000 (17:29 +0000)]
[project @ 2003-12-10 17:29:26 by simonmar]
Fix syntax error

20 years ago[project @ 2003-12-10 17:25:12 by simonmar]
simonmar [Wed, 10 Dec 2003 17:25:18 +0000 (17:25 +0000)]
[project @ 2003-12-10 17:25:12 by simonmar]
Cleanups:

- Move the collect* functions from HsSyn into HsUtils.  Check that we
  have a clean separation of utilties over HsSyn, with the generic
  versions in HsUtils, and the specific versions in RdrHsSyn, RnHsSyn
  and TcHsSyn as appropriate.

- Remove the RdrBinding data type, which was really just a nested list
  with O(1) append, and use OrdList instead.  This makes it much clearer
  that there's nothing strange going on.

- Various other minor cleanups.

20 years ago[project @ 2003-12-10 17:15:44 by simonmar]
simonmar [Wed, 10 Dec 2003 17:15:44 +0000 (17:15 +0000)]
[project @ 2003-12-10 17:15:44 by simonmar]
fix bogosity spotted by -Wall

20 years ago[project @ 2003-12-10 14:21:36 by simonmar]
simonmar [Wed, 10 Dec 2003 14:21:36 +0000 (14:21 +0000)]
[project @ 2003-12-10 14:21:36 by simonmar]
New file of miscellaneous utility functions over HsSyn.

20 years ago[project @ 2003-12-10 14:15:16 by simonmar]
simonmar [Wed, 10 Dec 2003 14:15:38 +0000 (14:15 +0000)]
[project @ 2003-12-10 14:15:16 by simonmar]
Add accurate source location annotations to HsSyn
-------------------------------------------------

Every syntactic entity in HsSyn is now annotated with a SrcSpan, which
details the exact beginning and end points of that entity in the
original source file.  All honest compilers should do this, and it was
about time GHC did the right thing.

The most obvious benefit is that we now have much more accurate error
messages; when running GHC inside emacs for example, the cursor will
jump to the exact location of an error, not just a line somewhere
nearby.  We haven't put a huge amount of effort into making sure all
the error messages are accurate yet, so there could be some tweaking
still needed, although the majority of messages I've seen have been
spot-on.

Error messages now contain a column number in addition to the line
number, eg.

   read001.hs:25:10: Variable not in scope: `+#'

To get the full text span info, use the new option -ferror-spans.  eg.

   read001.hs:25:10-11: Variable not in scope: `+#'

I'm not sure whether we should do this by default.  Emacs won't
understand the new error format, for one thing.

In a more elaborate editor setting (eg. Visual Studio), we can arrange
to actually highlight the subexpression containing an error.  Eventually
this information will be used so we can find elements in the abstract
syntax corresponding to text locations, for performing high-level editor
functions (eg. "tell me the type of this expression I just highlighted").

Performance of the compiler doesn't seem to be adversely affected.
Parsing is still quicker than in 6.0.1, for example.

Implementation:

This was an excrutiatingly painful change to make: both Simon P.J. and
myself have been working on it for the last three weeks or so.  The
basic changes are:

 - a new datatype SrcSpan, which represents a beginning and end position
   in a source file.

 - To reduce the pain as much as possible, we also defined:

      data Located e = L SrcSpan e

 - Every datatype in HsSyn has an equivalent Located version.  eg.

      type LHsExpr id = Located (HsExpr id)

   and pretty much everywhere we used to use HsExpr we now use
   LHsExpr.  Believe me, we thought about this long and hard, and
   all the other options were worse :-)

Additional changes/cleanups we made at the same time:

  - The abstract syntax for bindings is now less arcane.  MonoBinds
    and HsBinds with their built-in list constructors have gone away,
    replaced by HsBindGroup and HsBind (see HsSyn/HsBinds.lhs).

  - The various HsSyn type synonyms have now gone away (eg. RdrNameHsExpr,
    RenamedHsExpr, and TypecheckedHsExpr are now HsExpr RdrName,
    HsExpr Name, and HsExpr Id respectively).

  - Utilities over HsSyn are now collected in a new module HsUtils.
    More stuff still needs to be moved in here.

  - MachChar now has a real Char instead of an Int.  All GHC versions that
    can compile GHC now support 32-bit Chars, so this was a simplification.

20 years ago[project @ 2003-12-10 11:35:24 by wolfgang]
wolfgang [Wed, 10 Dec 2003 11:35:26 +0000 (11:35 +0000)]
[project @ 2003-12-10 11:35:24 by wolfgang]
PowerPC Linux support for registerised compilation and native code
generation. (object splitting and GHCi are still unsupported).

Code for other platforms is not affected, so MERGE TO STABLE.

20 years ago[project @ 2003-12-10 10:12:13 by wolfgang]
wolfgang [Wed, 10 Dec 2003 10:12:13 +0000 (10:12 +0000)]
[project @ 2003-12-10 10:12:13 by wolfgang]
PowerPC NCG bugfix: 2-byte data objects should be .short, not .byte

MERGE TO STABLE

20 years ago[project @ 2003-12-09 15:48:08 by simonmar]
simonmar [Tue, 9 Dec 2003 15:48:08 +0000 (15:48 +0000)]
[project @ 2003-12-09 15:48:08 by simonmar]
Add note about -all_load instead of --whole-archive on MacOS X.

20 years ago[project @ 2003-12-06 18:27:37 by panne]
panne [Sat, 6 Dec 2003 18:27:37 +0000 (18:27 +0000)]
[project @ 2003-12-06 18:27:37 by panne]
Fixed typo in OpenAL handling.

20 years ago[project @ 2003-12-06 18:24:05 by panne]
panne [Sat, 6 Dec 2003 18:24:07 +0000 (18:24 +0000)]
[project @ 2003-12-06 18:24:05 by panne]
Completely overhauled OpenGL/GLUT detection magic, making things more
modular. Removed support for Mesa and non-HW-accelerated support on
Windoze. Added initial support for handling missing glut.h header on
MinGW/MSYS (to be completed). Tested on Cygwin (plain, -mno-cygwin,
--without-x), MSYS/MinGW and SuSE 8.2 x86 Linux.

20 years ago[project @ 2003-12-05 09:50:39 by stolz]
stolz [Fri, 5 Dec 2003 09:50:39 +0000 (09:50 +0000)]
[project @ 2003-12-05 09:50:39 by stolz]
Use tso->id instead of tso as index to thread lables (tsos get relocated).

Please merge

20 years ago[project @ 2003-12-02 19:16:41 by panne]
panne [Tue, 2 Dec 2003 19:16:44 +0000 (19:16 +0000)]
[project @ 2003-12-02 19:16:41 by panne]
Added the first pieces of an OpenAL binding which has been of my disk for quite
a while. Note that it is built by default when a usable OpenAL library is found,
but this could be disabled via --disable-openal on the configure commandline.
Similar behaviour should probably be the default for all optional libraries.
Note that I have created a new hierarchy rooted at "Sound", the existing
hierarchies didn't fit.

20 years ago[project @ 2003-11-28 13:13:35 by simonmar]
simonmar [Fri, 28 Nov 2003 13:13:35 +0000 (13:13 +0000)]
[project @ 2003-11-28 13:13:35 by simonmar]
typo

20 years ago[project @ 2003-11-28 10:55:59 by simonmar]
simonmar [Fri, 28 Nov 2003 10:55:59 +0000 (10:55 +0000)]
[project @ 2003-11-28 10:55:59 by simonmar]
Wibbles to the UNPACK docs.

20 years ago[project @ 2003-11-27 15:18:11 by ross]
ross [Thu, 27 Nov 2003 15:18:11 +0000 (15:18 +0000)]
[project @ 2003-11-27 15:18:11 by ross]
fix typo

20 years ago[project @ 2003-11-27 13:27:11 by simonmar]
simonmar [Thu, 27 Nov 2003 13:27:11 +0000 (13:27 +0000)]
[project @ 2003-11-27 13:27:11 by simonmar]
Document UNPACK pragma

20 years ago[project @ 2003-11-27 13:26:38 by simonmar]
simonmar [Thu, 27 Nov 2003 13:26:39 +0000 (13:26 +0000)]
[project @ 2003-11-27 13:26:38 by simonmar]
On reflection, using the '!!' prefix for unboxing a constructor field
was a mistake:  firstly it has to be written '! !', and secondly it
isn't backwards-compatible.  So instead, we now use the syntax:

   data T = T {-# UNPACK #-} !Int

to unbox a field.  We thought this would be a cute reuse of the UNPACK
pragma.

The effect of -funbox-strict-fields is to add {-# UNPACK #-} to every
strict field.

20 years ago[project @ 2003-11-27 11:08:06 by simonmar]
simonmar [Thu, 27 Nov 2003 11:08:06 +0000 (11:08 +0000)]
[project @ 2003-11-27 11:08:06 by simonmar]
Fix syntax error

20 years ago[project @ 2003-11-27 09:30:54 by simonmar]
simonmar [Thu, 27 Nov 2003 09:30:54 +0000 (09:30 +0000)]
[project @ 2003-11-27 09:30:54 by simonmar]
Having tightened up GHC's syntax w.r.t. Haskell 98, it appears that
GHC itself was making use of the more lax syntax.

20 years ago[project @ 2003-11-26 12:14:26 by simonmar]
simonmar [Wed, 26 Nov 2003 12:14:26 +0000 (12:14 +0000)]
[project @ 2003-11-26 12:14:26 by simonmar]
Fix a rare bug in compacting GC, related to eval_thunk_selector().  This
might be the cause of the "Closure type 0" bug in SourceForge.

20 years ago[project @ 2003-11-26 10:07:19 by simonmar]
simonmar [Wed, 26 Nov 2003 10:07:19 +0000 (10:07 +0000)]
[project @ 2003-11-26 10:07:19 by simonmar]
Haskell 98 doesn't allow extra commas in record construction/update,
so neither should GHC.

20 years ago[project @ 2003-11-21 09:09:09 by simonpj]
simonpj [Fri, 21 Nov 2003 09:09:09 +0000 (09:09 +0000)]
[project @ 2003-11-21 09:09:09 by simonpj]
Add a note about avoiding trailing spaces in CVSROOT

20 years ago[project @ 2003-11-18 11:57:29 by simonpj]
simonpj [Tue, 18 Nov 2003 11:57:29 +0000 (11:57 +0000)]
[project @ 2003-11-18 11:57:29 by simonpj]
Add notes about windows build, esp the need for automake

20 years ago[project @ 2003-11-18 09:26:36 by simonmar]
simonmar [Tue, 18 Nov 2003 09:26:36 +0000 (09:26 +0000)]
[project @ 2003-11-18 09:26:36 by simonmar]
Restore a couple of functions that are used in ASSERTs.

20 years ago[project @ 2003-11-18 09:23:27 by simonmar]
simonmar [Tue, 18 Nov 2003 09:23:27 +0000 (09:23 +0000)]
[project @ 2003-11-18 09:23:27 by simonmar]
oops, fix overenthusiastic export-culling (noCCAttached is used in an ASSERT).

20 years ago[project @ 2003-11-17 14:47:52 by simonmar]
simonmar [Mon, 17 Nov 2003 14:47:53 +0000 (14:47 +0000)]
[project @ 2003-11-17 14:47:52 by simonmar]
GC dead code and export list entries.

20 years ago[project @ 2003-11-17 14:45:17 by simonmar]
simonmar [Mon, 17 Nov 2003 14:45:17 +0000 (14:45 +0000)]
[project @ 2003-11-17 14:45:17 by simonmar]
GC dead code.

20 years ago[project @ 2003-11-17 14:44:47 by simonmar]
simonmar [Mon, 17 Nov 2003 14:44:47 +0000 (14:44 +0000)]
[project @ 2003-11-17 14:44:47 by simonmar]
GC export list.

20 years ago[project @ 2003-11-17 14:44:07 by simonmar]
simonmar [Mon, 17 Nov 2003 14:44:07 +0000 (14:44 +0000)]
[project @ 2003-11-17 14:44:07 by simonmar]
GC dead code.

20 years ago[project @ 2003-11-17 14:43:22 by simonmar]
simonmar [Mon, 17 Nov 2003 14:43:22 +0000 (14:43 +0000)]
[project @ 2003-11-17 14:43:22 by simonmar]
GC export list.

20 years ago[project @ 2003-11-17 14:41:58 by simonmar]
simonmar [Mon, 17 Nov 2003 14:42:47 +0000 (14:42 +0000)]
[project @ 2003-11-17 14:41:58 by simonmar]
GC dead code.