ghc-hetmet.git
21 years ago[project @ 2003-02-12 10:32:38 by simonmar]
simonmar [Wed, 12 Feb 2003 10:32:38 +0000 (10:32 +0000)]
[project @ 2003-02-12 10:32:38 by simonmar]
Adapt the dist target a little to work with the nightly build's new
way of building source dists.

It now works by building a link tree to the build tree, and doing
'make dist' on the link tree, to avoid destroying the real build tree.
This just needed a couple of tweaks to the dist target to work.

21 years ago[project @ 2003-02-11 17:19:35 by simonpj]
simonpj [Tue, 11 Feb 2003 17:19:36 +0000 (17:19 +0000)]
[project @ 2003-02-11 17:19:35 by simonpj]
Lots of new stuff about data types

21 years ago[project @ 2003-02-11 15:27:32 by simonpj]
simonpj [Tue, 11 Feb 2003 15:27:32 +0000 (15:27 +0000)]
[project @ 2003-02-11 15:27:32 by simonpj]
More Win32 notes

21 years ago[project @ 2003-02-11 11:53:51 by wolfgang]
wolfgang [Tue, 11 Feb 2003 11:53:52 +0000 (11:53 +0000)]
[project @ 2003-02-11 11:53:51 by wolfgang]
Mac OS X:
Add support for dynamic linker "symbol stubs". For every function that might
be imported from a dynamic library, we have to generate a short piece of
assembly code.
Extend the NatM monad to keep track of the list of imports (for which stubs
will be generated later).
Fix a bug concerning 64 bit ints (hi and low words were swapped in one place).

21 years ago[project @ 2003-02-11 04:32:06 by sof]
sof [Tue, 11 Feb 2003 04:32:06 +0000 (04:32 +0000)]
[project @ 2003-02-11 04:32:06 by sof]
Tighten up prev commit:
- win32: only add default --template=... option if the template file
  exists.
- if user has supplied --cc=.., use it as a default for 'ld'.

21 years ago[project @ 2003-02-10 23:35:03 by wolfgang]
wolfgang [Mon, 10 Feb 2003 23:35:03 +0000 (23:35 +0000)]
[project @ 2003-02-10 23:35:03 by wolfgang]
Mac OS X:
add one more relocation type (PPC_RELOC_BR24)
and add more C run-time library symbols to the symbol table
(made more difficult by the fact that these symbols don't
have an underscore prefix, while everything else on Mac OS X has)

21 years ago[project @ 2003-02-10 10:41:52 by simonmar]
simonmar [Mon, 10 Feb 2003 10:41:52 +0000 (10:41 +0000)]
[project @ 2003-02-10 10:41:52 by simonmar]
Add some missing symbols.

Should fix several recent test breakages with GHCi.

21 years ago[project @ 2003-02-10 10:13:13 by simonmar]
simonmar [Mon, 10 Feb 2003 10:13:13 +0000 (10:13 +0000)]
[project @ 2003-02-10 10:13:13 by simonmar]
Add GHC_Ptr_FunPtr_con_info symbol in the other branch of the #ifdef, too.

21 years ago[project @ 2003-02-08 20:14:19 by wolfgang]
wolfgang [Sat, 8 Feb 2003 20:14:19 +0000 (20:14 +0000)]
[project @ 2003-02-08 20:14:19 by wolfgang]
PowerPC: for ccalls, use the correct minimum size (32 bytes) for the
parameter area

21 years ago[project @ 2003-02-08 13:34:06 by wolfgang]
wolfgang [Sat, 8 Feb 2003 13:34:06 +0000 (13:34 +0000)]
[project @ 2003-02-08 13:34:06 by wolfgang]
Fix a potential crash in the threaded RTS by copying ccall arguments
from the TSO stack to a malloced block before doing the call.
(no changes were made for the non-threaded case)

21 years ago[project @ 2003-02-07 22:26:08 by sof]
sof [Fri, 7 Feb 2003 22:26:08 +0000 (22:26 +0000)]
[project @ 2003-02-07 22:26:08 by sof]
hsc2hs-inplace: provide --ld default-default

21 years ago[project @ 2003-02-07 22:14:32 by sof]
sof [Fri, 7 Feb 2003 22:14:32 +0000 (22:14 +0000)]
[project @ 2003-02-07 22:14:32 by sof]
Rip out rawSystem impl -- it only happened to work by accident.

Simpler to just assume that SystemExts supplies it instead, which it
has for a number of versions now.

21 years ago[project @ 2003-02-07 21:55:36 by sof]
sof [Fri, 7 Feb 2003 21:55:36 +0000 (21:55 +0000)]
[project @ 2003-02-07 21:55:36 by sof]
- default linker is now 'ghc' (i.e., consistent with the default compiler.)
- new option, -v/--verbose, which makes the tool less inscrutable about what
  external commands it actually ends up exec'ing.
- under Win32, try locating the default 'ghc' to run by looking in the dir
  where 'hsc2hs' resides (which they do in a binary install.)
- make the default --template arg story actually work (win32 only.)

21 years ago[project @ 2003-02-07 09:39:02 by simonpj]
simonpj [Fri, 7 Feb 2003 09:39:03 +0000 (09:39 +0000)]
[project @ 2003-02-07 09:39:02 by simonpj]
Fix minor bugs in simplifier iteration control

