ghc-hetmet.git
17 years agoHaskell Program Coverage
andy@galois.com [Tue, 24 Oct 2006 21:29:07 +0000 (21:29 +0000)]
Haskell Program Coverage

This large checkin is the new ghc version of Haskell
Program Coverage, an expression-level coverage tool for Haskell.

Parts:

 - Hpc.[ch] - small runtime support for Hpc; reading/writing *.tix files.
 - Coverage.lhs - Annotates the HsSyn with coverage tickboxes.
  - New Note's in Core,
      - TickBox      -- ticked on entry to sub-expression
      - BinaryTickBox  -- ticked on exit to sub-expression, depending
             -- on the boolean result.

  - New Stg level TickBox (no BinaryTickBoxes, though)

You can run the coverage tool with -fhpc at compile time.
Main must be compiled with -fhpc.

17 years agofix 5.04 compile
Simon Marlow [Tue, 24 Oct 2006 13:39:43 +0000 (13:39 +0000)]
fix 5.04 compile

17 years agofix indentation wibble to make it compile with 5.04
Simon Marlow [Tue, 24 Oct 2006 12:28:00 +0000 (12:28 +0000)]
fix indentation wibble to make it compile with 5.04

17 years agoRe-enable TABLES_NEXT_TO_CODE for powerpc (was accidentally disabled)
wolfgang.thaller@gmx.net [Mon, 23 Oct 2006 20:33:21 +0000 (20:33 +0000)]
Re-enable TABLES_NEXT_TO_CODE for powerpc (was accidentally disabled)

17 years agoSplit GC.c, and move storage manager into sm/ directory
Simon Marlow [Tue, 24 Oct 2006 09:13:57 +0000 (09:13 +0000)]
Split GC.c, and move storage manager into sm/ directory
In preparation for parallel GC, split up the monolithic GC.c file into
smaller parts.  Also in this patch (and difficult to separate,
unfortunatley):

  - Don't include Stable.h in Rts.h, instead just include it where
    necessary.

  - consistently use STATIC_INLINE in source files, and INLINE_HEADER
    in header files.  STATIC_INLINE is now turned off when DEBUG is on,
    to make debugging easier.

  - The GC no longer takes the get_roots function as an argument.
    We weren't making use of this generalisation.

17 years agofix a printf format warning
Simon Marlow [Tue, 24 Oct 2006 09:13:23 +0000 (09:13 +0000)]
fix a printf format warning

17 years agoadd prototypes for exitHashTable()
Simon Marlow [Fri, 20 Oct 2006 10:29:34 +0000 (10:29 +0000)]
add prototypes for exitHashTable()

17 years agoremove ^Ms
Simon Marlow [Thu, 19 Oct 2006 14:12:18 +0000 (14:12 +0000)]
remove ^Ms

17 years agoadd pure spin locks
Simon Marlow [Thu, 19 Oct 2006 13:56:20 +0000 (13:56 +0000)]
add pure spin locks

17 years agocomments only: document allocateLocal()
Simon Marlow [Thu, 19 Oct 2006 10:12:00 +0000 (10:12 +0000)]
comments only: document allocateLocal()

17 years agorename allocated_bytes() to allocatedBytes()
Simon Marlow [Thu, 19 Oct 2006 10:11:29 +0000 (10:11 +0000)]
rename allocated_bytes() to allocatedBytes()

17 years agoremove performGCWithRoots()
Simon Marlow [Thu, 19 Oct 2006 10:11:02 +0000 (10:11 +0000)]
remove performGCWithRoots()
I don't think this can ever be useful, because to add more roots you
need to do it consistently for every GC.  The right way to add roots
is to use newStablePtr.

17 years agoBump the HEAD to 6.7
Ian Lynagh [Tue, 24 Oct 2006 00:35:53 +0000 (00:35 +0000)]
Bump the HEAD to 6.7

17 years agoClean up debugging code in RnNames
Manuel M T Chakravarty [Mon, 23 Oct 2006 18:05:03 +0000 (18:05 +0000)]
Clean up debugging code in RnNames

