ghc-hetmet.git
19 years ago[project @ 2005-01-18 11:31:03 by simonmar]
simonmar [Tue, 18 Jan 2005 11:31:03 +0000 (11:31 +0000)]
[project @ 2005-01-18 11:31:03 by simonmar]
Try again: Complain if --enable-src-tree-{happy,alex,haddock} is
given, but the relevant sources don't exist.

19 years ago[project @ 2005-01-18 11:30:17 by simonmar]
simonmar [Tue, 18 Jan 2005 11:30:17 +0000 (11:30 +0000)]
[project @ 2005-01-18 11:30:17 by simonmar]
Revert previous, used wrong version of aclocal.m4

19 years ago[project @ 2005-01-18 11:15:53 by simonmar]
simonmar [Tue, 18 Jan 2005 11:15:53 +0000 (11:15 +0000)]
[project @ 2005-01-18 11:15:53 by simonmar]
Complain if --enable-src-tree-{happy,alex,haddock} is given, but the
relevant sources don't exist.

19 years ago[project @ 2005-01-17 16:46:58 by simonmar]
simonmar [Mon, 17 Jan 2005 16:46:58 +0000 (16:46 +0000)]
[project @ 2005-01-17 16:46:58 by simonmar]
sparc-.*linux: slight modification to rev. 1.107, the whitespace
before .section should be \s+, not \t.  Fixes problems with even more
recent gcc versions on sparc64.

19 years ago[project @ 2005-01-17 12:01:13 by simonmar]
simonmar [Mon, 17 Jan 2005 12:01:13 +0000 (12:01 +0000)]
[project @ 2005-01-17 12:01:13 by simonmar]
Fix a bug in the register clobbering logic noticed by Wolfgang Thaller.

19 years ago[project @ 2005-01-16 05:31:39 by wolfgang]
wolfgang [Sun, 16 Jan 2005 05:31:45 +0000 (05:31 +0000)]
[project @ 2005-01-16 05:31:39 by wolfgang]
A first stab at position independent code generation for i386-linux.
It doesn't work yet, but it shouldn't break anything.

What we need now is one or both of the following:
a) A volunteer to implement PIC for x86 -fvia-C
    (I definitely refuse to touch any piece of code that contains
     both Perl and x86 assembly).