21 years ago[project @ 2003-02-06 19:39:35 by tgedell]
tgedell [Thu, 6 Feb 2003 19:39:37 +0000 (19:39 +0000)]
[project @ 2003-02-06 19:39:35 by tgedell]
Changed so that PredType is declared as a type and not a datatype,
this caused a problem when generating external Core.
Added SourceType as a datatype since PredType refers to it.

21 years ago[project @ 2003-02-06 17:37:50 by simonpj]
simonpj [Thu, 6 Feb 2003 17:37:50 +0000 (17:37 +0000)]
[project @ 2003-02-06 17:37:50 by simonpj]
Deal with TForall in cvtType

21 years ago[project @ 2003-02-06 17:15:50 by simonpj]
simonpj [Thu, 6 Feb 2003 17:15:54 +0000 (17:15 +0000)]
[project @ 2003-02-06 17:15:50 by simonpj]
-------------------------------------
  Fix parsing of floating-point constants in External Core
-------------------------------------

This fix accidentally made it into the previous (unrelated) commit,
so it's really the *previous* change to LexCore you should look
at.

The fix updates LexCore so that it can parse literals in scientific
notation (e.g. 4.3e-3)

21 years ago[project @ 2003-02-06 17:11:13 by simonpj]
simonpj [Thu, 6 Feb 2003 17:11:14 +0000 (17:11 +0000)]
[project @ 2003-02-06 17:11:13 by simonpj]
Minor tidy up of known-key names

21 years ago[project @ 2003-02-06 10:04:57 by simonmar]
simonmar [Thu, 6 Feb 2003 10:04:57 +0000 (10:04 +0000)]
[project @ 2003-02-06 10:04:57 by simonmar]
Oops, Add rts_getFunPtr too.

21 years ago[project @ 2003-02-06 09:56:07 by simonmar]
simonmar [Thu, 6 Feb 2003 09:56:10 +0000 (09:56 +0000)]
[project @ 2003-02-06 09:56:07 by simonmar]
rts_mkFunPtr and rts_getFunPtr were missing.  Thanks to Daan Leijen
for spotting and reporting the bug.

MERGE TO STABLE

21 years ago[project @ 2003-02-06 09:36:46 by simonpj]
simonpj [Thu, 6 Feb 2003 09:36:46 +0000 (09:36 +0000)]
[project @ 2003-02-06 09:36:46 by simonpj]
Fix version-itis in LexCore, so it will compile with 4.08 again

21 years ago[project @ 2003-02-06 09:29:14 by simonpj]
simonpj [Thu, 6 Feb 2003 09:29:14 +0000 (09:29 +0000)]
[project @ 2003-02-06 09:29:14 by simonpj]
Improve error message

21 years ago[project @ 2003-02-05 12:33:33 by simonmar]
simonmar [Wed, 5 Feb 2003 12:33:34 +0000 (12:33 +0000)]
[project @ 2003-02-05 12:33:33 by simonmar]
EXTRA_OBJS is not the right thing to be adding into the objects to be
put into a SplitObjs library - it causes certain objects to turn up
twice in the resulting library (eg. if EXTRA_OBJS duplicates some
objects also found in HS_OBJS).

In fact, EXTRA_OBJS is generally bogus and now isn't used anywhere, so
I've removed it.

Should fix the problem recently reported with PrimopWrappers occurring
twice in the libHSbase.a archive.

21 years ago[project @ 2003-02-05 12:05:05 by simonmar]
simonmar [Wed, 5 Feb 2003 12:05:05 +0000 (12:05 +0000)]
[project @ 2003-02-05 12:05:05 by simonmar]
fix markup slightly

21 years ago[project @ 2003-02-05 11:42:08 by simonpj]
simonpj [Wed, 5 Feb 2003 11:42:08 +0000 (11:42 +0000)]
[project @ 2003-02-05 11:42:08 by simonpj]
Remove more usage-analysis stuff

21 years ago[project @ 2003-02-05 11:41:50 by simonpj]
simonpj [Wed, 5 Feb 2003 11:41:50 +0000 (11:41 +0000)]
[project @ 2003-02-05 11:41:50 by simonpj]
Wibble to TcRules (fixes HEAD breakage)

21 years ago[project @ 2003-02-05 11:41:26 by simonpj]
simonpj [Wed, 5 Feb 2003 11:41:26 +0000 (11:41 +0000)]
[project @ 2003-02-05 11:41:26 by simonpj]
-------------------------------------
  Fix parsing of floating-point constants in External Core
-------------------------------------

This fix accidentally made it into the previous (unrelated) commit,
so it's really the *previous* change to LexCore you should look
at.

The fix updates LexCore so that it can parse literals in scientific
notation (e.g. 4.3e-3)

21 years ago[project @ 2003-02-05 11:39:26 by simonpj]
simonpj [Wed, 5 Feb 2003 11:39:27 +0000 (11:39 +0000)]
[project @ 2003-02-05 11:39:26 by simonpj]
Type sigs and comments only

21 years ago[project @ 2003-02-05 09:37:23 by simonmar]
simonmar [Wed, 5 Feb 2003 09:37:23 +0000 (09:37 +0000)]
[project @ 2003-02-05 09:37:23 by simonmar]
Remove usageSP directory