17 years agowibble in parseStaticFlags
Simon Marlow [Mon, 23 Oct 2006 14:58:17 +0000 (14:58 +0000)]
wibble in parseStaticFlags
should fix profiling and unreg in HEAD

17 years agoImprove error messages for indexed types
Manuel M T Chakravarty [Sun, 22 Oct 2006 17:12:12 +0000 (17:12 +0000)]
Improve error messages for indexed types

17 years agoA little abstraction
basvandijk@home.nl [Thu, 19 Oct 2006 15:23:28 +0000 (15:23 +0000)]
A little abstraction

17 years agoFix handling of family instances in the presense of this doc stuff
Manuel M T Chakravarty [Sun, 22 Oct 2006 00:49:04 +0000 (00:49 +0000)]
Fix handling of family instances in the presense of this doc stuff
- Not sure whether I do the right thing, because I don't understand the
  doc stuff.  However, the original code was definitely wrong and
  breaking the renaming of family instance declarations.
- The important point is that in

    data instance T pats = rhs

  T is *not* a defining occurence of T (similarly as C is not a defining
  occurence in "instance C Int").

17 years agoFix parent position in RnNames.nubAvails 2006-10-22
Manuel M T Chakravarty [Sat, 21 Oct 2006 03:58:29 +0000 (03:58 +0000)]
Fix parent position in RnNames.nubAvails
- `RnNames.nubAvails', which amalgamates AvailInfo items that belong to the
  same parent, needs to be careful that the parent name occurs first if it is
  in the list of subnames at all.  (Otherwise, we can get funny export items
  in ifaces.)
- I discovered this while debugging family import/exports, but I am pretty
  sure the bug would also have shown up without using families under the
  right circumstances.

17 years agoFix export of associated families with new name parent story
Manuel M T Chakravarty [Sat, 21 Oct 2006 00:28:13 +0000 (00:28 +0000)]
Fix export of associated families with new name parent story

Given

  module Exp (T)
  where

  class C a where
    data T a :: *

we need the AvailInfo for the export item to be C|{T}, not just T.
This patch achieves that under the new name parent scheme.

17 years agoFix processing of imports involving ATs with the new name parent code
Manuel M T Chakravarty [Fri, 20 Oct 2006 18:04:42 +0000 (18:04 +0000)]
Fix processing of imports involving ATs with the new name parent code

Associated types in import lists require special care and the new name
parent code broke that.  What's the problem?  in the presence of ATs
the name parent relation can have a depth of two (not just one as in H98).
Here is an example:

  class GMapKey a where
    data GMap a :: * -> *
  instance GMapKey Int where
    data GMap Int v = GMapInt ...

The data constructor GMapInt's parent is GMap whose parent in turn is the
class GMapKey; ie, GMapKey is GMapInt's grand parent.  In H98, data types
have no parents (which is in some places in the code represented by making
them their own parent).

I fixed this by extending the information in filterImport's occ_env and
taking the case of associated types explicitly in consideration when
processing the various forms of IE items.

17 years agoFix family instance bug due to the name parent elimination
Manuel M T Chakravarty [Thu, 19 Oct 2006 18:01:03 +0000 (18:01 +0000)]
Fix family instance bug due to the name parent elimination
- Its important that `isImplicitTyCon' considers
  (a) associated families to be implicit, but
  (b) considers family instances *not* to be implicit (for the same reasons
      that a dfun is not implicit).

17 years agoFix show-iface for family instances & add debug ppr for type declarations
Manuel M T Chakravarty [Thu, 19 Oct 2006 16:58:40 +0000 (16:58 +0000)]
Fix show-iface for family instances & add debug ppr for type declarations

17 years agoRun dos2unix on all the outputs, and don't let it eat stderr
Ian Lynagh [Thu, 19 Oct 2006 13:48:18 +0000 (13:48 +0000)]
Run dos2unix on all the outputs, and don't let it eat stderr

