- 09 Apr, 2002 3 commits
-
-
simonmar authored
If we free a StablePtr which has no StableName attached, then just add its entry to the free list immediately, rather than waiting for the garbage collector to free it.
-
simonmar authored
- Revert rev. 1.7, i.e. go back to using malloc/free and a free list to manage hash list cells, because the arena method doesn't recycle used cells, resulting in memory leaks. - Add a freeHashList() call which was missing in removeHashTable().
-
njn authored
Removed the unnecessary arg from TICK_ENT_{STATIC,DYN}_THK macros in the "#ifdef TICKY_TICKY" case. This meant the libraries would not compile with way=t for SimonPJ even though they did for me...
-
- 08 Apr, 2002 2 commits
- 05 Apr, 2002 6 commits
-
-
sof authored
Friday afternoon pet peeve removal: define (Util.notNull :: [a] -> Bool) and use it
-
sof authored
Catch the use of non-existent output directories & report this back to the user. By not doing this, we relied on external tools (such as the linker or assembler) to give good feedback about this error condition -- this wasn't the case (cf. GAS on mingw/cygwin.) To insert more sanity checks of the effective options (to the batch compiler), use Main.checkOptions
-
sof authored
Cleaned up the way the External Core front-end was integrated with the rest of the compiler; guided by detailed and helpful feedback from Simon PJ. Input files ending in ".hcr" are now assumed to contain external core -- still working on getting the renamer to slurp in interface files (implicitly) referred to in the Core source.
-
simonpj authored
More wibbles
-
simonpj authored
More head-healing
-
simonpj authored
Heal the head
-
- 04 Apr, 2002 3 commits
-
-
simonmar authored
This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations.
-
simonpj authored
--------------------------------------- A glorious improvement to CPR analysis --------------------------------------- Working on the CPR paper, I finally figured out how to do a decent job of taking account of strictness analyis when doing CPR analysis. There are two places we do that: 1. Usually, on a letrec for a *thunk* we discard any CPR info from the RHS. We can't worker/wrapper a thunk. BUT, if the let is non-recursive non-top-level used strictly we don't need to discard the CPR info, because the thunk-splitting transform (WorkWrap.splitThunk) works. This idea isn't new in this commit. 2. Arguments to strict functions. Consider fac n m = if n==0 then m else fac (n-1) (m*n) Does it have the CPR property? Apparently not, because it returns the accumulating parameter, m. But the strictness analyser will discover that fac is strict in m, so it will be passed unboxed to the worker for fac. More concretely, here is the worker/wrapper split that will result from strictness analysis alone: fac n m = case n of MkInt n' -> case m of MkInt m' -> facw n' m' facw n' m' = if n' ==# 0# then I# m' else facw (n' -# 1#) (m' *# n') Now facw clearly does have the CPR property! We can take advantage of this by giving a demanded lambda the CPR property. To make this work nicely, I've made NewDemandInfo into Maybe Demand rather than simply Demand, so that we can tell when we are on the first iteration. Lots of comments about this in Note [CPR-AND-STRICTNESS]. I don't know how much all this buys us, but it is simple and elegant.
-
simonmar authored
An I/O error while opening/writing the output file is *not* a panic.
-
- 03 Apr, 2002 2 commits
-
-
simonpj authored
Make -fgenerics the default
-
simonpj authored
----------------------------- Put existential tyvars second [fixes ParsecPerm lint error] ----------------------------- In an existential data constr: data Eq a => T a = forall b. Ord b => MkT a [b] the type of MkT is MkT :: forall a b . Ord b => a -> [b] -> MkT a Note that the existential tyvars (b in this case) come *after* the "ordinary" tyvars. I had switched this around earlier in the week, but I'm putting it back (and fixing a bug) because I found it really works better second. Reason: in a case expression we may find: case (e :: T t) of { MkT b (d:Ord b) (x:t) (xs:[b]) -> ... } It's convenient to apply the rep-type of MkT to 't', to get forall b. Ord b => ... and use that to check the pattern. Mind you, this is really only use in CoreLint.
-
- 02 Apr, 2002 9 commits
-
-
simonmar authored
Allow the use of 'let' for implcit bindings. Support for 'with' is left in place for the time being, but on seeing a 'with' we emit a non-suppressible warning about 'with' being deprecated in favour of 'let'.
-
simonpj authored
----------------------------------------------------- Fix two nasty, subtle loops in context simplification ----------------------------------------------------- The context simplifier in TcSimplify was building a recursive dictionary, which meant the program looped when run. The reason was pretty devious; in fact there are two independent causes. Cause 1 ~~~~~~~ Consider class Eq b => Foo a b instance Eq a => Foo [a] a If we are reducing d:Foo [t] t we'll first deduce that it holds (via the instance decl), thus: d:Foo [t] t = $fFooList deq deq:Eq t = ...some rhs depending on t... Now we add d's superclasses. We must not then overwrite the Eq t constraint with a superclass selection!! The only decent way to solve this is to track what dependencies a binding has; that is what the is_loop parameter to TcSimplify.addSCs now does. Cause 2 ~~~~~~~ This shows up when simplifying the superclass context of an instance declaration. Consider class S a class S a => C a where { opc :: a -> a } class S b => D b where { opd :: b -> b } instance C Int where opc = opd instance D Int where opd = opc From (instance C Int) we get the constraint set {ds1:S Int, dd:D Int} Simplifying, we may well get: $dfCInt = :C ds1 (opd dd) dd = $dfDInt ds1 = $p1 dd Notice that we spot that we can extract ds1 from dd. Alas! Alack! We can do the same for (instance D Int): $dfDInt = :D ds2 (opc dc) dc = $dfCInt ds2 = $p1 dc And now we've defined the superclass in terms of itself. Solution: treat the superclass context separately, and simplify it all the way down to nothing on its own. Don't toss any 'free' parts out to be simplified together with other bits of context. This is done in TcInstDcls.tcSuperClasses, which is well commented. All this from a bug report from Peter White!
-
simonmar authored
Make this compile with 4.08.
-
simonpj authored
Error message tidy up
-
simonmar authored
oops, accidentally committed some untested (and non-working) cleanups in the last commit. This commit fixes it up again. (fixes the ByteCodeGen panic in GHCi on the HEAD)
-
simonmar authored
Add my build.mk file as a sample, and point to it in the comments at the top of config.mk.
-
simonpj authored
Comments
-
simonmar authored
- Reverse the meaning of the *-prefix in the :module and :browse commands: '*Foo' now means the full contents of Foo, whereas just 'Foo' means Foo's exports only. This seems more intuitive to me, but the downside is that ':m Foo' doesn't do the same thing in GHC as Hugs (you have to say ':m *Foo' to get Hugs's behaviour). - Update the help text
-
simonmar authored
The hPutBuf bug looks to be in 5.00 as well as 4.08 - so enable the workaround on GHC <= 5.00. Hopefully should fix bootstrapping problems on Alpha.
-
- 01 Apr, 2002 11 commits
-
-
panne authored
Sigbjorn's last optimization (checking for -mno-cygwin only for mingw32 targets) kicked out -O from the default SRC_CC_OPTS. Apart from a minor performance hit for some parts of GHC, it yields a GHCi which can't load HSbase_cbits.o because `lstat' is unknown, at least on SuSE 7.3. A little investigation showed the rather arcane reason: lstat and friends are inline functions and therefore not in libc.so, only in its static counterpart. Normally this is not a problem at all, but the CPP INLINE trickery in fptools/libraries/base/cbits/PrelIOUtils.c manages to get a reference to lstat into PrelIOUtils.o if -O is not given. %-} A similar problem exists for fstat, too. Simple solution: Re-add -O to SRC_CC_OPTS, simplifying configure.in a bit on the way.
-
simonpj authored
Use hasktags for the HSTAGS_PGM
-
panne authored
Fixed imports for GHC >= 5.03
-
panne authored
"warning: unused variable"-police
-
simonpj authored
Comments
-
simonpj authored
wibble
-
simonpj authored
------------------------------------ Change the treatment of the stupid context on data constructors ----------------------------------- Data types can have a context: data (Eq a, Ord b) => T a b = T1 a b | T2 a and that makes the constructors have a context too (notice that T2's context is "thinned"): T1 :: (Eq a, Ord b) => a -> b -> T a b T2 :: (Eq a) => a -> T a b Furthermore, this context pops up when pattern matching (though GHC hasn't implemented this, but it is in H98, and I've fixed GHC so that it now does): f (T2 x) = x gets inferred type f :: Eq a => T a b -> a I say the context is "stupid" because the dictionaries passed are immediately discarded -- they do nothing and have no benefit. It's a flaw in the language. Up to now I have put this stupid context into the type of the "wrapper" constructors functions, T1 and T2, but that turned out to be jolly inconvenient for generics, and record update, and other functions that build values of type T (because they don't have suitable dictionaries available). So now I've taken the stupid context out. I simply deal with it separately in the type checker on occurrences of a constructor, either in an expression or in a pattern. To this end * Lots of changes in DataCon, MkId * New function Inst.tcInstDataCon to instantiate a data constructor I also took the opportunity to * Rename dataConId --> dataConWorkId for consistency. * Tidied up MkId.rebuildConArgs quite a bit, and renamed it mkReboxingAlt * Add function DataCon.dataConExistentialTyVars, with the obvious meaning
-
simonpj authored
Comments
-
simonpj authored
Split out FastMutInt separately
-
simonpj authored
Comments
-
simonpj authored
Import wibbles
-
- 29 Mar, 2002 3 commits
-
-
sof authored
Front end for External Core. Initial go at implementing a Core front end (enabled via -fcore); work in progress (renamer is currently not willing to slurp in & resolve imports.)
-
krasimir authored
Latest Win32 implementation allows dynamic loading only for *.dll libraries. This commit add checking for *.drv libraries (drivers). This allows loading of winspool.drv needed for ObjectIO
-
krasimir authored
Hack hs_libraries package info for HSobjectio[1,2,3,4]
-
- 28 Mar, 2002 1 commit
-
-
simonmar authored
In lookupTopBndrRn, if we're in an interface file, then create the binder in the cache with the correct Module (inc. package name) rather than making a vanilla module as we do currently. This helps to get the package names right in names from interfaces that we've read via checkOldIface (ie. "skipped" modules), and fixes a bug to do with unnecessary version bumping and recompilation. (Simon P.J. will add a better comment later) MERGE TO STABLE
-