21 years ago[project @ 2003-02-04 15:31:18 by simonpj]
simonpj [Tue, 4 Feb 2003 15:31:18 +0000 (15:31 +0000)]
[project @ 2003-02-04 15:31:18 by simonpj]
-------------------------------------
Fix a name-capture bug in Ext-Core
-------------------------------------

Don't expand newtypes (even non-recursive ones) when going to External Core.
Reason: the expansion was performed *after* Tidying; the expansion performs
type substitution, which is only done right if you take account of the Uniques.
But since it's post-tidying, we got capture of occurence names.

I hope the lack of newtype expansion doesn't hurt anyone; I doubt it will.
If so, we can think again.

Thanks to Tobias Gedell for this one.

21 years ago[project @ 2003-02-04 15:09:38 by simonpj]
simonpj [Tue, 4 Feb 2003 15:09:47 +0000 (15:09 +0000)]
[project @ 2003-02-04 15:09:38 by simonpj]
-------------------------------------
Remove all vestiges of usage analysis
-------------------------------------

This commit removes a large blob of usage-analysis-related code, almost
all of which was commented out.

Sadly, it doesn't look as if Keith is going to have enough time to polish it
up, and in any case the actual performance benefits (so far as we can measure
them) turned out to be pretty modest (a few percent).

So, with regret, I'm chopping it all out.  It's still there in the repository
if anyone wants go hack on it.  And Tobias Gedell at Chalmers is implementing
a different analysis, via External Core.

21 years ago[project @ 2003-02-04 13:06:41 by simonpj]
simonpj [Tue, 4 Feb 2003 13:06:41 +0000 (13:06 +0000)]
[project @ 2003-02-04 13:06:41 by simonpj]
---------------------------------------------------
External Core fix
output implicit bindings in correct dependency order
---------------------------------------------------

In coreSyn/MkExternalCore, output constructor wrappers before the
other implicit bindings, because the latter may use the former.

Thanks to Tobias Gedell for this one.

21 years ago[project @ 2003-02-04 12:40:00 by simonpj]
simonpj [Tue, 4 Feb 2003 12:40:01 +0000 (12:40 +0000)]
[project @ 2003-02-04 12:40:00 by simonpj]
Make utils/genprimopcode recognise the type ().
    It was previously written 'Unit', which is easily
    confused with the type 'Unit' (used for generic
    derived instances).

21 years ago[project @ 2003-02-04 12:33:05 by simonpj]
simonpj [Tue, 4 Feb 2003 12:33:07 +0000 (12:33 +0000)]
[project @ 2003-02-04 12:33:05 by simonpj]
---------------------------------------------------
Template-Haskell fix to make the global environment
      more side-effect-ful
---------------------------------------------------

Consider

f = $(...foldl...) $(...foldl...)

The first splice sucks in the type sig for foldl, which the second
splice needs.  That means that the second splice is going to have to
consult the persistent compiler state to see the effect of imports
by the first one.

We used to cache the global type environment in the TcGblEnv, but
this commit switches to the obvious thing: consult the persistent
state on every global lookup.  After all, reading a MutVar is no
big deal; and it's a benign, ever-growing cache of type signatures,
so the side effect is fine.

On the way I tidied up the knot-tying in TcIfaceSig a bit more.
Previously, I think the setUnfoldingInfo was being strict in the
unfolding, which forced it to be type-checked.  Now it's lazy.
That could mean a lot less typechecking overall, for things whose
unfolding isn't looked at.  I hope I havn't broken it, though.

21 years ago[project @ 2003-02-04 12:28:22 by simonpj]
simonpj [Tue, 4 Feb 2003 12:28:26 +0000 (12:28 +0000)]
[project @ 2003-02-04 12:28:22 by simonpj]
---------------------------------------------------
Important fix to the handling of class methods that
      mention their own class type variable
---------------------------------------------------