17 years agoFix stage1 build with 6.2.1 (from Andy Gill)
Ian Lynagh [Thu, 19 Oct 2006 00:08:07 +0000 (00:08 +0000)]
Fix stage1 build with 6.2.1 (from Andy Gill)

17 years agoFix the build with GHC 6.2.2
Ian Lynagh [Wed, 18 Oct 2006 23:05:55 +0000 (23:05 +0000)]
Fix the build with GHC 6.2.2

17 years agoCross-module consistency check for family instances
Manuel M T Chakravarty [Wed, 18 Oct 2006 22:13:00 +0000 (22:13 +0000)]
Cross-module consistency check for family instances

17 years agoFixed spelling error in compiler/ghci/InteractiveUI.hs and docs/users_guide/ghci.xml
basvandijk@home.nl [Wed, 11 Oct 2006 20:43:01 +0000 (20:43 +0000)]
Fixed spelling error in compiler/ghci/InteractiveUI.hs and docs/users_guide/ghci.xml

17 years agoFix a bug in Lint (which wrongly complained when compiling Data.Sequence with -02)
simonpj@microsoft.com [Wed, 18 Oct 2006 12:05:00 +0000 (12:05 +0000)]
Fix a bug in Lint (which wrongly complained when compiling Data.Sequence with -02)

17 years agoAdd the primitive type Any, and use it for Dynamics
simonpj@microsoft.com [Wed, 18 Oct 2006 11:56:58 +0000 (11:56 +0000)]
Add the primitive type Any, and use it for Dynamics

GHC's code generator can only enter a closure if it's guaranteed
not to be a function.  In the Dynamic module, we were using the
type (forall a.a) as the type to which the dynamic type was unsafely
cast:
type Obj = forall a.a

Gut alas this polytype was sometimes instantiated to (), something
like this (it only bit when profiling was enabled)
let y::() = dyn ()
in (y `cast` ..) p q
As a result, an ASSERT in ClosureInfo fired (hooray).

I've tided this up by making a new, primitive, lifted type Any, and
arranging that Dynamic uses Any, thus:
type Obj = ANy

While I was at it, I also arranged that when the type checker instantiates
un-constrained type variables, it now instantiates them to Any, not ()
e.g.  length Any []

[There remains a Horrible Hack when we want Any-like things at arbitrary
kinds.  This essentially never happens, but see comments with
TysPrim.mkAnyPrimTyCon.]

Anyway, this fixes Trac #905

17 years agoAdd comment about arity
simonpj@microsoft.com [Wed, 18 Oct 2006 11:24:18 +0000 (11:24 +0000)]
Add comment about arity

I'm not sure what the significance of the "arity" of a primtive
TyCon is.  They aren't necessarily saturated, so it's not that.

I rather think that arity is only relevant for
SynTyCon
AlgTyCon
CoercionTyCon

This comment (and commit message) is just an aide memoire.

17 years agoSpelling in comment
simonpj@microsoft.com [Wed, 18 Oct 2006 11:23:51 +0000 (11:23 +0000)]
Spelling in comment

17 years agoMinor refactoring
simonpj@microsoft.com [Wed, 18 Oct 2006 11:23:20 +0000 (11:23 +0000)]
Minor refactoring

17 years agoComments onl
simonpj@microsoft.com [Wed, 18 Oct 2006 11:22:35 +0000 (11:22 +0000)]
Comments onl

17 years agofix build for 6.4.x and 6.6.x
Simon Marlow [Wed, 18 Oct 2006 08:05:26 +0000 (08:05 +0000)]
fix build for 6.4.x and 6.6.x

17 years agocompensate for gmp/configure sometimes not being executable
Simon Marlow [Tue, 17 Oct 2006 13:22:15 +0000 (13:22 +0000)]
compensate for gmp/configure sometimes not being executable

17 years agoRejig TABLES_NEXT_TO_CODE: the -unreg flag was broken by earlier changes
Simon Marlow [Tue, 17 Oct 2006 09:44:35 +0000 (09:44 +0000)]
Rejig TABLES_NEXT_TO_CODE: the -unreg flag was broken by earlier changes
A GHC binary can generally build either registerised or unregisterised
code, unless it is unregisterised only.

