ghc-hetmet.git
22 years ago[project @ 2001-10-18 09:17:04 by simonmar]
simonmar [Thu, 18 Oct 2001 09:17:04 +0000 (09:17 +0000)]
[project @ 2001-10-18 09:17:04 by simonmar]
- use var_fs instead of just VARID for type variables, so that
  specialids (as, qualified, hiding, forall etc.) don't confuse the
  interface file parser.

- remove superfluous '!' in var_fs rule.  This was necessary to avoid
  conflicts caused by the previous change.

22 years ago[project @ 2001-10-18 08:53:03 by simonmar]
simonmar [Thu, 18 Oct 2001 08:53:03 +0000 (08:53 +0000)]
[project @ 2001-10-18 08:53:03 by simonmar]
Eeeek!  When looking for an interface for a way other than the normal
way (eg. profiling) we were correctly finding the .p_hi file, but then
reading the .hi file!

Sigbjorn: go stand in the corner for the rest of the day.

MERGE TO STABLE

22 years ago[project @ 2001-10-18 08:22:06 by simonpj]
simonpj [Thu, 18 Oct 2001 08:22:06 +0000 (08:22 +0000)]
[project @ 2001-10-18 08:22:06 by simonpj]
Wibble to case fiddling; dont merge

22 years ago[project @ 2001-10-18 08:03:29 by simonpj]
simonpj [Thu, 18 Oct 2001 08:03:29 +0000 (08:03 +0000)]
[project @ 2001-10-18 08:03:29 by simonpj]
Add comments

22 years ago[project @ 2001-10-17 16:08:35 by simonpj]
simonpj [Wed, 17 Oct 2001 16:08:35 +0000 (16:08 +0000)]
[project @ 2001-10-17 16:08:35 by simonpj]
Tidy up case-simplification a little bit

22 years ago[project @ 2001-10-17 15:44:40 by simonpj]
simonpj [Wed, 17 Oct 2001 15:44:40 +0000 (15:44 +0000)]
[project @ 2001-10-17 15:44:40 by simonpj]
---------------------------
   Better floating in CorePrep
   ---------------------------

** DO NOT MERGE  **

[NB: this commit also changes the wrongly-named
-ddump-sat
flag to be called
-ddump-prep ]

Earlier fiddling with CorePrep meant that it was ANF-ing
the top-level defn:

x = length [True,False]
to
x = let s1 = False : []
s2 = True  : s1
    in length s2

This is Very Bad for big constant data structures, as show
up in Happy-generated parsers, and that's why we get the
big-block-alloc crash in hssource.  Instead we want

s1 = False : []
s2 = True  : s1
x = length s2

This happens now, (I hope), but it's part of an ongoing jiggling
process in the CoreTidy-CorePrep-CoreToStg part of the compiler, so
it's possible I have broken something else.

22 years ago[project @ 2001-10-17 15:40:02 by simonpj]
simonpj [Wed, 17 Oct 2001 15:40:02 +0000 (15:40 +0000)]
[project @ 2001-10-17 15:40:02 by simonpj]
Remove foldr/cons RULE; see comments with the RULE

22 years ago[project @ 2001-10-17 15:39:08 by simonpj]
simonpj [Wed, 17 Oct 2001 15:39:08 +0000 (15:39 +0000)]
[project @ 2001-10-17 15:39:08 by simonpj]
Remove unused variable

22 years ago[project @ 2001-10-17 15:38:43 by simonpj]
simonpj [Wed, 17 Oct 2001 15:38:43 +0000 (15:38 +0000)]
[project @ 2001-10-17 15:38:43 by simonpj]
Add comments

22 years ago[project @ 2001-10-17 15:19:24 by simonmar]
simonmar [Wed, 17 Oct 2001 15:19:24 +0000 (15:19 +0000)]
[project @ 2001-10-17 15:19:24 by simonmar]
Add missing CONSTR_NOCAF_STATIC case to the THUNK_SELECTOR evacuation
code.  Strange that we've never seen this before...

22 years ago[project @ 2001-10-17 14:24:52 by simonmar]
simonmar [Wed, 17 Oct 2001 14:24:52 +0000 (14:24 +0000)]
[project @ 2001-10-17 14:24:52 by simonmar]
Comment out a bogus assertion, and add a comment to describe why it
isn't necessarily true (see the comment for details).

22 years ago[project @ 2001-10-17 14:17:11 by simonmar]
simonmar [Wed, 17 Oct 2001 14:17:11 +0000 (14:17 +0000)]
[project @ 2001-10-17 14:17:11 by simonmar]
Fix a small performance bug.  In mkAlts, when calculating the
impossible constructors, we were looking at the unfolding for the case
binder instead of the scrutinee, with the result that we sometimes
didn't notice that a DEFAULT case could be resolved into a specific
pattern.

22 years ago[project @ 2001-10-17 13:16:03 by simonpj]
simonpj [Wed, 17 Oct 2001 13:16:03 +0000 (13:16 +0000)]
[project @ 2001-10-17 13:16:03 by simonpj]
-------------------------------------------
   Desugar bindings into Rec groups more often
[Part 2]
   -------------------------------------------

