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

21 years ago[project @ 2002-12-12 03:19:12 by mthomas]
mthomas [Thu, 12 Dec 2002 03:19:12 +0000 (03:19 +0000)]
[project @ 2002-12-12 03:19:12 by mthomas]
Towards a complete binary package.

21 years ago[project @ 2002-12-12 03:15:41 by mthomas]
mthomas [Thu, 12 Dec 2002 03:15:41 +0000 (03:15 +0000)]
[project @ 2002-12-12 03:15:41 by mthomas]
Towards a MinGW32 binary distribution with all accessories + compiler.

21 years ago[project @ 2002-12-11 17:09:08 by simonpj]
simonpj [Wed, 11 Dec 2002 17:09:08 +0000 (17:09 +0000)]
[project @ 2002-12-11 17:09:08 by simonpj]
Back out the function tycon kind change (big comment to explain why)

21 years ago[project @ 2002-12-11 16:55:04 by simonpj]
simonpj [Wed, 11 Dec 2002 16:55:06 +0000 (16:55 +0000)]
[project @ 2002-12-11 16:55:04 by simonpj]
Tidy up info table generation

21 years ago[project @ 2002-12-11 16:37:44 by simonmar]
simonmar [Wed, 11 Dec 2002 16:37:44 +0000 (16:37 +0000)]
[project @ 2002-12-11 16:37:44 by simonmar]
Remove tests for text/data boundary symbols.

21 years ago[project @ 2002-12-11 16:37:16 by simonmar]
simonmar [Wed, 11 Dec 2002 16:37:17 +0000 (16:37 +0000)]
[project @ 2002-12-11 16:37:16 by simonmar]
Remove tests for text/data section boundary symbols.

21 years ago[project @ 2002-12-11 15:36:20 by simonmar]
simonmar [Wed, 11 Dec 2002 15:36:58 +0000 (15:36 +0000)]
[project @ 2002-12-11 15:36:20 by simonmar]
Merge the eval-apply-branch on to the HEAD
------------------------------------------

This is a change to GHC's evaluation model in order to ultimately make
GHC more portable and to reduce complexity in some areas.

At some point we'll update the commentary to describe the new state of
the RTS.  Pending that, the highlights of this change are:

  - No more Su.  The Su register is gone, update frames are one
    word smaller.

  - Slow-entry points and arg checks are gone.  Unknown function calls
    are handled by automatically-generated RTS entry points (AutoApply.hc,
    generated by the program in utils/genapply).

  - The stack layout is stricter: there are no "pending arguments" on
    the stack any more, the stack is always strictly a sequence of
    stack frames.

    This means that there's no need for LOOKS_LIKE_GHC_INFO() or
    LOOKS_LIKE_STATIC_CLOSURE() any more, and GHC doesn't need to know
    how to find the boundary between the text and data segments (BIG WIN!).

  - A couple of nasty hacks in the mangler caused by the neet to
    identify closure ptrs vs. info tables have gone away.

  - Info tables are a bit more complicated.  See InfoTables.h for the
    details.

  - As a side effect, GHCi can now deal with polymorphic seq.  Some bugs
    in GHCi which affected primitives and unboxed tuples are now
    fixed.

  - Binary sizes are reduced by about 7% on x86.  Performance is roughly
    similar, some programs get faster while some get slower.  I've seen
    GHCi perform worse on some examples, but haven't investigated
    further yet (GHCi performance *should* be about the same or better
    in theory).

  - Internally the code generator is rather better organised.  I've moved
    info-table generation from the NCG into the main codeGen where it is
    shared with the C back-end; info tables are now emitted as arrays
    of words in both back-ends.  The NCG is one step closer to being able
    to support profiling.

This has all been fairly thoroughly tested, but no doubt I've messed
up the commit in some way.

21 years ago[project @ 2002-12-11 14:02:28 by igloo]
igloo [Wed, 11 Dec 2002 14:02:28 +0000 (14:02 +0000)]
[project @ 2002-12-11 14:02:28 by igloo]
Handle bindings to just a pattern variable in cvtd.

