ghc-hetmet.git
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 "")'

21 years ago[project @ 2003-01-09 15:42:27 by simonpj]
simonpj [Thu, 9 Jan 2003 15:42:27 +0000 (15:42 +0000)]
[project @ 2003-01-09 15:42:27 by simonpj]
---------------------------------------
Improvements to the byte-code generator
---------------------------------------

1. The schemeR call in coreExprToBCOs was bogusly passing a bunch of free
   variables, when the set should always be empty. As a result, compiling
   an expression with an unbound free variable (e.g. 'x + 1', where 'x' is
   entirely unbound) succeeded, expecting 'x' to be passed on the stack,
   which of course it won't be.

   This bug only shows up if an earlier stage of the compiler goes wrong,
   but fixing turns a seg-fault into a more graceful failure.

2. Make schemeE allocate non-recursive constructors directly.

3. Lots of general tidying up.  Result is 50 lines shorter than before.

21 years ago[project @ 2003-01-09 15:41:50 by simonpj]
simonpj [Thu, 9 Jan 2003 15:41:50 +0000 (15:41 +0000)]
[project @ 2003-01-09 15:41:50 by simonpj]
Comments only

21 years ago[project @ 2003-01-09 15:35:31 by simonpj]
simonpj [Thu, 9 Jan 2003 15:35:31 +0000 (15:35 +0000)]
[project @ 2003-01-09 15:35:31 by simonpj]
Catch a staging error that slipped through before

21 years ago[project @ 2003-01-09 12:01:45 by simonmar]
simonmar [Thu, 9 Jan 2003 12:01:45 +0000 (12:01 +0000)]
[project @ 2003-01-09 12:01:45 by simonmar]
Fix the stage2 build even more.

21 years ago[project @ 2003-01-09 11:39:20 by simonmar]
simonmar [Thu, 9 Jan 2003 11:39:20 +0000 (11:39 +0000)]
[project @ 2003-01-09 11:39:20 by simonmar]
Add missing -pgmL switch.

MERGE TO STABLE

21 years ago[project @ 2003-01-09 11:22:19 by simonmar]
simonmar [Thu, 9 Jan 2003 11:22:19 +0000 (11:22 +0000)]
[project @ 2003-01-09 11:22:19 by simonmar]
Fix the stage2 build.

21 years ago[project @ 2003-01-09 10:49:21 by simonmar]
simonmar [Thu, 9 Jan 2003 10:49:22 +0000 (10:49 +0000)]
[project @ 2003-01-09 10:49:21 by simonmar]
Further refine the criteria for deciding whether command line
arguments should be passed to the compilation manager or the linker.
See comments in the file.

MERGE TO STABLE

21 years ago[project @ 2003-01-08 15:47:54 by simonmar]
simonmar [Wed, 8 Jan 2003 15:47:54 +0000 (15:47 +0000)]
[project @ 2003-01-08 15:47:54 by simonmar]
Improve the missing module message in the compilation manager, too.

21 years ago[project @ 2003-01-08 15:28:04 by simonmar]
simonmar [Wed, 8 Jan 2003 15:28:05 +0000 (15:28 +0000)]
[project @ 2003-01-08 15:28:04 by simonmar]
Improve missing-module error messages.  eg.

hello2.hs:1:
    Failed to load interface for `Foo':
        Could not find interface file for `Foo'
        (use -v to see a list of the files searched for)

and if we add the -v flag:

hello2.hs:1:
    Failed to load interface for `Foo':
        Could not find interface file for `Foo'
        locations searched:
            Foo.hi
            Foo.hi-boot-6
            Foo.hi-boot
            /home/simonmar/builds/i386-unknown-linux/libraries/haskell-src/Foo.hi
            /home/simonmar/builds/i386-unknown-linux/libraries/haskell98/Foo.hi
            /home/simonmar/builds/i386-unknown-linux/libraries/readline/Foo.hi
            /home/simonmar/builds/i386-unknown-linux/libraries/unix/Foo.hi
            /home/simonmar/builds/i386-unknown-linux/libraries/network/Foo.hi
            /home/simonmar/builds/i386-unknown-linux/libraries/base/Foo.hi