** MERGE PLEASE **

  [I forgot the unlifted case.]

  In rather obscure cases (involving functional dependencies)
  it is possible to get an AbsBinds [] [] (no tyvars, no dicts)
  which nevertheless has some "dictionary bindings".  These
  come out of the typechecker in non-dependency order, so we
  need to Rec them just in case.

  It turns out to be a bit awkward.  The smallest fix is
  to make dsLet always make a Rec; brutal but correct.

22 years ago[project @ 2001-10-17 13:13:36 by simonmar]
simonmar [Wed, 17 Oct 2001 13:13:36 +0000 (13:13 +0000)]
[project @ 2001-10-17 13:13:36 by simonmar]
Add a comment about assumptions that we make about the result of
etaExpand.

22 years ago[project @ 2001-10-17 13:12:56 by simonmar]
simonmar [Wed, 17 Oct 2001 13:12:56 +0000 (13:12 +0000)]
[project @ 2001-10-17 13:12:56 by simonmar]
Use the smart constructor mkNote instead of the dumb constructor
(Note) when rebuilding the expression after eta expansion.  This is
necessary to avoid invalidating some assumptions we make about the
output of etaExpand in CorePrep, in particular that there aren't any
lambda expressions inside an SCC note.

22 years ago[project @ 2001-10-17 11:50:38 by simonpj]
simonpj [Wed, 17 Oct 2001 11:50:38 +0000 (11:50 +0000)]
[project @ 2001-10-17 11:50:38 by simonpj]
--------------------------
nullAddr# fix for the HEAD
  [missed one file]
--------------------------

*** DO NOT MERGE ***

nullAddr# is simply a name for (Lit nullAddrLit).  Up
to now it has been a PrimOp with the rather stange type
nullAddr# :: Int# -> Addr#
which discards its argument.  (I think the problem with
nullary primops is to do with the top-level bindings in
PrelPrimOpWrappers.)   And there was a RULE in PrelRules
to rewrite
nullAddr _ ==> nullAddrLit

It's excessive to make it a PrimOp.  We can just treat it
like unsafeCoerce#, which is made in MkId.lhs.   So I've
done that, and given it the more sensible type
nullAddr# :: Addr#

I fixed all the occurrences I could find.

22 years ago[project @ 2001-10-17 11:26:04 by simonpj]
simonpj [Wed, 17 Oct 2001 11:26:04 +0000 (11:26 +0000)]
[project @ 2001-10-17 11:26:04 by simonpj]
-------------------------------------------
nullAddr# fix for the HEAD
-------------------------------------------

*** DO NOT MERGE ***

nullAddr# is simply a name for (Lit nullAddrLit).  Up
to now it has been a PrimOp with the rather stange type
nullAddr# :: Int# -> Addr#
which discards its argument.  (I think the problem with
nullary primops is to do with the top-level bindings in
PrelPrimOpWrappers.)   And there was a RULE in PrelRules
to rewrite
nullAddr _ ==> nullAddrLit

It's excessive to make it a PrimOp.  We can just treat it
like unsafeCoerce#, which is made in MkId.lhs.   So I've
done that, and given it the more sensible type
nullAddr# :: Addr#

I fixed all the occurrences I could find.

22 years ago[project @ 2001-10-17 11:05:36 by simonpj]
simonpj [Wed, 17 Oct 2001 11:05:36 +0000 (11:05 +0000)]
[project @ 2001-10-17 11:05:36 by simonpj]
-------------------------------------------
Desugar bindings into Rec groups more often
-------------------------------------------

In rather obscure cases (involving functional dependencies)
it is possible to get an AbsBinds [] [] (no tyvars, no dicts)
which nevertheless has some "dictionary bindings".  These
come out of the typechecker in non-dependency order, so we
need to Rec them just in case.

It turns out to be a bit awkward.  The smallest fix is
to make dsLet always make a Rec; brutal but correct.

22 years ago[project @ 2001-10-17 10:35:34 by simonpj]
simonpj [Wed, 17 Oct 2001 10:35:34 +0000 (10:35 +0000)]
[project @ 2001-10-17 10:35:34 by simonpj]
-------------------------------
Fix type-synonym arity checking
-------------------------------

*** MERGE TO STABLE BRANCH ***

The newish stuff on checking types (checkValidType etc)
didn't detect an un-saturated, but *kind-correct* type
synonym occurrence.  Example:

type A i = i
type B = A

Result: crash.  Fix is rather easy.

Thanks to Thomas Hallgren.

22 years ago[project @ 2001-10-16 15:50:02 by rrt]
rrt [Tue, 16 Oct 2001 15:50:02 +0000 (15:50 +0000)]
[project @ 2001-10-16 15:50:02 by rrt]
Fix a couple of typos.

22 years ago[project @ 2001-10-16 15:48:30 by simonmar]
simonmar [Tue, 16 Oct 2001 15:48:30 +0000 (15:48 +0000)]
[project @ 2001-10-16 15:48:30 by simonmar]
top-level constructor workers should have CCS_SUBSUMED, not NO_CCS.

22 years ago[project @ 2001-10-16 15:14:41 by simonpj]
simonpj [Tue, 16 Oct 2001 15:14:41 +0000 (15:14 +0000)]
[project @ 2001-10-16 15:14:41 by simonpj]
Hacky fix to paths for cpp; dont merge