b) A volunteer to improve the NCG to the point where it can compile
   the RTS (so we won't need point a).

19 years ago[project @ 2005-01-16 02:50:16 by wolfgang]
wolfgang [Sun, 16 Jan 2005 02:50:16 +0000 (02:50 +0000)]
[project @ 2005-01-16 02:50:16 by wolfgang]
pprExpr: add cases for CmmPicBaseReg and CmmRegOff
so that we can do -fPIC -ddump-opt-cmm

19 years ago[project @ 2005-01-14 22:47:29 by wolfgang]
wolfgang [Fri, 14 Jan 2005 22:47:29 +0000 (22:47 +0000)]
[project @ 2005-01-14 22:47:29 by wolfgang]
Fix a typo in the previous commit.

19 years ago[project @ 2005-01-14 22:12:54 by wolfgang]
wolfgang [Fri, 14 Jan 2005 22:12:55 +0000 (22:12 +0000)]
[project @ 2005-01-14 22:12:54 by wolfgang]
When -dynamic is specified but -fPIC is not, generate code that works around
the ELF dynamic linker's misguided attempts to keep the main program unaware
of dynamic linking.

This involves generating indirect references and computed jumps for position
dependent code, too, and making all constant data sections writable in order
to persuade ld to not use "COPY" relocations.

Tested on powerpc-linux; in theory, it also applies to i386-linux, but other
parts of the PIC story are missing there.

Note that the writable-const-data hack could be improved a bit by
distinguishing between "really" constant data and "relocatable" constant data,
which would be a nice thing to do anyway.

19 years ago[project @ 2005-01-14 17:57:41 by simonmar]
simonmar [Fri, 14 Jan 2005 17:57:55 +0000 (17:57 +0000)]
[project @ 2005-01-14 17:57:41 by simonmar]
HEADS UP!  You now need to use an up to date Happy from CVS to build
GHC.  Happy version 1.15 will be released shortly.

Replace the slow hacked up String-based GetImports with one based on
the real Haskell parser.  This requires a new addition to Happy to
support parsing partial files.  We now avoid reading each source file
off the disk twice: once to get its module name and imports, and again
to parse it.  Instead we just slurp it once, and cache the StringBuffer.

This should result in improved startup times for ghc --make,
especially when there are lots of source files.

19 years ago[project @ 2005-01-14 16:00:55 by simonmar]
simonmar [Fri, 14 Jan 2005 16:00:55 +0000 (16:00 +0000)]
[project @ 2005-01-14 16:00:55 by simonmar]
Add mk/fptools.css to $(SRC_DIST_FILES)

19 years ago[project @ 2005-01-14 11:46:24 by simonmar]
simonmar [Fri, 14 Jan 2005 11:46:24 +0000 (11:46 +0000)]
[project @ 2005-01-14 11:46:24 by simonmar]
hGetStringBuffer: hClose the file after we've read it (duh).  This
causes a real problem on Windows, where the file remains locked in
GHCi, and cannot be modified until after the finalizer has closed it
(bug #1047408).

19 years ago[project @ 2005-01-14 11:34:44 by simonmar]
simonmar [Fri, 14 Jan 2005 11:34:44 +0000 (11:34 +0000)]
[project @ 2005-01-14 11:34:44 by simonmar]
retire $(compiling_with_4xx): we don't support compiling with 4.x any more

19 years ago[project @ 2005-01-14 08:01:26 by wolfgang]
wolfgang [Fri, 14 Jan 2005 08:01:32 +0000 (08:01 +0000)]
[project @ 2005-01-14 08:01:26 by wolfgang]
Dynamic Linking, Part 2:

Hack the Makefiles to build dynamic libraries.
This allows you to actually use dynamic libraries to greatly reduce binary
sizes on Darwin/PowerPC and on powerpc64-linux (for now).

To use this, add the following to your build.mk

SplitObjs=NO
GhcBuildDylibs=YES
GhcStage2HcOpts=-dynamic
GhcLibHcOpts+=-fPIC -dynamic
GhcRtsHcOpts+=-fPIC -dynamic
GHC_CC_OPTS+=-fPIC

(You can leave out the last three lines on powerpc64-linux).

Then, to compile a program using dynamic libraries, pass the -dynamic option to GHC.
To make GHCi use the dynamic libraries instead of .o files, just delete the HS*.o files.

The dynamic library files are named libHSfoo_dyn.dylib or libHSfoo_dyn.so.

Note that the dynamic and static libraries are build from the same .o files,
but we really want to build the static libraries with SplitObjs and without
-fPIC -dynamic to achieve better code size and performance.

ghc/compiler/ghci/Linker.lhs:
    When looking for a library, look for HSfoo.o first (as before),
    then look for libHSfoo_dyn.[so/dylib] before looking for
    libHSfoo.[so/dylib].

ghc/compiler/main/DriverPipeline.hs:
    Main.dll_o and PrelMain.dll_o are dead, at least for now.

ghc/compiler/main/Packages.lhs:
    When -dynamic is specified, add "_dyn" to all libraries specified in
    hs-libraries (not to the extra-libs).

ghc/lib/compat/Makefile:
    Never build libghccompat as a dynamic lib.

mk/package.mk:
    if GhcBuildDylibs is set to YES, build dynamic libraries.

mk/target.mk:
    When installing .dylibs (Darwin only), update the install_name to point
    to the final location.
    (Somebody please read Apple's documentation on what install_names are,
    and then comment on whether this is a useful feature or whether it should
    be done the "normal" unix way).

19 years ago[project @ 2005-01-13 16:32:34 by simonmar]
simonmar [Thu, 13 Jan 2005 16:32:34 +0000 (16:32 +0000)]
[project @ 2005-01-13 16:32:34 by simonmar]
Small optimisation: allow lookForInline to skip over CmmNop too

19 years ago[project @ 2005-01-13 16:21:14 by simonmar]
simonmar [Thu, 13 Jan 2005 16:21:14 +0000 (16:21 +0000)]
[project @ 2005-01-13 16:21:14 by simonmar]
default STOLEN_X86_REGS to 4 (workaround because GHC doesn't normally
define STOLEN_X86_REGS when compiling plan .c source)

19 years ago[project @ 2005-01-13 16:08:22 by simonmar]
simonmar [Thu, 13 Jan 2005 16:08:23 +0000 (16:08 +0000)]
[project @ 2005-01-13 16:08:22 by simonmar]
Fix up STM when compiling unregisterised.  There were a few wibbles
with the stack layout.

19 years ago[project @ 2005-01-13 16:07:33 by simonmar]
simonmar [Thu, 13 Jan 2005 16:07:33 +0000 (16:07 +0000)]
[project @ 2005-01-13 16:07:33 by simonmar]
Instead of defining NO_REGS when IN_STG_CODE==0, define
NO_GLOBAL_REG_DECLS instead.

This means that in non-STG code we can still get at the values of
REG_R1 & co., even though the global register decls are turned off.
This is necessary because we sometimes need to set up different stack
layouts depending on REG_R1.

19 years ago[project @ 2005-01-13 16:05:37 by simonmar]
simonmar [Thu, 13 Jan 2005 16:05:37 +0000 (16:05 +0000)]
[project @ 2005-01-13 16:05:37 by simonmar]
Make it so that global register declarations are turned off if
NO_GLOBAL_REG_DECLS is defined.

19 years ago[project @ 2005-01-13 16:04:52 by simonmar]
simonmar [Thu, 13 Jan 2005 16:04:52 +0000 (16:04 +0000)]
[project @ 2005-01-13 16:04:52 by simonmar]
Improve a comment

19 years ago[project @ 2005-01-13 16:04:18 by simonmar]
simonmar [Thu, 13 Jan 2005 16:04:18 +0000 (16:04 +0000)]
[project @ 2005-01-13 16:04:18 by simonmar]
slight simplification

19 years ago[project @ 2005-01-13 14:15:38 by simonmar]
simonmar [Thu, 13 Jan 2005 14:15:38 +0000 (14:15 +0000)]
[project @ 2005-01-13 14:15:38 by simonmar]
Fix the unreg test in the rule for building AutoApply$(_way).cmm

19 years ago[project @ 2005-01-13 14:12:40 by simonmar]
simonmar [Thu, 13 Jan 2005 14:12:40 +0000 (14:12 +0000)]
[project @ 2005-01-13 14:12:40 by simonmar]
Add way debug_u

19 years ago[project @ 2005-01-13 12:44:08 by simonmar]
simonmar [Thu, 13 Jan 2005 12:44:08 +0000 (12:44 +0000)]
[project @ 2005-01-13 12:44:08 by simonmar]
Fix bug(s) in the register allocator: if a virtual register is both in
memory and in a register (perhaps because it was recently loaded from
a spill slot), and the current instruction writes it, we're supposed
to invalidate the memory slot.  That wasn't happening properly.

This fixes two problems noticed when using -prof -fasm: 10queens in the
testsuite gives the wrong answer, and nofib/spectral/hartel/ida fails
with a 'head []' message.  Interesting bug to track down!

19 years ago[project @ 2005-01-12 23:52:17 by wolfgang]
wolfgang [Wed, 12 Jan 2005 23:52:17 +0000 (23:52 +0000)]
[project @ 2005-01-12 23:52:17 by wolfgang]
-package Cabal is required whenever $(bootstrapped) is yes, not only
for bootstrapped compiles with GHCi.

19 years ago[project @ 2005-01-12 16:33:54 by simonmar]
simonmar [Wed, 12 Jan 2005 16:33:54 +0000 (16:33 +0000)]
[project @ 2005-01-12 16:33:54 by simonmar]
Fix a bug in mk_switch.

19 years ago[project @ 2005-01-12 15:26:28 by simonmar]
simonmar [Wed, 12 Jan 2005 15:26:28 +0000 (15:26 +0000)]
[project @ 2005-01-12 15:26:28 by simonmar]
Track removal of Distribution.Compat.Error

19 years ago[project @ 2005-01-12 13:44:20 by simonmar]
simonmar [Wed, 12 Jan 2005 13:44:22 +0000 (13:44 +0000)]
[project @ 2005-01-12 13:44:20 by simonmar]
Track removal of Distribution.Compat.Error.

19 years ago[project @ 2005-01-12 13:36:30 by simonmar]
simonmar [Wed, 12 Jan 2005 13:36:34 +0000 (13:36 +0000)]
[project @ 2005-01-12 13:36:30 by simonmar]
Restore splitting at ':' for the -i option, which I broke recently.

19 years ago[project @ 2005-01-12 12:51:57 by simonmar]
simonmar [Wed, 12 Jan 2005 12:51:57 +0000 (12:51 +0000)]
[project @ 2005-01-12 12:51:57 by simonmar]
Yet another STM fix: don't attempt to kick any threads which are ThreadRelocated.

19 years ago[project @ 2005-01-12 12:44:25 by ross]
ross [Wed, 12 Jan 2005 12:44:25 +0000 (12:44 +0000)]
[project @ 2005-01-12 12:44:25 by ross]
fix System.IO.Error breakage

19 years ago[project @ 2005-01-12 12:36:28 by simonmar]
simonmar [Wed, 12 Jan 2005 12:36:30 +0000 (12:36 +0000)]
[project @ 2005-01-12 12:36:28 by simonmar]
Numerous bug fixes to the STM code, mostly from a debugging session
with Tim Harris.  The test that flushed out all the bugs will shortly
be added to the test suite.

19 years ago[project @ 2005-01-12 10:04:00 by simonmar]
simonmar [Wed, 12 Jan 2005 10:04:00 +0000 (10:04 +0000)]
[project @ 2005-01-12 10:04:00 by simonmar]
Issue an error when the stdcall calling convention is requested on
non-x86 platforms.

19 years ago[project @ 2005-01-12 09:46:06 by simonmar]
simonmar [Wed, 12 Jan 2005 09:46:06 +0000 (09:46 +0000)]
[project @ 2005-01-12 09:46:06 by simonmar]
import System.IO.Error

19 years ago[project @ 2005-01-12 05:53:07 by wolfgang]
wolfgang [Wed, 12 Jan 2005 05:53:07 +0000 (05:53 +0000)]
[project @ 2005-01-12 05:53:07 by wolfgang]
Move _srtd and _closure_tbl to read-only data instead of text
(these things contain pointers to other symbols, so they can't go into
.text for position-independent code).

19 years ago[project @ 2005-01-12 05:44:21 by wolfgang]
wolfgang [Wed, 12 Jan 2005 05:44:21 +0000 (05:44 +0000)]
[project @ 2005-01-12 05:44:21 by wolfgang]
PowerPC Linux: Fix a slight ABI bug in genCCall
Double and I64 arguments on the stack were not properly aligned.

19 years ago[project @ 2005-01-11 22:16:07 by wolfgang]
wolfgang [Tue, 11 Jan 2005 22:16:07 +0000 (22:16 +0000)]
[project @ 2005-01-11 22:16:07 by wolfgang]
Cleanup and additional comments for the Mac OS/AIX/powerpc64-linux adjustor
code.

19 years ago[project @ 2005-01-11 16:21:53 by simonmar]
simonmar [Tue, 11 Jan 2005 16:21:53 +0000 (16:21 +0000)]
[project @ 2005-01-11 16:21:53 by simonmar]
ignore OPTIONS_anything_else when looking for OPTIONS_GHC/OPTIONS pragmas.

19 years ago[project @ 2005-01-11 16:06:56 by simonmar]
simonmar [Tue, 11 Jan 2005 16:06:58 +0000 (16:06 +0000)]
[project @ 2005-01-11 16:06:56 by simonmar]
Rename OPTIONS to OPTIONS_GHC.

19 years ago[project @ 2005-01-11 15:59:39 by simonmar]
simonmar [Tue, 11 Jan 2005 15:59:39 +0000 (15:59 +0000)]
[project @ 2005-01-11 15:59:39 by simonmar]
Make GHC accept OPTIONS_GHC.  OPTIONS is also accepted, for now.

19 years ago[project @ 2005-01-11 15:22:04 by simonmar]
simonmar [Tue, 11 Jan 2005 15:22:04 +0000 (15:22 +0000)]
[project @ 2005-01-11 15:22:04 by simonmar]
fix for parsing OPTIONS pragmas: OPTIONS should be followed by a
non-identifier character.

19 years ago[project @ 2005-01-11 14:17:50 by simonmar]
simonmar [Tue, 11 Jan 2005 14:17:50 +0000 (14:17 +0000)]
[project @ 2005-01-11 14:17:50 by simonmar]
wibble: got my endifs mixed up

19 years ago[project @ 2005-01-11 14:14:48 by simonmar]
simonmar [Tue, 11 Jan 2005 14:14:48 +0000 (14:14 +0000)]
[project @ 2005-01-11 14:14:48 by simonmar]
When way=u, turn off split objects by setting SplitObjs=NO, rather
than testing for way=u directly.  Fixes a build wibble.

19 years ago[project @ 2005-01-11 11:32:44 by simonmar]
simonmar [Tue, 11 Jan 2005 11:32:44 +0000 (11:32 +0000)]
[project @ 2005-01-11 11:32:44 by simonmar]
Fix $(StripLibraries) code after ld changes yesterday.

19 years ago[project @ 2005-01-11 07:23:21 by wolfgang]
wolfgang [Tue, 11 Jan 2005 07:23:21 +0000 (07:23 +0000)]
[project @ 2005-01-11 07:23:21 by wolfgang]
Support foreign import "wrapper" with > 6 arguments on PowerPC Linux (32-bit).
This calling convention looks deceptively simple at first, but it turns out
to be hideously complex...

19 years ago[project @ 2005-01-10 23:48:07 by krasimir]
krasimir [Mon, 10 Jan 2005 23:48:07 +0000 (23:48 +0000)]
[project @ 2005-01-10 23:48:07 by krasimir]
createDirectoryIfMissing is added to Compat.Directory and is used in ghc-pkg.
The mingw32_HOST_OS is replaced with mingw32_TARGET_OS. I don't know why but
prior the last commit the tool was working with mingw32_HOST_OS fine but not
it isn't. Maybe I miss something. Simon, could you check whether the patch is
fine?

19 years ago[project @ 2005-01-10 23:00:53 by wolfgang]
wolfgang [Mon, 10 Jan 2005 23:00:53 +0000 (23:00 +0000)]
[project @ 2005-01-10 23:00:53 by wolfgang]
Fix for AIX-like ABIs.

19 years ago[project @ 2005-01-10 19:01:27 by panne]
panne [Mon, 10 Jan 2005 19:01:28 +0000 (19:01 +0000)]
[project @ 2005-01-10 19:01:27 by panne]
Refactored and cleaned up ld-related tests. Only tested mildly under Linux.

19 years ago[project @ 2005-01-10 18:44:38 by wolfgang]
wolfgang [Mon, 10 Jan 2005 18:44:40 +0000 (18:44 +0000)]
[project @ 2005-01-10 18:44:38 by wolfgang]
Handle foreign import wrapper properly for MacOS X, powerpc64-linux and AIX.
Only Mac OS X tested so far.
Pass information about argument types from DsForeign to createAdjustor encoded
as a string ('i' for integers, 'f' for floats, 'd' for doubles and 'l' for
long [64bit] integers).

19 years ago[project @ 2005-01-10 16:24:16 by simonmar]
simonmar [Mon, 10 Jan 2005 16:24:16 +0000 (16:24 +0000)]
[project @ 2005-01-10 16:24:16 by simonmar]
Add *.S to $(C_SRCS).  Seems to do the right thing, including  mkdependC.

19 years ago[project @ 2005-01-10 13:53:14 by simonmar]
simonmar [Mon, 10 Jan 2005 13:53:14 +0000 (13:53 +0000)]
[project @ 2005-01-10 13:53:14 by simonmar]
Obscure bugfix affecting foreign import "wrapper" with non-word-sized
argument types (eg. Double) on Windows.  The list of arguments types
returned by dsFExport was the boxed types, rather than the unboxed
types, so dsFExportDynamic couldn't get the correct sizes of the
argument types to the stub function.

It's more correct now, but not totally correct (see the comment for
details).

Noticed by: Wolfgang Thaller.

19 years ago[project @ 2005-01-10 12:34:21 by simonmar]
simonmar [Mon, 10 Jan 2005 12:34:21 +0000 (12:34 +0000)]
[project @ 2005-01-10 12:34:21 by simonmar]
Remove copied definitions for joinFileName, splitFileName:
System.FilePath is in libghccompat now.

19 years ago[project @ 2005-01-10 11:45:19 by simonmar]
simonmar [Mon, 10 Jan 2005 11:45:24 +0000 (11:45 +0000)]
[project @ 2005-01-10 11:45:19 by simonmar]
Work around problems caused by limit on the length of the command line
in ld, which shows up when building OpenGL on Windows with SplitObjs=YES.

We now pass the names of the input files to ld via a linker script.
This is (probably) only supported by GNU ld, so we now have to detect
GNU ld in the configure script (yawn) and back off to the old method
if we don't have it.

19 years ago[project @ 2005-01-09 00:29:05 by desrt]
desrt [Sun, 9 Jan 2005 00:29:05 +0000 (00:29 +0000)]
[project @ 2005-01-09 00:29:05 by desrt]
Modified the mangler for powerpc64.  This is the last missing piece for supporting
registerised builds on PPC64.

The current state of the mangler is temporary.  We're discussing a better way to take
advantage of the PPC64 ABI's unique features to provide a better way of storing info
tables.

I don't think I've changed anything that affects other platforms.

19 years ago[project @ 2005-01-08 22:54:28 by desrt]
desrt [Sat, 8 Jan 2005 22:54:28 +0000 (22:54 +0000)]
[project @ 2005-01-08 22:54:28 by desrt]
Fixed this 6.4 TODO item listed on the wiki:

 PowerPC Linux (32bit): Fix GHCi FFI calls for arguments that are not passed on the stack (ByteCodeFFI).

Separated the code for Darwin and Linux (for PowerPC only).  Rewrote the Linux version to account for the differences in the ABIs.

All changes are inside #if powerpc_TARGET_ARCH && linux_TARGET_OS except:
  - import Data.List ( mapAccumL )      (used by my code)
  - small fix to a comment typo in Wolfgang's Darwin code
  - changed 'undefined' to a more meaningful 'error' message if
     mkMarshalCode is unimplemented

Ran regression tests.  It passes them all except for the ones that are broken because of the 'wrapper' problems currently being addressed.

19 years ago[project @ 2005-01-08 16:37:09 by krasimir]
krasimir [Sat, 8 Jan 2005 16:37:09 +0000 (16:37 +0000)]
[project @ 2005-01-08 16:37:09 by krasimir]
system is replaced with rawSystem. This allows to use path names with embeded
spaces under Windows. This is the same story as with hsc2hs but ghc-pkg is
used only with GHC, so the change will not affect other compilers.
Cabal uses "Program Files" as default installation path and this manifests
the bug.

19 years ago[project @ 2005-01-07 13:06:20 by simonmar]
simonmar [Fri, 7 Jan 2005 13:06:20 +0000 (13:06 +0000)]
[project @ 2005-01-07 13:06:20 by simonmar]
Fix what looks like a cut-n-pasto in retry#: the MAYBE_GC() was
specifying readTVarzh_fast as the restart point, leading to a crash if
MAYBE_GC triggered a GC in here.

19 years ago[project @ 2005-01-06 19:01:10 by igloo]
igloo [Thu, 6 Jan 2005 19:01:10 +0000 (19:01 +0000)]
[project @ 2005-01-06 19:01:10 by igloo]
Document some missing flags.

19 years ago[project @ 2005-01-06 18:24:50 by igloo]
igloo [Thu, 6 Jan 2005 18:24:50 +0000 (18:24 +0000)]
[project @ 2005-01-06 18:24:50 by igloo]
Fix for ghci on sparc.

19 years ago[project @ 2005-01-06 16:59:22 by simonmar]
simonmar [Thu, 6 Jan 2005 16:59:22 +0000 (16:59 +0000)]
[project @ 2005-01-06 16:59:22 by simonmar]
lookupFixityRn: we should be using loadHomeInterface rather than
loadSrcInterface here, because this is a system-ish import rather than
an explicit user import.  In particular, loadSrcInterface will
complain if the module in question is hidden, but this is not what we
want.

19 years ago[project @ 2005-01-06 15:10:21 by simonmar]
simonmar [Thu, 6 Jan 2005 15:10:24 +0000 (15:10 +0000)]
[project @ 2005-01-06 15:10:21 by simonmar]
Add Distribution.Compat to libghccompat

19 years ago[project @ 2005-01-06 15:05:45 by simonpj]
simonpj [Thu, 6 Jan 2005 15:05:45 +0000 (15:05 +0000)]
[project @ 2005-01-06 15:05:45 by simonpj]
Mention problem with ld on Windows

19 years ago[project @ 2005-01-06 14:55:02 by malcolm]
malcolm [Thu, 6 Jan 2005 14:55:02 +0000 (14:55 +0000)]
[project @ 2005-01-06 14:55:02 by malcolm]
Remove dead branch of #elif.

19 years ago[project @ 2005-01-06 14:54:15 by malcolm]
malcolm [Thu, 6 Jan 2005 14:54:17 +0000 (14:54 +0000)]
[project @ 2005-01-06 14:54:15 by malcolm]
When built as a ghc utility, Compat.RawSystem is always available.
When built as an nhc98 utility, -DBUILD_NHC symbol allows for getting
the best otherwise-available version of rawSystem.

19 years ago[project @ 2005-01-06 11:55:12 by malcolm]
malcolm [Thu, 6 Jan 2005 11:55:12 +0000 (11:55 +0000)]
[project @ 2005-01-06 11:55:12 by malcolm]
Add System.Cmd to c-files dependencies.

19 years ago[project @ 2005-01-06 10:44:14 by malcolm]
malcolm [Thu, 6 Jan 2005 10:44:14 +0000 (10:44 +0000)]
[project @ 2005-01-06 10:44:14 by malcolm]
It seems that ghc-6.2.x doesn't have Compat.RawSystem, so should use
System.Cmd instead.  And ghc-5.04.x doesn't export rawSystem from
there either, so should use the simple inline definition.

19 years ago[project @ 2005-01-06 10:04:30 by simonpj]
simonpj [Thu, 6 Jan 2005 10:04:30 +0000 (10:04 +0000)]
[project @ 2005-01-06 10:04:30 by simonpj]
Wibble to ambiguity reporting

19 years ago[project @ 2005-01-06 09:40:06 by simonpj]
simonpj [Thu, 6 Jan 2005 09:40:06 +0000 (09:40 +0000)]
[project @ 2005-01-06 09:40:06 by simonpj]
Improve error message for top-level ambiguity

19 years ago[project @ 2005-01-06 09:39:42 by simonpj]
simonpj [Thu, 6 Jan 2005 09:39:42 +0000 (09:39 +0000)]
[project @ 2005-01-06 09:39:42 by simonpj]
Remove null where

19 years ago[project @ 2005-01-06 00:28:05 by simonpj]
simonpj [Thu, 6 Jan 2005 00:28:05 +0000 (00:28 +0000)]
[project @ 2005-01-06 00:28:05 by simonpj]
Wibble; fixes tcTyVarDetails breakage

19 years ago[project @ 2005-01-05 17:49:38 by simonpj]
simonpj [Wed, 5 Jan 2005 17:49:38 +0000 (17:49 +0000)]
[project @ 2005-01-05 17:49:38 by simonpj]
Add assert

19 years ago[project @ 2005-01-05 16:24:44 by wolfgang]
wolfgang [Wed, 5 Jan 2005 16:24:44 +0000 (16:24 +0000)]
[project @ 2005-01-05 16:24:44 by wolfgang]
Don't use PK_Word64 and ASSIGN_Word64 on 64-bit machines;
they just make the .hc files harder to read without adding any benefit.

19 years ago[project @ 2005-01-05 15:38:31 by simonpj]
simonpj [Wed, 5 Jan 2005 15:38:31 +0000 (15:38 +0000)]
[project @ 2005-01-05 15:38:31 by simonpj]
Allow trailing semicolon in GADT constructor list

19 years ago[project @ 2005-01-05 15:28:39 by simonpj]
simonpj [Wed, 5 Jan 2005 15:28:54 +0000 (15:28 +0000)]
[project @ 2005-01-05 15:28:39 by simonpj]
------------------------
          GADTs and unification
   ------------------------

1. Adjustment to typechecking of pattern matching the call to
   gadtRefineTys in TcPat.  Now wobbly types are treated as wild
   cards in the unification process.

2. Add the WildCard possibility to the BindFlag in types/Unify.lhs

3. Some related refactoring of tcMatchTys etc.

19 years ago[project @ 2005-01-05 15:06:25 by ross]
ross [Wed, 5 Jan 2005 15:06:25 +0000 (15:06 +0000)]
[project @ 2005-01-05 15:06:25 by ross]
recent non-GHCs can use System.Cmd.rawSystem

19 years ago[project @ 2005-01-05 11:17:46 by malcolm]
malcolm [Wed, 5 Jan 2005 11:17:46 +0000 (11:17 +0000)]
[project @ 2005-01-05 11:17:46 by malcolm]
`rawSystem` is only available in GHC.

19 years ago[project @ 2005-01-05 10:26:45 by simonmar]
simonmar [Wed, 5 Jan 2005 10:26:46 +0000 (10:26 +0000)]
[project @ 2005-01-05 10:26:45 by simonmar]
Use rawSystem where appropriate.

19 years ago[project @ 2005-01-04 16:26:55 by simonpj]
simonpj [Tue, 4 Jan 2005 16:27:01 +0000 (16:27 +0000)]
[project @ 2005-01-04 16:26:55 by simonpj]
------------------
          Fix an mdo bug
   ------------------

Embarassingly, this bug makes GHC either panic (for some programs) or
go into a loop (on others) in a recursive mdo that involves a
polymorphic function.  Urk!

The fix is twofold:
  a) add a missing bindInstsOfLocalFuns to tcStmtAndThen (RecStmt case)
  b) bind the correct set of variables in dsRecStmt

