Sun Apr 6 09:47:55 EDT 2008 Samuel Bronson
* Implement #2191 (traceCcs# -- prints CCS of a value when available)
Apparantly, tagged objects are passed, contrary to the comments for
UNTAG and GETTAG in Cmm.h. So I untag them. *sigh*.
New patches:
[Implement #2191 (traceCcs# -- prints CCS of a value when available)
Samuel Bronson **20080406134755
Apparantly, tagged objects are passed, contrary to the comments for
UNTAG and GETTAG in Cmm.h. So I untag them. *sigh*.
] {
hunk ./compiler/prelude/primops.txt.pp 1702
with
out_of_line = True
+------------------------------------------------------------------------
+section "Misc"
+ {These aren't nearly as wired in as Etc...}
+------------------------------------------------------------------------
+
+primop TraceCcsOp "traceCcs#" GenPrimOp
+ a -> b -> b
+ with
+ has_side_effects = True
+ out_of_line = True
+
------------------------------------------------------------------------
section "Etc"
{Miscellaneous built-ins}
hunk ./includes/StgMiscClosures.h 606
RTS_FUN(getApStackValzh_fast);
RTS_FUN(noDuplicatezh_fast);
+
+RTS_FUN(traceCcszh_fast);
/* Other misc stuff */
hunk ./rts/Linker.c 771
SymX(rts_stop_on_exception) \
SymX(stopTimer) \
SymX(n_capabilities) \
+ SymX(traceCcszh_fast) \
RTS_USER_SIGNALS_SYMBOLS
#ifdef SUPPORT_LONG_LONGS
hunk ./rts/PrimOps.cmm 2236
RET_NP(ok,val);
}
+/* -----------------------------------------------------------------------------
+ Misc. primitives
+ -------------------------------------------------------------------------- */
+
+// Write the cost center stack of the first argument on stderr; return
+// the second. Possibly only makes sense for already evaluated
+// things?
+traceCcszh_fast
+{
+ W_ ccs;
+
+#ifdef PROFILING
+ ccs = StgHeader_ccs(UNTAG(R1));
+ foreign "C" fprintCCS_stderr(ccs "ptr") [R2];
+#endif
+
+ RET_P(R2);
+}
+
}
Context:
[Virtualize the cwd in GHCi
Pepe Iborra **20080405145136
This fixes the issue where :list would stop working if the
program being debugged side-effected the working directory,
and should prevent other similar issues
]
[Fix rendering of references in :print under -fprint-evld-with-show flag
Pepe Iborra **20071219174431]
[Fix Trac #2188: scoping in TH declarations quotes
simonpj@microsoft.com**20080404205556
This patch fixes a rather tiresome issue, namely the fact that
a TH declaration quote *shadows* bindings in outer scopes:
f g = [d| f :: Int
f = g
g :: Int
g = 4 |]
Here, the outer bindings for 'f' (top-level) and 'g' (local)
are shadowed, and the inner bindings for f,g should not be
reported as duplicates. (Remember they are top-level bindings.)
The actual bug was that we'd forgotten to delete 'g' from the
LocalRdrEnv, so the type sig for 'g' was binding to the outer
'g' not the inner one.
]
[Fix simplifier thrashing
simonpj@microsoft.com**20080403223819
Another example of the simplifier thrashing, getting nowhere.
See SimplUtils, Note [Unsaturated functions]
There's a test at eyeball/inline4.hs
]
[Fix Trac #2179: error message for main
simonpj@microsoft.com**20080403173746
A short-cut to generate the (runMainIO main) wrapper turned out
to make a bad error message. This should fix it.
]
[Fix Trac #2136: reporting of unused variables
simonpj@microsoft.com**20080403110250
There's a bit of a hack RnBinds.rnValBindsAndThen, documented
in Note [Unused binding hack]. But the hack was over brutal
before, and produced unnecssarily bad (absence of) warnings.
This patch does a bit of refactoring; and fixes the bug in
rnValBindsAndThen.
]
[Fix Trac #2137: report correct location for shadowed binding
simonpj@microsoft.com**20080402153410
The error message generation for a shadowed binding was
plain wrong, at least where the shadowed binding isn't
top-level. Just a typo really -- the fix is trivial.
]
[Fix Trac #2141: invalid record update
simonpj@microsoft.com**20080402132057
See Note [Record field lookup] in TcEnv. The fix here
is quite straightforward.
]
[Do not #include external header files when compiling via C
Simon Marlow **20080402051412
This has several advantages:
- -fvia-C is consistent with -fasm with respect to FFI declarations:
both bind to the ABI, not the API.
- foreign calls can now be inlined freely across module boundaries, since
a header file is not required when compiling the call.
- bootstrapping via C will be more reliable, because this difference
in behavour between the two backends has been removed.
There is one disadvantage:
- we get no checking by the C compiler that the FFI declaration
is correct.
So now, the c-includes field in a .cabal file is always ignored by
GHC, as are header files specified in an FFI declaration. This was
previously the case only for -fasm compilations, now it is also the
case for -fvia-C too.
]
[Derive a valid Ix instance for data Foo = Foo Int Int
Ian Lynagh **20080330182813
The old one didn't satisfy the axioms. See trac #2158 for details.
]
[Revive External Core parser
Tim Chevalier **20080329223948
Huzzah, the External Core parser will now parse External Core generated by
the HEAD.
Most notably, I rewrote the parser in Parsec, but the old Happy version
remains in the repository.
I checked all the nofib benchmarks and most of the ghc-prim, base and integer
libraries to make sure they parsed; one known bug:
- Strings like "\x0aE", in which a hex escape code is followed by a
letter that could be a hex digit, aren't handled properly. I'm
investigating whether this is a bug in Parsec or expected behavior.
The checker and interpreter still don't work, but should compile.
Please mess around with the parser, report bugs, improve my code, etc.,
if you're so inclined.
]
[Fix big character literal printing in External Core
Tim Chevalier **20080329221109
Characters bigger than '\xff' should be represented as int
literals in External Core. (This was originally fixed five years ago
and broken again four and a half years ago...)
]
[External Core: don't print superfluous parens in case types
Tim Chevalier **20080329194629
The External Core printer was parenthesizing the scrutinee type in case expressions. Since this type is required to be atomic, the parens aren't necessary.
]
[Don't import FastString in HsVersions.h
Ian Lynagh **20080329185043
Modules that need it import it themselves instead.
]
[DEBUG removal
Ian Lynagh **20080329171135]
[DEBUG removal
Ian Lynagh **20080329171013]
[DEBUG removal
Ian Lynagh **20080329170935]
[DEBUG removal
Ian Lynagh **20080329170341]
[DEBUG removal
Ian Lynagh **20080329170227]
[DEBUG removal
Ian Lynagh **20080329165412]
[Fix typo; spotted by Bdh in #ghc
Ian Lynagh **20080329165303]
[DEBUG removal
Ian Lynagh **20080329164849]
[DEBUG removal
Ian Lynagh **20080329164420]
[Remove a DEBUG use
Ian Lynagh **20080329164209]
[Remove a DEBUG
Ian Lynagh **20080329163936]
[Remove more #ifdef DEBUGs
Ian Lynagh **20080329145716]
[Remove an #ifdef DEBUG
Ian Lynagh **20080329145508]
[Remove an #ifdef DEBUG
Ian Lynagh **20080329145244]
[Remove an #ifdef DEBUG
Ian Lynagh **20080329144844]
[Remove a #ifdef DEBUG
Ian Lynagh **20080329144658]
[Remove an #ifdef DEBUG
Ian Lynagh **20080329144544]
[Remove some redundant code
Ian Lynagh **20080329144226]
[prelude/PrimOp is now mostly warning-free
Ian Lynagh **20080329143914
commutableOp seems to be unused, so we're no 100% there yet.
]
[Fix warnings from primops.txt.pp
Ian Lynagh **20080329142637]
[Use _ rather than "other" in generated code
Ian Lynagh **20080329142508]
[Fix some warnings
Ian Lynagh **20080329142219]
[Remove some redundant imports
Ian Lynagh **20080329141809]
[Remove an #ifdef DEBUG
Ian Lynagh **20080329141733]
[Remove an #ifdef DEBUG
Ian Lynagh **20080329141629]
[Remove some unnecessary imports
Ian Lynagh **20080329141145]
[Remove an unnecessary #ifdef DEBUG
Ian Lynagh **20080329141047]
[Another debugIsOn use
Ian Lynagh **20080329140126]
[Convert some DEBUG uses to debugIsOn
Ian Lynagh **20080329135950]
[Put debugIsOn in Util, rather than rely on it being CPPed in
Ian Lynagh **20080329135755]
[External Core: print function types correctly, improve newtype pretty-printing
Tim Chevalier **20080328222630
- In a previous patch I broke the printing of fully-applied arrow
types (e.g., "a -> b" was "(ghczmprim:GHCziPrim a b)") by z-encoding
package names and not updating the primitive module name as defined in
External Core accordingly. Fixed. (Mega sigh...)
- Make newtype decls print slightly more readably.
]
[Print out rational literals correctly in External Core
Tim Chevalier **20080328211919
The External Core printer was printing out rational literals of the
form:
2.0e-2
when the External Core grammar doesn't allow this. (This
bug has apparently been there since the beginning...)
It's now printing rationals in the same form that (show (r::Rational))
does. This requires a parser change as well (soon to come.)
]
[Change syntax for qualified names in External Core
Tim Chevalier **20080327185436
Two changes that make the ext-core code uglier but the parser easier:
- Prefix qualified names with "^" so that we can more easily
distinguish a qualified name:
^a:Foo.Bar.quux
from an unqualified name:
a
- z-encode package names ("ghc-prim" was the culprit.)
]
[Make use of the SDoc type synonym
Ian Lynagh **20080326175306]
[Fix warnings in rename/RnTypes
Ian Lynagh **20080326174657]
[Fix warnings in basicTypes/IdInfo
Ian Lynagh **20080326170014]
[Fix warnings in basicTypes/NameEnv
Ian Lynagh **20080326165139]
[Fix warnings in basicTypes/NameSet
Ian Lynagh **20080326164837]
[Fix warning in basicTypes/NewDemand
Ian Lynagh **20080326160017]
[Fix warnings in basicTypes/VarEnv
Ian Lynagh **20080326155412]
[Fix warnings in basicTypes/VarSet
Ian Lynagh **20080326155105]
[main/BreakArray has no warnings
Ian Lynagh **20080326154747]
[In validate settings, make -Werror easier to override
Ian Lynagh **20080326141030]
[Remove a redundant type sig
Ian Lynagh **20080326004932]
[Fix warnings in main/DriverPhases
Ian Lynagh **20080325235828]
[Remove redundant type sig
Ian Lynagh **20080325235801]
[Fix warnings in main/HscStats
Ian Lynagh **20080325234110]
[Fix warnings in main/Constants
Ian Lynagh **20080325233034]
[Fix warnings in main/InteractiveEval
Ian Lynagh **20080325230153]
[Fix warnings in main/Packages
Ian Lynagh **20080325224444]
[Fix warnings in main/PprTyThing
Ian Lynagh **20080325223104]
[Fix warnings in main/StaticFlags
Ian Lynagh **20080325221632]
[Change syntax for newtypes in External Core
Tim Chevalier **20080325170218
The way that newtype declarations were printed in External Core files was
incomplete, since there was no declaration for the coercion introduced by a
newtype.
For example, the Haskell source:
newtype T a = MkT (a -> a)
foo (MkT x) = x
got printed out in External Core as (roughly):
%newtype T a = a -> a;
foo :: %forall t . T t -> t -> t =
%cast (\ @ t -> a1 @ t)
(%forall t . T t -> ZCCoT t);
There is no declaration anywhere in the External Core program for :CoT, so
that's bad.
I changed the newtype decl syntax so as to include the declaration for the
coercion axiom introduced by the newtype. Now, it looks like:
%newtype T a ^ (ZCCoT :: ((T a) :=: (a -> a))) = a -> a;
And an external typechecker could conceivably typecheck code that uses this.
The major changes are to MkExternalCore and PprExternalCore (as well as
ExternalCore, to change the External Core AST.) I also corrected some typos in
comments in other files.
Documentation and external tool changes to follow.
]
[Fix warnings in the RTS
Ian Lynagh **20080325160314
For some reason this causes build failures for me in my 32-bit chroot,
]
[Another change for GHC.PrimopWrappers moving from base to ghc-prim
Ian Lynagh **20080324224006]
[Update darcs-boring
Ian Lynagh **20080324212319]
[Fix primMname in External Core printer
Tim Chevalier **20080324014311
My earlier changes broke printing of function types in .hcr files.
In other words: the z-encoding must die.
]
[Fix primMname in External Core printer
Tim Chevalier **20080324005246
My earlier changes broke printing of function types in .hcr files.
In other words: the z-encoding must die.
]
[Follow library changes
Ian Lynagh **20080323182557
Integer, Bool and Unit/Inl/Inr are now in new packages integer
and ghc-prim.
]
[CgTicky now doesn't know about the Integer data constructors
Ian Lynagh **20080320195836]
[-DDEBUG build fix
Ian Lynagh **20080322140641]
[Rename rebuild to remake, and define rebuild to "clean; build"
Ian Lynagh **20080320221915]
[Handle hierarchical module names in External Core tools
Tim Chevalier **20080320014449
I updated the parser to handle hierarchical module names (with package names)
the way GHC is currently printing them out in External Core.
Beware kludgy use of z-encoding and gratutious copy-pasta from GHC.
You can now use the stand-alone Core parser to parse a very simple
GHC-generated .hcr file (progress!) but not to typecheck or interpret it
(the typechecker/interpreter don't snarf in the right libraries yet, among
other things.) And, the parser is still incomplete in that it doesn't handle
programs with newtypes/GADTs/etc. whose syntax has changed since 2003. In
other words: probably don't try to use this yet.
]
[Improve hierarchical module name handling in MkExternalCore
Tim Chevalier **20080319190429
It's easier for the External Core parser if MkExternalCore prints
module names like:
base:GHCziBase
rather than like:
base:GHC.Base
(which it was doing before.)
So now we z-encode the hierarchical module-name part of a module
name, but don't z-encode the ':'.
I also removed some old comments that don't seem relevant anymore.
]
[Fixed remaining warning in coreSyn/MkExternalCore
Tim Chevalier **20080319182521
There was a (suppressed) warning about an incomplete pattern match in make_alt. This was because the DEFAULT alt never has variable bindings. I thought it would be better to check that case and panic if it happens than to have an incomplete pattern. It's still not great, but at least now we don't have to suppress any warnings in this file.
]
[Revert an accidental change
Ian Lynagh **20080317200130]
[Print some extra debugging info when doing --show-iface
Ian Lynagh **20080317185032]
[Eliminate a global variable
Ian Lynagh **20080317180150
Very little parameter passing is needed without it, so there was no real
benefit to it.
]
[Follow changes in editline
Ian Lynagh **20080317103617]
[Use editline instead of readline
Ian Lynagh **20080316060407]
[Vectorise tuple constructorsn
Roman Leshchinskiy **20080317033436]
[Added double divide and unzipP
keller@cse.unsw.edu.au**20080317025553]
[Added 'div' to set of vectorising functions
keller@cse.unsw.edu.au**20080311125035]
[If unregisterised, link with -optl-Wl,--relax on IA64
Ian Lynagh **20080316214104
This fixes part of trac #856
]
[When concatenating variables in Makefile, strip spaces in case one is empty
Ian Lynagh **20080315141751
Otherwise "$(A) $(B)" will not be equal to "" even if A and B are empty.
Trac #856.
]
[Fix a space leak in :trace (trac #2128)
Ian Lynagh **20080316211748
We were doing lots of cons'ing and tail'ing without forcing the tails,
so were building up lots of thunks.
]
[If we are failing due to a warning and -Werror, say so
Ian Lynagh **20080316195636
Fixes trac #1893, based on a patch from Daniel Franke.
]
[Remove leftover NoteTy/FTVNote bits
Ian Lynagh **20080315194220]
[Remove uses of addFreeTyVars
Ian Lynagh **20080315155027
This optimisation actually make things a bit slower on average, as
measured by nofib. The example in #1136 in particular suffers from high
memory usage. Therefore we no longer do the optimisation.
]
[parsing tweak for :break
Simon Marlow **20080313182936]
[Tweaks to stack squeezing
Simon Marlow **20080207122445
1. We weren't squeezing two frames if one of them was a marked update
frame. This is easy to fix.
2. The heuristic to decide whether to squeeze was a little
conservative. It's worth copying 3 words to save an update frame.
]
[Some cleanup in TcSimplify.reduceContext
Manuel M T Chakravarty **20080313065220
- Makes this horrid function a bit better - and shorter!
- Also gets rid of another API function of TcTyFuns
]
[Properly normalise reduced dicts
Manuel M T Chakravarty **20080313051708
- Another chapter in the never-ending TcSimplify.reduceContext saga: after
context reduction of wanted dicts it is not sufficient to normalise them
wrt to the wanted equalities. We also need to take top-level equalities
into account. (In fact, we probably also have to normalise wrt to given
equalities, but I have left that open for the moment - but added a TODO
note.)
- This finally eliminates substEqInDictInsts from TcTyFuns interface and
suggest some further possible clean up (which will be in a separate patch).
Thanks to Roman for the intricate example that uncovered this bug.
]
[Bump mAX_NDP_PROD to 5
Roman Leshchinskiy **20080313061411]
[#2050: save the GHCi history in ~/.ghc/ghci_history
Simon Marlow **20080312215724
Modified version of Judah's patch
]
[Make sure we generate PA dictionaries for tuples up to mAX_NDP_PROD
Roman Leshchinskiy **20080312034905]
[Bump mAX_NDP_PROD to 4
Roman Leshchinskiy **20080312030245]
[First cut at reviving the External Core tools
Tim Chevalier **20080310025821
I updated the External Core AST to be somewhat closer to reality (where reality is defined by the HEAD), and got all the code to compile under GHC 6.8.1. (That means it works, right?)
Major changes:
- Added a Makefile.
- Core AST:
- Represented package names and qualified module names.
- Added type annotation on Case exps.
- Changed Coerce to Cast.
- Cleaned up representation of qualified/unqualified names.
- Fixed up wired-in module names (no more "PrelGHC", etc.)
- Updated parser/interpreter/typechecker/prep for the new AST.
- Typechecker:
- Used a Reader monad to pass around the global environment and top module name.
- Added an entry point to check a single expression.
- Prep:
- Got rid of typeofExp; it's now defined in terms of the typechecker.
]
[Remove ndpFlatten
Roman Leshchinskiy **20080309225914
This patch removes the ndpFlatten directory and the -fflatten static flag.
This code has never worked and has now been superceded by vectorisation.
]
[documentation fix: change flag -frules-off to -fno-rewrite-rules
iavor.diatchki@gmail.com**20080309191911]
[Don't expose the unfolding of dictionary selectors without -O
simonpj@microsoft.com**20080306135026
When compiling without -O we were getting code like this
f x = case GHC.Base.$f20 of
:DEq eq neq -> eq x x
But because of the -O the $f20 dictionary is not available, so exposing
the dictionary selector was useless. Yet it makes the code bigger!
Better to get
f x = GHC.Base.== GHC.Bsae.$f20 x x
This patch suppresses the implicit unfolding for dictionary selectors
when compiling without -O. We could do the same for other implicit
Ids, but this will do for now.
There should be no effect when compiling with -O. Programs should
be smaller without -O and may run a tiny bit slower.
]
[Fix Trac #783: improve short-cutting literals in the type checker
simonpj@microsoft.com**20080306134734
The Inst.shortCutIntLit mechanism in the type checker was missing cases
where a floating-point literal was given without an explicit decimal point.
As a result, programs with lots of floating-point literals (without decimals)
ended up with massive Static Reference Tables. This is not cool. See
comments with Trac #783 for details.
]
[Fix Trac #2138: print the 'stupid theta' of a data type
simonpj@microsoft.com**20080306134651]
[Fix vectorisation monad
Roman Leshchinskiy **20080307050859]
[Improve SpecConstr for local bindings: seed specialisation from the calls
simonpj@microsoft.com**20080306120004
This patch makes a significant improvement to SpecConstr, based on
Roman's experience with using it for stream fusion. The main change is
this:
* For local (not-top-level) declarations, seed the specialisation
loop from the calls in the body of the 'let'.
See Note [Local recursive groups] for discussion and example. Top-level
declarations are treated just as before.
Other changes in this patch:
* New flag -fspec-constr-count=N sets the maximum number of specialisations
for any single function to N. -fno-spec-constr-count removes the limit.
* Refactoring in specLoop and friends; new algebraic data types
OneSpec and SpecInfo instead of the tuples that were there before
* Be less keen to specialise on variables that are simply in scope.
Example
f p q = letrec g a y = ...g.... in g q p
We probably do not want to specialise 'g' for calls with exactly
the arguments 'q' and 'p', since we know nothing about them.
]
[Refactor OccAnal; and improve dead-code elimination
simonpj@microsoft.com**20080305155708
The occurrence analyer is now really rather subtle when dealing
with recursive groups; see Note [Loop breaking and RULES] especially.
This patch refactors this code a bit, notably
* Introduces a new data type Details instead of a tuple
* More clearly breaks up a recursive group into its SCCs
before processing it in a separate function occAnalRec
* As a result, does better dead-code elimination, becuause it's
done per SCC rather than for the whole Rec
]
[Copy the right ghc-pkg.bin into bindists
Ian Lynagh **20080305224020]
[Add a missing endif to the bindist Makefile
Ian Lynagh **20080305221136]
[Fix bashisms; patch from Bernie Pope
Ian Lynagh **20080305134556]
[Improve no-type-signature warning
Ian Lynagh **20080305011242
Instead of
Warning: Definition but no type signature for `.+.'
Inferred type: .+. :: forall a. a
we now say
Warning: Definition but no type signature for `.+.'
Inferred type: (.+.) :: forall a. a
]
[Fix typo
Ian Lynagh **20080302151339]
[In bindists, look in the right place to see if we have provided docs
Ian Lynagh **20080302140408
Fixes trac #1971: unjustified warning about documentation
]
[Remove GADT refinements, part 3
Manuel M T Chakravarty **20080229035740]
[MacOS installer: Uninstaller must be able to deal with ATiger receipts
Manuel M T Chakravarty **20080228050707]
[Add and use seqBitmap when constructing SRTs
Ian Lynagh **20080227144505
This roughly halves memory usage when compiling
module Foo where
foo :: Double -> Int
foo x | x == 1 = 1
...
foo x | x == 500 = 500
without optimisation.
]
[Whitespace
Ian Lynagh **20080220191230]
[Remove GADT refinements, part 2
Manuel M T Chakravarty **20080228055326]
[Fix Trac #2130: improve derived Ord for primmitive types
simonpj@microsoft.com**20080228121106
This patch does two things:
* (Minor): in TcGenDeriv.careful_compare_Case, test for less-than before
equality. This should reduce the number of dynamic tests, and also gives
more scope for optimisation, since less-than tells us more than equality.
* (More important): add special-case derived code for data types that are
simple wrappers of primitive types. See
Note [Comparision of primitive types]
This fixes Trac 2130.
However see also Trac #2132, which is not addressed here.
]
[Comments only
simonpj@microsoft.com**20080228111301]
[add a note about SMP execution not being supported with profiling
Simon Marlow **20080228112209]
[Enable -prof -threaded (#886)
Simon Marlow **20080228111631
It turns out that -prof -threaded works (modulo some small changes),
because all the data structures used in profiling are only accessed by
one thread at a time, at long as we don't use +RTS -N2 or higher. So
this patch enables the use of -prof -threaded, but an error is given
if you ask for more than one CPU with +RTS -N.
]
[Wibble to error message (stmt of do block or comprehension)
simonpj@microsoft.com**20080228083104]
[Make explicit lists more fusable
Max Bolingbroke **20080228083050]
[Add comments explaining flags
simonpj@microsoft.com**20080228082935]
[Remove GADT refinements, part 1
Manuel M T Chakravarty **20080228045351
- A while ago, I changed the type checker to use equality constraints together
with implication constraints to track local type refinement due to GADT
pattern matching. This patch is the first of a number of surgical strikes
to remove the resulting dead code of the previous GADT refinement machinery.
Hurray to code simplification!
]
[Eliminate SkolemOccurs skolems only after checkLoop reached a fixed point
Manuel M T Chakravarty **20080228001957
- See test case indexed-types/should_fail/SkolemOccursLoop, which sends the
type checker into an endless loop without this fix
]
[Fix Trac #2126: re-order tests (easy)
simonpj@microsoft.com**20080227163202]
[Fix Trac #2111: improve error handling for 'rec' in do-notation
simonpj@microsoft.com**20080226175635
We were not dealing correctly with all the combinations of
do notation
mdo notation
arrow notation
in combination with 'rec' Stmts.
I think this patch sorts it out.
]
[Remove gaw comment
simonpj@microsoft.com**20080226175305]
[Fix Trac #1899; missing equality check in typechecker's constraint simplifier
simonpj@microsoft.com**20080226174743
This patch fixes a missing equality check (uifying type variable b=b) in
the new constraint simplifier in TcTyFuns. As it stands, we were making
'b' point to itself, which subsequently led to an infinite loop when
zonking. Test is T1899.hs
]
[FIX #2122: file locking bug
Simon Marlow **20080226104650
Second and subsequent readers weren't being inserted into the
fd->lock hash table, which meant that the file wasn't correctly
unlocked when the Handles were closed.
]
[documentation improvements from Frederik Eaton
Simon Marlow **20080226102612]
[markup fix
Simon Marlow **20080226102558]
[Mac installer: cross-compile for 10.4
Manuel M T Chakravarty **20080225093734]
[Make UniqFM non-strict again while we work out what we're doing.
Ian Lynagh **20080225171305
This "fixes" the very-slow problem we have when compiling dictionaries.
]
[Fix Trac #2082
simonpj@microsoft.com**20080219173410]
[Fix Trac #2114: error reporting for 'forall' without appropriate flags
simonpj@microsoft.com**20080222182646]
[Improve error messages from type-checking data constructors
simonpj@microsoft.com**20080222182514
This addresses Trac #2112
]
[Add type sigs and minor refactoring
simonpj@microsoft.com**20080222182305]
[FIX #2073: Don't add empty lines to GHCI's history
Ian Lynagh **20080224143256]
[FIX #1977: Check to see if $(bindir) is in the path
Ian Lynagh **20080224134334
Before telling the user to add it, when installing a bindist, check to
see if $(bindir) is already in the path.
]
[Fix warnings in Simplify
Ian Lynagh **20080222150318]
[Whitespace
Ian Lynagh **20080222140755]
[Add a comment
Ian Lynagh **20080220205844]
[Fix most of the warnings in StgLint
Ian Lynagh **20080220171858]
[Whitespace
Ian Lynagh **20080220171140]
[CprAnalyse is warning-free
Ian Lynagh **20080220170843]
[Whitespace
Ian Lynagh **20080220170650]
[Fix #1984: missing context switches
Simon Marlow **20080219102212]
[fix unregisterised stage 2 build
Simon Marlow **20080219093407]
[Mac OS X deployment target: piping opts through Makefiles
Manuel M T Chakravarty **20080221224449]
[Rewrite fixTvSubstEnv so it iteratively applies its substition
Ian Lynagh **20080220153752
This fixes a stack overflow when using strict UniqFMs. It might be
possible to rewrite it more efficiently, or to avoid needing it in the
first place.
]
[Typo
Ian Lynagh **20080219204117]
[Make some more modules use LazyUniqFM instead of UniqFM
Ian Lynagh *-20080207015714
If these modules use UniqFM then we get a stack overflow when compiling
modules that use fundeps. I haven't tracked down the actual cause.
]
[Add configure option --with-macos-deployment-target
Manuel M T Chakravarty **20080219031755]
[Fix warning in SCCfinal
Ian Lynagh **20080219020429]
[Whitespace only
Ian Lynagh **20080219015259]
[Fix warnings in UniqSupply
Ian Lynagh **20080219013233]
[Whitespace only
Ian Lynagh **20080219012417]
[Fix non-missing-signature warnings in MkId
Ian Lynagh **20080219010917]
[Whitespace only
Ian Lynagh **20080219005042]
[Whitespace only
Ian Lynagh **20080218234559]
[Make literals in the syntax tree strict
Ian Lynagh **20080218183424]
[Make the parser a bit stricter
Ian Lynagh **20080218175514]
[seq what we actually want to seq, not the seq'ing function
Ian Lynagh **20080213131857]
[attempt to fix #2098 (PPC pepple please test & fix)
Simon Marlow **20080218115748]
[FIX #2023: substitute for $topdir in haddockInterfaces and haddockHTMLs
Simon Marlow **20080209143648]
[All installed Haskell prgms have an inplace and an installed version
Manuel M T Chakravarty **20080218061809
- GHC installs a range of compiled Haskell programs in addition to the actual
compiler. To ensure that they all run on the platform targeted by the build
(which may have different libraries installed than the build host), we need
to make sure that all compiled Haskell code going into an install is build
with the stage 1 compiler, not the bootstrap compiler. Getting this right
is especially important on the Mac to enable builds that work on Mac OS X
versions that are older than the one performing the build.
- For all installed utils implemented in Haskell (i.e., ghc-pkg, hasktags,
hsc2hs, runghc, hpc, and pwd) we compile two versions, an inplace version
and a version for installation. The former is build by the bootstrap
compiler during the stage 1 build and the latter is build by the stage 1
compiler during the stage 2 build.
- This is really very much as the setup for ghc itself, only that we don't use
separate stage1/ and stage2/ build directories. Instead, we clean before
each build. CAVEAT: This only works properly if invoked from the
toplevel Makefile.
- Instead of UseStage1=YES (as used by the previous binary-dist-specific
recompilation), we now use the same $(stage) variables as used for the
compiler proper - to increase uniformity and to avoid extra conditionals for
the install target.
]
[Fix warnings in Pretty
Ian Lynagh **20080218214151]
[Fix warnings in FiniteMap
Ian Lynagh **20080218200408]
[Fix warnings in Binary
Ian Lynagh **20080218193645]
[Fix warnings in StringBuffer
Ian Lynagh **20080218191846]
[Fix warnings in IOEnv
Ian Lynagh **20080218190849]
[Fix warnings in FastString, and check for empty case in head/tail
Ian Lynagh **20080218144707]
[Whitespace only
Ian Lynagh **20080218112232]
[Whitespace only
Ian Lynagh **20080218112101]
[Whitespace only
Ian Lynagh **20080218111941]
[Whitespace only
Ian Lynagh **20080218110241]
[Whitespace only
Ian Lynagh **20080218105909]
[Whitespace only
Ian Lynagh **20080218105343]
[Tweak whitespace
Ian Lynagh **20080217175133]
[Fix typo
Ian Lynagh **20080217175021]
[Print better error message for reading External Core
Tim Chevalier **20080217223844
GHC panicked with a "Prelude.undefined" error message if you tried to
compile a .hcr file. Since support for reading ExternalCore simply does
not exist, I added an error message to say that.
Please merge to 6.8. Thanks.
]
[Documentation only: update External Core section of user guide
Tim Chevalier **20080217213206
I updated the External Core section of the user guide, mostly to reflect
that the input path is broken and there are no firm plans to fix it.
]
[Generate foo(void) rather than foo() in FFI stub files
Ian Lynagh **20080216141031
-Wstrict-prototypes warns about the latter.
Patch from pcc in trac #2100.
]
[Make hasktags -Wall clean
Ian Lynagh **20080215160309]
[Whitespace only
Ian Lynagh **20080215155122]
[Fix building hasktags
Ian Lynagh **20080215154415]
[Revert an accidental comment change
Ian Lynagh **20080215153558]
[find module names, fix for get constructor names, find class names as well, sort ctag files
marco-oweber@gmx.de**20080212232157]
[added TODO item and link to alternatives on wiki
marco-oweber@gmx.de**20080212231853]
[Make more arch-specific #if's exclusive with #else #error cases
Duncan Coutts **20080207170020
So when the next person compiles the Sparc NCG it should fail more
obviously at compile time rather than panicing at runtime.
Plus one obvious fix for LocalReg gaining an extra param
Missing bits of Sparc NCG:
* genSwitch for generating jump tables. This is the most tricky one.
* ALLOCATABLE_REGS_INTEGER and ALLOCATABLE_REGS_DOUBLE just requires
finding and verifying the values. The nearby comment describes how.
* isRegRegMove and mkRegRegMoveInstr. Sparc uses Or for int move, check
what this is supposed to do for single and double float types.
* regDotColor. Probably just copy the ppc impl.
]
[Document code a bit better
Ian Lynagh **20080213161106]
[Add a necessary [] error case
Ian Lynagh **20080213154232]
[\e -> f e ===> f
Ian Lynagh **20080213153835]
[Fixed warnings in parser/Lexer.x
Twan van Laarhoven **20080204021131
The -w flag can not be removed, because alex also generates code with lots of warnings.
]
[Monadification and Fixed warnings in parser/RdrHsSyn, except for incomplete pattern matches
Twan van Laarhoven **20080204015053]
[Fixed warnings in vectorise/VectMonad
Twan van Laarhoven **20080203223932]
[Fix typo in message
Roman Leshchinskiy **20080212052219]
[Remove old code to get TMPDIR, use System.Directory.getTemporaryDirectory
Simon Marlow **20080207143915]
[Mac installer: Added XCODE_EXTRA_CONFIGURE_ARGS
Manuel M T Chakravarty **20080211115201]
[Mac installer: make Uninstaller a bit more robust
Manuel M T Chakravarty **20080211091119]
[Mac installer: add comprehensive licencing information
Manuel M T Chakravarty **20080211061450]
[Force -s on ar in xcode builds
Manuel M T Chakravarty **20080211022329]
[Fix warning (FIX validate)
Roman Leshchinskiy **20080211040211]
[Symbolic tags for simplifier phases
Roman Leshchinskiy **20080211032350
Every simplifier phase can have an arbitrary number of tags and multiple
phases can share the same tags. The tags can be used as arguments to
-ddump-simpl-phases to specify which phases are to be dumped.
For instance, -ddump-simpl-phases=main will dump the output of phases 2, 1 and
0 of the initial simplifier run (they all share the "main" tag) while
-ddump-simpl-phases=main:0 will dump only the output of phase 0 of that run.
At the moment, the supported tags are:
main The main, staged simplifier run (before strictness)
post-worker-wrapper After the w/w split
post-liberate-case After LiberateCase
final Final clean-up run
The names are somewhat arbitrary and will change in the future.
]
[Allow -ddump-simpl-phases to specify which phases to dump
Roman Leshchinskiy **20080211020630
We can now say -ddump-simpl-phases=1,2 to dump only these two phases and
nothing else.
]
[Fixed warnings in parser/ParserCoreUtils
Twan van Laarhoven **20080204022226]
[Fixed warnings in hsSyn/Convert, except for incomplete pattern matches
Twan van Laarhoven **20080204000510]
[Fixed warnings in types/Unify
Twan van Laarhoven **20080203224228]
[Fixed warnings in ndpFlatten/FlattenInfo
Twan van Laarhoven **20080203224159]
[Fixed warnings in vectorise/VectBuiltIn
Twan van Laarhoven **20080203224043]
[Fixed warnings in vectorise/VectCore
Twan van Laarhoven **20080203224003]
[Fixed warnings in deSugar/DsExpr, except for incomplete pattern matches
Twan van Laarhoven **20080203214848]
[Fixed warnings in deSugar/DsGRHSs, except for incomplete pattern matches
Twan van Laarhoven **20080203214602]
[Fixed warnings in deSugar/DsListComp, except for incomplete pattern matches
Twan van Laarhoven **20080203211253]
[Fixed warnings in deSugar/Check, except for incomplete pattern matches
Twan van Laarhoven **20080203210814]
[Fixed warnings in deSugar/Match, except for incomplete pattern matches
Twan van Laarhoven **20080203210533]
[Fixed warnings in deSugar/MatchCon, except for incomplete pattern matches
Twan van Laarhoven **20080203210402]
[Fixed warnings in deSugar/DsMonad
Twan van Laarhoven **20080203210339]
[Wibble the Makefile: DQ, \" and '"'
Ian Lynagh **20080210171104]
[Don't use -w when compiling Config.hs
Ian Lynagh **20080210171050]
[Add typesigs to Config.hs
Ian Lynagh **20080210170925]
[Allow skipping "make clean" or only re-running the testsuite in validate
Ian Lynagh **20080210162842]
[Mac installer: added support for full docs
Manuel M T Chakravarty **20080209110727]
[Fixed permissions and other cleanup in Mac installer package
Manuel M T Chakravarty **20080207030528]
[Adjust error message (Trac #2079)
simonpj@microsoft.com**20080207171622]
[Redo inlining patch, plus some tidying up
simonpj@microsoft.com**20080207155102
This adds back in the patch
* UNDO: Be a little keener to inline
It originally broke the compiler because it tickled a Cmm optimisation bug,
now fixed.
In revisiting this I have also make inlining a bit cleverer, in response to
more examples from Roman. In particular
* CoreUnfold.CallCtxt is a data type that tells something about
the context of a call. The new feature is that if the context is
the argument position of a function call, we record both
- whether the function (or some higher up function) has rules
- what the argument discount in that position is
Either of these make functions keener to inline, even if it's
in a lazy position
* There was conseqential tidying up on the data type of CallCont.
In particular I got rid of the now-unused LetRhsFlag
]
[Comments, and a type signature
simonpj@microsoft.com**20080125174203]
[FIX #2080: an optimisation to remove a widening was wrong
Simon Marlow **20080208124219]
[Remove some of the old compat stuff now that we assume GHC 6.4
Simon Marlow **20080208124132]
[Allow runghc to take input from stdin, just like Ruby & Python
Simon Marlow **20080207145830]
[remove a bogus assertion
Simon Marlow **20080207143805]
[Convert more UniqFM's back to LazyUniqFM's
Ian Lynagh **20080207144736
These fix these failures:
break008(ghci)
break009(ghci)
break026(ghci)
ghci.prog009(ghci)
ghci025(ghci)
print007(ghci)
prog001(ghci)
prog002(ghci)
prog003(ghci)
at least some of which have this symptom:
Exception: expectJust prune
]
[Be a bit more consistent about what's a set and what's a map
Ian Lynagh **20080205211909]
[Make some more modules use LazyUniqFM instead of UniqFM
Ian Lynagh **20080207015714
If these modules use UniqFM then we get a stack overflow when compiling
modules that use fundeps. I haven't tracked down the actual cause.
]
[Remove unused import
Ian Lynagh **20080207002544]
[Make UniqFM strict in its elements
Ian Lynagh **20080206141620]
[Use uniqSetToList rather than eltsUFM
Ian Lynagh **20080206000043]
[Use isEmptyUniqSet rather than isNullUFM
Ian Lynagh **20080205205336]
[Added Uninstaller
Manuel M T Chakravarty **20080206073054]
[FIX BUILD on x86_64
Simon Marlow **20080206113936]
[matchesPkg: match against the pkg Id (foo-1.0) not just the package name (foo)
Simon Marlow **20080205090429
Fixes the ghcpkg01 test.
]
[Teach cheapEqExpr about casts
Roman Leshchinskiy **20080206035007
Previously, cheapEqExpr would always return False if it encountered a cast.
This was bad for two reasons. Firstly, CSE (which uses cheapEqExpr to compare
expressions) never eliminated expressions which contained casts and secondly,
it was inconsistent with exprIsBig. This patch fixes this.
]
[Inject implicit bindings before the simplifier (Trac #2070)
simonpj@microsoft.com**20080205165507
With constructor unpacking, it's possible for constructors and record
selectors to have non-trivial code, which should be optimised before
being fed to the code generator. Example:
data Foo = Foo { get :: {-# UNPACK #-} !Int }
Then we do not want to get this:
T2070.get =
\ (tpl_B1 :: T2070.Foo) ->
case tpl_B1 of tpl1_B2 { T2070.Foo rb_B4 ->
let {
ipv_B3 [Just S] :: GHC.Base.Int
[Str: DmdType m]
ipv_B3 = GHC.Base.I# rb_B4
} in ipv_B3 }
If this goes through to codegen, we'll generate bad code. Admittedly,
this only matters when the selector is used in a curried way (e.g
map get xs), but nevertheless it's silly.
This patch injects the implicit bindings in SimplCore, before the
simplifier runs. That slows the simplifier a little, because it has
to look at some extra bindings; but it's probably a slight effect.
If it turns out to matter I suppose we can always inject them later,
e.g. just before the final simplification.
An unexpected (to me) consequence is that we get some specialisation rules
for class-method selectors. E.g. we get a rule
RULE (==) Int dInt = eqInt
There's no harm in this, but not much benefit either, because the
same result will happen when we inline (==) and dInt, but it's perhaps
more direct.
]
[Make do-notation a bit more flexible (Trac #1537)
simonpj@microsoft.com**20080205164816
This is a second attempt to fix #1537: to make the static typechecking
of do-notation behave just like the desugared version of the same thing.
This should allow parameterised monads to work properly (see Oleg's comment
in the above ticket).
We can probably merge to 6.8.3 if it goes smoothly.
Incidentally, the resulting setup suffers from greater type ambiguity
if (>>=) has a very general type. So test rebindable6 no longer works
(at least not without more type signatures), and rebindable5 requires
extra functional dependencies. But they are weird tests.
]
[White space only
simonpj@microsoft.com**20080205163702]
[FIX #2047: Windows (and older Unixes): align info tables to 4 bytes, not 2
Simon Marlow **20080205101425
Perhaps in the past '.align 2' meant align to 4 bytes, but nowadays it
means align to 2 bytes. The compacting collector requires info tables
to be aligned to 4 bytes, because it stores tag bits in the low 2
bits.
This only affects -fvia-C - the native code generator was already
emitting the correct alignment. The incorrect alignment might well
have been adversely affecting performance with -fvia-C on Windows.
]
[Most of installer for framework on system volume
Manuel M T Chakravarty **20080205073738]
[Split into two types of Mac installer specs
Manuel M T Chakravarty **20080205052504]
[Lambda logo for packages
Manuel M T Chakravarty **20080205052017
- This image is in the public domain, cf
http://en.wikipedia.org/wiki/Image:Greek_lc_lamda_thin.svg
]
[xcode build target for fixed /Library/Frameworks inst
Manuel M T Chakravarty **20080205030047
- Also moving all MacOS-specific Makefile components into
distrib/MacOS/Makefile
]
[First stab at an installer package for the Mac
Manuel M T Chakravarty **20080202134853
- GHC as a Mac framework
- I tried to make a package where the user could choose whether to install
in /Library/Frameworks or ~/Library/Frameworks (to allow installation for
non-admins). However, that doesn't work well without including the whole
distribution twice as the decision as to whether the admin password needs
to be entered is made at packaging time (not at install time).
]
[Support for using libffi to implement FFI calls in GHCi (#631)
Simon Marlow **20080204161053
This means that an unregisterised build on a platform not directly
supported by GHC can now have full FFI support using libffi.
Also in this commit:
- use PrimRep rather than CgRep to describe FFI args in the byte
code generator. No functional changes, but PrimRep is more correct.
- change TyCon.sizeofPrimRep to primRepSizeW, which is more useful
]
[Use the correct libffi type for pointers
Simon Marlow **20080104131936]
[Fix DEBUG build
simonpj@microsoft.com**20080204160514]
[Make seqAlts actually seq everything
Ian Lynagh **20080203134321]
[Strictness tweaks
Ian Lynagh **20080203024836]
[Whitespace
Ian Lynagh **20080203003929]
[Whitespace only
Ian Lynagh **20080202213936]
[Tweak strictness
Ian Lynagh **20080202213542]
[Fix warnings in deSugar/DsBinds
Ian Lynagh **20080130144014]
[UNDO: Be a little keener to inline
Simon Marlow **20080201144810
This patch caused at least the following test failures:
1744(normal)
ghci028(ghci)
unicode001(normal)
and additionally made the stage3 build fail.
A little more validation please!
I didn't find the exact cause of the failure yet, but it appears that
the Lexer is miscompiled in some strange way. If any of {Encoding,
StringBuffer, or Lexer} are compiled without -O, the problem goes
away.
]
[FIX BUILD with GHC 6.4.x
Simon Marlow **20080201122753]
[FIX BUILD with ghc-6.4.x
Simon Marlow **20080201114302]
[Some tweaks to the building from source section
Simon Marlow **20080129091132]
[Warning clean up
Manuel M T Chakravarty **20080131024845]
[Move spiltDmdTy within module (no change in code)
simonpj@microsoft.com**20080129011438]
[Fix typo where I forgot the new substitution
simonpj@microsoft.com**20080128213856]
[Add missing (error) case in isIrrefutablePat
simonpj@microsoft.com**20080128213429]
[Add missing (error) case in pprConDecl
simonpj@microsoft.com**20080128213409]
[Fix warnings on non-Windows
Ian Lynagh **20080130114640]
[Fixed warnings in main/ErrUtils
Twan van Laarhoven **20080127015419]
[Fixed warnings in main/HeaderInfo, except for incomplete pattern matches
Twan van Laarhoven **20080127014118]
[Fixed warnings in main/DynFlags
Twan van Laarhoven **20080127012443]
[Fixed warnings in hsSyn/HsSyn
Twan van Laarhoven **20080127004626]
[Fixed warnings in hsSyn/HsUtils
Twan van Laarhoven **20080127004506]
[Fixed warnings in hsSyn/HsTypes
Twan van Laarhoven **20080127004419]
[Fixed warnings in hsSyn/HsDoc
Twan van Laarhoven **20080127004359]
[Fixed warnings in hsSyn/HsLit
Twan van Laarhoven **20080127004330]
[Fixed warnings in hsSyn/HsImpExp, except for incomplete pattern matches
Twan van Laarhoven **20080127004254]
[Fixed warnings in hsSyn/HsPat, except for incomplete pattern matches
Twan van Laarhoven **20080127004209]
[Fixed warnings in hsSyn/HsBinds, except for incomplete pattern matches
Twan van Laarhoven **20080127004119]
[Fixed warnings in hsSyn/HsDecls, except for incomplete pattern matches
Twan van Laarhoven **20080127004046]
[Fixed warnings in simplCore/CSE
Twan van Laarhoven **20080126233918]
[Fixed warnings in profiling/CostCentre, except for incomplete pattern matches
Twan van Laarhoven **20080126232841]
[Fixed warnings in types/InstEnv
Twan van Laarhoven **20080126231732]
[Fixed warnings in types/FamInstEnv
Twan van Laarhoven