22 years ago[project @ 2001-10-16 15:06:38 by simonmar]
simonmar [Tue, 16 Oct 2001 15:06:38 +0000 (15:06 +0000)]
[project @ 2001-10-16 15:06:38 by simonmar]
Add a Show instance for HandlePosn

22 years ago[project @ 2001-10-16 14:44:51 by simonmar]
simonmar [Tue, 16 Oct 2001 14:44:51 +0000 (14:44 +0000)]
[project @ 2001-10-16 14:44:51 by simonmar]
Catch ^C exceptions at the top level of the interactive loop and
ignore them.

MERGE TO STABLE

22 years ago[project @ 2001-10-16 14:08:26 by simonmar]
simonmar [Tue, 16 Oct 2001 14:08:26 +0000 (14:08 +0000)]
[project @ 2001-10-16 14:08:26 by simonmar]
Clean tmp files between compilations, rather than all at the end.
This reduces the /tmp clutter if GHC dies messily (current values of
"messily" include segmentation fault and, sadly, heap overflow).

22 years ago[project @ 2001-10-16 14:02:01 by rrt]
rrt [Tue, 16 Oct 2001 14:03:12 +0000 (14:03 +0000)]
[project @ 2001-10-16 14:02:01 by rrt]
Comment dubious hack.

22 years ago[project @ 2001-10-16 13:31:56 by simonmar]
simonmar [Tue, 16 Oct 2001 13:31:56 +0000 (13:31 +0000)]
[project @ 2001-10-16 13:31:56 by simonmar]
Format some comments to 80 columns.

22 years ago[project @ 2001-10-16 13:29:35 by simonmar]
simonmar [Tue, 16 Oct 2001 13:29:35 +0000 (13:29 +0000)]
[project @ 2001-10-16 13:29:35 by simonmar]
Don't print the 'Loading package...' message for packages which don't
require any loading (gmp & rts in particular).

22 years ago[project @ 2001-10-16 13:25:00 by simonmar]
simonmar [Tue, 16 Oct 2001 13:25:00 +0000 (13:25 +0000)]
[project @ 2001-10-16 13:25:00 by simonmar]
- set the buffering mode on stdout & stderr to unbuffered in
  interactive mode

- fix some bugs in package linking: loading a package using the :set
  command wasn't using the same mechanism as the command-line package
  loading to avoid linking in dynamic libraries that are already
  linked into the GHCi binary.

- fix a compile error.

MERGE TO STABLE

22 years ago[project @ 2001-10-16 11:29:08 by simonmar]
simonmar [Tue, 16 Oct 2001 11:29:08 +0000 (11:29 +0000)]
[project @ 2001-10-16 11:29:08 by simonmar]
mention that you might need to add -lHSrts before any other libraries
on the linker command line, if another library has its own main() function.

22 years ago[project @ 2001-10-16 11:20:58 by rrt]
rrt [Tue, 16 Oct 2001 11:20:58 +0000 (11:20 +0000)]
[project @ 2001-10-16 11:20:58 by rrt]
Strip out \r on Windows. This should not be necessary as Perl should
read in text mode on a text mounted volume (under Cygwin).

22 years ago[project @ 2001-10-16 10:50:11 by simonmar]
simonmar [Tue, 16 Oct 2001 10:50:11 +0000 (10:50 +0000)]
[project @ 2001-10-16 10:50:11 by simonmar]
mention that identifiers beginning with a double underscore are to be
avoided in -fglasgow-exts mode.

22 years ago[project @ 2001-10-16 10:37:32 by simonpj]
simonpj [Tue, 16 Oct 2001 10:37:32 +0000 (10:37 +0000)]
[project @ 2001-10-16 10:37:32 by simonpj]
Fix the default-expansion code for HEAD; fixes cg050

22 years ago[project @ 2001-10-16 10:01:13 by simonmar]
simonmar [Tue, 16 Oct 2001 10:01:13 +0000 (10:01 +0000)]
[project @ 2001-10-16 10:01:13 by simonmar]
Explicitly sign- or zero-extend the result of a ccall up to the word
size if necessary.  Recent discussion on
glasgow-haskell-users@haskell.org suggests that this is the
responsibility of the caller rather than the callee.

We do it by wrapping the result in narrow{8,16,32}{Int,Word}# as
appropriate, at desugaring time, because this way we only have to do
it once instead of once per backend.  Furthermore the narrowing is
exposed to the simplifier which is generally a good thing.

22 years ago[project @ 2001-10-15 16:03:04 by simonpj]
simonpj [Mon, 15 Oct 2001 16:03:04 +0000 (16:03 +0000)]
[project @ 2001-10-15 16:03:04 by simonpj]
--------------------------
Tidy up arity propagation (the saga continues)
--------------------------

Turns out that it's not as easy as I thought.

The code generator was assuming that (not . isLocalName) was enough to
identify an imported thing (whose CgInfo should be right), but that's
not true.  Needs more thought.

Meanwhile, I've made the code generator a bit more sensible about how
it looks things up.  But there's still a problem for GHCi: the
unfoldings in the TypeEnv won't have CgIdInfo stuff.  Sigh.  Thinks.