21 years ago[project @ 2002-12-11 14:01:22 by simonmar]
simonmar [Wed, 11 Dec 2002 14:01:23 +0000 (14:01 +0000)]
[project @ 2002-12-11 14:01:22 by simonmar]
Update config.guess and config.sub from GNU; a bug was reported in the
previous versions.

21 years ago[project @ 2002-12-11 12:35:57 by igloo]
igloo [Wed, 11 Dec 2002 12:35:58 +0000 (12:35 +0000)]
[project @ 2002-12-11 12:35:57 by igloo]
Improved foreign import conversion.

21 years ago[project @ 2002-12-11 12:04:05 by simonpj]
simonpj [Wed, 11 Dec 2002 12:04:05 +0000 (12:04 +0000)]
[project @ 2002-12-11 12:04:05 by simonpj]
wibbles to External Core

21 years ago[project @ 2002-12-11 12:02:15 by simonpj]
simonpj [Wed, 11 Dec 2002 12:02:15 +0000 (12:02 +0000)]
[project @ 2002-12-11 12:02:15 by simonpj]
Behave decently if there are NoStubs in ForeignStubs

21 years ago[project @ 2002-12-11 12:01:20 by simonpj]
simonpj [Wed, 11 Dec 2002 12:01:20 +0000 (12:01 +0000)]
[project @ 2002-12-11 12:01:20 by simonpj]
Change interface to mkIfaceOrig

21 years ago[project @ 2002-12-11 12:00:50 by simonpj]
simonpj [Wed, 11 Dec 2002 12:00:50 +0000 (12:00 +0000)]
[project @ 2002-12-11 12:00:50 by simonpj]
Better comparision for Exact RdrNames

21 years ago[project @ 2002-12-11 11:59:59 by simonpj]
simonpj [Wed, 11 Dec 2002 11:59:59 +0000 (11:59 +0000)]
[project @ 2002-12-11 11:59:59 by simonpj]
Original names can occur in binding positions in External Core

21 years ago[project @ 2002-12-11 11:59:26 by simonpj]
simonpj [Wed, 11 Dec 2002 11:59:26 +0000 (11:59 +0000)]
[project @ 2002-12-11 11:59:26 by simonpj]
Give -> the correct kind!

21 years ago[project @ 2002-12-10 21:25:07 by igloo]
igloo [Tue, 10 Dec 2002 21:25:08 +0000 (21:25 +0000)]
[project @ 2002-12-10 21:25:07 by igloo]
Use real datatypes for TH Clause and Match

21 years ago[project @ 2002-12-10 17:34:34 by simonpj]
simonpj [Tue, 10 Dec 2002 17:34:35 +0000 (17:34 +0000)]
[project @ 2002-12-10 17:34:34 by simonpj]
Check for qualified names in binding positions in the parser instead
of the rename.  In External Core it's OK to have qualified names in
these places.

21 years ago[project @ 2002-12-10 17:34:14 by simonpj]
simonpj [Tue, 10 Dec 2002 17:34:14 +0000 (17:34 +0000)]
[project @ 2002-12-10 17:34:14 by simonpj]
Parse Word literals

21 years ago[project @ 2002-12-10 17:31:59 by simonpj]
simonpj [Tue, 10 Dec 2002 17:31:59 +0000 (17:31 +0000)]
[project @ 2002-12-10 17:31:59 by simonpj]
Remove checkGHCI

21 years ago[project @ 2002-12-10 16:28:48 by igloo]
igloo [Tue, 10 Dec 2002 16:28:48 +0000 (16:28 +0000)]
[project @ 2002-12-10 16:28:48 by igloo]
Use layout inside declarations quasi-quotes [d| ... |]

21 years ago[project @ 2002-12-10 15:42:19 by simonpj]
simonpj [Tue, 10 Dec 2002 15:42:19 +0000 (15:42 +0000)]
[project @ 2002-12-10 15:42:19 by simonpj]
Wibble