The previous changes broke this, but I think I've now restored it.

17 years agoStage 2 fix to "Keep track of family instance modules"
Manuel M T Chakravarty [Mon, 16 Oct 2006 19:40:48 +0000 (19:40 +0000)]
Stage 2 fix to "Keep track of family instance modules"

17 years agoremove use of FiniteMap, use Text.Printf
Simon Marlow [Mon, 16 Oct 2006 15:19:35 +0000 (15:19 +0000)]
remove use of FiniteMap, use Text.Printf

17 years agofix a regular expression in banner_re
Simon Marlow [Mon, 16 Oct 2006 15:08:02 +0000 (15:08 +0000)]
fix a regular expression in banner_re

17 years agoTry to get the right output for nofib-analyse
Samuel Bronson [Sat, 14 Oct 2006 17:58:55 +0000 (17:58 +0000)]
Try to get the right output for nofib-analyse

17 years agoGet nofib-analyse to build with 6.4 at least...
Samuel Bronson [Sat, 14 Oct 2006 16:34:42 +0000 (16:34 +0000)]
Get nofib-analyse to build with 6.4 at least...

17 years agoDon't squish "Inlined fn" into the right margin quite as much in trace output
Samuel Bronson [Mon, 16 Oct 2006 13:00:04 +0000 (13:00 +0000)]
Don't squish "Inlined fn" into the right margin quite as much in trace output

17 years agoFix build on x86_64
Simon Marlow [Mon, 16 Oct 2006 11:20:45 +0000 (11:20 +0000)]
Fix build on x86_64

17 years agoFix deadlock on second call to newSession
Simon Marlow [Mon, 16 Oct 2006 11:17:41 +0000 (11:17 +0000)]
Fix deadlock on second call to newSession
Tracked down by Krasimir Angelov

17 years agoBuild the GHC package in stage 3 too
Simon Marlow [Mon, 16 Oct 2006 11:09:26 +0000 (11:09 +0000)]
Build the GHC package in stage 3 too
This fixes the problem with the nightly builds not including the GHC
package.

17 years agomore fixups to make a stage 3 build do the right thing with the ghc package
Simon Marlow [Fri, 13 Oct 2006 13:53:18 +0000 (13:53 +0000)]
more fixups to make a stage 3 build do the right thing with the ghc package

17 years agouse the correct $(HC)
Simon Marlow [Fri, 13 Oct 2006 13:44:43 +0000 (13:44 +0000)]
use the correct $(HC)

17 years agoremove unused origPkgIdMap field from PackageState
Simon Marlow [Fri, 6 Oct 2006 10:51:48 +0000 (10:51 +0000)]
remove unused origPkgIdMap field from PackageState

17 years agoCache the package database the first time it is read
Simon Marlow [Fri, 6 Oct 2006 10:42:21 +0000 (10:42 +0000)]
Cache the package database the first time it is read
This was a slight oversight on my part, I intended to store the
pristine database in the pkgDatabase of DynFlags, but managed to
forget to do it.

17 years agofix non-DEBUG build (probably my fault, sorry)
Simon Marlow [Mon, 16 Oct 2006 10:58:52 +0000 (10:58 +0000)]
fix non-DEBUG build (probably my fault, sorry)

17 years agoAdd assertion checks for mkCoVar/mkTyVar
simonpj@microsoft.com [Fri, 13 Oct 2006 16:24:34 +0000 (16:24 +0000)]
Add assertion checks for mkCoVar/mkTyVar

A type variable has a flag saying whether it is a *type* variable or
a *coercion* variable.  This patch adds assertions to check the flag.

And it adds fixes to places which were Wrong (and hence fired the
assertion)!

Also removed isCoVar from Coercion, since it's done by Var.isCoVar.

17 years agoUncomment code to emit a space in place of a '>' in literate scripts
Ian Lynagh [Fri, 13 Oct 2006 13:15:14 +0000 (13:15 +0000)]
Uncomment code to emit a space in place of a '>' in literate scripts
This fixes trac #210. Test is read041.