22 years ago[project @ 2001-10-15 15:06:01 by simonpj]
simonpj [Mon, 15 Oct 2001 15:06:01 +0000 (15:06 +0000)]
[project @ 2001-10-15 15:06:01 by simonpj]
--------------------------
Tidy up arity propagation
--------------------------

Due to excessive complexity, correct arity information was getting
lost on the way to interface files.  As a result, a function that had
CPR info __S SLm (say), was getting arity 0, and this confused the (old)
CPR analyser ("lub of function and HasCPR").

I hope this fixes the above error (which showed up somewhere in
compiling Edison), but I'm going to commit it right now anyway.
Meanwhile I'll recompile Edison too.

Details
~~~~~~~
Digging out the rather obscure cause made me tidy up the CgInfo stuff.
The story is now

* The CgInfo field of an Id gets attached to the Id *only* in
  the TypeEnv of the ModuleDetails, during CoreTidy.

  This ModuleDetails stuff is used
a) to generate the interface file
b) to import into other modules in GHCi

* No CgInfo field is in the CoreBindings which are passed
  downsteam to CorePrep and thence CodeGen.  Quite right too...
  it's the downstream stuff that *generates* the CgInfo.

* But the Arity field *is* now passed on through CoreTidy
  (like strictness info) since it is usefully used by CorePrep.

* On the way I simplified the ArityInfo field of an IdInfo
  to simply
Arity
  instead of
Maybe Arity

22 years ago[project @ 2001-10-15 15:05:17 by simonpj]
simonpj [Mon, 15 Oct 2001 15:05:17 +0000 (15:05 +0000)]
[project @ 2001-10-15 15:05:17 by simonpj]
Rename ifaceTyCls to ifaceTyThing (more consistent)

22 years ago[project @ 2001-10-15 15:03:48 by simonpj]
simonpj [Mon, 15 Oct 2001 15:03:48 +0000 (15:03 +0000)]
[project @ 2001-10-15 15:03:48 by simonpj]
Add comments re eta expansion

22 years ago[project @ 2001-10-15 15:03:24 by simonpj]
simonpj [Mon, 15 Oct 2001 15:03:24 +0000 (15:03 +0000)]
[project @ 2001-10-15 15:03:24 by simonpj]
Add comment for type of unsafeCoerce#

22 years ago[project @ 2001-10-13 20:47:43 by sof]
sof [Sat, 13 Oct 2001 20:47:43 +0000 (20:47 +0000)]
[project @ 2001-10-13 20:47:43 by sof]
When 'boot'ing, delay 'all' target a bit

22 years ago[project @ 2001-10-13 20:46:24 by sof]
sof [Sat, 13 Oct 2001 20:46:24 +0000 (20:46 +0000)]
[project @ 2001-10-13 20:46:24 by sof]
In defn of CPP, include @CPPFLAGS@ on RHS.

22 years ago[project @ 2001-10-13 20:44:52 by sof]
sof [Sat, 13 Oct 2001 20:44:52 +0000 (20:44 +0000)]
[project @ 2001-10-13 20:44:52 by sof]
Add explanatory comment as to why a pair of win32-specific options
are filtered out of CC_OPTS.

22 years ago[project @ 2001-10-13 20:26:13 by sof]
sof [Sat, 13 Oct 2001 20:26:13 +0000 (20:26 +0000)]
[project @ 2001-10-13 20:26:13 by sof]
Added FPTOOLS_FIND_FIND.

On Win32 boxes, rejects the MS 'find' utility and continues
searching for GNU find. On non-Win32 boxes, equal to
AC_PATH_PROG(FindCmd, find)

22 years ago[project @ 2001-10-13 16:02:47 by sof]
sof [Sat, 13 Oct 2001 16:02:47 +0000 (16:02 +0000)]
[project @ 2001-10-13 16:02:47 by sof]
- unpackProgName: recognise '/' and '\\' as path separators under Win32.
- donated in-house version of basename, it's cool (== doesn't use reverse).

22 years ago[project @ 2001-10-12 18:44:52 by sof]
sof [Fri, 12 Oct 2001 18:44:52 +0000 (18:44 +0000)]
[project @ 2001-10-12 18:44:52 by sof]
Robustified:

- 'make clean' followed by 'make all' should now work
  as expected.
- 'make boot' now forces 'depend' and 'all' to fire (not
  the other way around).

22 years ago[project @ 2001-10-12 14:28:08 by rrt]
rrt [Fri, 12 Oct 2001 14:29:11 +0000 (14:29 +0000)]
[project @ 2001-10-12 14:28:08 by rrt]
Update "make install" settings for Windows.

22 years ago[project @ 2001-10-12 14:27:28 by rrt]
rrt [Fri, 12 Oct 2001 14:27:28 +0000 (14:27 +0000)]
[project @ 2001-10-12 14:27:28 by rrt]
Changes to installation locations of various files on Windows.

22 years ago[project @ 2001-10-11 23:52:51 by sof]
sof [Thu, 11 Oct 2001 23:52:52 +0000 (23:52 +0000)]
[project @ 2001-10-11 23:52:51 by sof]
Robustified handling of paths, allowing both / and \ to be recognised
as path separators under Win32 -- ghc-5.02-win32 has a bug where
it will barf when invoked as follows:

   c:\dot\net> ghc -c c:\dot\net\foo.hs -odir c:\dot\net\output