21 years ago[project @ 2003-01-08 13:03:25 by simonmar]
simonmar [Wed, 8 Jan 2003 13:03:25 +0000 (13:03 +0000)]
[project @ 2003-01-08 13:03:25 by simonmar]
Add -mno-omit-leaf-frame-pointer if gcc supports it.

MERGE TO STABLE

21 years ago[project @ 2003-01-08 12:37:45 by simonmar]
simonmar [Wed, 8 Jan 2003 12:37:45 +0000 (12:37 +0000)]
[project @ 2003-01-08 12:37:45 by simonmar]
stg_BCO_entry needs to be extern now.

21 years ago[project @ 2003-01-08 12:03:28 by simonmar]
simonmar [Wed, 8 Jan 2003 12:03:29 +0000 (12:03 +0000)]
[project @ 2003-01-08 12:03:28 by simonmar]
- Detect whether we have a recent GCC that might need
  -mno-omit-leaf-fram-pointer.

- Add missing HAVE_SC_GETGR_R_SIZE_MAX and HAVE_SC_GETPW_R_SIZE_MAX
  templates to acconfig.h.

- Regen mk/config.h.in.

21 years ago[project @ 2003-01-08 10:10:19 by simonmar]
simonmar [Wed, 8 Jan 2003 10:10:19 +0000 (10:10 +0000)]
[project @ 2003-01-08 10:10:19 by simonmar]
Update the documentation on --make mode to indicate that multiple
sources/modules can be given on the command line, as well as multiple
object files.

MERGE TO STABLE

21 years ago[project @ 2003-01-07 16:30:37 by simonmar]
simonmar [Tue, 7 Jan 2003 16:30:37 +0000 (16:30 +0000)]
[project @ 2003-01-07 16:30:37 by simonmar]
80-columnify a comment

21 years ago[project @ 2003-01-07 14:31:19 by simonmar]
simonmar [Tue, 7 Jan 2003 14:31:20 +0000 (14:31 +0000)]
[project @ 2003-01-07 14:31:19 by simonmar]
Update comments

21 years ago[project @ 2003-01-07 14:19:25 by simonmar]
simonmar [Tue, 7 Jan 2003 14:19:25 +0000 (14:19 +0000)]
[project @ 2003-01-07 14:19:25 by simonmar]
Simplify the bitmap-generating code by collecting all the pointer
words rather than all the non-pointer words, and then subtracting
these from a bitmap made of all ones.  This is simpler because we only
have to look in the bindings, rather than combining information from
bindings and the free stack slot list.

21 years ago[project @ 2003-01-07 13:25:07 by simonmar]
simonmar [Tue, 7 Jan 2003 13:25:07 +0000 (13:25 +0000)]
[project @ 2003-01-07 13:25:07 by simonmar]
Expand bitmaps to cover the full size of the stack frame.  Previously
the bitmap would stop at the last non-zero bit, which might shorten
the bitmap by one or more words.  The behaviour used to be correct,
but with the eval/apply changes bitmaps must now cover the entire
stack frame rather than everything up to the last non-pointer word.

21 years ago[project @ 2003-01-07 09:29:24 by simonmar]
simonmar [Tue, 7 Jan 2003 09:29:24 +0000 (09:29 +0000)]
[project @ 2003-01-07 09:29:24 by simonmar]
Declare stg_BCO_entry.  (this should have been committed with rev. 1.4
of utils/genapply/GenApply.hs).

21 years ago[project @ 2003-01-06 15:30:14 by simonpj]
simonpj [Mon, 6 Jan 2003 15:30:17 +0000 (15:30 +0000)]
[project @ 2003-01-06 15:30:14 by simonpj]
--------------------------------------------------------------
Several small but tiresome things shown up by Template Haskell
--------------------------------------------------------------

1. Make the 'knot' in TcRnDriver much smaller; in fact move it to
   TcIfaceSig.tcInterfaceSigs.  Reasons