[NB: I'm not 100% certain that this commit is independent of the
     Template-Haskell-related commit I'm doing at the same time.
     I've tried to separate them but may not have succeeded totally.]

This bug gives utterly bogus (detected by Core Lint) programs.
Isaac Jones discovered it.  Here's an example, now enshrined as tc165.

    class C a where
f :: (Eq a) => a

    instance C () where
f = f

The instance decl was translated as

    dfC() = MkC (let f = \dEq -> f in f)

which is utterly wrong.  Reason: the 'f' on the left was being treated
as an available Inst, but it doesn't obey INVARIANT 2 for Insts, which
is that they are applied to all their dictionaries.  (See the data type
decl for Inst.)

Solution: don't include such class methods in the available Insts.

21 years ago[project @ 2003-02-04 12:25:21 by simonpj]
simonpj [Tue, 4 Feb 2003 12:25:21 +0000 (12:25 +0000)]
[project @ 2003-02-04 12:25:21 by simonpj]
Use nameIsLocalOrFrom instead of open code

21 years ago[project @ 2003-02-04 12:23:32 by simonpj]
simonpj [Tue, 4 Feb 2003 12:23:51 +0000 (12:23 +0000)]
[project @ 2003-02-04 12:23:32 by simonpj]
Add type sig

21 years ago[project @ 2003-02-03 15:41:52 by simonpj]
simonpj [Mon, 3 Feb 2003 15:41:52 +0000 (15:41 +0000)]
[project @ 2003-02-03 15:41:52 by simonpj]
Modify error message

21 years ago[project @ 2003-02-01 09:10:16 by mthomas]
mthomas [Sat, 1 Feb 2003 09:10:17 +0000 (09:10 +0000)]
[project @ 2003-02-01 09:10:16 by mthomas]
Initialize stp->n_to_blocks as 0.  Add function for MinGW32 in Signals.c.

21 years ago[project @ 2003-01-31 17:29:46 by wolfgang]
wolfgang [Fri, 31 Jan 2003 17:29:46 +0000 (17:29 +0000)]
[project @ 2003-01-31 17:29:46 by wolfgang]
PowerPC bugfix: Don't forget to save GPR13
(Thanks to Ashley Yakeley for reporting this)

MERGE TO STABLE

21 years ago[project @ 2003-01-30 10:19:07 by simonmar]
simonmar [Thu, 30 Jan 2003 10:19:07 +0000 (10:19 +0000)]
[project @ 2003-01-30 10:19:07 by simonmar]
Quick fix for profiling after I broke it in rev. 1.68.

The profiling system needs some initialisation after module
registration (hs_add_root()).  Since module registration now happens
later, the profiling system was getting initialised too early before
any cost centers had been registered.  This is a quick fix; we still
can't handle multiple hs_add_root()s with profiling.

21 years ago[project @ 2003-01-30 10:06:35 by simonmar]
simonmar [Thu, 30 Jan 2003 10:06:35 +0000 (10:06 +0000)]
[project @ 2003-01-30 10:06:35 by simonmar]
gcc 2.96 miscompiles LDV_recordDead_FILL_SLOP_DYNAMIC() when DEBUG is
on, and I think I must have debugged this crash about three times
already.  So I'm inserting a #error to stop me doing it again.

21 years ago[project @ 2003-01-29 10:28:56 by simonmar]
simonmar [Wed, 29 Jan 2003 10:28:56 +0000 (10:28 +0000)]
[project @ 2003-01-29 10:28:56 by simonmar]
Multi-init protection.

Multiple inits now don't crash, but they still don't do anything
sensible because the finalizers have been run during the first
hs_exit().

21 years ago[project @ 2003-01-29 09:54:31 by simonmar]
simonmar [Wed, 29 Jan 2003 09:54:33 +0000 (09:54 +0000)]
[project @ 2003-01-29 09:54:31 by simonmar]
- re-instate setProgArgv, it is used in System.Environment (bah, could
  have sworn I grepped for it and found nothing...)

- Remove init_stack symbol from the Linker's symbol table; this is
  now static.

21 years ago[project @ 2003-01-28 17:06:24 by simonmar]
simonmar [Tue, 28 Jan 2003 17:06:24 +0000 (17:06 +0000)]
[project @ 2003-01-28 17:06:24 by simonmar]
I moved startTime here, from RtsStartup.c where it seemed out of placed

21 years ago[project @ 2003-01-28 17:05:43 by simonmar]
simonmar [Tue, 28 Jan 2003 17:05:43 +0000 (17:05 +0000)]
[project @ 2003-01-28 17:05:43 by simonmar]
Make it multi-init-safe

21 years ago[project @ 2003-01-28 17:05:32 by simonmar]
simonmar [Tue, 28 Jan 2003 17:05:32 +0000 (17:05 +0000)]
[project @ 2003-01-28 17:05:32 by simonmar]
- Remove setProgArgv
- Belatedly add startupHaskell/shutdownHaskell

21 years ago[project @ 2003-01-28 17:04:58 by simonmar]
simonmar [Tue, 28 Jan 2003 17:04:58 +0000 (17:04 +0000)]
[project @ 2003-01-28 17:04:58 by simonmar]
Make it multi-init-safe

21 years ago[project @ 2003-01-28 16:57:40 by simonmar]
simonmar [Tue, 28 Jan 2003 16:57:40 +0000 (16:57 +0000)]
[project @ 2003-01-28 16:57:40 by simonmar]
Update the FFI docs to use hs_init()/hs_exit() rather than
startupHaskell()/shutdownHaskell().

21 years ago[project @ 2003-01-28 16:30:06 by simonmar]
simonmar [Tue, 28 Jan 2003 16:30:07 +0000 (16:30 +0000)]
[project @ 2003-01-28 16:30:06 by simonmar]
Flesh out support for hs_init() and hs_exit() according to the latest
FFI spec.

For GHC, I also added:

  hs_add_root( void (*fn)(void) );

which is used to specify the root module.  This *must* be called prior
to invoking any Haskell functions.

The previous way of doing things still works:

  startupHaskell( argc, argv, root );

but the right way to do this is now

  hs_init( &argc, &argv );
  hs_add_root( root );

It is possible to invoke hs_add_root() multiple times with different
roots.

- setProgArgv() has been removed; it was unused and looks like it was
  there to support STG Hugs.

21 years ago[project @ 2003-01-28 16:23:53 by simonmar]
simonmar [Tue, 28 Jan 2003 16:23:53 +0000 (16:23 +0000)]
[project @ 2003-01-28 16:23:53 by simonmar]
Initialise prog_argc, prog_argv and rts_argc to sensible zero values
just in case hs_init() is called without passing any arguments in.

21 years ago[project @ 2003-01-28 16:22:20 by simonmar]
simonmar [Tue, 28 Jan 2003 16:22:20 +0000 (16:22 +0000)]
[project @ 2003-01-28 16:22:20 by simonmar]
- Add headers
- Make initThreadLabels multi-init-safe

21 years ago[project @ 2003-01-27 23:23:30 by wolfgang]
wolfgang [Mon, 27 Jan 2003 23:23:30 +0000 (23:23 +0000)]
[project @ 2003-01-27 23:23:30 by wolfgang]
Add #ifdef around an assertion that only holds for the threaded RTS.

21 years ago[project @ 2003-01-27 16:41:18 by simonmar]
simonmar [Mon, 27 Jan 2003 16:41:18 +0000 (16:41 +0000)]
[project @ 2003-01-27 16:41:18 by simonmar]
Fixes to make previous revision compatible with autoconf 2.13.

21 years ago[project @ 2003-01-27 11:08:16 by wolfgang]
wolfgang [Mon, 27 Jan 2003 11:08:16 +0000 (11:08 +0000)]
[project @ 2003-01-27 11:08:16 by wolfgang]
Un-break the non-threaded RTS
Sorry :-/

21 years ago[project @ 2003-01-26 12:56:00 by panne]
panne [Sun, 26 Jan 2003 12:56:00 +0000 (12:56 +0000)]
[project @ 2003-01-26 12:56:00 by panne]
Synched OpenGL detection macro with HOpenGL-1.04.
TODO: Modularization of the macro and caching.

21 years ago[project @ 2003-01-25 15:54:48 by wolfgang]
wolfgang [Sat, 25 Jan 2003 15:54:51 +0000 (15:54 +0000)]
[project @ 2003-01-25 15:54:48 by wolfgang]
This commit fixes many bugs and limitations in the threaded RTS.
There are still some issues remaining, though.

The following bugs should have been fixed:

- [+] "safe" calls could cause crashes
- [+] yieldToReturningWorker/grabReturnCapability
    -     It used to deadlock.
- [+] couldn't wake blocked workers
    -     Calls into the RTS could go unanswered for a long time, and
          that includes ordinary callbacks in some circumstances.
- [+] couldn't block on an MVar and expect to be woken up by a signal
      handler
    -     Depending on the exact situation, the RTS shut down or
          blocked forever and ignored the signal.
- [+] The locking scheme in RtsAPI.c didn't work
- [+] run_thread label in wrong place (schedule())
- [+] Deadlock in GHC.Handle
    -     if a signal arrived at the wrong time, an mvar was never
          filled again
- [+] Signals delivered to the "wrong" thread were ignored or handled
      too late.

Issues:
*) If GC can move TSO objects (I don't know - can it?), then ghci
will occasionally crash when calling foreign functions, because the
parameters are stored on the TSO stack.

*) There is still a race condition lurking in the code
(both threaded and non-threaded RTS are affected):
If a signal arrives after the check for pending signals in
schedule(), but before the call to select() in awaitEvent(),
select() will be called anyway. The signal handler will be
executed much later than expected.