i.e., a DOS-style input filename together with the use of -odir. (5.02
constructs an illegal path for the -o argument to the assembler).

Branch mergers: go wild

22 years ago[project @ 2001-10-11 22:27:04 by sof]
sof [Thu, 11 Oct 2001 22:27:05 +0000 (22:27 +0000)]
[project @ 2001-10-11 22:27:04 by sof]
- removed Win32-only IOErrorType.ComError
- added IOErrorType.(DynIOError Dynamic.Dynamic)

  Propagating dynamically-typed exceptions as Exception.DynException
  isn't always the right thing to do
  [ why? You cannot catch them with IO.catch & you don't get the
    'infrastructure' that IOError offers, so you're forced to
    reinvent that wheel for each dynamic exception.
  ]
- removed IOExts.isComError  :: IOError -> Bool
- added IOExts.isDynIOError  :: IOError -> Bool
- added IOExts.getDynIOError :: IOError -> Dynamic.Dynamic
- documented IOExts changes.

22 years ago[project @ 2001-10-11 16:44:10 by simonpj]
simonpj [Thu, 11 Oct 2001 16:44:10 +0000 (16:44 +0000)]
[project @ 2001-10-11 16:44:10 by simonpj]
Add special ILX case for Coerce

22 years ago[project @ 2001-10-11 14:31:45 by sewardj]
sewardj [Thu, 11 Oct 2001 14:31:45 +0000 (14:31 +0000)]
[project @ 2001-10-11 14:31:45 by sewardj]
Correctly handle unboxed tuples when converting DEFAULT alts to
  unboxed tuple constructors in case args.  (I'm sure this could
  be worded better).  Branch and HEAD have drifted too far apart
  for easy common commit for this, so is committed seperately for
  ghc-5-02-branch.

22 years ago[project @ 2001-10-10 23:18:43 by sof]
sof [Wed, 10 Oct 2001 23:18:43 +0000 (23:18 +0000)]
[project @ 2001-10-10 23:18:43 by sof]
Remove HDirect/COM package.

22 years ago[project @ 2001-10-10 23:17:14 by sof]
sof [Wed, 10 Oct 2001 23:17:14 +0000 (23:17 +0000)]
[project @ 2001-10-10 23:17:14 by sof]
savePackageConfig: Robustified - remove existing .old file before saving
away new. In case of failure, print out a msg detailing what files were
involved.