a) much tidier
b) avoids a loop in Template Haskell, when we try to run
   an expression during type checking (when the knot is
   not fully tied)

   See comments in TcIfaceSig

2. Stop typechecking if tcGroup fails.  Reason: otherwise tcLookup can
   fail in the next group.

3. Catch linking errors more gracefully when running a splice (in TcSplice)

21 years ago[project @ 2003-01-06 15:29:27 by simonpj]
simonpj [Mon, 6 Jan 2003 15:29:27 +0000 (15:29 +0000)]
[project @ 2003-01-06 15:29:27 by simonpj]
Small extra tc-trace

21 years ago[project @ 2003-01-06 15:27:11 by simonpj]
simonpj [Mon, 6 Jan 2003 15:27:11 +0000 (15:27 +0000)]
[project @ 2003-01-06 15:27:11 by simonpj]
Make HscMain.compileExpr run lint if -dcore-lint is on

21 years ago[project @ 2003-01-06 15:26:09 by simonpj]
simonpj [Mon, 6 Jan 2003 15:26:09 +0000 (15:26 +0000)]
[project @ 2003-01-06 15:26:09 by simonpj]
1.  Arrange that -ddump-tc-trace will print out the exception caught by tryTc

2.  Make forkM a bit quieter, unless -ddump-tc-trace is on.

21 years ago[project @ 2003-01-06 15:19:08 by simonpj]
simonpj [Mon, 6 Jan 2003 15:19:08 +0000 (15:19 +0000)]
[project @ 2003-01-06 15:19:08 by simonpj]
Spelling

21 years ago[project @ 2003-01-06 15:18:48 by simonpj]
simonpj [Mon, 6 Jan 2003 15:18:48 +0000 (15:18 +0000)]
[project @ 2003-01-06 15:18:48 by simonpj]
dieWith uses ProgramError, not UsageError

21 years ago[project @ 2003-01-06 15:17:57 by simonpj]
simonpj [Mon, 6 Jan 2003 15:17:57 +0000 (15:17 +0000)]
[project @ 2003-01-06 15:17:57 by simonpj]
---------------------------------------------
Try slightly more aggressive rule application
---------------------------------------------

Switch on AlwaysActive rules even in SimplGently.  This should
make some TH programs a little better, but it's not a big deal.

21 years ago[project @ 2003-01-06 15:16:33 by simonpj]
simonpj [Mon, 6 Jan 2003 15:16:39 +0000 (15:16 +0000)]
[project @ 2003-01-06 15:16:33 by simonpj]
--------------------------------
Make ModLocation have a FilePath
instead of (Maybe FilePath) for
the object-file location
--------------------------------

This generally tides things up, and makes ml_obj_file more like
ml_hi_file.

Furthermore the ml_obj_file field gets filled in even when we
initially expect just an .hi file.  This is important for Template
Haskell.

21 years ago[project @ 2003-01-06 14:40:04 by simonmar]
simonmar [Mon, 6 Jan 2003 14:40:07 +0000 (14:40 +0000)]
[project @ 2003-01-06 14:40:04 by simonmar]
Disable the version check on the .hi file for --show-iface.  This
means that it can be used on .hi files for other "ways" (eg. profiled)
without having to resort to using the undocumented -buildtag option.

21 years ago[project @ 2003-01-06 14:15:38 by simonmar]
simonmar [Mon, 6 Jan 2003 14:15:38 +0000 (14:15 +0000)]
[project @ 2003-01-06 14:15:38 by simonmar]
Add a handy hint for finding the correct fully-qualified original
names for entities in .hi-boot files.

21 years ago[project @ 2003-01-06 13:12:37 by simonmar]
simonmar [Mon, 6 Jan 2003 13:12:37 +0000 (13:12 +0000)]
[project @ 2003-01-06 13:12:37 by simonmar]
The FUN application code is wrong when entering a BCO, because the BCO
entry code assumes a stack-only calling convention.  Use the PAP entry
code instead, which also uses a stack-only convention.