I added some explanatory comments about RecStmt in HsExpr too.

The tests is mdo/should_compile/mdo006

19 years ago[project @ 2005-01-04 13:41:53 by simonmar]
simonmar [Tue, 4 Jan 2005 13:41:54 +0000 (13:41 +0000)]
[project @ 2005-01-04 13:41:53 by simonmar]
ghc/mk/config.mk was never being included in ordinary Makefiles.  It
was only included in the top-level fptools/Makefile for the purposes
of obtaining binary distribution settings.

This fixes that problem, and now as a side-effect $(GhcHasReadline)
will start working again.

19 years ago[project @ 2005-01-04 10:26:34 by simonpj]
simonpj [Tue, 4 Jan 2005 10:26:35 +0000 (10:26 +0000)]
[project @ 2005-01-04 10:26:34 by simonpj]
Import trimming

19 years ago[project @ 2005-01-04 09:19:50 by simonpj]
simonpj [Tue, 4 Jan 2005 09:19:50 +0000 (09:19 +0000)]
[project @ 2005-01-04 09:19:50 by simonpj]
Remove redundant Subst hi-boot files

19 years ago[project @ 2004-12-30 22:14:59 by simonpj]
simonpj [Thu, 30 Dec 2004 22:15:19 +0000 (22:15 +0000)]
[project @ 2004-12-30 22:14:59 by simonpj]
Fix to the pre-Xmas simplifier changes, which should make
everything work again.  I'd forgotten to attend to this
corner.  Still not properly tested I fear.