22 years ago[project @ 2001-10-10 17:25:15 by sof]
sof [Wed, 10 Oct 2001 17:25:15 +0000 (17:25 +0000)]
[project @ 2001-10-10 17:25:15 by sof]
- fixed awfully bad bug in allocation of new argv vector, it
  did:

      malloc(sizeof(char) * (argc + 1 + 1));

  where it should have done:

      malloc(sizeof(char*) * (argc + 1 + 1));

  [ This one is the cause of one or two 5.02 bug reports
    that are now starting to trickle in. As a stopgap
    measure (and since I'm to blame for this one, really),
    I've put up a replacement ghci.exe wrapper at

      http://www.galconn.com/~sof/ghci.zip
  ]

- added some (currently disabled) debug print code.

22 years ago[project @ 2001-10-10 17:17:44 by ken]
ken [Wed, 10 Oct 2001 17:17:44 +0000 (17:17 +0000)]
[project @ 2001-10-10 17:17:44 by ken]
Pass the "-mieee" flag to gcc, so that we get IEEE floating-point.
(Fixed: pass the flag all the time, not just when compiling HC files.)
MERGE TO STABLE

22 years ago[project @ 2001-10-09 08:31:15 by sof]
sof [Tue, 9 Oct 2001 08:31:15 +0000 (08:31 +0000)]
[project @ 2001-10-09 08:31:15 by sof]
FPTOOLS_CC_FLAG: fixed bug that prevented cygwin-based GCCen from working

22 years ago[project @ 2001-10-08 14:22:43 by simonmar]
simonmar [Mon, 8 Oct 2001 14:22:43 +0000 (14:22 +0000)]
[project @ 2001-10-08 14:22:43 by simonmar]
Turn the error message about package mismatch into a warning.  This is
really harmless at the moment (only fatal with DLLs), but really gets
in the way when you want to build a package and also use it directly
with the appropriate -i/-l flags.

22 years ago[project @ 2001-10-08 13:24:53 by simonmar]
simonmar [Mon, 8 Oct 2001 13:24:53 +0000 (13:24 +0000)]
[project @ 2001-10-08 13:24:53 by simonmar]
Don't panic when an out-of-range optimisation level is requested.

22 years ago[project @ 2001-10-04 14:21:07 by rrt]
rrt [Thu, 4 Oct 2001 14:21:07 +0000 (14:21 +0000)]
[project @ 2001-10-04 14:21:07 by rrt]
Track reality somewhat on the ILX front.

22 years ago[project @ 2001-10-04 14:19:26 by rrt]
rrt [Thu, 4 Oct 2001 14:19:26 +0000 (14:19 +0000)]
[project @ 2001-10-04 14:19:26 by rrt]
Move PrelGHC.ilx.real to PrelGHC.ilx.pp, for consistency with other such
files. Actually, the "preprocessing" just consists of copying it to
PrelGHC.ilx; it's done because ILX files aren't precious, and we don't want
it being deleted.

22 years ago[project @ 2001-10-04 10:48:19 by simonpj]
simonpj [Thu, 4 Oct 2001 10:48:19 +0000 (10:48 +0000)]
[project @ 2001-10-04 10:48:19 by simonpj]
More healing

22 years ago[project @ 2001-10-04 08:35:24 by simonpj]
simonpj [Thu, 4 Oct 2001 08:35:26 +0000 (08:35 +0000)]
[project @ 2001-10-04 08:35:24 by simonpj]
Heal the HEAD

22 years ago[project @ 2001-10-03 16:20:57 by simonpj]
simonpj [Wed, 3 Oct 2001 16:20:57 +0000 (16:20 +0000)]
[project @ 2001-10-03 16:20:57 by simonpj]
Add comments, and nuke strictness info in CoreTidy if totally boring

22 years ago[project @ 2001-10-03 15:30:57 by rrt]
rrt [Wed, 3 Oct 2001 15:30:57 +0000 (15:30 +0000)]
[project @ 2001-10-03 15:30:57 by rrt]
Dear Sigbjorn,

next time you turn an

if...endif

into an

if...else..endif

remember to check the sense of the test. Sometimes, it needs to be reversed
(there was in this case a hint in the surrounding code).

Love,

Reuben.

22 years ago[project @ 2001-10-03 13:59:22 by simonpj]
simonpj [Wed, 3 Oct 2001 13:59:22 +0000 (13:59 +0000)]
[project @ 2001-10-03 13:59:22 by simonpj]
wibbles only

22 years ago[project @ 2001-10-03 13:58:50 by simonpj]
simonpj [Wed, 3 Oct 2001 13:58:51 +0000 (13:58 +0000)]
[project @ 2001-10-03 13:58:50 by simonpj]
---------------------
Clear up infelicities
---------------------
CorePrep, CoreUtils, SimplUtils
LiberateCase (wibbles only)

* Previously CorePrep was floating LocalIds to top level, which
  breaks the invariant that after CorePrep all top level Ids are
  GlobalIds.  But it didn't really need to, and this pass makes it
  so.  It's much tidier now.

* Make CorePrep do eta expansion on partial applications
x = foldr f y  ==>   x = \ys -> foldr f y ys
  (This used to be done in the simplifier, but now the
  simplifier only eta expands where there is at least one
  lambda already.)

* Omit CoreUtils.etaReduce.  (Never called.)

* Improve CoreUtils.etaExpand, so that it doesn't add gratuitous
  beta redexes.

22 years ago[project @ 2001-10-03 13:58:13 by simonpj]
simonpj [Wed, 3 Oct 2001 13:58:13 +0000 (13:58 +0000)]
[project @ 2001-10-03 13:58:13 by simonpj]
----------------------------------------------
Output curried functions for data constructors
----------------------------------------------
(incomplete)

The idea here is to output code for the *curried* version of
the worker of a data constructor, so that the worker can be
treated as a first-class citizen elsewhere in the compiler.
In particular, it doesn't need to be a "hasNoBinding" thing,
which are the subject of a number of nasty hacks.

These changes only do the business for the code gen route
via AbstractC.  Remaining to do: the byte code generator.

Idea: move the byte-code gen to STG code, and inject the
curried data-constructor workers at the STG stage.

I hope the changes here won't make
anything stop working.  For now, constructor
workers remain "hasNoBinding" things.

CgConTbls, CodeGen, CoreTidy, CoreToStg

22 years ago[project @ 2001-10-03 13:57:42 by simonmar]
simonmar [Wed, 3 Oct 2001 13:57:42 +0000 (13:57 +0000)]
[project @ 2001-10-03 13:57:42 by simonmar]
Tidy up ghc/includes/Constants and related things.

Now all the constants that the compiler needs to know, such as header
size, update frame size, info table size and so on are generated
automatically into a header file, DeriviedConstants.h, by a small C
program in the same way as NativeDefs.h.  The C code in the RTS is
expected to use sizeof() directly (it already does).

Also tidied up the constants in MachDeps.h - all the constants
representing the sizes of various types are named SIZEOF_<foo>, to
match the constants defined in config.h.  PrelStorable.lhs now doesn't
contain any special knowledge about GHC's conventions as regards the
size of certain types, this is all in MachDeps.h.

22 years ago[project @ 2001-10-03 13:57:33 by simonpj]
simonpj [Wed, 3 Oct 2001 13:57:33 +0000 (13:57 +0000)]
[project @ 2001-10-03 13:57:33 by simonpj]
-------------------------------------------
Don't bomb out on inlining big constructors
-------------------------------------------

The unfolder bombs out if the expression get too big; no point in
computing its exact size when it's vast.  But for *constructors*
applied to a lot of args, it's worth keeping going, because we
get a big *disount* too
$fFooInt = :CFoo a1 a2 a3 ... a50

We want to keep the inlining for $fFooInt in interface files, so
that importing guys can do the selection.

Solution: only bomb out when size-discount gets too big.

22 years ago[project @ 2001-10-03 10:18:31 by rrt]
rrt [Wed, 3 Oct 2001 10:18:31 +0000 (10:18 +0000)]
[project @ 2001-10-03 10:18:31 by rrt]
This file shouldn't be in the repository any more (there's a
PrelGHC.hi-boot.pp).