21 years ago[project @ 2003-01-06 13:11:26 by simonmar]
simonmar [Mon, 6 Jan 2003 13:11:26 +0000 (13:11 +0000)]
[project @ 2003-01-06 13:11:26 by simonmar]
Prefix a double-underscore to a variable in a macro, to avoid conflicts.

21 years ago[project @ 2003-01-04 18:46:57 by wolfgang]
wolfgang [Sat, 4 Jan 2003 18:46:57 +0000 (18:46 +0000)]
[project @ 2003-01-04 18:46:57 by wolfgang]
Darwin: Replace "g" constraint by "r" in inline assembly, otherwise it won't compile without -O

21 years ago[project @ 2002-12-27 21:55:30 by panne]
panne [Fri, 27 Dec 2002 21:55:30 +0000 (21:55 +0000)]
[project @ 2002-12-27 21:55:30 by panne]
Imports cleanup

21 years ago[project @ 2002-12-27 12:33:21 by panne]
panne [Fri, 27 Dec 2002 12:33:21 +0000 (12:33 +0000)]
[project @ 2002-12-27 12:33:21 by panne]
Nuked prototype for non-existent function 'RevertCAFs'. Even if this
should be the same as ghc/rts/Storage.h's 'revertCAFs', it would still
be a strange place...

21 years ago[project @ 2002-12-27 12:20:06 by panne]
panne [Fri, 27 Dec 2002 12:20:06 +0000 (12:20 +0000)]
[project @ 2002-12-27 12:20:06 by panne]
-#include cleanup. What we really need here are additional prototypes
for 'getAllocations' and 'revertCAFs', but these are only available
via RTS headers. I'm not sure if -#including them somehow would be OK,
so I left this out. A few lines of documentation who is allowed to
#include (or -#include) what would be helpful...

21 years ago[project @ 2002-12-27 11:35:16 by panne]
panne [Fri, 27 Dec 2002 11:35:16 +0000 (11:35 +0000)]
[project @ 2002-12-27 11:35:16 by panne]
* Fixed non-Mac-OS-X-builds
* Warning police: Fixed #includes

21 years ago[project @ 2002-12-27 10:32:59 by panne]
panne [Fri, 27 Dec 2002 10:32:59 +0000 (10:32 +0000)]
[project @ 2002-12-27 10:32:59 by panne]
Warning police: #undef SymX_redirect before it gets redefined.  :-P

21 years ago[project @ 2002-12-26 17:54:51 by wolfgang]
wolfgang [Thu, 26 Dec 2002 17:54:51 +0000 (17:54 +0000)]
[project @ 2002-12-26 17:54:51 by wolfgang]
Load Mac OS X - style "frameworks" given on the command line (-framework XXX)

21 years ago[project @ 2002-12-26 17:52:34 by wolfgang]
wolfgang [Thu, 26 Dec 2002 17:52:35 +0000 (17:52 +0000)]
[project @ 2002-12-26 17:52:34 by wolfgang]
Mac OS X doesn't have the sysconfig constants _SC_GETPW_R_SIZE_MAX and _SC_GETGR_R_SIZE_MAX, so add a configure check

21 years ago[project @ 2002-12-23 11:02:15 by simonmar]
simonmar [Mon, 23 Dec 2002 11:02:15 +0000 (11:02 +0000)]
[project @ 2002-12-23 11:02:15 by simonmar]
Add the #includes from the rts package to the stub .c file.

Prior to rev. 1.42, we used to add all the #includes from all enabled
packages, together with any -#include options from the command-line.
But since this is auto-generated code and we know exactly which
#includes are required, this was overkill.

In rev. 1.42, all #includes except RtsAPI.h were removed from the stub
.c file.  This was incorrect, because the stub file refers to some
entities defined in other RTS header files (the StgStablePtr type, and
deRefStablePtr() for example).

This change adds the header files from the rts package to the stub .c
file, fixing some recent test breakages.

21 years ago[project @ 2002-12-20 16:22:19 by ross]
ross [Fri, 20 Dec 2002 16:22:19 +0000 (16:22 +0000)]
[project @ 2002-12-20 16:22:19 by ross]
Add more M4 quoting (required by autoconf 2.57)