Also remove dead code from SimplEnv, and simplify the remainder (hooray).

19 years ago[project @ 2004-12-27 18:28:21 by simonpj]
simonpj [Mon, 27 Dec 2004 18:28:21 +0000 (18:28 +0000)]
[project @ 2004-12-27 18:28:21 by simonpj]
Wibble

19 years ago[project @ 2004-12-27 11:27:56 by simonpj]
simonpj [Mon, 27 Dec 2004 11:27:56 +0000 (11:27 +0000)]
[project @ 2004-12-27 11:27:56 by simonpj]
import wibble

19 years ago[project @ 2004-12-24 16:14:36 by simonpj]
simonpj [Fri, 24 Dec 2004 16:15:15 +0000 (16:15 +0000)]
[project @ 2004-12-24 16:14:36 by simonpj]
---------------------------
          Refactor the simplifier
   ---------------------------

Driven by a GADT bug, I have refactored the simpifier, and the way GHC
treats substitutions.  I hope I have gotten it right.  Be cautious about updating.

* coreSyn/Subst.lhs has gone

* coreSyn/CoreSubst replaces it, except that it's quite a bit simpler

* simplCore/SimplEnv is added, and contains the simplifier-specific substitution
  stuff

Previously Subst was trying to be all things to all men, and that was making
it Too Complicated.