17 years agoChange type of TcGadt.refineType, plus consequences
simonpj@microsoft.com [Fri, 13 Oct 2006 11:58:01 +0000 (11:58 +0000)]
Change type of TcGadt.refineType, plus consequences

17 years agoMore refactoring in RnNames
simonpj@microsoft.com [Fri, 13 Oct 2006 09:42:30 +0000 (09:42 +0000)]
More refactoring in RnNames

I rather self-indulgently spent a chunk of yesterday working on
refactoring RnNames further.  The result is significantly simpler:

* A GlobalRdrElt gets an extra field, gre_par, which records
  the parent (if any) of the name

* ImportAvails has two fields deleted: imp_env and imp_parent.
  The information provided by these fields was only used when
  processing the export list; and the same information is now readily
  generated from the GlobalRdrElts in the GlobalRdrEnv

I also did some tidying up; notably moving AvailEnv stuff from
TcRnTypes to RnNames.

The result is tha the compiler is some 130 lines shorter than before

17 years agoKeep track of family instance modules
Manuel M T Chakravarty [Fri, 13 Oct 2006 00:42:23 +0000 (00:42 +0000)]
Keep track of family instance modules
- Now each modules carries
  (1) a flag saying whether it contains family instance declarations and
  (2) a list of all modules further down in the import tree that contain
      family instance declarations.
  (The information is split into these two parts for the exact same reasons why
  the info about orphan modules is split, too.)
- This is the first step to *optimised* overlap checking of family instances
  coming from imported modules.

*** WARNING: This patch changes the interface file format! ***
***          Recompile libraries and stage2 from scratch!  ***

17 years agoOverlap check for family instances def'd in current module
Manuel M T Chakravarty [Thu, 12 Oct 2006 20:37:37 +0000 (20:37 +0000)]
Overlap check for family instances def'd in current module
- All family instances are checked for overlap when entered into TcGblEnv.
  Their are checked against all instances in the EPS and those currently in
  the TcGblEnv.

17 years agoComments only
simonpj@microsoft.com [Thu, 12 Oct 2006 16:02:54 +0000 (16:02 +0000)]
Comments only

17 years agoMake Inst into a record type to ease subsequent changes
simonpj@microsoft.com [Wed, 11 Oct 2006 11:23:05 +0000 (11:23 +0000)]
Make Inst into a record type to ease subsequent changes

17 years agoImprove pretty-printing slightly
simonpj@microsoft.com [Wed, 11 Oct 2006 11:22:42 +0000 (11:22 +0000)]
Improve pretty-printing slightly

17 years agoAdd comments about primop rules
simonpj@microsoft.com [Wed, 11 Oct 2006 11:22:24 +0000 (11:22 +0000)]
Add comments about primop rules

17 years agofix definition of fib in example code
Simon Marlow [Thu, 12 Oct 2006 11:07:11 +0000 (11:07 +0000)]
fix definition of fib in example code

17 years agoTrack changes in source packaging scheme
sven.panne@aedion.de [Thu, 12 Oct 2006 12:12:13 +0000 (12:12 +0000)]
Track changes in source packaging scheme

17 years agofix definition of fib in example code
Simon Marlow [Thu, 12 Oct 2006 11:07:11 +0000 (11:07 +0000)]
fix definition of fib in example code

17 years agoPartially fix GHCi when unregisterised
Ian Lynagh [Thu, 12 Oct 2006 01:39:01 +0000 (01:39 +0000)]
Partially fix GHCi when unregisterised
We were constructing info tables designed for TABLES_NEXT_TO_CODE,
but were building without TABLES_NEXT_TO_CODE.

This patch also fixes a bug when we are unregisterised on amd64 and
have code with an address above 2^32.

17 years agoMore import tidying and fixing the stage 2 build
Simon Marlow [Wed, 11 Oct 2006 20:01:10 +0000 (20:01 +0000)]
More import tidying and fixing the stage 2 build