21 years ago[project @ 2002-12-19 18:43:53 by wolfgang]
wolfgang [Thu, 19 Dec 2002 18:43:53 +0000 (18:43 +0000)]
[project @ 2002-12-19 18:43:53 by wolfgang]
Un-break for Mac OS X (handling of Apple's "frameworks")

21 years ago[project @ 2002-12-19 18:02:13 by panne]
panne [Thu, 19 Dec 2002 18:02:13 +0000 (18:02 +0000)]
[project @ 2002-12-19 18:02:13 by panne]
Warning police (labels at end of compound statements are uncool, GCC says...)

21 years ago[project @ 2002-12-19 18:00:42 by panne]
panne [Thu, 19 Dec 2002 18:00:42 +0000 (18:00 +0000)]
[project @ 2002-12-19 18:00:42 by panne]
Use a less uncool way to avoid spurious warnings

21 years ago[project @ 2002-12-19 17:57:39 by panne]
panne [Thu, 19 Dec 2002 17:57:39 +0000 (17:57 +0000)]
[project @ 2002-12-19 17:57:39 by panne]
Fixed #ifdefery for GCC >= 3.x

21 years ago[project @ 2002-12-19 15:12:01 by simonmar]
simonmar [Thu, 19 Dec 2002 15:12:02 +0000 (15:12 +0000)]
[project @ 2002-12-19 15:12:01 by simonmar]
GHCi needs to link in packages eagerly if they're specified on the
command line.

21 years ago[project @ 2002-12-19 14:33:22 by simonmar]
simonmar [Thu, 19 Dec 2002 14:33:23 +0000 (14:33 +0000)]
[project @ 2002-12-19 14:33:22 by simonmar]
Terrible hack to restore CAF handling behaviour in GHCi (it's
currently broken).

The story used to be this: in newCAF(), if the CAF is in dynamically
loaded code, then we save the CAF's info ptr in a spare slot in the
closure, and add the CAF to the caf_list.  The GC will retain
everything on the caf_list.  At any point the CAFs can all be reverted
by replacing their info pointers from the saved copies.

CAFs need to be retained for GHCi because they might be required in a
future execution; an optimisation would be to avoid retaining the CAFs
if we're in "revert mode"; i.e. the CAFs are all going to be reverted
after execution anyway.  Also, this only applies to CAFs in compiled
code; CAFs in interpreted code are currently always retained.

Anyway, the old story is harder now that I removed the code that
checks whether a pointer is dynamically loaded or not (:-)).  Rather
than re-instate that code, I created a new version of newCAF
(newDynCAF), and arranged that the dynamic linker redirects any
references to newCAF to point to newDynCAF instead.  The result is
more efficient than before, and takes less code.

21 years ago[project @ 2002-12-19 14:25:04 by simonmar]
simonmar [Thu, 19 Dec 2002 14:25:05 +0000 (14:25 +0000)]
[project @ 2002-12-19 14:25:04 by simonmar]
Include a static version of deRefStablePtr in case the code that uses
it was compiled without optimisation (and therefore doesn't get the
inlined version).

21 years ago[project @ 2002-12-19 14:23:35 by simonmar]
simonmar [Thu, 19 Dec 2002 14:23:35 +0000 (14:23 +0000)]
[project @ 2002-12-19 14:23:35 by simonmar]
comment wibble

21 years ago[project @ 2002-12-19 12:49:27 by simonmar]
simonmar [Thu, 19 Dec 2002 12:49:27 +0000 (12:49 +0000)]
[project @ 2002-12-19 12:49:27 by simonmar]
Make this compile again

21 years ago[project @ 2002-12-19 12:24:49 by simonmar]
simonmar [Thu, 19 Dec 2002 12:24:49 +0000 (12:24 +0000)]
[project @ 2002-12-19 12:24:49 by simonmar]
Freshly generated by autoheader.