There may be a little more code now, but it's much easier to understand.

19 years ago[project @ 2004-12-24 11:38:09 by simonpj]
simonpj [Fri, 24 Dec 2004 11:38:20 +0000 (11:38 +0000)]
[project @ 2004-12-24 11:38:09 by simonpj]
Reset the export flag for the new bindings in LiberateCase

19 years ago[project @ 2004-12-24 11:02:39 by simonpj]
simonpj [Fri, 24 Dec 2004 11:03:06 +0000 (11:03 +0000)]
[project @ 2004-12-24 11:02:39 by simonpj]
Further wibbles to the scoped-tyvar story.

This commit tidies up the ATyVar in TcTyThing, making it
ATyVar Name Type
instead of the previous misleading
ATyVar TyVar Type

But the main thing is that we must take care with definitions
like this:

type T a = forall b. b -> (a,b)

f :: forall c. T c
f = ...

Here, we want only 'c' to scope over the RHS of f.  The renamer ensures
that... but we must also take care that we freshly instantiate the
expanded type signature (forall c b. b -> (c,b)) before checking f's RHS,
so that we don't get false sharing between uses of T.

19 years ago[project @ 2004-12-23 14:59:46 by simonpj]
simonpj [Thu, 23 Dec 2004 14:59:50 +0000 (14:59 +0000)]
[project @ 2004-12-23 14:59:46 by simonpj]
Simplifications, dead code elimination