17 years agoUse relative URLs when referring to libraries; push to 6.6 branch
simonpj@microsoft.com [Wed, 11 Oct 2006 14:25:02 +0000 (14:25 +0000)]
Use relative URLs when referring to libraries; push to 6.6 branch

17 years agoImprove documentation of concurrent and parallel Haskell; push to branch
simonpj@microsoft.com [Tue, 10 Oct 2006 15:58:34 +0000 (15:58 +0000)]
Improve documentation of concurrent and parallel Haskell; push to branch

17 years agoCorrect id to linkend
simonpj@microsoft.com [Tue, 10 Oct 2006 15:58:14 +0000 (15:58 +0000)]
Correct id to linkend

17 years agoFix trac #921: generate *q instructions for int-float conversions
Ian Lynagh [Wed, 11 Oct 2006 14:00:07 +0000 (14:00 +0000)]
Fix trac #921: generate *q instructions for int-float conversions
We need to generate, e.g., cvtsi2sdq rather than cvtsi2sd on amd64 in
order to have int-float conversions work correctly for values not
correctly representable in 32 bits.

17 years agoModule header tidyup #2
Simon Marlow [Wed, 11 Oct 2006 14:35:23 +0000 (14:35 +0000)]
Module header tidyup #2
Push this further along, and fix build problems in the first patch.

17 years agoremove BitSet, it isn't used
Simon Marlow [Wed, 11 Oct 2006 13:16:14 +0000 (13:16 +0000)]
remove BitSet, it isn't used

17 years agoModule header tidyup, phase 1
Simon Marlow [Wed, 11 Oct 2006 12:05:17 +0000 (12:05 +0000)]
Module header tidyup, phase 1
This patch is a start on removing import lists and generally tidying
up the top of each module.  In addition to removing import lists:

   - Change DATA.IOREF -> Data.IORef etc.
   - Change List -> Data.List etc.
   - Remove $Id$
   - Update copyrights
   - Re-order imports to put non-GHC imports last
   - Remove some unused and duplicate imports

17 years agoInterface file optimisation and removal of nameParent
Simon Marlow [Wed, 11 Oct 2006 12:05:18 +0000 (12:05 +0000)]
Interface file optimisation and removal of nameParent

This large commit combines several interrelated changes:

  - IfaceSyn now contains actual Names rather than the special
    IfaceExtName type.  The binary interface file contains
    a symbol table of Names, where each entry is a (package,
    ModuleName, OccName) triple.  Names in the IfaceSyn point
    to entries in the symbol table.

    This reduces the size of interface files, which should
    hopefully improve performance (not measured yet).

    The toIfaceXXX functions now do not need to pass around
    a function from Name -> IfaceExtName, which makes that
    code simpler.

  - Names now do not point directly to their parents, and the
    nameParent operation has gone away.  It turned out to be hard to
    keep this information consistent in practice, and the parent info
    was only valid in some Names.  Instead we made the following
    changes:

    * ImportAvails contains a new field
          imp_parent :: NameEnv AvailInfo
      which gives the family info for any Name in scope, and
      is used by the renamer when renaming export lists, amongst
      other things.  This info is thrown away after renaming.

    * The mi_ver_fn field of ModIface now maps to
      (OccName,Version) instead of just Version, where the
      OccName is the parent name.  This mapping is used when
      constructing the usage info for dependent modules.
      There may be entries in mi_ver_fn for things that are not in
      scope, whereas imp_parent only deals with in-scope things.

    * The md_exports field of ModDetails now contains
      [AvailInfo] rather than NameSet.  This gives us
      family info for the exported names of a module.

Also:

   - ifaceDeclSubBinders moved to IfaceSyn (seems like the
     right place for it).

   - heavily refactored renaming of import/export lists.

   - Unfortunately external core is now broken, as it relied on
     IfaceSyn.  It requires some attention.

17 years agoadd extendNameEnvList_C
Simon Marlow [Tue, 10 Oct 2006 15:31:37 +0000 (15:31 +0000)]
add extendNameEnvList_C