21 years ago[project @ 2002-12-19 12:21:36 by simonmar]
simonmar [Thu, 19 Dec 2002 12:21:36 +0000 (12:21 +0000)]
[project @ 2002-12-19 12:21:36 by simonmar]
Using AC_CHECK_FUNCS rather than AC_CHECK_FUNC seems to allow
autoheader to pick up HAVE_LCHOWN.  Don't know why.

21 years ago[project @ 2002-12-19 12:06:41 by simonmar]
simonmar [Thu, 19 Dec 2002 12:06:41 +0000 (12:06 +0000)]
[project @ 2002-12-19 12:06:41 by simonmar]
- remove unused CODE_BEFORE_DATA
- remove duplicate symbols
- kill extra whitespace
- add missing HAVE_FRAMEWORK_HASKELLSUPPORT and HAVE_IN_ADDR_T

21 years ago[project @ 2002-12-19 11:28:58 by simonmar]
simonmar [Thu, 19 Dec 2002 11:28:58 +0000 (11:28 +0000)]
[project @ 2002-12-19 11:28:58 by simonmar]
Avoid using a variable for the first argument of AC_DEFINE_UNQUOTED,
because autoheader doesn't like it.

21 years ago[project @ 2002-12-19 09:37:32 by simonmar]
simonmar [Thu, 19 Dec 2002 09:37:32 +0000 (09:37 +0000)]
[project @ 2002-12-19 09:37:32 by simonmar]
oops, thought I compiled this before committing.  Oh well.

21 years ago[project @ 2002-12-18 17:45:30 by igloo]
igloo [Wed, 18 Dec 2002 17:45:30 +0000 (17:45 +0000)]
[project @ 2002-12-18 17:45:30 by igloo]
Context predicates start with a tcon name, not a type variable

21 years ago[project @ 2002-12-18 17:28:17 by igloo]
igloo [Wed, 18 Dec 2002 17:28:17 +0000 (17:28 +0000)]
[project @ 2002-12-18 17:28:17 by igloo]
Convert Tup [e] and Pat [p] and e, p respectively.

21 years ago[project @ 2002-12-18 16:29:25 by simonmar]
simonmar [Wed, 18 Dec 2002 16:29:34 +0000 (16:29 +0000)]
[project @ 2002-12-18 16:29:25 by simonmar]
"Auto" packages.

The big change here is that it is no longer necessary to explicitly
say '-package X' on the command line if X is a package containing
hierarchical Haskell modules.  All packages marked "auto" contribute
to the import path, so their modules are always available.  At link
time, the compiler knows which packages are actually used by the
program, and it links in only those libraries needed.

There's one exception: one-shot linking.  If you link a program using

    ghc -o prog A.o B.o ...

then you need to explicitly add -package flags for each package
required (except base & haskell98) because the compiler has no
information about the package dependencies in this case.

Package configs have a new field: auto, which is either True or False.
Non-auto packages must be mentioned on the command-line as usual.
Non-auto packages are still required for:

  - non-hierarchical libraries (to avoid polluting the module namespace)

  - packages with no Haskell content

  - if you want more than one version of a package, or packages
    providing overlapping functionality where the user must decide
    which one to use.

Doc changes to follow...

21 years ago[project @ 2002-12-18 16:15:43 by simonmar]
simonmar [Wed, 18 Dec 2002 16:15:43 +0000 (16:15 +0000)]
[project @ 2002-12-18 16:15:43 by simonmar]
Comment fix.

21 years ago[project @ 2002-12-18 11:17:15 by simonmar]
simonmar [Wed, 18 Dec 2002 11:17:16 +0000 (11:17 +0000)]
[project @ 2002-12-18 11:17:15 by simonmar]
Correctly describe the stack during a GHCi CCALL instruction to the
RTS.  The previous hack, temporarily truncating the stack to the
topmost valid stack frame, didn't work because stack-squeezing tends
to move the stack around before the call.

The right thing to do is correctly describe the chunk of ccall args
with an info table, which is what this change does.  We use a RET_DYN
info table with the number of non-ptrs from the CCALL instruction.