19 years ago[project @ 2004-12-23 13:44:06 by simonpj]
simonpj [Thu, 23 Dec 2004 13:44:10 +0000 (13:44 +0000)]
[project @ 2004-12-23 13:44:06 by simonpj]
minor nomenclature wibble

19 years ago[project @ 2004-12-23 11:50:55 by simonpj]
simonpj [Thu, 23 Dec 2004 11:50:57 +0000 (11:50 +0000)]
[project @ 2004-12-23 11:50:55 by simonpj]
Enable scoped type variables only where there is an explicit forall

19 years ago[project @ 2004-12-23 09:07:30 by simonpj]
simonpj [Thu, 23 Dec 2004 09:07:39 +0000 (09:07 +0000)]
[project @ 2004-12-23 09:07:30 by simonpj]
---------------------------------
          Template Haskell: names again
   ---------------------------------

On 2 Dec 04 I made this commit (1.58 in Convert.lhs)

    Fix a Template Haskell bug that meant that top-level names created
    with newName were not made properly unique.

But that just introduced a new bug!  THe trouble is that names created by
newName are NameUs; but I was *also* using NameU for names of free varaibles,
such as the 'x' in the quoted code here
f x = $( g [| \y -> (x,y) |])

But when converting to HsSyn, the x and y must be treated diffferently.
The 'x' must convert to an Exact RdrName, so that it binds to the 'x' that's
in the type environment; but the 'y' must generate a nice unique RdrName.