17 years agogetMainDeclBinder should return Nothing for a binding with no variables
Simon Marlow [Tue, 10 Oct 2006 15:30:23 +0000 (15:30 +0000)]
getMainDeclBinder should return Nothing for a binding with no variables
See test rn003

17 years agoUse ":Co", not "Co" to prefix coercion TyCon names
Simon Marlow [Tue, 10 Oct 2006 13:44:49 +0000 (13:44 +0000)]
Use ":Co", not "Co" to prefix coercion TyCon names
Avoid possibility of name clash

17 years agoFix another hi-boot file
Ian Lynagh [Tue, 10 Oct 2006 23:51:57 +0000 (23:51 +0000)]
Fix another hi-boot file

17 years agoRemoved unused unwrapFamInstBody from MkId
Manuel M T Chakravarty [Tue, 10 Oct 2006 20:58:43 +0000 (20:58 +0000)]
Removed unused unwrapFamInstBody from MkId

17 years agoRejig the auto-scc wrapping stuff
simonpj@microsoft.com [Tue, 10 Oct 2006 16:41:16 +0000 (16:41 +0000)]
Rejig the auto-scc wrapping stuff

17 years agoDo not filter the type envt after each GHCi stmt
simonpj@microsoft.com [Tue, 10 Oct 2006 14:32:25 +0000 (14:32 +0000)]
Do not filter the type envt after each GHCi stmt

Fixes Trac #925

A new comment in TcRnDriver in tcRnStmt reads thus:

At one stage I removed any shadowed bindings from the type_env;
they are inaccessible but might, I suppose, cause a space leak if we leave them there.
However, with Template Haskell they aren't necessarily inaccessible.  Consider this
GHCi session
 Prelude> let f n = n * 2 :: Int
 Prelude> fName <- runQ [| f |]
 Prelude> $(return $ AppE fName (LitE (IntegerL 7)))
 14
 Prelude> let f n = n * 3 :: Int
 Prelude> $(return $ AppE fName (LitE (IntegerL 7)))
In the last line we use 'fName', which resolves to the *first* 'f'
in scope. If we delete it from the type env, GHCi crashes because
it doesn't expect that.

17 years agoFail more informatively when a global isn't in the type environment
simonpj@microsoft.com [Tue, 10 Oct 2006 14:31:45 +0000 (14:31 +0000)]
Fail more informatively when a global isn't in the type environment

17 years agoRough matches for family instances
Manuel M T Chakravarty [Tue, 10 Oct 2006 04:46:56 +0000 (04:46 +0000)]
Rough matches for family instances
- Class and type family instances just got a lot more similar.
- FamInst, like Instance, now has a rough match signature.  The idea is the
  same: if the rough match doesn't match, there is no need to pull in the while
  tycon describing the instance (from a lazily read iface).
- IfaceFamInst changes in a similar way and the list of all IFaceFamInsts is
  now written into the binary iface (as for class instances), as deriving it
  from the tycon (as before) would render the whole rough matching useless.
- As a result of this, the plumbing of class instances and type instances
  through the various environments, ModIface, ModGuts, and ModDetails is now
  almost the same.  (The remaining difference are mostly because the dfun of a
  class instance is an Id, but type instance refer to a TyCon, not an Id.)

*** WARNING: The interface file format changed! ***
***      Rebuild from scratch. ***

17 years agoTweaks and missing case in disassembler
Ian Lynagh [Mon, 9 Oct 2006 23:05:39 +0000 (23:05 +0000)]
Tweaks and missing case in disassembler

17 years agoUpdate hi-boot files to fix building with old GHCs
Ian Lynagh [Mon, 9 Oct 2006 19:32:18 +0000 (19:32 +0000)]
Update hi-boot files to fix building with old GHCs

17 years agoSTM invariants
tharris@microsoft.com [Sat, 7 Oct 2006 12:29:07 +0000 (12:29 +0000)]
STM invariants

