
New patches:

[Don't build editline
Ian Lynagh <igloo@earth.li>**20090121171955
 It was causing build problems for people who don't have the C editline,
 and we plan to switch to Haskelline anyway.
] {
hunk ./compiler/ghc.mk 318
-# Enable editline if:
-#   - we're building stage 2/3, and we have built the editline package
-#
-# But we don't enable editline on Windows, as Windows terminals have
-# editline-like support builtin.
-#
-ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-ifeq "$(wildcard $(FPTOOLS_TOP_ABS)/libraries/editline/unbuildable)" ""
-compiler_stage2_CONFIGURE_OPTS += --flags=editline
-endif
-endif
hunk ./ghc.mk 256
-	random
-
-ifeq "$(Windows)" "NO"
-PACKAGES += \
-	editline
-endif
-
-PACKAGES += \
+	random \
}

Context:

[When running configure, pass the location of gcc
Ian Lynagh <igloo@earth.li>**20090117164527] 
[Use '' around flags to cope with paths containing \ on Windows
Ian Lynagh <igloo@earth.li>**20090117155839] 
[validate fix on 32-bit
Simon Marlow <marlowsd@gmail.com>**20090114162834] 
[fix validate on Windows
Simon Marlow <marlowsd@gmail.com>**20090114155842] 
[UNDO: Always check the result of pthread_mutex_lock() and pthread_mutex_unlock().
Simon Marlow <marlowsd@gmail.com>**20090116114339
 Ignore-this: 6cc82d384582097785d78fba46ca29d2
 This patch caused problems on Mac OS X, undoing until we can do it better.
 
 rolling back:
 
 Sun Jan  4 19:24:43 GMT 2009  Matthias Kilian <kili@outback.escape.de>
   * Always check the result of pthread_mutex_lock() and pthread_mutex_unlock().
   
   Don't check pthread_mutex_*lock() only on Linux and/or only if DEBUG
   is defined. The return values of those functions are well defined
   and should be supported on all operation systems with pthreads. The
   checks are cheap enough to do them even in the default build (without
   -DDEBUG).
   
   While here, recycle an unused macro ASSERT_LOCK_NOTHELD, and let
   the debugBelch part enabled with -DLOCK_DEBUG work independently
   of -DDEBUG.
   
 
     M ./includes/OSThreads.h -30 +10
] 
[Update config.guess, config.sub and install.sh from automake-1.10.2
Simon Marlow <marlowsd@gmail.com>**20090116095311
 Ignore-this: cdc19dd28053a6a71283776ecb802c62
 In particular, config.guess should now know about x86_64-pc-solaris2
] 
[robustify a bit: include the package-data.mk rule only in phase 0
Simon Marlow <marlowsd@gmail.com>**20090116152731
 Ignore-this: 25ba18bcb3a6a61090c8f756cfb7bc0b
 So if we forget to run phase 0, the build will fail earlier
] 
[remove some code that didn't do anything
Simon Marlow <marlowsd@gmail.com>**20090116113915
 Ignore-this: 80ea11908f5c66c6e1cc3cbfe5c88014
] 
[Fix a race in the build system
Ian Lynagh <igloo@earth.li>**20090116123125
 mkdependC needs to create inplace/bin itself, rather than relying on
 something else doing so before it is created.
] 
[More useful error message when a package .hi file cannot be found:
Simon Marlow <marlowsd@gmail.com>**20090115122524
 Ignore-this: b595e2fac5d9b5214340f83a7d7dd730
 
 > import System.Process
 Could not find module `System.Process':
   There are files missing in the process-1.0.1.1 package,
   try running 'ghc-pkg check'.
   Use -v to see a list of the files searched for.
] 
[soup-up "ghc-pkg check"
Simon Marlow <marlowsd@gmail.com>**20090115122143
 Ignore-this: 6d29af258eb31d417d01fed167cd5d47
 
 We now look for missing files (including .hi files), and report all
 the packages that are transitively broken.
 
 $ ghc-pkg check 
 There are problems in package syb-0.1.0.0:
   dependency foo-4.0.0.0 doesn't exist
 There are problems in package process-1.0.1.1:
   file System/Process.hi is missing
 
 The following packages are broken, either because they have a problem
 listed above, or because they depend on a broken package.
 syb-0.1.0.0
 process-1.0.1.1
 base-3.0.3.0
 Cabal-1.7.0
 haskell98-1.0.1.0
 haddock-2.4.2
 ghc-6.11
] 
[document -feager-blackholing
Simon Marlow <marlowsd@gmail.com>**20090115093922
 Ignore-this: 5958a16c7148cb5df0f4b3f1e1dee6d6
] 
[External Core: re-add code I removed mistakenly in last commit
Tim Chevalier <chevalier@alum.wellesley.edu>**20090115002612] 
[External Core lib: lots of cleanup
Tim Chevalier <chevalier@alum.wellesley.edu>**20090114224428
 
 - Factor out code for applying newtypes from Check into CoreUtils
 - Use this code in Prep, which allowed for some simplification
 - Change Merge and ElimDeadCode to not flatten top-level binds
 - Add a flag for elimDeadCode to tell it whether to keep
 exported bindings or not.
 - Other things.
] 
[External Core: print out more precise dependency info
Tim Chevalier <chevalier@alum.wellesley.edu>**20090114221734
 
 Print out the same recursive/non-recursive binding groups
 that existed in internal Core in an External Core file,
 rather than dumping everything into one big recursive group.
] 
[Fix "make install": Put "[]" in the install package.conf
Ian Lynagh <igloo@earth.li>**20090114205945] 
[Remove redundant import; spotted by Thorkil Naur
Ian Lynagh <igloo@earth.li>**20090114181937] 
[Detect when a C finalizer calls back to Haskell
Simon Marlow <marlowsd@gmail.com>**20090114121526
 Ignore-this: e361d7278e2478da2f300625076cc0ae
 This is illegal now, after the fix for #1364, but it turns out that
 the existing check for dodgy callbacks doesn't catch finalizers
 calling back, so we need another test.  This will be particularly
 important for 6.10.2, because the behaviour has changed.
] 
[Fix Trac #2931
simonpj@microsoft.com**20090113170948
 Ignore-this: 6ff0207627165f3f7bd145171e59b533
 
 Fix the lexical analyser when it encounters 'x<EOF> and Template 
 Haskell is on.
 
] 
[Rewrite CorePrep and improve eta expansion
simonpj@microsoft.com**20090113164953
 Ignore-this: 910d1d613592c116714c324618b1e45c
 
 This patch does two main things
 
 a) Rewrite most of CorePrep to be much easier to understand (I hope!).
    The invariants established by CorePrep are now written out, and
    the code is more perspicuous.  It is surpringly hard to get right,
    and the old code had become quite incomprehensible.
 
 b) Rewrite the eta-expander so that it does a bit of simplifying
    on-the-fly, and thereby guarantees to maintain the CorePrep
    invariants.  This make it much easier to use from CorePrep, and
    is a generally good thing anyway.
 
 A couple of pieces of re-structuring:
 
 *  I moved the eta-expander and arity analysis stuff into a new
    module coreSyn/CoreArity.
 
    Max will find that the type CoreArity.EtaInfo looks strangely 
    familiar.
 
 *  I moved a bunch of comments from Simplify to OccurAnal; that's
    why it looks as though there's a lot of lines changed in those
    modules.
 
 On the way I fixed various things
 
   - Function arguments are eta expanded
        f (map g)  ===>  let s = \x. map g x in f s
 
   - Trac #2368
 
 The result is a modest performance gain, I think mainly due
 to the first of these changes:
 
 --------------------------------------------------------------------------------
         Program           Size    Allocs   Runtime   Elapsed
 --------------------------------------------------------------------------------
             Min          -1.0%    -17.4%    -19.1%    -46.4%
             Max          +0.3%     +0.5%     +5.4%    +53.8%
  Geometric Mean          -0.1%     -0.3%     -7.0%    -10.2%
 
 
 
] 
[Rename isIdentityCoercion to isIdentityCoI; add Coercion.isIdentityCoercion
simonpj@microsoft.com**20090113164804
 Ignore-this: ac05f38a092959c08972c768fe427e06
] 
[Spelling in comment only
simonpj@microsoft.com**20090113164624
 Ignore-this: 2eb6372f996b9133683918aecad1a5aa
] 
[Make the ASSERT more informative
simonpj@microsoft.com**20090113164133
 Ignore-this: 4059e33cf594403e03c0eb4169dc300f
] 
[Export mapOL from OrdList
simonpj@microsoft.com**20090113164051
 Ignore-this: 3debd81ae00d3745ec248197b97d312f
] 
[Improve error messages slightly
simonpj@microsoft.com**20090113164020
 Ignore-this: 89090ec03d8ea201f64105c0dbb8d5f9
] 
[Do not do SpecConstr on functions that unconditionally diverge
simonpj@microsoft.com**20090113162918
 Ignore-this: cb0c210b936941b241c312c72545bfe2
 
 There is no point in specialising a function that is guaranteed to
 diverge, and doing so screwed up arity stuff.  
 
 See Note [Do not specialise diverging functions].
 
 
] 
[Make -XTypeFamilies imply -XRelaxedPolyRec (Trac #2944)
simonpj@microsoft.com**20090113162716
 Ignore-this: 8ab21566045c8bc8050ed7dda04e2df
] 
[Fix Trac #2937: deserialising assoicated type definitions
simonpj@microsoft.com**20090113153217
 Ignore-this: 7d7852a70a34fc22773757709735cc24
 
 The deserialiser (TcIface) for associated type definitions wasn't
 taking into account that the class decl brings into scope some 
 type variables that scope over the data/type family declaration.
 
 Easy to fix: the new function is TcIface.bindIfaceTyVars_AT
 
] 
[Remove a redundant import
Ian Lynagh <igloo@earth.li>**20090114181212] 
[Always check the result of pthread_mutex_lock() and pthread_mutex_unlock().
Matthias Kilian <kili@outback.escape.de>**20090104192443
 
 Don't check pthread_mutex_*lock() only on Linux and/or only if DEBUG
 is defined. The return values of those functions are well defined
 and should be supported on all operation systems with pthreads. The
 checks are cheap enough to do them even in the default build (without
 -DDEBUG).
 
 While here, recycle an unused macro ASSERT_LOCK_NOTHELD, and let
 the debugBelch part enabled with -DLOCK_DEBUG work independently
 of -DDEBUG.
 
] 
[sanity checking fixes
Simon Marlow <marlowsd@gmail.com>**20090112121042] 
[Keep the remembered sets local to each thread during parallel GC
Simon Marlow <marlowsd@gmail.com>**20090112121024
 This turns out to be quite vital for parallel programs:
 
   - The way we discover which threads to traverse is by finding
     dirty threads via the remembered sets (aka mutable lists).
 
   - A dirty thread will be on the remembered set of the capability
     that was running it, and we really want to traverse that thread's
     stack using the GC thread for the capability, because it is in
     that CPU's cache.  If we get this wrong, we get penalised badly by
     the memory system.
 
 Previously we had per-capability mutable lists but they were
 aggregated before GC and traversed by just one of the GC threads.
 This resulted in very poor performance particularly for parallel
 programs with deep stacks.
 
 Now we keep per-capability remembered sets throughout GC, which also
 removes a lock (recordMutableGen_sync).
] 
[indicate which TSOs are dirty in the printAllThreads() output
Simon Marlow <marlowsd@gmail.com>**20090107151449] 
[Fix Trac #2584: Pretty printing of types with HsDocTy
David Waern <david.waern@gmail.com>**20090109191713
 
 The pretty printing clause for HsDocTy was wrong, causing brackets to be left
 out. We now print Haddock comments on types as if they were postfix type
 operators.
] 
[Add support for .S sources
Ian Lynagh <igloo@earth.li>**20090115152421] 
[Clean the testsuite if it exists
Ian Lynagh <igloo@earth.li>**20090115142627] 
[Add a comment
Ian Lynagh <igloo@earth.li>**20090115142459] 
[Fix building of AdjustorAsm.S
Ian Lynagh <igloo@earth.li>**20090115142447] 
[don't copy .hs-boot files into the build dir unless we have to
Simon Marlow <marlowsd@gmail.com>**20090115160504
 Ignore-this: a787e93cf33db05e92a012f7179955
] 
[filter-out v from the WAYS
Simon Marlow <marlowsd@gmail.com>**20090115152257
 Ignore-this: b1b16c7bb25a32f4f7587c62bcfb1ca7
] 
[Disable the "unnecessary SOURCE import" warning if !isOneShot
Simon Marlow <marlowsd@gmail.com>**20090115150840
 Ignore-this: a364fabb01dae3672318bff3a6213959
 This check is done by the compilation manager in
 GHC.warnUnnecessarySourceImports, and doing it here gives
 non-deterministic results.
 
 Should fix random failures of the hs-boot test.
] 
[add missing dependency of stage2 on the stage2 ghc package
Simon Marlow <marlowsd@gmail.com>**20090115150628
 Ignore-this: 90d4e1da870cc8f6a53438a4f3f95e1e
] 
[revert the STANDARD_OPTS hack, and rename H_FILES to rts_H_FILES
Simon Marlow <marlowsd@gmail.com>**20090115144703
 Ignore-this: 63acad9378b9eb1827646a2d7f6067c4
] 
[Windows fix: = should be +=
Simon Marlow <marlowsd@gmail.com>**20090115144608
 Ignore-this: 50279854b2265e25476c6a69754eca4b
] 
[add comments
Simon Marlow <marlowsd@gmail.com>**20090114160931
 Ignore-this: 451d750a6a16b5d4533fcf9f31ffbb55
] 
[eliminate some hacks that aren't (or shouldn't) be necessary now
Simon Marlow <marlowsd@gmail.com>**20090114155644
 Ignore-this: f8fee823b00928caadd3b91a46ed8181
] 
[make this a stub
Simon Marlow <marlowsd@gmail.com>**20090114155627
 Ignore-this: f6204760d77f69f0da59e42bda93e36
] 
[add a missing $
Simon Marlow <marlowsd@gmail.com>**20090114155325
 Ignore-this: d4dc15579524f8d292b292ecf9fb488a
] 
[make this a stub makefile
Simon Marlow <marlowsd@gmail.com>**20090114155222
 Ignore-this: d82fdff9846d2944ecd8208da90fcbad
] 
[make this work
Simon Marlow <marlowsd@gmail.com>**20090114155200
 Ignore-this: e9a2be3c4c8b2ff154f2bc9559f36b6d
] 
[comment updates
Simon Marlow <marlowsd@gmail.com>**20090114154518
 Ignore-this: ba2e2b44309710d8613dcc1b4ff701c9
] 
[Define and use $(INPLACE)
Ian Lynagh <igloo@earth.li>**20090114145510] 
[Don't copy files to inplace/ before it exists
Ian Lynagh <igloo@earth.li>*-20090113233623] 
[Don't copy files to inplace/ before it exists
Ian Lynagh <igloo@earth.li>**20090113233623] 
[Install ghc(i)-usage.txt
Ian Lynagh <igloo@earth.li>**20090113232337] 
[Only add GHC_TOUCHY_DIR to BUILD_DIRS on Windows
Ian Lynagh <igloo@earth.li>**20090113202159] 
[Remove troublesome spaces from make macro calls
Ian Lynagh <igloo@earth.li>**20090113200745] 
[Simplify SysTools
Ian Lynagh <igloo@earth.li>**20090113180005
 We no longer differentiate between installed and inplace compilers
] 
[Fix the datadir set in the ghc script
Ian Lynagh <igloo@earth.li>**20090113164132] 
[Build the splitter
Ian Lynagh <igloo@earth.li>**20090113162135] 
[Tweak the mangler's ghc.mk
Ian Lynagh <igloo@earth.li>**20090113161449] 
[GHC doesn't depend on touchy unless we're on Windows
Ian Lynagh <igloo@earth.li>**20090113160350] 
[SysTools now always assumes that we have an installed compiler
Ian Lynagh <igloo@earth.li>**20090113154833] 
[Add dependencies on the mangler and splitter
Ian Lynagh <igloo@earth.li>**20090113154200] 
[Rename FIELD_OFFSET to STG_FIELD_OFFSET to avoid clashing with a symbol defined in winnt.h
Ian Lynagh <igloo@earth.li>**20090112235322] 
[Fix building of touchy
Ian Lynagh <igloo@earth.li>**20090112232839] 
[filepath is no longer a boot package
Ian Lynagh <igloo@earth.li>**20090112221725] 
[Add a TODO item
Ian Lynagh <igloo@earth.li>**20090112203826] 
[Disable the in-tree windres for now
Ian Lynagh <igloo@earth.li>**20090112203744] 
[Fix building AutoApply.cmm
Ian Lynagh <igloo@earth.li>**20090112203122] 
[Temporarily disable the use of the in-tree perl
Ian Lynagh <igloo@earth.li>**20090112203059] 
[Build touchy
Ian Lynagh <igloo@earth.li>**20090112191100] 
[Tell GHC to look in the right place for installed binaries
Ian Lynagh <igloo@earth.li>**20090112190645] 
[Build gmp before phase 0
Ian Lynagh <igloo@earth.li>**20090112190017] 
[Temporarily disable the Windows in-tree gcc
Ian Lynagh <igloo@earth.li>**20090112184401] 
[Add some more exeext's
Ian Lynagh <igloo@earth.li>**20090112182123] 
[Fix installing GHC on Windows
Ian Lynagh <igloo@earth.li>**20090112181939] 
[Wibble the topdir-finding on Windows
Ian Lynagh <igloo@earth.li>**20090112183602] 
[Tweak some paths
Ian Lynagh <igloo@earth.li>**20090112181125] 
[Fix building genprimopcode on Windows
Ian Lynagh <igloo@earth.li>**20090112173759] 
[Add a missing $
Ian Lynagh <igloo@earth.li>**20090112172325] 
[mkdependC is a script, so no exeext
Ian Lynagh <igloo@earth.li>**20090112163735] 
[Fix building unlit on Windows
Ian Lynagh <igloo@earth.li>**20090112163546] 
[Don't build editline on Windows
Ian Lynagh <igloo@earth.li>**20090112163402] 
[Kludge around the path to GHC on Windows
Ian Lynagh <igloo@earth.li>**20090112161851] 
[comments only: add some idioms
Simon Marlow <marlowsd@gmail.com>**20090112102044] 
[Make ghc-pkg and the build system agree on where package.conf is
Ian Lynagh <igloo@earth.li>**20090111214831
 GHC itself doesn't agree yet
] 
[ghc-pkg can't be a script, as then Cabal can't run it
Ian Lynagh <igloo@earth.li>**20090111213552] 
[ghc-pkg is still a script at the moment
Ian Lynagh <igloo@earth.li>**20090111201311] 
[mkdirhier doesn't want an exe extension
Ian Lynagh <igloo@earth.li>**20090111184750] 
[Don't fail if inplace and inplace/bin already exist
Ian Lynagh <igloo@earth.li>**20090111184634] 
[Add a load more exeexts
Ian Lynagh <igloo@earth.li>**20090111184044] 
[Whitespace-only
Ian Lynagh <igloo@earth.li>**20090111184007] 
[Add some exeexts
Ian Lynagh <igloo@earth.li>**20090111183741
 We were touch $@ (ghc-cabal), but GHC was creating ghc-cabal.exe.
 When we later came to install ghc-cabal, we were installing the
 touched (empty) file, not the program we'd linked.
] 
[Fix typos; PNONY -> PHONY
Ian Lynagh <igloo@earth.li>**20090111180103] 
[Remove duplicate definition from newconfig.mk
Ian Lynagh <igloo@earth.li>**20090111175528] 
[Fix bootstrapping with GHC < 6.10
Ian Lynagh <igloo@earth.li>**20090109231233] 
[Follow changes in the old build system
Ian Lynagh <igloo@earth.li>**20090109205438] 
[Work-around a makefile loop of some sort related to INPLACE_PACKAGE_CONF
Ian Lynagh <igloo@earth.li>**20090109190229] 
[Don't hide makefile commands
Ian Lynagh <igloo@earth.li>**20090109185223] 
[Don't hide commands frmo Makefile
Ian Lynagh <igloo@earth.li>**20090109184543] 
[Create INPLACE_PACKAGE_CONF
Ian Lynagh <igloo@earth.li>**20090109171036
 It presumably worked before
     Thu Jan  8 09:56:28 GMT 2009  Simon Marlow <marlowsd@gmail.com>
       * Fix #2873: should fail if a package DB desn't exist
 as it would have been created the first time we added something to it.
] 
[Add "Word size" to the +RTS --info output
Ian Lynagh <igloo@earth.li>**20090109160454] 
[FIX BUILD on Windows (fix for #2873 broke it)
Simon Marlow <marlowsd@gmail.com>**20090109090658] 
[when calling mmap() with MAP_ANON, the fd argument should be -1
Simon Marlow <marlowsd@gmail.com>**20090108155341
 might fix #2925
] 
[Fix Trac #2914: record wild cards and assoicated types
simonpj@microsoft.com**20090108124118] 
[Fix #2873: should fail if a package DB desn't exist
Simon Marlow <marlowsd@gmail.com>**20090108095628
 We allowed non-existence before because the user DB is allowed to not
 exist, so now we have an explicit exception for that case.
] 
[Close the races between throwTo and thread completion
Simon Marlow <marlowsd@gmail.com>**20090107140507
 Any threads we missed were being caught by the GC (possibly the idle
 GC if the system was otherwise inactive), but that's not ideal.  The
 fix (from Bertram Felgenhauer) is to use lockTSO to synchronise,
 imposing an unconditional lockTSO on thread exit.  I couldn't measure
 any performance overhead from doing this, so it seems reasonable.
] 
[add comment
Simon Marlow <marlowsd@gmail.com>**20090107121142] 
[Fix two more locking issues in throwTo()
Bertram Felgenhauer <int-e@gmx.de>**20090107120808] 
[maybePerformBlockedException() should handle ThreadComplete/ThreadKilled
Simon Marlow <marlowsd@gmail.com>**20090107120734
 Part of the fix for #2910
] 
[fix a race where the timer signal could remain turned off, leading to deadlock
Simon Marlow <marlowsd@gmail.com>**20090107120652] 
[putMVar and takeMVar: add write_barrier() to fix race with throwTo
Simon Marlow <marlowsd@gmail.com>**20090107112026] 
[cruft removal
Simon Marlow <marlowsd@gmail.com>**20090106154408] 
[wake up the blocked exception queue on ThreadFinished; fixes #2910
Simon Marlow <marlowsd@gmail.com>**20090106153254] 
[bump GHC's max stack size to 512M
Simon Marlow <marlowsd@gmail.com>**20081219112211
 To accomodate compiling very long static lists (#2002)
] 
[ext-core: change .cabal file so we can build with either GHC 6.8 or 6.10
Tim Chevalier <chevalier@alum.wellesley.edu>**20090105192757] 
[ext-core: fix some Prep bugs
Tim Chevalier <chevalier@alum.wellesley.edu>**20090105192734] 
[ext-core: use shorter names when combining modules
Tim Chevalier <chevalier@alum.wellesley.edu>**20090105192645] 
[ext-core: twiddle primitive things
Tim Chevalier <chevalier@alum.wellesley.edu>**20090105192434] 
[Check that make supports eval
Ian Lynagh <igloo@earth.li>**20090109151006] 
[Add some more fields to +RTS --info
Ian Lynagh <igloo@earth.li>**20090108131101] 
[Fix building hp2ps
Ian Lynagh <igloo@earth.li>**20090108165136] 
[Build hp2ps
Ian Lynagh <igloo@earth.li>**20090108164304] 
[We no longer build anything in testsuite/
Ian Lynagh <igloo@earth.li>**20090108162031] 
[Assume stage2 depends on all the libraries
Ian Lynagh <igloo@earth.li>**20090107182822
 This means that it gets configured after they've been added to the
 package database, so cabal doesn't fail to configure it
] 
[Build ghc-asm
Ian Lynagh <igloo@earth.li>**20090106172301] 
[Don't pin a register for gc_thread on SPARC.
Ben.Lippmeier@anu.edu.au**20090105030758
 
 This makes the build work again.
] 
[Require HsColour by default
Ian Lynagh <igloo@earth.li>**20090104214647
 This should stop us ending up without HsColour'ed sources on some
 platforms.
 
 We also now tell Cabal where to find HsColour, rather than it finding
 it itself.
] 
[Fix build
Ian Lynagh <igloo@earth.li>**20090104211810] 
[Add GHCi completions to :set and :show
Ori Avtalion <ori@avtalion.name>**20081209194210] 
[Fix sync-all: Check for --complete/partial before --<anything>
Ian Lynagh <igloo@earth.li>**20090104184652
 Patch from megacz in trac #2857
] 
[Remove time from extralibs at request of maintainer
Ian Lynagh <igloo@earth.li>**20090104115509] 
[validate fix: InteractiveEval no longer needs to import  IdInfo
Ian Lynagh <igloo@earth.li>**20090103154754] 
[Fix validate: strs is no longer used in IfaceSyn
Ian Lynagh <igloo@earth.li>**20090103153624] 
[Make record selectors into ordinary functions
simonpj@microsoft.com**20090102142851
 
 This biggish patch addresses Trac #2670.  The main effect is to make
 record selectors into ordinary functions, whose unfoldings appear in
 interface files, in contrast to their previous existence as magic
 "implicit Ids".  This means that the usual machinery of optimisation,
 analysis, and inlining applies to them, which was failing before when
 the selector was somewhat complicated.  (Which it can be when
 strictness annotations, unboxing annotations, and GADTs are involved.)
 
 The change involves the following points
 
 * Changes in Var.lhs to the representation of Var.  Now a LocalId can
   have an IdDetails as well as a GlobalId.  In particular, the
   information that an Id is a record selector is kept in the
   IdDetails.  While compiling the current module, the record selector
   *must* be a LocalId, so that it participates properly in compilation
   (free variables etc).
 
   This led me to change the (hidden) representation of Var, so that there
   is now only one constructor for Id, not two.
 
 * The IdDetails is persisted into interface files, so that an
   importing module can see which Ids are records selectors.
 
 * In TcTyClDecls, we generate the record-selector bindings in renamed,
   but not typechecked form.  In this way, we can get the typechecker
   to add all the types and so on, which is jolly helpful especially
   when GADTs or type families are involved.  Just like derived
   instance declarations.
 
   This is the big new chunk of 180 lines of code (much of which is
   commentary).  A call to the same function, mkAuxBinds, is needed in
   TcInstDcls for associated types.
 
 * The typechecker therefore has to pin the correct IdDetails on to 
   the record selector, when it typechecks it.  There was a neat way
   to do this, by adding a new sort of signature to HsBinds.Sig, namely
   IdSig.  This contains an Id (with the correct Name, Type, and IdDetails);
   the type checker uses it as the binder for the final binding.  This
   worked out rather easily.
 
 * Record selectors are no longer "implicit ids", which entails changes to
      IfaceSyn.ifaceDeclSubBndrs
      HscTypes.implicitTyThings
      TidyPgm.getImplicitBinds
   (These three functions must agree.)
 
 * MkId.mkRecordSelectorId is deleted entirely, some 300+ lines (incl
   comments) of very error prone code.  Happy days.
 
 * A TyCon no longer contains the list of record selectors: 
   algTcSelIds is gone
 
 The renamer is unaffected, including the way that import and export of
 record selectors is handled.
 
 Other small things
 
 * IfaceSyn.ifaceDeclSubBndrs had a fragile test for whether a data
   constructor had a wrapper.  I've replaced that with an explicit flag
   in the interface file. More robust I hope.
 
 * I renamed isIdVar to isId, which touched a few otherwise-unrelated files.
 
 
] 
[Fix Trac #2721: reject newtype deriving if the class has associated types
simonpj@microsoft.com**20081231164300] 
[-XImpredicativeTypes implies -XRankNTypes, and improve error msg in TcMType
simonpj@microsoft.com**20081231152517
 
 If you are going for impredicative types you almost certainly want RankN
 too. The change to TcMType improves the error when you say
      T (forall a. blah)
 where T is a type synonym.  This doesn't necessarily need impredicativity,
 if you have LiberalTypeSynonyms.
 
] 
[Fix Trac #2856: make deriving work for type families
simonpj@microsoft.com**20081231144151
 
 Darn, but TcDeriv is complicated, when type families get in on
 the act!  This patch makes GeneralisedNewtypeDeriving work 
 properly for type families.  I think.
 
 In order to do so, I found that GeneralisedNewtypeDeriving can
 work for recursive newtypes too -- and since families are conservatively
 marked recursive, that's a crucial part of the fix, and useful too.
 See Note [Recursive newtypes] in TcDeriv.
 
] 
[White space and spelling in comments
simonpj@microsoft.com**20081231144131] 
[Remove -XImpredicativeTypes from -fglasgow-exts
simonpj@microsoft.com**20081231144006
 
 See Trac #2846: impredicative types are far from stable, so
 -fglasgow-exts should not imply them.  Maybe we should merge
 this into 6.10?
 
] 
[Improve error reporting for 'deriving'
simonpj@microsoft.com**20081231143521
 
 a) Improve the extra suggested fix when there's a "no instance"
    error in a deriving clause.
 
 b) Improve error location recording in tcInstDecl2
 
 Many of the changes in tcInstDecl2 are simple reformatting.
 
 
] 
[Improve error message in deriving (fix Trac #2851)
simonpj@microsoft.com**20081230165906] 
[Avoid nasty name clash with associated data types (fixes Trac #2888)
simonpj@microsoft.com**20081230164432
 
 The main bug was in TcHsType; see Note [Avoid name clashes for 
 associated data types].  However I did a bit of re-factoring while 
 I was abouut it.
 
 I'm still a but unhappy with the use of TyCon.setTyConArgPoss; it'd
 be better to construct the TyCon correctly in the first place.  But
 that means passing an extra parameter to tcTyDecl1... maybe we should
 do this.
 
 
] 
[Refactor RnEnv to fix Trac #2901
simonpj@microsoft.com**20081230150445
 
 This tidy-up fixes Trac #2901, and eliminates 20 lines of code.
 Mainly this is done by making a version of lookupGlobalOccRn that
 returns (Maybe Name); this replaces lookupSrcOccRn but does more.
 
] 
[Add quotes to error message
simonpj@microsoft.com**20081230150402] 
[Tidy up treatment of big lambda (fixes Trac #2898)
simonpj@microsoft.com**20081230145948
 
 There was a leftover big lambda in the CorePrep'd code, which confused
 the bytecode generator.  Actually big lambdas are harmless.  This patch
 refactors ByteCodeGen so that it systemantically used 'bcView' to eliminate
 junk.  I did a little clean up in CorePrep too.
 
 See comments in Trac #2898.
 
] 
[Remove trailing whitespace from HaddockUtils
Ian Lynagh <igloo@earth.li>**20081229191727] 
[Fix warnings in HaddockUtils
Ian Lynagh <igloo@earth.li>**20081229191657] 
[Remove dead code from HaddockUtils
Ian Lynagh <igloo@earth.li>**20081229191430] 
[Fix warnings in ByteCodeAsm
Ian Lynagh <igloo@earth.li>**20081229174726] 
[Fix warnings in ByteCodeInstr
Ian Lynagh <igloo@earth.li>**20081229173331] 
[Fix warnings in Rules
Ian Lynagh <igloo@earth.li>**20081229171832] 
[Fix warnings in StgCmmForeign
Ian Lynagh <igloo@earth.li>**20081229165957] 
[Fix warnings in CgCallConv
Ian Lynagh <igloo@earth.li>**20081229165402] 
[Fix warnings in SMRep
Ian Lynagh <igloo@earth.li>**20081229164959] 
[Fix warnings in ClosureInfo
Ian Lynagh <igloo@earth.li>**20081229164618] 
[Fix warnings in CgTicky
Ian Lynagh <igloo@earth.li>**20081229153416] 
[Fix warnings in CgCon
Ian Lynagh <igloo@earth.li>**20081229151733] 
[Fix warnings in WorkWrap
Ian Lynagh <igloo@earth.li>**20081229150406] 
[Fix warnings in NCGMonad
Ian Lynagh <igloo@earth.li>**20081229145627] 
[Fix warnings in CmmInfo
Ian Lynagh <igloo@earth.li>**20081229145307] 
[Fix warnings in CmmCPSGen
Ian Lynagh <igloo@earth.li>**20081229145119] 
[Fix warnings in CmmProcPoint
Ian Lynagh <igloo@earth.li>**20081229144214] 
[Fix warnings in CmmCallConv
Ian Lynagh <igloo@earth.li>**20081229141924] 
[Fix warnings in CmmLive
Ian Lynagh <igloo@earth.li>**20081229141035] 
[Fix warnings in CmmCPS
Ian Lynagh <igloo@earth.li>**20081229133158] 
[Fix warnings in CmmUtils
Ian Lynagh <igloo@earth.li>**20081229132637] 
[Comment out dead function breakProc
Ian Lynagh <igloo@earth.li>**20081229115647] 
[Fix warnings in CmmBrokenBlock
Ian Lynagh <igloo@earth.li>**20081229115527] 
[Comments only.  Haddockify parts of TcRnTypes.
Thomas Schilling <nominolo@googlemail.com>**20081211154657] 
[Comments only.  Fix typo.
Thomas Schilling <nominolo@googlemail.com>**20081211153104] 
[Include PprTyThings in tags file.
Thomas Schilling <nominolo@googlemail.com>**20081211153005] 
[Use DynFlags to work out if we are doing ticky ticky profiling
Ian Lynagh <igloo@earth.li>**20081218161928
 We used to use StaticFlags
] 
[Fix warnings in CgExpr
Ian Lynagh <igloo@earth.li>**20081217201152] 
[Fix warnings in CgBindery
Ian Lynagh <igloo@earth.li>**20081217194607] 
[Fix warnings in CgStackery
Ian Lynagh <igloo@earth.li>**20081217191713] 
[Fix warnings in CgCase
Ian Lynagh <igloo@earth.li>**20081217190848] 
[Remove some dead code from CgCase
Ian Lynagh <igloo@earth.li>**20081217184755] 
[Fix warnings in StgCmmProf
Ian Lynagh <igloo@earth.li>**20081217182236] 
[Fix warnings in CgProf
Ian Lynagh <igloo@earth.li>**20081217181711] 
[Fix warnings in CgInfoTbls
Ian Lynagh <igloo@earth.li>**20081217180144] 
[Remove dead function srtLabelAndLength from CgInfoTbls
Ian Lynagh <igloo@earth.li>**20081217180044] 
[Fix warnings in CgHeapery
Ian Lynagh <igloo@earth.li>**20081217175726] 
[Fix warnings in CgTailCall
Ian Lynagh <igloo@earth.li>**20081217175040] 
[Remove a little dead code from CgTailCall
Ian Lynagh <igloo@earth.li>**20081217174947] 
[Fix warnings in CodeGen
Ian Lynagh <igloo@earth.li>**20081217165904] 
[Fix warnings in StgCmmTicky
Ian Lynagh <igloo@earth.li>**20081217165433] 
[Remove dead code from CgUtils
Ian Lynagh <igloo@earth.li>**20081217163920] 
[Fix warnings in CgPrimOp
Ian Lynagh <igloo@earth.li>**20081217163912] 
[Fix warnings in CgMonad
Ian Lynagh <igloo@earth.li>**20081217163903] 
[Fix warnings in CgClosure
Ian Lynagh <igloo@earth.li>**20081217163850] 
[Workaround for #2262, from Barney Stratford
Simon Marlow <marlowsd@gmail.com>**20081216124706
 See http://www.haskell.org/pipermail/glasgow-haskell-users/2008-December/016333.html
] 
[UNDO: Add -fpass-case-bndr-to-join-points
Simon Marlow <marlowsd@gmail.com>**20081216114235
 
 rolling back:
 
 Fri Dec  5 10:51:59 GMT 2008  simonpj@microsoft.com
   * Add -fpass-case-bndr-to-join-points
   
   See Note [Passing the case binder to join points] in Simplify.lhs
   The default now is *not* to pass the case binder.  There are some
   nofib results with the above note; the effect is almost always 
   negligible.
   
   I don't expect this flag to be used by users (hence no docs). It's just
   there to let me try the performance effects of switching on and off.
   
 
     M ./compiler/main/StaticFlagParser.hs +1
     M ./compiler/main/StaticFlags.hs +4
     M ./compiler/simplCore/Simplify.lhs -14 +73
] 
[Rollback INLINE patches
Simon Marlow <marlowsd@gmail.com>**20081216103556
 
 rolling back:
 
 Fri Dec  5 16:54:00 GMT 2008  simonpj@microsoft.com
   * Completely new treatment of INLINE pragmas (big patch)
   
   This is a major patch, which changes the way INLINE pragmas work.
   Although lots of files are touched, the net is only +21 lines of
   code -- and I bet that most of those are comments!
   
   HEADS UP: interface file format has changed, so you'll need to
   recompile everything.
   
   There is not much effect on overall performance for nofib, 
   probably because those programs don't make heavy use of INLINE pragmas.
   
           Program           Size    Allocs   Runtime   Elapsed
               Min         -11.3%     -6.9%     -9.2%     -8.2%
               Max          -0.1%     +4.6%     +7.5%     +8.9%
    Geometric Mean          -2.2%     -0.2%     -1.0%     -0.8%
   
   (The +4.6% for on allocs is cichelli; see other patch relating to
   -fpass-case-bndr-to-join-points.)
   
   The old INLINE system
   ~~~~~~~~~~~~~~~~~~~~~
   The old system worked like this. A function with an INLINE pragam
   got a right-hand side which looked like
        f = __inline_me__ (\xy. e)
   The __inline_me__ part was an InlineNote, and was treated specially
   in various ways.  Notably, the simplifier didn't inline inside an
   __inline_me__ note.  
   
   As a result, the code for f itself was pretty crappy. That matters
   if you say (map f xs), because then you execute the code for f,
   rather than inlining a copy at the call site.
   
   The new story: InlineRules
   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   The new system removes the InlineMe Note altogether.  Instead there
   is a new constructor InlineRule in CoreSyn.Unfolding.  This is a 
   bit like a RULE, in that it remembers the template to be inlined inside
   the InlineRule.  No simplification or inlining is done on an InlineRule,
   just like RULEs.  
   
   An Id can have an InlineRule *or* a CoreUnfolding (since these are two
   constructors from Unfolding). The simplifier treats them differently:
   
     - An InlineRule is has the substitution applied (like RULES) but 
       is otherwise left undisturbed.
   
     - A CoreUnfolding is updated with the new RHS of the definition,
       on each iteration of the simplifier.
   
   An InlineRule fires regardless of size, but *only* when the function
   is applied to enough arguments.  The "arity" of the rule is specified
   (by the programmer) as the number of args on the LHS of the "=".  So
   it makes a difference whether you say
     	{-# INLINE f #-}
   	f x = \y -> e     or     f x y = e
   This is one of the big new features that InlineRule gives us, and it
   is one that Roman really wanted.
   
   In contrast, a CoreUnfolding can fire when it is applied to fewer
   args than than the function has lambdas, provided the result is small
   enough.
   
   
   Consequential stuff
   ~~~~~~~~~~~~~~~~~~~
   * A 'wrapper' no longer has a WrapperInfo in the IdInfo.  Instead,
     the InlineRule has a field identifying wrappers.
   
   * Of course, IfaceSyn and interface serialisation changes appropriately.
   
   * Making implication constraints inline nicely was a bit fiddly. In
     the end I added a var_inline field to HsBInd.VarBind, which is why
     this patch affects the type checker slightly
   
   * I made some changes to the way in which eta expansion happens in
     CorePrep, mainly to ensure that *arguments* that become let-bound
     are also eta-expanded.  I'm still not too happy with the clarity
     and robustness fo the result.
   
   * We now complain if the programmer gives an INLINE pragma for
     a recursive function (prevsiously we just ignored it).  Reason for
     change: we don't want an InlineRule on a LoopBreaker, because then
     we'd have to check for loop-breaker-hood at occurrence sites (which
     isn't currenlty done).  Some tests need changing as a result.
   
   This patch has been in my tree for quite a while, so there are
   probably some other minor changes.
   
 
     M ./compiler/basicTypes/Id.lhs -11
     M ./compiler/basicTypes/IdInfo.lhs -82
     M ./compiler/basicTypes/MkId.lhs -2 +2
     M ./compiler/coreSyn/CoreFVs.lhs -2 +25
     M ./compiler/coreSyn/CoreLint.lhs -5 +1
     M ./compiler/coreSyn/CorePrep.lhs -59 +53
     M ./compiler/coreSyn/CoreSubst.lhs -22 +31
     M ./compiler/coreSyn/CoreSyn.lhs -66 +92
     M ./compiler/coreSyn/CoreUnfold.lhs -112 +112
     M ./compiler/coreSyn/CoreUtils.lhs -185 +184
     M ./compiler/coreSyn/MkExternalCore.lhs -1
     M ./compiler/coreSyn/PprCore.lhs -4 +40
     M ./compiler/deSugar/DsBinds.lhs -70 +118
     M ./compiler/deSugar/DsForeign.lhs -2 +4
     M ./compiler/deSugar/DsMeta.hs -4 +3
     M ./compiler/hsSyn/HsBinds.lhs -3 +3
     M ./compiler/hsSyn/HsUtils.lhs -2 +7
     M ./compiler/iface/BinIface.hs -11 +25
     M ./compiler/iface/IfaceSyn.lhs -13 +21
     M ./compiler/iface/MkIface.lhs -24 +19
     M ./compiler/iface/TcIface.lhs -29 +23
     M ./compiler/main/TidyPgm.lhs -55 +49
     M ./compiler/parser/ParserCore.y -5 +6
     M ./compiler/simplCore/CSE.lhs -2 +1
     M ./compiler/simplCore/FloatIn.lhs -6 +1
     M ./compiler/simplCore/FloatOut.lhs -23
     M ./compiler/simplCore/OccurAnal.lhs -36 +5
     M ./compiler/simplCore/SetLevels.lhs -59 +54
     M ./compiler/simplCore/SimplCore.lhs -48 +52
     M ./compiler/simplCore/SimplEnv.lhs -26 +22
     M ./compiler/simplCore/SimplUtils.lhs -28 +4
     M ./compiler/simplCore/Simplify.lhs -91 +109
     M ./compiler/specialise/Specialise.lhs -15 +18
     M ./compiler/stranal/WorkWrap.lhs -14 +11
     M ./compiler/stranal/WwLib.lhs -2 +2
     M ./compiler/typecheck/Inst.lhs -1 +3
     M ./compiler/typecheck/TcBinds.lhs -17 +27
     M ./compiler/typecheck/TcClassDcl.lhs -1 +2
     M ./compiler/typecheck/TcExpr.lhs -4 +6
     M ./compiler/typecheck/TcForeign.lhs -1 +1
     M ./compiler/typecheck/TcGenDeriv.lhs -14 +13
     M ./compiler/typecheck/TcHsSyn.lhs -3 +2
     M ./compiler/typecheck/TcInstDcls.lhs -5 +4
     M ./compiler/typecheck/TcRnDriver.lhs -2 +11
     M ./compiler/typecheck/TcSimplify.lhs -10 +17
     M ./compiler/vectorise/VectType.hs +7
 
 Mon Dec  8 12:43:10 GMT 2008  simonpj@microsoft.com
   * White space only
 
     M ./compiler/simplCore/Simplify.lhs -2
 
 Mon Dec  8 12:48:40 GMT 2008  simonpj@microsoft.com
   * Move simpleOptExpr from CoreUnfold to CoreSubst
 
     M ./compiler/coreSyn/CoreSubst.lhs -1 +87
     M ./compiler/coreSyn/CoreUnfold.lhs -72 +1
 
 Mon Dec  8 17:30:18 GMT 2008  simonpj@microsoft.com
   * Use CoreSubst.simpleOptExpr in place of the ad-hoc simpleSubst (reduces code too)
 
     M ./compiler/deSugar/DsBinds.lhs -50 +16
 
 Tue Dec  9 17:03:02 GMT 2008  simonpj@microsoft.com
   * Fix Trac #2861: bogus eta expansion
   
   Urghlhl!  I "tided up" the treatment of the "state hack" in CoreUtils, but
   missed an unexpected interaction with the way that a bottoming function
   simply swallows excess arguments.  There's a long
        Note [State hack and bottoming functions]
   to explain (which accounts for most of the new lines of code).
   
 
     M ./compiler/coreSyn/CoreUtils.lhs -16 +53
 
 Mon Dec 15 10:02:21 GMT 2008  Simon Marlow <marlowsd@gmail.com>
   * Revert CorePrep part of "Completely new treatment of INLINE pragmas..."
   
   The original patch said:
   
   * I made some changes to the way in which eta expansion happens in
     CorePrep, mainly to ensure that *arguments* that become let-bound
     are also eta-expanded.  I'm still not too happy with the clarity
     and robustness fo the result.
     
   Unfortunately this change apparently broke some invariants that were
   relied on elsewhere, and in particular lead to panics when compiling
   with profiling on.
   
   Will re-investigate in the new year.
 
     M ./compiler/coreSyn/CorePrep.lhs -53 +58
     M ./configure.ac -1 +1
 
 Mon Dec 15 12:28:51 GMT 2008  Simon Marlow <marlowsd@gmail.com>
   * revert accidental change to configure.ac
 
     M ./configure.ac -1 +1
] 
[Fix warnings in CgForeignCall
Ian Lynagh <igloo@earth.li>**20081215222515] 
[revert accidental change to configure.ac
Simon Marlow <marlowsd@gmail.com>**20081215122851] 
[Revert CorePrep part of "Completely new treatment of INLINE pragmas..."
Simon Marlow <marlowsd@gmail.com>**20081215100221
 
 The original patch said:
 
 * I made some changes to the way in which eta expansion happens in
   CorePrep, mainly to ensure that *arguments* that become let-bound
   are also eta-expanded.  I'm still not too happy with the clarity
   and robustness fo the result.
   
 Unfortunately this change apparently broke some invariants that were
 relied on elsewhere, and in particular lead to panics when compiling
 with profiling on.
 
 Will re-investigate in the new year.
] 
[Remove some redundant code
Ian Lynagh <igloo@earth.li>**20081215194047
 We were looking at opt_DoTickyProfiling, and if it was set claling ifTicky
 which looks at opt_DoTickyProfiling itself.
] 
[Fix warnings in CgLetNoEscape
Ian Lynagh <igloo@earth.li>**20081215173752] 
[wake up other Capabilities even when there is only one spark (see #2868)
Simon Marlow <marlowsd@gmail.com>**20081210164644] 
[Document new GC options -q1 and -qg<n>
Simon Marlow <marlowsd@gmail.com>**20081210164557] 
[SysTools no longer needs -fno-cse
Ian Lynagh <igloo@earth.li>**20081211182327] 
[Make the lists of files and directories to be cleaned-up non-global
Ian Lynagh <igloo@earth.li>**20081211180739
 They still need to be stored in IORefs, as the exception handler needs
 to know what they all are.
] 
[The default cleanup handler should /always/ delete the temp files
Ian Lynagh <igloo@earth.li>**20081211170006
 Not only if there has been an exception. It worked for GHC anyway,
 as it was getting an ExitSuccess exception, but GHC API clients
 shouldn't be required to do that.
] 
[On FreeBSD, try MAP_FIXED if ordinary mmap() fails to give us suitable memory
Simon Marlow <marlowsd@gmail.com>**20081210115751
 This appears to be necessary on FreeBSD.  It might be necessary on
 other OSs too, but I'm being cautious because using MAP_FIXED can lead
 to crashes by overwriting existing mappings, and we have no (easy) way
 to prevent that.
] 
[Document hs_init() infelicity (#2863)
Simon Marlow <marlowsd@gmail.com>**20081209164322] 
[Fix user guide typesetting
Ian Lynagh <igloo@earth.li>**20081210165434] 
[Improve documentation for data family instances (cf Trac #1968)
simonpj@microsoft.com**20081210054432
 
 The HEAD allows GADT syntax for data/newtype family instances. 
 (GHC 6.10 does not seem to.)
 
] 
[Make some profiling flags dynamic
Ian Lynagh <igloo@earth.li>**20081209230157
 In particular:
     -fauto-sccs-on-all-toplevs          -auto-all   -no-auto-all
     -fauto-sccs-on-exported-toplevs     -auto       -no-auto
     -fauto-sccs-on-individual-cafs      -caf-all    -no-caf-all
] 
[Fix warnings in StgCmmGran
Ian Lynagh <igloo@earth.li>**20081209222413] 
[Fix Trac #2861: bogus eta expansion
simonpj@microsoft.com**20081209170302
 
 Urghlhl!  I "tided up" the treatment of the "state hack" in CoreUtils, but
 missed an unexpected interaction with the way that a bottoming function
 simply swallows excess arguments.  There's a long
      Note [State hack and bottoming functions]
 to explain (which accounts for most of the new lines of code).
 
] 
[Fix #2592: do an orderly shutdown when the heap is exhausted
Simon Marlow <marlowsd@gmail.com>**20081209105919
 Really we should be raising an exception in this case, but that's
 tricky (see comments).  At least now we shut down the runtime
 correctly rather than just exiting.
] 
[Fix #2848: avoid overflow during time calculation
Simon Marlow <marlowsd@gmail.com>**20081209105600] 
[Fix #2838: we should narrow a CmmInt before converting to ImmInteger
Simon Marlow <marlowsd@gmail.com>**20081209105515] 
[fix an assertion failure in prof/threaded/debug mode
Simon Marlow <marlowsd@gmail.com>**20081204101201] 
[Add OPTIONS_CATCH,DERIVE,YHC to those that GHC knows about; trac #2847
Ian Lynagh <igloo@earth.li>**20081209191724] 
[Fix warnings in CgHpc
Ian Lynagh <igloo@earth.li>**20081209191713] 
[Parse pragma names better; trac #2847
Ian Lynagh <igloo@earth.li>**20081209190318
 We require that pragma names are not followed by pragma character,
 defined as
     isAlphaNum c || c == '_'
] 
[Fix warnings in CgParallel
Ian Lynagh <igloo@earth.li>**20081209184402] 
[Fix warnings in StgCmmHpc
Ian Lynagh <igloo@earth.li>**20081209184004] 
[Remove an unnecessary -w flag
Ian Lynagh <igloo@earth.li>**20081209183812] 
[Inject implicit bindings after CoreTidy, not before Simplify
simonpj@microsoft.com**20081208173525
 
 Originally I inject the "implicit bindings" (record selectors, class
 method selectors, data con wrappers...) after CoreTidy.  However, in a
 misguided attempt to fix Trac #2070, I moved the injection point to
 before the Simplifier, so that record selectors would be optimised by
 the simplifier.
 
 This was misguided because record selectors (indeed all implicit bindings)
 are GlobalIds, whose IdInfo is meant to be frozen.  But the Simplifier,
 and other Core-to-Core optimisations, merrily change the IdInfo.  That 
 ultimately made Trac #2844 happen, where a record selector got arity 2,
 but the GlobalId (which importing scopes re-construct from the class decl
 rather than reading from the interface file) has arity 1.
 
 So this patch moves the injection back to CoreTidy. Happily #2070 should
 still be OK because we now use CoreSubst.simpleOptExpr on the unfoldings
 for implict things, which gets rid of the most gratuitous infelicities.
 
 Still, there's a strong case for stoppping record selectors from being
 GlobalIds, and treating them much more like dict-funs.  I'm thinking
 about that.  Meanwhile, #2844 is ok now.
 
] 
[Add assertion for arity match (checks Trac #2844)
simonpj@microsoft.com**20081208173241
 
 The exported arity of a function must match the arity for the
 STG function.  Trac #2844 was a pretty obscure manifestation of
 the failure of this invariant. This patch doesn't cure the bug;
 rather it adds an assertion to CoreToStg to check the invariant
 so we should get an earlier and less obscure warning if this
 fails in future.
 
] 
[Use CoreSubst.simpleOptExpr in place of the ad-hoc simpleSubst (reduces code too)
simonpj@microsoft.com**20081208173018] 
[Move simpleOptExpr from CoreUnfold to CoreSubst
simonpj@microsoft.com**20081208124840] 
[White space only
simonpj@microsoft.com**20081208124310] 
[Comments only
simonpj@microsoft.com**20081208124155] 
[Completely new treatment of INLINE pragmas (big patch)
simonpj@microsoft.com**20081205165400
 
 This is a major patch, which changes the way INLINE pragmas work.
 Although lots of files are touched, the net is only +21 lines of
 code -- and I bet that most of those are comments!
 
 HEADS UP: interface file format has changed, so you'll need to
 recompile everything.
 
 There is not much effect on overall performance for nofib, 
 probably because those programs don't make heavy use of INLINE pragmas.
 
         Program           Size    Allocs   Runtime   Elapsed
             Min         -11.3%     -6.9%     -9.2%     -8.2%
             Max          -0.1%     +4.6%     +7.5%     +8.9%
  Geometric Mean          -2.2%     -0.2%     -1.0%     -0.8%
 
 (The +4.6% for on allocs is cichelli; see other patch relating to
 -fpass-case-bndr-to-join-points.)
 
 The old INLINE system
 ~~~~~~~~~~~~~~~~~~~~~
 The old system worked like this. A function with an INLINE pragam
 got a right-hand side which looked like
      f = __inline_me__ (\xy. e)
 The __inline_me__ part was an InlineNote, and was treated specially
 in various ways.  Notably, the simplifier didn't inline inside an
 __inline_me__ note.  
 
 As a result, the code for f itself was pretty crappy. That matters
 if you say (map f xs), because then you execute the code for f,
 rather than inlining a copy at the call site.
 
 The new story: InlineRules
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 The new system removes the InlineMe Note altogether.  Instead there
 is a new constructor InlineRule in CoreSyn.Unfolding.  This is a 
 bit like a RULE, in that it remembers the template to be inlined inside
 the InlineRule.  No simplification or inlining is done on an InlineRule,
 just like RULEs.  
 
 An Id can have an InlineRule *or* a CoreUnfolding (since these are two
 constructors from Unfolding). The simplifier treats them differently:
 
   - An InlineRule is has the substitution applied (like RULES) but 
     is otherwise left undisturbed.
 
   - A CoreUnfolding is updated with the new RHS of the definition,
     on each iteration of the simplifier.
 
 An InlineRule fires regardless of size, but *only* when the function
 is applied to enough arguments.  The "arity" of the rule is specified
 (by the programmer) as the number of args on the LHS of the "=".  So
 it makes a difference whether you say
   	{-# INLINE f #-}
 	f x = \y -> e     or     f x y = e
 This is one of the big new features that InlineRule gives us, and it
 is one that Roman really wanted.
 
 In contrast, a CoreUnfolding can fire when it is applied to fewer
 args than than the function has lambdas, provided the result is small
 enough.
 
 
 Consequential stuff
 ~~~~~~~~~~~~~~~~~~~
 * A 'wrapper' no longer has a WrapperInfo in the IdInfo.  Instead,
   the InlineRule has a field identifying wrappers.
 
 * Of course, IfaceSyn and interface serialisation changes appropriately.
 
 * Making implication constraints inline nicely was a bit fiddly. In
   the end I added a var_inline field to HsBInd.VarBind, which is why
   this patch affects the type checker slightly
 
 * I made some changes to the way in which eta expansion happens in
   CorePrep, mainly to ensure that *arguments* that become let-bound
   are also eta-expanded.  I'm still not too happy with the clarity
   and robustness fo the result.
 
 * We now complain if the programmer gives an INLINE pragma for
   a recursive function (prevsiously we just ignored it).  Reason for
   change: we don't want an InlineRule on a LoopBreaker, because then
   we'd have to check for loop-breaker-hood at occurrence sites (which
   isn't currenlty done).  Some tests need changing as a result.
 
 This patch has been in my tree for quite a while, so there are
 probably some other minor changes.
 
] 
[Add -fpass-case-bndr-to-join-points
simonpj@microsoft.com**20081205105159
 
 See Note [Passing the case binder to join points] in Simplify.lhs
 The default now is *not* to pass the case binder.  There are some
 nofib results with the above note; the effect is almost always 
 negligible.
 
 I don't expect this flag to be used by users (hence no docs). It's just
 there to let me try the performance effects of switching on and off.
 
] 
[Add static flag -fsimple-list-literals
simonpj@microsoft.com**20081205105002
 
 The new static flag -fsimple-list-literals makes ExplicitList literals
 be desugared in the straightforward way, rather than using 'build' as
 now.  See SLPJ comments with Note [Desugaring explicit lists].
 
 I don't expect this flag to be used by users (hence no docs). It's just
 there to let me try the performance effects of switching on and off.
 
] 
[Comments only in OccurAnal
simonpj@microsoft.com**20081205103252] 
[Comments only
simonpj@microsoft.com**20081205102437] 
[Layout only
simonpj@microsoft.com**20081205102252] 
[Comments only (Note [Entering error thunks])
simonpj@microsoft.com**20081205102149] 
[Make CoreToStg a little more robust to eta expansion
simonpj@microsoft.com**20081205101932] 
[Add no-op case for addIdSpecialisations (very minor optimisation)
simonpj@microsoft.com**20081205101022] 
[Trim redundant import
simonpj@microsoft.com**20081205101006] 
[Make CoreTidy retain deadness info (better -ddump-simpl)
simonpj@microsoft.com**20081205100518
 
 GHC now retains more robust information about dead variables; but
 CoreTidy was throwing it away.  This patch makes CoreTidy retain it,
 which gives better output for -ddump-simpl.
 
 New opportunity: shrink interface files by using wildcards for dead variables.
 
 
] 
[Remove INLINE pragmas on recursive functions
simonpj@microsoft.com**20081205100353
 
 INLINE pragmas on recursive functions are ignored; and this
 is checked in my upcoming patch for inlinings.
 
] 
[Comments only (on Activation)
simonpj@microsoft.com**20081205100139] 
[Document 'loadModule'.
Thomas Schilling <nominolo@googlemail.com>**20081202154800] 
[Add 'needsTemplateHaskell' utility function and document why one might
Thomas Schilling <nominolo@googlemail.com>**20081202152358
 want to use it.
] 
[Documentation only.
Thomas Schilling <nominolo@googlemail.com>**20081202150158] 
[Export 'succeeded' and 'failed' helper functions.
Thomas Schilling <nominolo@googlemail.com>**20081202144451] 
[Fix more problems caused by padding in the Capability structure
Simon Marlow <marlowsd@gmail.com>**20081202120735
 Fixes crashes on Windows and Sparc
] 
[add missing case to Ord GlobalReg (EagerBlackhole == EagerBlackhole)
Simon Marlow <marlowsd@gmail.com>**20081128130106] 
[Better error message for fundep conflict
simonpj@microsoft.com**20081201162845] 
[Fix typo in quasi-quote documentation's sample.
shelarcy <shelarcy@gmail.com>**20081129024344] 
[We need to tell cabal-bin which version of Cabal to use
Ian Lynagh <igloo@earth.li>**20081203123208
 Otherwise, if the bootstrapping compiler has a newer version, we get
 a mismatch between the version used to compile ghc-prim's Setup.hs and
 the version that installPackage uses.
] 
[Remove the v_Split_info global variable and use a field of dflags instead
Ian Lynagh <igloo@earth.li>**20081130152403] 
[Document the --machine-readable RTS flag
Ian Lynagh <igloo@earth.li>**20081130152311] 
[Let 'loadModule' generate proper code depending on the 'hscTarget'.
Thomas Schilling <nominolo@googlemail.com>**20081128164412
 
 With this change it should be possible to perform something similar to
 'load' by traversing the module graph in dependency order and calling
 '{parse,typecheck,load}Module' on each.  Of course, if you want smart
 recompilation checking you should still use 'load'.
] 
[Expose a separate 'hscBackend' phase for 'HsCompiler' and change
Thomas Schilling <nominolo@googlemail.com>**20081128163746
 parameter to 'InteractiveStatus' to a 'Maybe'.
] 
[Whoops, *don't* reset the complete session in 'withLocalCallbacks'.
Thomas Schilling <nominolo@googlemail.com>**20081128150727] 
[Use a record instead of a typeclass for 'HsCompiler'.  This is mostly
Thomas Schilling <nominolo@googlemail.com>**20081128121947
 equivalent to a typeclass implementation that uses a functional
 dependency from the target mode to the result type.
] 
[Remove dead code
Ian Lynagh <igloo@earth.li>**20081128193831] 
[Update docs not to talk about deprecated -optdep-* flags; fixes trac #2773
Ian Lynagh <igloo@earth.li>**20081128193633] 
[Use relative URLs in the GHC API haddock docs; fixes #2755
Ian Lynagh <igloo@earth.li>**20081128184511] 
[Teach runghc about --help; fixes trac #2757
Ian Lynagh <igloo@earth.li>**20081128191706] 
[Use a per-session data structure for callbacks.  Make 'WarnErrLogger'
Thomas Schilling <nominolo@googlemail.com>**20081128103628
 part of it.
 
 Part of the GHC API essentially represents a compilation framework.
 The difference of a *framework* as opposed to a *library* is that the
 overall structure of the functionality is pre-defined but certain
 details can be customised via callbacks.  (Also known as the Hollywood
 Principle: "Don't call us, we'll call you.")
 
 This patch introduces a per-session data structure that contains all
 the callbacks instead of adding lots of small function arguments
 whenever we want to give the user more control over certain parts of
 the API.  This should also help with future changes: Adding a new
 callback doesn't break old code since code that doesn't know about the
 new callback will use the (hopefully sane) default implementation.
 
 Overall, however, we should try and keep the number of callbacks small
 and well-defined (and provide useful defaults) and use simple library
 routines for the rest.
] 
[Improve error message for #2739 (but no fix).
Thomas Schilling <nominolo@googlemail.com>**20081127135725
 
 This patch changes 'loadModule' to define a fake linkable.  The
 previous implementation of providing no linkable at all violated a
 pre-condition in the ByteCode linker.  This doesn't fix #2739, but it
 improves the error message a bit.
] 
[Remove the packing I added recently to the Capability structure
Simon Marlow <marlowsd@gmail.com>**20081128105046
 The problem is that the packing caused some unaligned loads, which
 lead to bus errors on Sparc (and reduced performance elsewhere,
 presumably).
] 
[don't emit CmmComments for now
Simon Marlow <marlowsd@gmail.com>**20081127090145
   - if the string contains */, we need to fix it (demonstrated by 
     building Cabal with -fvia-C)
   - the strings can get quite large, so we probably only want to
     inject comments when some debugging option is on.
] 
[Collect instead of print warnings in 'warnUnnecessarySourceImports'.
Thomas Schilling <nominolo@googlemail.com>**20081127102534] 
[Force recompilation of BCOs when they were compiled in HscNothing mode.
Thomas Schilling <nominolo@googlemail.com>**20081126183402
 
 Previously, loading a set of modules in HscNothing mode and then
 switching to HscInterpreted could lead to crashes since modules
 compiled with HscNothing were thought to be valid bytecode objects.
 
 This patch forces recompilation in these cases, hence switching between
 HscNothing and HscInterpreted should be safe now.
] 
[Documentation only: Add module description for HscMain.
Thomas Schilling <nominolo@googlemail.com>**20081126134344] 
[Include GHCi files in ctags/etags.
Thomas Schilling <nominolo@googlemail.com>**20081126122801] 
[drop some debugging traces and use only one flag for new codegen
dias@eecs.harvard.edu**20081126180808] 
[one more missing patch from new codegen path
dias@eecs.harvard.edu**20081126165742] 
[Fix Trac #2817 (TH syntax -> HsSyn conversion)
simonpj@microsoft.com**20081126154022] 
[Fix Trac #2756: CorePrep strictness bug
simonpj@microsoft.com**20081126143448] 
[Format output for :t more nicely
simonpj@microsoft.com**20081126134814] 
[Fix Trac #2766: printing operator type variables
simonpj@microsoft.com**20081126132202] 
[Fix build following codegen patch
simonpj@microsoft.com**20081126125526] 
[Removed warnings, made Haddock happy, added examples in documentation
dias@eecs.harvard.edu**20081017170707
 The interesting examples talk about our story with heap checks in
 case alternatives and our story with the case scrutinee as a Boolean.
] 
[Fixed linear regalloc bug, dropped some tracing code
dias@eecs.harvard.edu**20081016104218
 o The linear-scan register allocator sometimes allocated a block
   before allocating one of its predecessors, which could lead
   to inconsistent allocations. Now, we allocate a block only
   if a predecessor has set the "incoming" assignments for the block
   (or if it's the procedure's entry block).
 o Also commented out some tracing code on the new codegen path.
] 
[Keep update frames live even in functions that never return
dias@eecs.harvard.edu**20081014165437
 An unusual case, but without it:
 (a) we had an assertion failure
 (b) we can overwrite the caller's infotable, which might cause
     the garbage collector to collect live data.
 Better to keep the update frame live at all call sites,
 not just at returns.
] 
[Removed space and time inefficiency in procpoint splitting
dias@eecs.harvard.edu**20081014160354
 I was adding extra jumps to every procpoint, even when the split-off graph
 referred to only some of the procpoints. No effect on correctness,
 but a big effect on space/time efficiency when there are lots of procpoints...
] 
[Clarify the SRT building process
dias@eecs.harvard.edu**20081014140202
 Before: building a closure that would build an SRT given the top-level
 SRT. It was somewhat difficult to understand the control flow, and it
 may have had held onto some data structures long after they should be dead.
 Now, I just bundle the info we need about CAFs along with the procedure
 and directly call a new top-level function to build the SRTs later.
] 
[Don't adjust hp up when the case scrutinee won't allocate
dias@eecs.harvard.edu**20081014112618
 
 If the case scrutinee can't allocate, we don't need to do a heap
 check in the case alternatives. (A previous patch got that right.)
 In that case, we had better not adjust the heap pointer to recover
 unused stack space before evaluating the scrutinee -- because we
 aren't going to reallocate for the case alternative.
] 
[Floating infotables were reversed in C back end
dias@eecs.harvard.edu**20081013152718] 
[forgot a few files
dias@eecs.harvard.edu**20081013134251] 
[Big collection of patches for the new codegen branch.
dias@eecs.harvard.edu**20081013132556
 o Fixed bug that emitted the copy-in code for closure entry
   in the wrong place -- at the initialization of the closure.
 o Refactored some of the closure entry code.
 o Added code to check that no LocalRegs are live-in to a procedure
    -- trip up some buggy programs earlier
 o Fixed environment bindings for thunks
    -- we weren't (re)binding the free variables in a thunk
 o Fixed a bug in proc-point splitting that dropped some updates
   to the entry block in a procedure.
 o Fixed improper calls to code that generates CmmLit's for strings
 o New invariant on cg_loc in CgIdInfo: the expression is always tagged
 o Code to load free vars on entry to a thunk was (wrongly) placed before
   the heap check.
 o Some of the StgCmm code was redundantly passing around Id's
   along with CgIdInfo's; no more.
 o Initialize the LocalReg's that point to a closure before allocating and
   initializing the closure itself -- otherwise, we have problems with
   recursive closure bindings
 o BlockEnv and BlockSet types are now abstract.
 o Update frames:
   - push arguments in Old call area
   - keep track of the return sp in the FCode monad
   - keep the return sp in every call, tail call, and return
       (because it might be different at different call sites,
        e.g. tail calls to the gc after a heap check are performed
             before pushing the update frame)
   - set the sp appropriately on returns and tail calls
 o Reduce call, tail call, and return to a single LastCall node
 o Added slow entry code, using different calling conventions on entry and tail call
 o More fixes to the calling convention code.
   The tricky stuff is all about the closure environment: it must be passed in R1,
   but in non-closures, there is no such argument, so we can't treat all arguments
   the same way: the closure environment is special. Maybe the right step forward
   would be to define a different calling convention for closure arguments.
 o Let-no-escapes need to be emitted out-of-line -- otherwise, we drop code.
 o Respect RTS requirement of word alignment for pointers
   My stack allocation can pack sub-word values into a single word on the stack,
   but it wasn't requiring word-alignment for pointers. It does now,
   by word-aligning both pointer registers and call areas.
 o CmmLint was over-aggresively ruling out non-word-aligned memory references,
   which may be kosher now that we can spill small values into a single word.
 o Wrong label order on a conditional branch when compiling switches.
 o void args weren't dropped in many cases.
   To help prevent this kind of mistake, I defined a NonVoid wrapper,
   which I'm applying only to Id's for now, although there are probably
   other good candidates.
 o A little code refactoring: separate modules for procpoint analysis splitting, 
   stack layout, and building infotables.
 o Stack limit check: insert along with the heap limit check, using a symbolic
   constant (a special CmmLit), then replace it when the stack layout is known.
 o Removed last node: MidAddToContext 
 o Adding block id as a literal: means that the lowering of the calling conventions
   no longer has to produce labels early, which was inhibiting common-block elimination.
   Will also make it easier for the non-procpoint-splitting path.
 o Info tables: don't try to describe the update frame!
 o Over aggressive use of NonVoid!!!!
   Don't drop the non-void args before setting the type of the closure!!!
 o Sanity checking:
   Added a pass to stub dead dead slots on the stack
   (only ~10 lines with the dataflow framework)
 o More sanity checking:
   Check that incoming pointer arguments are non-stubbed.
   Note: these checks are still subject to dead-code removal, but they should
   still be quite helpful.
 o Better sanity checking: why stop at function arguments?
   Instead, in mkAssign, check that _any_ assignment to a pointer type is non-null
   -- the sooner the crash, the easier it is to debug.
   Still need to add the debugging flag to turn these checks on explicitly.
 o Fixed yet another calling convention bug.
   This time, the calls to the GC were wrong. I've added a new convention
   for GC calls and invoked it where appropriate.
   We should really straighten out the calling convention stuff:
     some of the code (and documentation) is spread across the compiler,
     and there's some magical use of the node register that should really
     be handled (not avoided) by calling conventions.
 o Switch bug: the arms in mkCmmLitSwitch weren't returning to a single join point.
 o Environment shadowing problem in Stg->Cmm:
   When a closure f is bound at the top-level, we should not bind f to the
   node register on entry to the closure.
   Why? Because if the body of f contains a let-bound closure g that refers
   to f, we want to make sure that it refers to the static closure for f.
   Normally, this would all be fine, because when we compile a closure,
   we rebind free variables in the environment. But f doesn't look like
   a free variable because it's a static value. So, the binding for f
   remains in the environment when we compile g, inconveniently referring
   to the wrong thing.
   Now, I bind the variable in the local environment only if the closure is not
   bound at the top level. It's still okay to make assumptions about the
   node holding the closure environment; we just won't find the binding
   in the environment, so code that names the closure will now directly
   get the label of the static closure, not the node register holding a
   pointer to the static closure.
 o Don't generate bogus Cmm code containing SRTs during the STG -> Cmm pass!
   The tables made reference to some labels that don't exist when we compute and
   generate the tables in the back end.
 o Safe foreign calls need some special treatment (at least until we have the integrated
   codegen). In particular:
   o they need info tables
   o they are not procpoints -- the successor had better be in the same procedure
   o we cannot (yet) implement the calling conventions early, which means we have
     to carry the calling-conv info all the way to the end
 o We weren't following the old convention when registering a module.
   Now, we use update frames to push any new modules that have to be registered
   and enter the youngest one on the stack.
   We also use the update frame machinery to specify that the return should pop
   the return address off the stack.
 o At each safe foreign call, an infotable must be at the bottom of the stack,
   and the TSO->sp must point to it.
 o More problems with void args in a direct call to a function:
   We were checking the args (minus voids) to check whether the call was saturated,
   which caused problems when the function really wasn't saturated because it
   took an extra void argument.
 o Forgot to distinguish integer != from floating != during Stg->Cmm
 o Updating slotEnv and areaMap to include safe foreign calls
   The dataflow analyses that produce the slotEnv and areaMap give
   results for each basic block, but we also need the results for
   a safe foreign call, which is a middle node.
   After running the dataflow analysis, we have another pass that
   updates the results to includ any safe foreign calls.
 o Added a static flag for the debugging technique that inserts
   instructions to stub dead slots on the stack and crashes when
   a stubbed value is loaded into a pointer-typed LocalReg.
 o C back end expects to see return continuations before their call sites.
   Sorted the flowgraphs appropriately after splitting.
 o PrimOp calling conventions are special -- unlimited registers, no stack
   Yet another calling convention...
 o More void value problems: if the RHS of a case arm is a void-typed variable,
   don't try to return it.
 o When calling some primOp, they may allocate memory; if so, we need to
   do a heap check when we return from the call.
 
] 
[Merging in the new codegen branch
dias@eecs.harvard.edu**20080814124027
 This merge does not turn on the new codegen (which only compiles
 a select few programs at this point),
 but it does introduce some changes to the old code generator.
 
 The high bits:
 1. The Rep Swamp patch is finally here.
    The highlight is that the representation of types at the
    machine level has changed.
    Consequently, this patch contains updates across several back ends.
 2. The new Stg -> Cmm path is here, although it appears to have a
    fair number of bugs lurking.
 3. Many improvements along the CmmCPSZ path, including:
    o stack layout
    o some code for infotables, half of which is right and half wrong
    o proc-point splitting
] 
[Major clean-up of HscMain.
Thomas Schilling <nominolo@googlemail.com>**20081125153201
 
 This patch entails a major restructuring of HscMain and a small bugfix
 to MkIface (which required the restructuring in HscMain).
 
 In MkIface:
 
   - mkIface* no longer outputs orphan warnings directly and also no
     longer quits GHC when -Werror is set.  Instead, errors are
     reported using the common IO (Messages, Maybe result) scheme.
 
 In HscMain:
 
   - Get rid of the 'Comp' monad.  This monad was mostly GhcMonad + two
     reader arguments, a ModSummary for the currently compiled module
     and a possible old interface.  The latter actually lead to a small
     space-leak since only its hash was needed (to check whether the
     newly-generated interface file was the same as the original one).
 
     Functions originally of type 'Comp' now only take the arguments
     that they actually need.  This leads to slighly longer argument
     lists in some places, however, it is now much easier to see what
     is actually going on.
 
   - Get rid of 'myParseModule'.  Rename 'parseFile' to 'hscParse'.
 
   - Join 'deSugarModule' and 'hscDesugar' (keeping the latter).
 
   - Rename 'typecheck{Rename}Module{'}' to 'hscTypecheck{Rename}'.
     One variant keeps the renamed syntax, the other doesn't.
 
   - Parameterise 'HscStatus', so that 'InteractiveStatus' is just a
     different parameterisation of 'HscStatus'.
 
   - 'hscCompile{OneShot,Batch,Nothing,Interactive}' are now
     implemented using a (local) typeclass called 'HsCompiler'.  The
     idea is to make the common structure more obvious.  Using this
     typeclass we now have two functions 'genericHscCompile' (original
     'hscCompiler') and 'genericHscRecompile' (original 'genComp')
     describing the default pipeline.  The methods of the typeclass
     describe a sort of "hook" interface (in OO-terms this would be
     called the "template method" pattern).
 
     One problem with this approach is that we parameterise over the
     /result/ type which, in fact, is not actually different for
     "nothing" and "batch" mode.  To avoid functional dependencies or
     associated types, we use type tags to make them artificially
     different and parameterise the type class over the result type.
     A perhaps better approach might be to use records instead.
     
   - Drop some redundant 'HscEnv' arguments.  These were likely
     different from what 'getSession' would return because during
     compilation we temporarily set the module's DynFlags as well as a
     few other fields.  We now use the 'withTempSession' combinator to
     temporarily change the 'HscEnv' and automatically restore the
     original session after the enclosed action has returned (even in
     case of exceptions).
 
   - Rename 'hscCompile' to 'hscGenHardCode' (since that is what it
     does).
 
 Calls in 'GHC' and 'DriverPipeline' accordingly needed small
 adaptions.
] 
[Fix Trac #2799: TcType.isOverloadedTy
simonpj@microsoft.com**20081125110540
 
 A missing case (for equality predicates) in isOverloadedTy make
 bindInstsOfLocalFuns/Pats do the wrong thing.  Core Lint nailed it.
 
 Merge to 6.10 branch.
 
] 
[Fix #2740: we were missing the free variables on some expressions
Simon Marlow <marlowsd@gmail.com>**20081125103113
 Particularly boolean expresions: the conditional of an 'if', and
 guards, were missing their free variables.
] 
[Fix symbol macro names in Linker.c
Thorkil Naur <naur@post11.tele.dk>**20081121160149] 
[Add a --machine-readable RTS flag
Ian Lynagh <igloo@earth.li>**20081123152127
 Currently it only affects the -t flag output
] 
[Return errors instead of dying in myParseModule.
Thomas Schilling <nominolo@googlemail.com>**20081122154151] 
[Comments/Haddockification only.
Thomas Schilling <nominolo@googlemail.com>**20081122143018] 
[Report source span instead of just source location for unused names.
Thomas Schilling <nominolo@googlemail.com>**20081122142641] 
[Change 'handleFlagWarnings' to throw exceptions instead of dying.
Thomas Schilling <nominolo@googlemail.com>**20081122130658
 
 It now uses the standard warning log and error reporting mechanism.
] 
[Use mutator threads to do GC, instead of having a separate pool of GC threads
Simon Marlow <marlowsd@gmail.com>**20081121151233
 
 Previously, the GC had its own pool of threads to use as workers when
 doing parallel GC.  There was a "leader", which was the mutator thread
 that initiated the GC, and the other threads were taken from the pool.
 
 This was simple and worked fine for sequential programs, where we did
 most of the benchmarking for the parallel GC, but falls down for
 parallel programs.  When we have N mutator threads and N cores, at GC
 time we would have to stop N-1 mutator threads and start up N-1 GC
 threads, and hope that the OS schedules them all onto separate cores.
 It practice it doesn't, as you might expect.
 
 Now we use the mutator threads to do GC.  This works quite nicely,
 particularly for parallel programs, where each mutator thread scans
 its own spark pool, which is probably in its cache anyway.
 
 There are some flag changes:
 
   -g<n> is removed (-g1 is still accepted for backwards compat).
   There's no way to have a different number of GC threads than mutator
   threads now.
 
   -q1       Use one OS thread for GC (turns off parallel GC)
   -qg<n>    Use parallel GC for generations >= <n> (default: 1)
 
 Using parallel GC only for generations >=1 works well for sequential
 programs.  Compiling an ordinary sequential program with -threaded and
 running it with -N2 or more should help if you do a lot of GC.  I've
 found that adding -qg0 (do parallel GC for generation 0 too) speeds up
 some parallel programs, but slows down some sequential programs.
 Being conservative, I left the threshold at 1.
 
 ToDo: document the new options.
 
] 
[we shouldn't update topBound in discardSparks()
Simon Marlow <marlowsd@gmail.com>**20081121113539] 
[Add a todo
Ian Lynagh <igloo@earth.li>**20090106145001] 
[Also make sure that HSffi.o gets built
Ian Lynagh <igloo@earth.li>**20090106144729] 
[Add a hack so that libHSffi.a gets built in time
Ian Lynagh <igloo@earth.li>**20090106135712] 
[FIX #1364: added support for C finalizers that run as soon as the value is not longer reachable.
Simon Marlow <marlowsd@gmail.com>**20081210150425
   
 Patch originally by Ivan Tomac <tomac@pacific.net.au>, amended by
 Simon Marlow:
 
   - mkWeakFinalizer# commoned up with mkWeakFinalizerEnv#
   - GC parameters to ALLOC_PRIM fixed
] 
[Put all the Makefile define's in their own file
Ian Lynagh <igloo@earth.li>**20090106120421] 
[add $(GhcLibHcOpts) to the boot libs too
Simon Marlow <marlowsd@gmail.com>**20081217151102] 
[quieter
Simon Marlow <marlowsd@gmail.com>**20081217151050] 
[todo items
Simon Marlow <marlowsd@gmail.com>**20081217151042] 
[put -no-user-package-conf in the right place
Simon Marlow <marlowsd@gmail.com>**20081217151035] 
[remove the .depend file if there's an error while generating it
Simon Marlow <marlowsd@gmail.com>**20081217151020] 
[remove unused $1_$2_NO_DEPS
Simon Marlow <marlowsd@gmail.com>**20081217142635] 
[refactor: add $(GHC_DUMMY_GHC_INPLACE)
Simon Marlow <marlowsd@gmail.com>**20081217142623] 
[fix 'make clean'
Simon Marlow <marlowsd@gmail.com>**20081217142528] 
[remove the _DIR_ABS variables, which were almost never used
Simon Marlow <marlowsd@gmail.com>**20081217135559] 
[make sure progs built with stage1 depend on the libraries
Simon Marlow <marlowsd@gmail.com>**20081217134044] 
[more deps to get parallel builds working
Simon Marlow <marlowsd@gmail.com>**20081217124852] 
[deps for testsuite/timeout
Simon Marlow <marlowsd@gmail.com>**20081217124835] 
[more dependencies on mkdirhier
Simon Marlow <marlowsd@gmail.com>**20081217124720] 
[comment updates
Simon Marlow <marlowsd@gmail.com>**20081217124702] 
[comment updates
Simon Marlow <marlowsd@gmail.com>**20081217112822] 
[small tidyup
Simon Marlow <marlowsd@gmail.com>**20081217112815] 
[ghc-prim fix
Simon Marlow <marlowsd@gmail.com>**20081217112803] 
[package.conf.inplace depends on includes/ghcautoconf.h
Simon Marlow <marlowsd@gmail.com>**20081217104501] 
[Change the phase ordering machinery, should be much more robust now
Simon Marlow <marlowsd@gmail.com>**20081217104439] 
[more dependencies
Simon Marlow <marlowsd@gmail.com>**20081216144336] 
[call genapply correctly (no -u arg)
Simon Marlow <marlowsd@gmail.com>**20081216144325] 
[GhcLibWays = v
Simon Marlow <marlowsd@gmail.com>**20081216144309] 
[the .depend files depend on ghcautoconf.h, ghcplatform.h
Simon Marlow <marlowsd@gmail.com>**20081216144256] 
[dependency fixes for stage1
Simon Marlow <marlowsd@gmail.com>**20081216144236] 
[add GhcStage[123]HcOpts
Simon Marlow <marlowsd@gmail.com>**20081216144202] 
[validate using the new build
Simon Marlow <marlowsd@gmail.com>**20081216144150] 
[use GhcLibHcOpts, and add -fno-warn-deprecated-flags
Simon Marlow <marlowsd@gmail.com>**20081216144142] 
[build testsuite/timeout if available
Simon Marlow <marlowsd@gmail.com>**20081216144122] 
[register the boot packages in sequence (fixes a -j bug)
Simon Marlow <marlowsd@gmail.com>**20081216144109] 
[include _stub.o files when building libraries
Simon Marlow <marlowsd@gmail.com>**20081216144031] 
[comment updates
Simon Marlow <marlowsd@gmail.com>**20081216144011] 
[calculate C source dependencies
Simon Marlow <marlowsd@gmail.com>**20081216143957] 
[add some MKDIRHIER depndencies
Simon Marlow <marlowsd@gmail.com>**20081216143923] 
[add foot-protection: make sure $(GhcLibWays) is not empty
Simon Marlow <marlowsd@gmail.com>**20081216143914] 
[ANSIfy (!)
Simon Marlow <marlowsd@gmail.com>**20081216130902] 
[fix some missing files in the RTS
Simon Marlow <marlowsd@gmail.com>**20081216112438] 
[more fixes, up to stage2 with link errors
Simon Marlow <marlowsd@gmail.com>**20081212150129] 
[fix typos in marco
Simon Marlow <marlowsd@gmail.com>**20081212141623] 
[pass -r to sub-makes
Simon Marlow <marlowsd@gmail.com>**20081212141508] 
[compiler/stage2 builds, new scheme for resolving deps between included Makefiles
Simon Marlow <marlowsd@gmail.com>**20081209165403] 
[snapshot: working up to bootlibs
Simon Marlow <marlowsd@gmail.com>**20081209141120] 
[fixes from simonmar, and the rest of the ghc/ghc.mk file
Simon Marlow <marlowsd@gmail.com>**20081208163900] 
[make the new makefile the default
Simon Marlow <marlowsd@gmail.com>**20081208155039] 
[add a dep
Ian Lynagh <igloo@earth.li>**20081206231512] 
[Use stage1 rather than dist-stage1
Ian Lynagh <igloo@earth.li>**20081206231238] 
[Get closer to building stage1
Ian Lynagh <igloo@earth.li>**20081206224959] 
[Add utils/unlit/ghc.mk
Ian Lynagh <igloo@earth.li>**20081206194002] 
[fix problem with ghc_boot_platform.h
Simon Marlow <marlowsd@gmail.com>**20081205164911] 
[fix some dependency problems
Simon Marlow <marlowsd@gmail.com>**20081205163647] 
[getting further...
Simon Marlow <marlowsd@gmail.com>**20081205161752] 
[building up to stage1 from scratch
Simon Marlow <marlowsd@gmail.com>**20081205124453] 
[compiler nearly built now
Simon Marlow <marlowsd@gmail.com>**20081204165907] 
[another snapshot: building from scratch now, next step is stage1
Simon Marlow <marlowsd@gmail.com>**20081204134009] 
[getting closer... libffi and RTS now building
Simon Marlow <marlowsd@gmail.com>**20081203165841] 
[refactor, tidy up, and fix a few bugs
Simon Marlow <marlowsd@gmail.com>**20081203112835] 
[almost there with the bootstrapping libraries now
Simon Marlow <marlowsd@gmail.com>**20081202171129] 
[Put full ImportDecls in ModSummary instead of just ModuleNames
Simon Marlow <marlowsd@gmail.com>**20081202133736
 ... and use it to make ghc -M generate correct cross-package
 dependencies when using package-qualified imports (needed for the new
 build system).  Since we're already parsing the ImportDecl from the
 source file, there seems no good reason not to keep it in the
 ModSummary, it might be useful for other things too.
] 
[update todos
Simon Marlow <marlowsd@gmail.com>**20081202135525] 
[fix hs-boot rules
Simon Marlow <marlowsd@gmail.com>**20081202135513] 
[run configure scripts, use *.buildinfo, and generate cabal-macros.h
Simon Marlow <marlowsd@gmail.com>**20081202134439] 
[Document exported functions in main/HeaderInfo.
Thomas Schilling <nominolo@googlemail.com>**20081121145307] 
[Remove warning supression klugde in main/HeaderInfo
Thomas Schilling <nominolo@googlemail.com>**20081121144155] 
[Throw SourceErrors instead of ProgramErrors in main/HeaderInfo.
Thomas Schilling <nominolo@googlemail.com>**20081121141339
 
 Parse errors during dependency analysis or options parsing really
 shouldn't kill GHC; this is particularly annoying for GHC API clients.
] 
[ghc -M: need to add a dep on Prelude unless -fno-implicit-prelude is on
Simon Marlow <marlowsd@gmail.com>**20081128165707] 
[todos
Simon Marlow <marlowsd@gmail.com>**20081128165644] 
[Pass the GHC and ghc-pkg to use to ghc-cabal
Simon Marlow <marlowsd@gmail.com>**20081128162459
 And enable the rest of the libraries, we can built the bootlibs now
 (modulo bootstrapping issues)
] 
[disable built-in suffix rules to speed up make
Simon Marlow <marlowsd@gmail.com>**20081128162325] 
[build more libraries
Simon Marlow <marlowsd@gmail.com>**20081128144700] 
[tmp hacks
Simon Marlow <marlowsd@gmail.com>**20081128144650] 
[fix absolute paths in the cross-package deps we get from GHC
Simon Marlow <marlowsd@gmail.com>**20081128144644] 
[generate cross-package dependencies
Simon Marlow <marlowsd@gmail.com>**20081128135851] 
[tmp hack: explicitly add -Iincludes for now
Simon Marlow <marlowsd@gmail.com>**20081128135840] 
[fixes to the implicit rules
Simon Marlow <marlowsd@gmail.com>**20081128135824] 
[make -include-pkg-deps work (not sure when this got lost)
Simon Marlow <marlowsd@gmail.com>**20081128135746] 
[break some lines
Simon Marlow <marlowsd@gmail.com>**20081128130525] 
[lots of updates
Simon Marlow <marlowsd@gmail.com>**20081128130405
   - put more variables in package-data.mk
   - don't copy source files into dist/build (it turned out to be
     easier this way: hs-boot files and #include from Haskell source
     caused trouble)
] 
[Actually generate the makefiles for bootstrapping the filepath package
Ian Lynagh <igloo@earth.li>**20081128012916] 
[fixes for the C suffix rules
Simon Marlow <marlowsd@gmail.com>**20081127152229] 
[warning wibble
Simon Marlow <marlowsd@gmail.com>**20081127150832] 
[build C files
Simon Marlow <marlowsd@gmail.com>**20081127150817] 
[todo list updates
Simon Marlow <marlowsd@gmail.com>**20081127150722] 
[encode the ways into the name of the .depend file (e.g. .depend-v-p)
Simon Marlow <marlowsd@gmail.com>**20081127144353
 To make sure we rebuild dependencies if GhcLibWays changes
] 
[add some comments
Simon Marlow <marlowsd@gmail.com>**20081127143449] 
[make hs-boot files work
Simon Marlow <marlowsd@gmail.com>**20081127120127] 
[don't include .depend files if NODEPS=YES
Simon Marlow <marlowsd@gmail.com>**20081127113810
 and set NODEPS=YES if we're cleaning, or doing 'make show'
] 
[Some fixes for hsc2hs
Simon Marlow <marlowsd@gmail.com>**20081127113740
 We now need libraries/foo_INCLUDE_DIRS to be defined in package-data.mk
] 
[no need to pass "-dep-suffix v" to ghc -M
Simon Marlow <marlowsd@gmail.com>**20081127104324] 
[ghc-cabal sort-of works
Ian Lynagh <igloo@earth.li>**20081127021946] 
[Generalise package building over GHC stage
Ian Lynagh <igloo@earth.li>**20081126211538] 
[Build mkdirhier
Ian Lynagh <igloo@earth.li>**20081126205203] 
[Add the distdir to teh generated build-package calls
Ian Lynagh <igloo@earth.li>**20081126180625] 
[Parameterise over distdir
Ian Lynagh <igloo@earth.li>**20081126174627] 
[fix ways in package dependencies
Simon Marlow <marlowsd@gmail.com>**20081126164555] 
[a couple of todo items
Simon Marlow <marlowsd@gmail.com>**20081126164351] 
[go back to creating $(odir) at dependency-generation time
Simon Marlow <marlowsd@gmail.com>**20081126154944] 
[fix a suffix rule
Simon Marlow <marlowsd@gmail.com>**20081126153523] 
[Wibble
Ian Lynagh <igloo@earth.li>**20081126153449] 
[fix the .hi rules
Simon Marlow <marlowsd@gmail.com>**20081126153000] 
[Change the special case for ghc -M
Simon Marlow <marlowsd@gmail.com>**20081126151530
 When generating dependencies, if there's only one place that a package
 .hi file can be found, then don't check that the .hi file exists.
 This means we can make dependencies for packages before building them,
 which is important in the new build system.
 
 There was a previous hack to do something similar, where we looked for
 source files, but it doesn't work any more because the location of the
 .hi file isn't known relative to the source file for other packages.
] 
[Build ghc-cabal with --make
Ian Lynagh <igloo@earth.li>**20081126151501] 
[build the GHCi library for a package
Simon Marlow <marlowsd@gmail.com>**20081126140814] 
[configuring a package also creates cabal_macros.h
Simon Marlow <marlowsd@gmail.com>**20081126140801] 
[depend on $(1)/$(odir)
Simon Marlow <marlowsd@gmail.com>**20081126140741] 
[Remove unnecessary parentheses and whitespace from NewMakefile
Ian Lynagh <igloo@earth.li>**20081126133251] 
[fix an apparent typo in GHC_UNLIT_DIR
Simon Marlow <marlowsd@gmail.com>**20081126132654] 
[remove outdated comment and unnecessary $(MKDIRHIER)
Simon Marlow <marlowsd@gmail.com>**20081126132633] 
[package building fixes - I can now build a package to a .a file
Simon Marlow <marlowsd@gmail.com>**20081126131516] 
[fixes to mkdir rules
Simon Marlow <marlowsd@gmail.com>**20081126131450] 
[$(HC) fixes
Simon Marlow <marlowsd@gmail.com>**20081126131435] 
[todo items
Simon Marlow <marlowsd@gmail.com>**20081126131424] 
[a couple of 'make -j' fixes
Simon Marlow <marlowsd@gmail.com>**20081126131414] 
[fix the build when !USE_MMAP
Simon Marlow <marlowsd@gmail.com>**20081121085418] 
[round the size up to a page in mmapForLinker() instead of in the caller
Simon Marlow <marlowsd@gmail.com>**20081120154014] 
[Make BOOTSTRAPPING_CONF a relative path
Ian Lynagh <igloo@earth.li>**20081126121210] 
[Handle directory creation a bit better
Ian Lynagh <igloo@earth.li>**20081126115431] 
[Reinstate the boot script contents
Ian Lynagh <igloo@earth.li>**20081126114409] 
[Change a :: Makefile rule to a : Makefile rule
Ian Lynagh <igloo@earth.li>**20081125222357] 
[Wibble to how GhcLibWays is set
Ian Lynagh <igloo@earth.li>**20081125222318
 No functional change
] 
[can make dependencies for ghc-prim now
Simon Marlow <marlowsd@gmail.com>**20081125170142] 
[New build system hacking for Igloo to look at
Simon Marlow <marlowsd@gmail.com>**20081125161636] 
[TAG 2008-11-20
Ian Lynagh <igloo@earth.li>**20081120153852] 
Patch bundle hash:
bb44354818b407733c34755e1e7eaf9cb85ec561