Why is it only me that notices these phantom leftovers? Why don't they cause
problems for other people?

22 years ago[project @ 2001-10-03 09:56:18 by sewardj]
sewardj [Wed, 3 Oct 2001 09:56:18 +0000 (09:56 +0000)]
[project @ 2001-10-03 09:56:18 by sewardj]
In the interactive FFI, handle f-i'd fns which return char.

22 years ago[project @ 2001-10-03 09:43:11 by rrt]
rrt [Wed, 3 Oct 2001 09:43:11 +0000 (09:43 +0000)]
[project @ 2001-10-03 09:43:11 by rrt]
Remove import of unDosifyPath, and the comment saying that it is used.

22 years ago[project @ 2001-10-03 09:20:20 by simonmar]
simonmar [Wed, 3 Oct 2001 09:20:20 +0000 (09:20 +0000)]
[project @ 2001-10-03 09:20:20 by simonmar]
minor wibble: use Maybe.isJust rather than maybeToBool

22 years ago[project @ 2001-10-03 08:16:49 by simonmar]
simonmar [Wed, 3 Oct 2001 08:16:49 +0000 (08:16 +0000)]
[project @ 2001-10-03 08:16:49 by simonmar]
Don't print the "compilation IS NOT required" in quiet mode (-v0).

22 years ago[project @ 2001-10-02 22:30:47 by sof]
sof [Tue, 2 Oct 2001 22:30:47 +0000 (22:30 +0000)]
[project @ 2001-10-02 22:30:47 by sof]
field: robustify - give a parse error (rather than p-match failure)
if LHS isn't known.

22 years ago[project @ 2001-10-02 16:15:10 by simonpj]
simonpj [Tue, 2 Oct 2001 16:15:10 +0000 (16:15 +0000)]
[project @ 2001-10-02 16:15:10 by simonpj]
Wibble in eqString

22 years ago[project @ 2001-10-02 15:27:15 by sewardj]
sewardj [Tue, 2 Oct 2001 15:27:15 +0000 (15:27 +0000)]
[project @ 2001-10-02 15:27:15 by sewardj]
Fix spurious sp increment in RET_{VEC_}_SMALL printing code.

MERGE TO STABLE

22 years ago[project @ 2001-10-02 11:48:28 by simonpj]
simonpj [Tue, 2 Oct 2001 11:48:28 +0000 (11:48 +0000)]
[project @ 2001-10-02 11:48:28 by simonpj]
Dont try to float unboxed things to top level

22 years ago[project @ 2001-10-02 11:09:55 by simonmar]
simonmar [Tue, 2 Oct 2001 11:09:55 +0000 (11:09 +0000)]
[project @ 2001-10-02 11:09:55 by simonmar]
Add a FAQ entry about using getContents in GHCi.

22 years ago[project @ 2001-10-01 15:42:42 by simonpj]
simonpj [Mon, 1 Oct 2001 15:42:42 +0000 (15:42 +0000)]
[project @ 2001-10-01 15:42:42 by simonpj]
ILX ifdefery

22 years ago[project @ 2001-10-01 14:40:33 by rrt]
rrt [Mon, 1 Oct 2001 14:40:33 +0000 (14:40 +0000)]
[project @ 2001-10-01 14:40:33 by rrt]
Various updates to track the state of GHC and ILX.

22 years ago[project @ 2001-10-01 14:34:51 by rrt]
rrt [Mon, 1 Oct 2001 14:34:51 +0000 (14:34 +0000)]
[project @ 2001-10-01 14:34:51 by rrt]
Track reality a bit.

22 years ago[project @ 2001-10-01 14:28:37 by rrt]
rrt [Mon, 1 Oct 2001 14:28:37 +0000 (14:28 +0000)]
[project @ 2001-10-01 14:28:37 by rrt]
Implement -keep-il-file.

22 years ago[project @ 2001-10-01 14:01:42 by rrt]
rrt [Mon, 1 Oct 2001 14:01:42 +0000 (14:01 +0000)]
[project @ 2001-10-01 14:01:42 by rrt]
Implement -keep-il-file

22 years ago[project @ 2001-10-01 13:57:13 by rrt]
rrt [Mon, 1 Oct 2001 13:57:13 +0000 (13:57 +0000)]
[project @ 2001-10-01 13:57:13 by rrt]
Add -keep-il-file.

22 years ago[project @ 2001-10-01 13:45:43 by rrt]
rrt [Mon, 1 Oct 2001 13:45:43 +0000 (13:45 +0000)]
[project @ 2001-10-01 13:45:43 by rrt]
PrelGHC.dll -> PrelGHC.i_o, and a few other corrections to follow
changes to ILX.

22 years ago[project @ 2001-10-01 13:38:50 by rrt]
rrt [Mon, 1 Oct 2001 13:38:50 +0000 (13:38 +0000)]
[project @ 2001-10-01 13:38:50 by rrt]
Reflect reality ever-so-slightly better.

22 years ago[project @ 2001-10-01 13:30:27 by rrt]
rrt [Mon, 1 Oct 2001 13:30:27 +0000 (13:30 +0000)]
[project @ 2001-10-01 13:30:27 by rrt]
Remove unused import.