17 years agoFix unregisterised alpha builds
Ian Lynagh [Wed, 4 Oct 2006 12:58:57 +0000 (12:58 +0000)]
Fix unregisterised alpha builds

17 years agoComments and an import-trim
simonpj@microsoft.com [Fri, 6 Oct 2006 16:14:03 +0000 (16:14 +0000)]
Comments and an import-trim

17 years agoMention that the module sub-directory structure for .o and .hi files is created autom...
simonpj@microsoft.com [Fri, 6 Oct 2006 15:12:34 +0000 (15:12 +0000)]
Mention that the module sub-directory structure for .o and .hi files is created automatically by GHC

17 years agoBale out before renamer errors are duplicated
simonpj@microsoft.com [Fri, 6 Oct 2006 14:02:50 +0000 (14:02 +0000)]
Bale out before renamer errors are duplicated

With the new Haddock patch, renamer errors can be duplicated;
so we want to bale out before doing the Haddock stuff if errors
are found.

(E.g test mod67 shows this up.)

17 years agoAvoid repeatedly loading GHC.Prim
simonpj@microsoft.com [Fri, 6 Oct 2006 14:01:02 +0000 (14:01 +0000)]
Avoid repeatedly loading GHC.Prim

This patch changes HscTypes.lookupIfaceByModule.  The problem was that
when compiling the 'base' package, we'd repeatedly reload GHC.Prim.
This is easily fixed by looking in the PIT too. A comment with
lookupIfaceByModule explains

17 years agoPrint the 'skipping' messages at verbosity level 1
simonpj@microsoft.com [Fri, 6 Oct 2006 14:00:34 +0000 (14:00 +0000)]
Print the 'skipping' messages at verbosity level 1

17 years agoFix up the typechecking of interface files during --make
simonpj@microsoft.com [Fri, 6 Oct 2006 13:19:32 +0000 (13:19 +0000)]
Fix up the typechecking of interface files during --make

This patch fixes Trac #909.  The problem was that when compiling
the base package, the handling of wired-in things wasn't right;
in TcIface.tcWiredInTyCon it repeatedly loaded GHC.Base.hi into the
PIT, even though that was the very module it was compiling.

The main fix is by introducing TcIface.ifCheckWiredInThing.

But I did some minor refactoring as well.

17 years agoImport trimming
simonpj@microsoft.com [Fri, 6 Oct 2006 13:18:30 +0000 (13:18 +0000)]
Import trimming

17 years agoFigure out where the rest of the repositories are, based on defaultrepo
Simon Marlow [Fri, 6 Oct 2006 10:00:49 +0000 (10:00 +0000)]
Figure out where the rest of the repositories are, based on defaultrepo
This is a slight improvement over the patch sent by jamey@minilop.net,
we now do it properly if the source repo was a GHC tree on the local
filesystem too.

Merge post 6.6.

17 years agoYet another fix to mkAtomicArgs (for floating of casts)
simonpj@microsoft.com [Fri, 6 Oct 2006 07:52:13 +0000 (07:52 +0000)]
Yet another fix to mkAtomicArgs (for floating of casts)

Comment Note [Take care] explains.

mkAtomicArgs is a mess.  A substantial rewrite of Simplify is needed.

17 years agoImprove comments and error tracing
simonpj@microsoft.com [Fri, 6 Oct 2006 07:50:58 +0000 (07:50 +0000)]
Improve comments and error tracing

17 years agoImprove error message
simonpj@microsoft.com [Fri, 6 Oct 2006 07:20:02 +0000 (07:20 +0000)]
Improve error message

17 years agoUndo an accidentally-committed patch by Audrey
simonpj@microsoft.com [Fri, 6 Oct 2006 07:19:25 +0000 (07:19 +0000)]
Undo an accidentally-committed  patch by Audrey

17 years agoMerge Haddock comment support from ghc.haddock -- big patch
davve@dtek.chalmers.se [Thu, 5 Oct 2006 22:02:58 +0000 (22:02 +0000)]
Merge Haddock comment support from ghc.haddock -- big patch