So this commit adds NameL for the lexically-scoped bindings like 'x'.

19 years ago[project @ 2004-12-22 16:58:34 by simonpj]
simonpj [Wed, 22 Dec 2004 16:59:22 +0000 (16:59 +0000)]
[project @ 2004-12-22 16:58:34 by simonpj]
----------------------------------------
     Add more scoped type variables
----------------------------------------

Now the top-level forall'd variables of a type signature scope
over the right hand side of that function.

f :: a -> a
f x = ....

The type variable 'a' is in scope in the RHS, and in f's patterns.

It's implied by -fglasgow-exts, but can also be switched off independently
using -fscoped-type-variables (and the -fno variant)

19 years ago[project @ 2004-12-22 12:06:13 by simonpj]
simonpj [Wed, 22 Dec 2004 12:07:41 +0000 (12:07 +0000)]
[project @ 2004-12-22 12:06:13 by simonpj]
----------------------------------------
     New Core invariant: keep case alternatives in sorted order
----------------------------------------

We now keep the alternatives of a Case in the Core language in sorted
order.  Sorted, that is,
by constructor tag for DataAlt
by literal for LitAlt

The main reason is that it makes matching and equality testing more robust.
But in fact some lines of code vanished from SimplUtils.mkAlts.

WARNING: no change to interface file formats, but you'll need to recompile
your libraries so that they generate interface files that respect the
invariant.