21 years ago[project @ 2002-12-18 01:13:37 by mthomas]
mthomas [Wed, 18 Dec 2002 01:13:37 +0000 (01:13 +0000)]
[project @ 2002-12-18 01:13:37 by mthomas]
Do a George Bush on unused macro arg irritating rich western programmer.

21 years ago[project @ 2002-12-17 13:56:00 by simonmar]
simonmar [Tue, 17 Dec 2002 13:56:01 +0000 (13:56 +0000)]
[project @ 2002-12-17 13:56:00 by simonmar]
Document -no-link.

21 years ago[project @ 2002-12-17 13:50:28 by simonmar]
simonmar [Tue, 17 Dec 2002 13:50:29 +0000 (13:50 +0000)]
[project @ 2002-12-17 13:50:28 by simonmar]
- add -no-link flag (omits link step, except in GHCi)
- tidy up some informmational messages

21 years ago[project @ 2002-12-17 12:29:48 by simonmar]
simonmar [Tue, 17 Dec 2002 12:29:48 +0000 (12:29 +0000)]
[project @ 2002-12-17 12:29:48 by simonmar]
On second thoughts, use memcmp instead.

21 years ago[project @ 2002-12-17 12:27:30 by simonmar]
simonmar [Tue, 17 Dec 2002 12:27:30 +0000 (12:27 +0000)]
[project @ 2002-12-17 12:27:30 by simonmar]
Oops, cmpFS uses strcmp() to compare strings, so it has a '\0'
terminator requirement.  Fix it to use strncmp() instead.

21 years ago[project @ 2002-12-17 11:39:41 by simonmar]
simonmar [Tue, 17 Dec 2002 11:39:42 +0000 (11:39 +0000)]
[project @ 2002-12-17 11:39:41 by simonmar]
Fix recent breakage on the HEAD.  This was caused by the fix to
Lex.lhs to treat primitive strings as "narrow" FastStrings in all
cases, rather than Unicode ("wide") FastStrings if the string
contained a '\0'.  The problem is that narrow FastStrings aren't set
up to handle strings containing '\0'.  They used to be, but it got
broken somewhere along the line.

This commit:

 - remove the '\0' test from unpackCStringBA (it takes a length
   argument anyway), and rename it to unpackNBytesBA.  This fixes
   the bug.

 - remove the '\0' terminator from all strings generated by the
   functions in PrimPacked.  The terminators aren't required,
   as far as I can tell.  This should have a tiny but positive
   effect on compile times.

MERGE TO STABLE

21 years ago[project @ 2002-12-13 19:17:02 by wolfgang]
wolfgang [Fri, 13 Dec 2002 19:17:02 +0000 (19:17 +0000)]
[project @ 2002-12-13 19:17:02 by wolfgang]
Remove Mac OS X-specific code for determining memory layout (no longer needed).

21 years ago[project @ 2002-12-13 19:14:58 by wolfgang]
wolfgang [Fri, 13 Dec 2002 19:14:58 +0000 (19:14 +0000)]
[project @ 2002-12-13 19:14:58 by wolfgang]
Add missing 'const's

21 years ago[project @ 2002-12-13 16:04:56 by simonmar]
simonmar [Fri, 13 Dec 2002 16:04:56 +0000 (16:04 +0000)]
[project @ 2002-12-13 16:04:56 by simonmar]
When lexing a primitive string, always make a "narrow" FastString.
Otherwise when the string contains zeros we get a Unicode string,
which luckily turns into the right thing when compiled but confuses the
byte-code generator.