22 years ago[project @ 2001-10-01 13:28:40 by rrt]
rrt [Mon, 1 Oct 2001 13:28:40 +0000 (13:28 +0000)]
[project @ 2001-10-01 13:28:40 by rrt]
Removed unused imports.

22 years ago[project @ 2001-10-01 13:13:38 by rrt]
rrt [Mon, 1 Oct 2001 13:13:38 +0000 (13:13 +0000)]
[project @ 2001-10-01 13:13:38 by rrt]
Get rid of \rs at the end of lines in prescripts and postscripts to
work around Windows dodginess.

22 years ago[project @ 2001-10-01 13:10:53 by simonmar]
simonmar [Mon, 1 Oct 2001 13:10:53 +0000 (13:10 +0000)]
[project @ 2001-10-01 13:10:53 by simonmar]
Export run_queue_hd to the dynamic linker; TkHaskell has a grotesque
hack which requires it.

22 years ago[project @ 2001-10-01 11:36:28 by simonmar]
simonmar [Mon, 1 Oct 2001 11:36:29 +0000 (11:36 +0000)]
[project @ 2001-10-01 11:36:28 by simonmar]
Allow default RTS options to be specified by linking in an object file
which defines the symbol `ghc_rts_opts' to point to a string of RTS
options.

This is preferred to using defaultsHook(), if possible.  Perhaps we
could remove defaultsHook().

(won't work with DLL's; if we ever ressurrect them we'll
have to deal with this somehow).

22 years ago[project @ 2001-10-01 11:09:02 by simonmar]
simonmar [Mon, 1 Oct 2001 11:09:02 +0000 (11:09 +0000)]
[project @ 2001-10-01 11:09:02 by simonmar]
Actually bomb out with an error message if the maximum heap size is
smaller than the minimum allocation area size.

22 years ago[project @ 2001-10-01 10:52:36 by simonmar]
simonmar [Mon, 1 Oct 2001 10:52:36 +0000 (10:52 +0000)]
[project @ 2001-10-01 10:52:36 by simonmar]
Fix a bug in the heap size calculation, where a negative result wasn't
noticed because we're working with unsigned types.  We now explicitly
test that the heap has enough room for the minimum allocation area
size, otherwise a heap overflow is reported.

22 years ago[project @ 2001-10-01 09:45:38 by simonpj]
simonpj [Mon, 1 Oct 2001 09:45:38 +0000 (09:45 +0000)]
[project @ 2001-10-01 09:45:38 by simonpj]
---------------------------
Match rules before inlining
---------------------------

This commit fulfils a long-standing wish by Manuel that RULES
matching occurs before inlining.  So if a RULE matches, it'll
get used, even if the function can also be inlined.

It's a bit dodgy to actually rely on this, because maybe the rule
doesn't match *yet* but will do after a bit more transformation.
But it does help with things like class operations.  Class ops are
simply selectors which pick a method out of a dictionary, so they
are inlined rather vigorously.  But we might want a RULE for a
class method (e.g. (==) [Char] = eqString), and such rules would
practically never fire if inlining took priority.

22 years ago[project @ 2001-10-01 09:41:28 by simonpj]
simonpj [Mon, 1 Oct 2001 09:41:28 +0000 (09:41 +0000)]
[project @ 2001-10-01 09:41:28 by simonpj]
Stuff to make a RULE work for
eqString "foo" "foo" = True
(etc.)  The rule is of course a BuiltinRule in PrelRules

22 years ago[project @ 2001-10-01 09:40:26 by simonpj]
simonpj [Mon, 1 Oct 2001 09:40:26 +0000 (09:40 +0000)]
[project @ 2001-10-01 09:40:26 by simonpj]
Add a rule for equality on strings

22 years ago[project @ 2001-10-01 09:26:27 by simonpj]
simonpj [Mon, 1 Oct 2001 09:26:27 +0000 (09:26 +0000)]
[project @ 2001-10-01 09:26:27 by simonpj]
Fix a long-standing lossage of rules attached to class operations
(A one-line fix to SimplCore.updateBinders.)

22 years ago[project @ 2001-09-28 23:41:00 by sof]
sof [Fri, 28 Sep 2001 23:41:00 +0000 (23:41 +0000)]
[project @ 2001-09-28 23:41:00 by sof]
Rename 'doDiscard' to 'lexPragma', and make it EOF-resistant.
As was, it would run off the end of a StringBuffer (and SIGSEGV,
most likely) if a pragma wasn't properly closed.

22 years ago[project @ 2001-09-28 23:36:50 by sof]
sof [Fri, 28 Sep 2001 23:36:50 +0000 (23:36 +0000)]
[project @ 2001-09-28 23:36:50 by sof]
Provide finer-grained control for turning off mk/target.mk's
'all', 'boot' and 'install' rules. i.e., instead of having
the variable NO_ALL_TARGETS control the defnition of rules
for all three, NO_ALL_TARGET, NO_BOOT_TARGET, and NO_INSTALL_TARGET
lets you individually control which ones you don't want.

Sub-projects (GC and HDirect, for example) have the need
to turn off the 'boot' rule, which is what motivated this
change.