19 years ago[project @ 2004-12-22 12:04:14 by simonpj]
simonpj [Wed, 22 Dec 2004 12:04:24 +0000 (12:04 +0000)]
[project @ 2004-12-22 12:04:14 by simonpj]
--------------------------
Add -fwarn-orphans flag
--------------------------

This gives a decent report for modules that contain 'orphan' instance and
rule declarations.  These are to be avoided, because GHC has to proactively
read the interface file every single time, just in case the instance/rule is
needed.

The flag just gives a convenient way of identifying the culprits.

19 years ago[project @ 2004-12-21 17:08:59 by simonpj]
simonpj [Tue, 21 Dec 2004 17:09:02 +0000 (17:09 +0000)]
[project @ 2004-12-21 17:08:59 by simonpj]
---------------------------------
     Template Haskell: dynamically scoped qualified names
---------------------------------

This commit adds a constructor to TH.Name, so that

nameBase (mkName "Foo.baz")    == "baz"
nameModule (MkName "Foo.baz") == "Foo"

We always did parse the module name off the front, but it used to
be done in hsSyn/Convert, but now it's done in TH.Syntax, which is
a better place.

19 years ago[project @ 2004-12-21 16:23:23 by simonpj]
simonpj [Tue, 21 Dec 2004 16:23:23 +0000 (16:23 +0000)]
[project @ 2004-12-21 16:23:23 by simonpj]
Fix buglet in CSE

19 years ago[project @ 2004-12-21 12:35:10 by simonpj]
simonpj [Tue, 21 Dec 2004 12:35:10 +0000 (12:35 +0000)]
[project @ 2004-12-21 12:35:10 by simonpj]
An old commit about paths on windows

19 years ago[project @ 2004-12-21 12:22:22 by simonpj]
simonpj [Tue, 21 Dec 2004 12:23:03 +0000 (12:23 +0000)]
[project @ 2004-12-21 12:22:22 by simonpj]
---------------------------------
     Improve handling of lexically scoped type variables
---------------------------------

If we have

f :: T a -> a
f (x :: T b) = ...

then the lexically scoped variable 'b' should refer to the rigid
type variable 'a', without any intervening wobbliness.  Previously
the in-scope type variables were always mutable TyVars, which were
instantatiated to point to the type they were bound to; but since
the advent of GADTs the intervening mutable type variable is a bad
thing.

Hence
  * In the type environment, ATyVar now carries a type
  * The call to refineTyVars in tc_pat on SigPatIn
    finds the types by matching
  * Then tcExtendTyVarEnv3 extends the type envt appropriately

Rater a lot of huff and puff, but it's quite natural for ATyVar
to contain a type.

Various other small nomenclature changes along the way.

19 years ago[project @ 2004-12-21 12:21:16 by simonpj]
simonpj [Tue, 21 Dec 2004 12:21:16 +0000 (12:21 +0000)]
[project @ 2004-12-21 12:21:16 by simonpj]
Comments

19 years ago[project @ 2004-12-21 12:14:31 by simonpj]
simonpj [Tue, 21 Dec 2004 12:14:31 +0000 (12:14 +0000)]
[project @ 2004-12-21 12:14:31 by simonpj]
Remove debug output