So this fixes the symptom (byte-code generator can't load files
generated with happy -ag), but not the real bug (byte-code generator
can't handle unicode strings).

21 years ago[project @ 2002-12-13 15:16:29 by simonmar]
simonmar [Fri, 13 Dec 2002 15:16:29 +0000 (15:16 +0000)]
[project @ 2002-12-13 15:16:29 by simonmar]
Shortcut when switching evaluators: instead of going round the normal
scheduler loop, just cut to the chase and run the thread using the
other evaluator.

This avoids doing stack squeezing each time we switch evaluators,
which is an O(n) operation these days, whereas it used to be O(n) the
first time, and O(1) thereafter if the stack hadn't changed too much.
This is a problem that we should perhaps address separately, but for
now the workaround should provide a speed boost to GHCi on the HEAD.

21 years ago[project @ 2002-12-13 14:43:06 by simonmar]
simonmar [Fri, 13 Dec 2002 14:43:06 +0000 (14:43 +0000)]
[project @ 2002-12-13 14:43:06 by simonmar]
Fix bug in stack_frame_sizeW

21 years ago[project @ 2002-12-12 17:36:16 by simonmar]
simonmar [Thu, 12 Dec 2002 17:36:19 +0000 (17:36 +0000)]
[project @ 2002-12-12 17:36:16 by simonmar]
A modification to the way we build link lines.

Currently the link line is constructed like this, for packages p1, p2 etc.:

  libraries p1 ++ extra_libs p1 ++
  libraries p2 ++ extra_libs p2 ++
  ...
  extra_ld_opts p1 ++
  extra_ld_opts p2 ++
  ..

This change makes it follow this pattern:

  libraries p1 ++ extra_libs p1 ++ extra_ld_opts p1 ++
  libraries p2 ++ extra_libs p2 ++ extra_ld_opts p2 ++
  ...

which seems more useful: in particular it means that using foo-config
(eg. gtk-config) to populate extra_ld_opts should now work properly,
and extra_libs is no longer strictly speaking needed (you can just use
-l options in extra_ld_opts and get the same effect).

Also:

  - There's now no difference between -l<lib> and -optl-l<lib>
  - GHCi grabs libs from extra_ld_opts as well as extra_libs

21 years ago[project @ 2002-12-12 16:35:14 by simonmar]
simonmar [Thu, 12 Dec 2002 16:35:14 +0000 (16:35 +0000)]
[project @ 2002-12-12 16:35:14 by simonmar]
Fix to build with 4.08.x

21 years ago[project @ 2002-12-12 15:17:52 by simonmar]
simonmar [Thu, 12 Dec 2002 15:17:53 +0000 (15:17 +0000)]
[project @ 2002-12-12 15:17:52 by simonmar]
Fix some issues with hschooks.c, and hopefully clear up (or at least
document) the mess regarding which versions of Rts.h and RtsFlags.h
are included.

21 years ago[project @ 2002-12-12 15:03:42 by simonmar]
simonmar [Thu, 12 Dec 2002 15:03:43 +0000 (15:03 +0000)]
[project @ 2002-12-12 15:03:42 by simonmar]
Sigh, I thought I could keep this file private to the RTS, but sadly
it's needed in order to #include RtsFlags.h, and we advertise
RtsFlags.h as a way to tweak flags through defaultsHook().  Oh well.

21 years ago[project @ 2002-12-12 14:35:57 by simonmar]
simonmar [Thu, 12 Dec 2002 14:35:57 +0000 (14:35 +0000)]
[project @ 2002-12-12 14:35:57 by simonmar]
- Don't use non-portable autoconfery (this configure script was broken
  with newer autoconfs)

- Use FPTOOLS_SHEBANG_PERL from aclocal.m4 rather than local copy.

21 years ago[project @ 2002-12-12 13:28:35 by simonmar]
simonmar [Thu, 12 Dec 2002 13:28:35 +0000 (13:28 +0000)]
[project @ 2002-12-12 13:28:35 by simonmar]
Also install <package>.haddock when we install the docs.

21 years ago[project @ 2002-12-12 13:21:46 by ross]
ross [Thu, 12 Dec 2002 13:21:47 +0000 (13:21 +0000)]
[project @ 2002-12-12 13:21:46 by ross]
Use ioError instead of throw for IOErrors, in anticipation of
a change from IOError = Exception to IOError = IOException.

21 years ago[project @ 2002-12-12 11:53:11 by simonmar]
simonmar [Thu, 12 Dec 2002 11:53:11 +0000 (11:53 +0000)]
[project @ 2002-12-12 11:53:11 by simonmar]
Make the new info-table construction code word without instance Bits
Int (i.e. GHC 4.08.x).  This probably makes it more correct, too.