*) For Win32, GHC doesn't yet support non-blocking IO, so while a
thread is waiting for IO, no call-ins can happen. If the RTS is
blocked in awaitEvent, it uses a polling loop on Win32, so call-ins
should work (although the polling loop looks ugly).

*) Deadlock detection is disabled for the threaded rts, because I
don't know how to do it properly in the presence of foreign call-ins
from foreign threads.
This causes the tests conc031, conc033 and conc034 to fail.

*) "safe" is currently treated as "threadsafe". Implementing "safe" in
a way that blocks other Haskell threads is more difficult than was
thought at first. I think it could be done with a few additional lines
of code, but personally, I'm strongly in favour of abolishing the
distinction.

*) Running finalizers at program termination is inefficient - there
are two OS threads passing messages back and forth for every finalizer
that is run. Also (just as in the non-threaded case) the finalizers
are run in parallel to any remaining haskell threads and to any
foreign call-ins that might still happen.

21 years ago[project @ 2003-01-24 16:05:57 by simonmar]
simonmar [Fri, 24 Jan 2003 16:05:57 +0000 (16:05 +0000)]
[project @ 2003-01-24 16:05:57 by simonmar]
remove setting of $(way_) and $(_way); these are now set in boilerplate.mk

21 years ago[project @ 2003-01-24 14:04:40 by simonmar]
simonmar [Fri, 24 Jan 2003 14:04:41 +0000 (14:04 +0000)]
[project @ 2003-01-24 14:04:40 by simonmar]
- Generalise seq to allow an unlifted type in its second argument.  This
  works because seq is *always* inlined and replaced by a case.

- Remove getTag, a wired-in Id with an unfolding, with a definition
  in GHC.Base:

getTag x = x `seq` dataToTag# x

  this is why we required the above generalisation to seq (dataToTag#
  returns an Int#).  See the comments in GHC.Base for more details.

- As a side-effect, this fixes a bug in the interpreter, where the
  compiler optimised away the evaluation of the argument to dataToTag#,
  but the interpreter ended up passing it an unevaluated thunk (nullary
  constructors aren't always evaluated in GHCi, but the simplifier
  assumes they are).  Now, in the interpreter, getTag won't be inlined
  so the compiler can't optimise away the evaluation, and we're saved.

  The real bug here is either (a) dataToTag# requires an evaluated
  argument or (b) the interpreter doesn't supply it with one, take your
  pick.

21 years ago[project @ 2003-01-24 13:56:45 by simonmar]
simonmar [Fri, 24 Jan 2003 13:56:45 +0000 (13:56 +0000)]
[project @ 2003-01-24 13:56:45 by simonmar]
- Reverse the code for workers and wrappers for nullary constructors.
  For some reason it was the wrong way around, but the effects were
  harmless since they both evaluate to the same thing.

- When passing a nullary constructor as an argument, we should pass
  the name of the worker rather than the wrapper.  Again, this is
  mostly harmless, but it enables some small simplification in
  pushAtom.

- Rearrange/cleanup pushAtom.

21 years ago[project @ 2003-01-24 11:26:39 by simonpj]
simonpj [Fri, 24 Jan 2003 11:26:39 +0000 (11:26 +0000)]
[project @ 2003-01-24 11:26:39 by simonpj]
Perform 'tidying' on the implicit bindings before emitting
External Core.  We were getting silly bindings like
\ tpl -> case tpl of tpl -> (tpl,tpl) -> tpl

Maybe we should add these implicit bindings in CoreTidy,
rather than in both MkExternalCore and CorePrep?

21 years ago[project @ 2003-01-23 16:39:30 by simonmar]
simonmar [Thu, 23 Jan 2003 16:39:30 +0000 (16:39 +0000)]
[project @ 2003-01-23 16:39:30 by simonmar]
Fix compilation with DEBUG

21 years ago[project @ 2003-01-23 16:13:43 by simonmar]
simonmar [Thu, 23 Jan 2003 16:13:43 +0000 (16:13 +0000)]
[project @ 2003-01-23 16:13:43 by simonmar]
We have to desugar polymorphic FFI declarations properly, too.
(companion commit to rev. 1.84 of TcType.lhs).

21 years ago[project @ 2003-01-23 16:01:33 by simonmar]
simonmar [Thu, 23 Jan 2003 16:01:33 +0000 (16:01 +0000)]
[project @ 2003-01-23 16:01:33 by simonmar]
Allow FFI declarations to have polymorphic types. eg:

foreign import ccall unsafe "stdlib.h &free" pFree :: FunPtr (Ptr a -> IO ())

(the change actually removed a line, the extra lines are because I
reformatted an import declaration).

21 years ago[project @ 2003-01-23 14:55:56 by simonpj]
simonpj [Thu, 23 Jan 2003 14:55:56 +0000 (14:55 +0000)]
[project @ 2003-01-23 14:55:56 by simonpj]
Refine documentation of newtype-deriving stuff

21 years ago[project @ 2003-01-23 14:55:36 by simonpj]
simonpj [Thu, 23 Jan 2003 14:55:36 +0000 (14:55 +0000)]
[project @ 2003-01-23 14:55:36 by simonpj]
Document warning suppression with leading underscore on variable names

21 years ago[project @ 2003-01-23 14:54:35 by simonpj]
simonpj [Thu, 23 Jan 2003 14:54:35 +0000 (14:54 +0000)]
[project @ 2003-01-23 14:54:35 by simonpj]
Suppress "No explicit method or default decl given for m"
if the method name starts with an underscore

This in response to a suggestion by George Russel

21 years ago[project @ 2003-01-23 14:50:53 by simonpj]
simonpj [Thu, 23 Jan 2003 14:50:53 +0000 (14:50 +0000)]
[project @ 2003-01-23 14:50:53 by simonpj]
Improve error message again

21 years ago[project @ 2003-01-23 14:36:58 by simonpj]
simonpj [Thu, 23 Jan 2003 14:36:58 +0000 (14:36 +0000)]
[project @ 2003-01-23 14:36:58 by simonpj]
Fix two small bugs in deriving mechanism, both concerning error reporting

21 years ago[project @ 2003-01-23 14:08:46 by simonpj]
simonpj [Thu, 23 Jan 2003 14:08:46 +0000 (14:08 +0000)]
[project @ 2003-01-23 14:08:46 by simonpj]
Improve error message

21 years ago[project @ 2003-01-23 12:26:04 by simonmar]
simonmar [Thu, 23 Jan 2003 12:26:04 +0000 (12:26 +0000)]
[project @ 2003-01-23 12:26:04 by simonmar]
Document +RTS -xt

21 years ago[project @ 2003-01-23 12:13:10 by simonmar]
simonmar [Thu, 23 Jan 2003 12:13:12 +0000 (12:13 +0000)]
[project @ 2003-01-23 12:13:10 by simonmar]
- Add a new flag, -xt, which enables inclusion of TSOs in a heap profile.

- Include large objects in heap profiles (except TSOs unless the -xt flag
  is given).

- In order to make this work, I had to set the bd->free field of the
  block descriptor for a large object to the correct value.  Previously,
  it pointed to the start of the block (i.e. the same as bd->start).
  I hope this doesn't have any other consequences; it looks more
  correct this way in any case.

21 years ago[project @ 2003-01-23 11:22:50 by simonmar]
simonmar [Thu, 23 Jan 2003 11:22:50 +0000 (11:22 +0000)]
[project @ 2003-01-23 11:22:50 by simonmar]
A nullary constructor in an argument position should refer to the
constructor worker, not the wrapper.  In most cases they're the same,
but when using -funbox-strict-fields (or maybe a context on a data
type?) they can be different, leading to a crash.

MERGE TO STABLE

21 years ago[project @ 2003-01-20 16:24:51 by simonpj]
simonpj [Mon, 20 Jan 2003 16:24:51 +0000 (16:24 +0000)]
[project @ 2003-01-20 16:24:51 by simonpj]
Increase the size of a string literal; cures a simplifier loop
    when an application (f "x") appeared to have size 1, and so was
    inlined repeatedly.  The problem was that "x" appeared to have
    size 0.

21 years ago[project @ 2003-01-19 18:41:19 by wolfgang]
wolfgang [Sun, 19 Jan 2003 18:41:19 +0000 (18:41 +0000)]
[project @ 2003-01-19 18:41:19 by wolfgang]
Fix two really bad typos in the Mac OS X specific code

MERGE TO STABLE

21 years ago[project @ 2003-01-17 17:01:13 by stolz]
stolz [Fri, 17 Jan 2003 17:01:14 +0000 (17:01 +0000)]
[project @ 2003-01-17 17:01:13 by stolz]
- Add sendfile-API for pumping out data via sendfile(2)
  Currently supported are Linux (tested) & FreeBSD (not tested yet), others
  will throw a runtime error until I get around to implement a fallback.

21 years ago[project @ 2003-01-17 16:22:09 by sof]
sof [Fri, 17 Jan 2003 16:22:09 +0000 (16:22 +0000)]
[project @ 2003-01-17 16:22:09 by sof]
mingw: use cp's -u flag when copying over hi-boot files (or not, as the case might be now.)

21 years ago[project @ 2003-01-17 16:05:09 by sof]
sof [Fri, 17 Jan 2003 16:05:10 +0000 (16:05 +0000)]
[project @ 2003-01-17 16:05:09 by sof]
for mingw builds, redirect to NUL

21 years ago[project @ 2003-01-14 14:58:42 by simonmar]
simonmar [Tue, 14 Jan 2003 14:58:42 +0000 (14:58 +0000)]
[project @ 2003-01-14 14:58:42 by simonmar]
Set $(way_) and $(_way) in here, so they are available as soon as possible.

21 years ago[project @ 2003-01-14 13:43:11 by simonmar]
simonmar [Tue, 14 Jan 2003 13:43:11 +0000 (13:43 +0000)]
[project @ 2003-01-14 13:43:11 by simonmar]
Fix to previous commit

21 years ago[project @ 2003-01-14 13:17:43 by simonmar]
simonmar [Tue, 14 Jan 2003 13:17:43 +0000 (13:17 +0000)]
[project @ 2003-01-14 13:17:43 by simonmar]
Clean up properly after generating Haddock docs.

21 years ago[project @ 2003-01-13 17:01:22 by simonpj]
simonpj [Mon, 13 Jan 2003 17:01:29 +0000 (17:01 +0000)]
[project @ 2003-01-13 17:01:22 by simonpj]
------------------------------------
(a) Improve reporting of staging errors
(b) Tidy up the construction of dict funs
and default methods
------------------------------------

21 years ago[project @ 2003-01-13 14:12:31 by simonpj]
simonpj [Mon, 13 Jan 2003 14:12:31 +0000 (14:12 +0000)]
[project @ 2003-01-13 14:12:31 by simonpj]
Bale out earlier if main is not in scope (fixes several test failures)

21 years ago[project @ 2003-01-13 14:02:07 by simonmar]
simonmar [Mon, 13 Jan 2003 14:02:08 +0000 (14:02 +0000)]
[project @ 2003-01-13 14:02:07 by simonmar]
The hook NoRunnableThreads() is not used; kill it.

21 years ago[project @ 2003-01-13 13:39:34 by simonpj]
simonpj [Mon, 13 Jan 2003 13:39:34 +0000 (13:39 +0000)]
[project @ 2003-01-13 13:39:34 by simonpj]
wibble

21 years ago[project @ 2003-01-13 13:22:58 by simonpj]
simonpj [Mon, 13 Jan 2003 13:22:58 +0000 (13:22 +0000)]
[project @ 2003-01-13 13:22:58 by simonpj]
Comment

21 years ago[project @ 2003-01-13 13:20:37 by simonpj]
simonpj [Mon, 13 Jan 2003 13:20:38 +0000 (13:20 +0000)]
[project @ 2003-01-13 13:20:37 by simonpj]
--------------------------------
Don't export the inlining for a foreign
import that has a #include directive
--------------------------------

Reason for this change: if the inlining is imported into another
module, the latter may not have the right #include directives.

Also add notes to the documentation to explain the issues.

21 years ago[project @ 2003-01-13 13:19:25 by simonpj]
simonpj [Mon, 13 Jan 2003 13:19:25 +0000 (13:19 +0000)]
[project @ 2003-01-13 13:19:25 by simonpj]
------------------------------------
Type signature for derived con2tag
------------------------------------

MERGE TO STABLE

The derived con2tag didn't have a type signature, so we got

con2tagFoo :: a -> Int#
con2tagFoo = \x -> getTag x

The getTag generates a case expression, so we get a polymorphic
case.  The polymorphic case simply does not work in *interpreted*
GHC 5.02.3 and as a result neither does con2tag.  Alas.

This commit fixes the problem, by giving a type signature for
con2TagFoo.  But note that getTag in interpreted GHC 5.02 will continue
to fail if used in a polymorphic context.  This problem does not arise
in the HEAD (eval/apply) so I'm going to leave it as a wont-fix bug.

21 years ago[project @ 2003-01-13 13:10:19 by simonpj]
simonpj [Mon, 13 Jan 2003 13:10:24 +0000 (13:10 +0000)]
[project @ 2003-01-13 13:10:19 by simonpj]
Import trimming

21 years ago[project @ 2003-01-10 22:08:20 by wolfgang]
wolfgang [Fri, 10 Jan 2003 22:08:20 +0000 (22:08 +0000)]
[project @ 2003-01-10 22:08:20 by wolfgang]
blockUserSignal() should use SIG_BLOCK instead of SIG_SETMASK, otherwise it
would also sometimes unblock signals that should be blocked.

MERGE TO STABLE

21 years ago[project @ 2003-01-10 16:33:49 by simonmar]
simonmar [Fri, 10 Jan 2003 16:33:50 +0000 (16:33 +0000)]
[project @ 2003-01-10 16:33:49 by simonmar]
Changes to the way stack checks are handled in GHCi, to fix a rare bug
when a stack check fails in a BCO.

We now aggregate all stack use from case alternatives up to the
enclosing function/thunk BCO, and do a single stack check at the
beginning of that BCO.  This simplifies the stack check failure code,
because it doesn't have to cope with the case when a case alternative
needs to restart.

We still employ the trick of doing a fixed stack check before every
BCO, only inserting an actual stack check instruction in the BCO if it
needs more stack than this fixed amount.  The fixed stack check is now
only done before running a function/thunk BCO.

21 years ago[project @ 2003-01-10 16:10:00 by simonpj]
simonpj [Fri, 10 Jan 2003 16:10:00 +0000 (16:10 +0000)]
[project @ 2003-01-10 16:10:00 by simonpj]
Add notes on real-time profiling from Jan-Willhem

21 years ago[project @ 2003-01-10 15:00:22 by simonmar]
simonmar [Fri, 10 Jan 2003 15:00:22 +0000 (15:00 +0000)]
[project @ 2003-01-10 15:00:22 by simonmar]
Fix GHCi breakage on the HEAD: my recent fixes to the BCO cases in
GenApply weren't quite correct.

21 years ago[project @ 2003-01-10 14:20:41 by simonpj]
simonpj [Fri, 10 Jan 2003 14:20:41 +0000 (14:20 +0000)]
[project @ 2003-01-10 14:20:41 by simonpj]
Export main from Main (only matters for ghci) [missed file]

21 years ago[project @ 2003-01-10 14:20:01 by simonpj]
simonpj [Fri, 10 Jan 2003 14:20:01 +0000 (14:20 +0000)]
[project @ 2003-01-10 14:20:01 by simonpj]
Export main from Main (only matters for ghci)

21 years ago[project @ 2003-01-10 10:55:24 by simonmar]
simonmar [Fri, 10 Jan 2003 10:55:24 +0000 (10:55 +0000)]
[project @ 2003-01-10 10:55:24 by simonmar]
Only add -package readline if $(GhcLibsWithReadline) == YES

This isn't really the correct solution, since we actually want to know
whether the bootstrapping compiler has readline, not this one, but
since the most common bootstrapping compiler is going to be the stage1
compiler in this tree it's a good guess that GhcLibsWithReadline is
correct.

21 years ago[project @ 2003-01-09 16:15:51 by simonpj]
simonpj [Thu, 9 Jan 2003 16:15:52 +0000 (16:15 +0000)]
[project @ 2003-01-09 16:15:51 by simonpj]
--------------------------
Fix export-calculation bug
--------------------------

Ross points out that in
  module M where
  import List as M
  sort = "foo"

there is no conflict in the export list. GHC used to treat this
like

module M( module M ) where ...

which is wrong, wrong, wrong.

Now fixed.   Test in modules/mod200.hs

Some other small tidying up (notably in GRE.gre_parent).

21 years ago[project @ 2003-01-09 16:15:30 by simonpj]
simonpj [Thu, 9 Jan 2003 16:15:30 +0000 (16:15 +0000)]
[project @ 2003-01-09 16:15:30 by simonpj]
Layout wibble

21 years ago[project @ 2003-01-09 16:11:03 by simonpj]
simonpj [Thu, 9 Jan 2003 16:11:03 +0000 (16:11 +0000)]
[project @ 2003-01-09 16:11:03 by simonpj]
Wibble

21 years ago[project @ 2003-01-09 15:49:25 by simonmar]
simonmar [Thu, 9 Jan 2003 15:49:25 +0000 (15:49 +0000)]
[project @ 2003-01-09 15:49:25 by simonmar]
small fix:  'if ($x)' is not the same as 'if ($x ne "")'