| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improved #include path handling:
* Don't use '-I-', it breaks a lot of system headers, e.g.
#include <GL/glut.h>
fails (when using freeglut), because /usr/include/GL/glut.h contains
#include "freeglut_std.h"
but /usr/include/GL/freeglut_std.h will not be found. It is a bit
debatable if the header is broken and should use
#include "GL/freeglut_std.h"
instead. Anyway, a grep through the SuSE 9.1 system headers shows that
there seems to be no real common practice, so let's play safe and don't
use '-I-'.
* Don't use '-I .', #include stub headers "locally" instead, e.g. use
#include "Concurrent_stub.h"
instead of
#include "Control/Concurrent_stub.h"
Note that "Control" is still in the #include path, because the *.hc file
is normally in /tmp and the stub header is in the directory where *.hs
is. We could remove this path element, too, if the stub header would be
copied to the directory of the *.hc file during compilation. SimonM?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
------------------------------------
Simplify the treatment of newtypes
Complete hi-boot file consistency checking
------------------------------------
In the representation of types, newtypes used to have a special constructor
all to themselves, very like TyConApp, called NewTcApp. The trouble is
that means we have to *know* when a newtype is a newtype, and in an hi-boot
context we may not -- the data type might be declared as
data T
in the hi-boot file, but as
newtype T = ...
in the source file. In GHCi, which accumulates stuff from multiple compiles,
this makes a difference.
So I've nuked NewTcApp. Newtypes are represented using TyConApps again. This
turned out to reduce the total amount of code, and simplify the Type data type,
which is all to the good.
This commit also fixes a few things in the hi-boot consistency checking
stuff.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-----------------------------------
Do simple checking on hi-boot files
-----------------------------------
This commit arranges that, when compiling A.hs, we compare
the types we infer with those in A.hi-boot, if the latter
exists. (Or, more accurately, if anything A.hs imports in
turn imports A.hi-boot, directly or indirectly.)
This has been on the to-do list forever.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
------------------------------------
Add Generalised Algebraic Data Types
------------------------------------
This rather big commit adds support for GADTs. For example,
data Term a where
Lit :: Int -> Term Int
App :: Term (a->b) -> Term a -> Term b
If :: Term Bool -> Term a -> Term a
..etc..
eval :: Term a -> a
eval (Lit i) = i
eval (App a b) = eval a (eval b)
eval (If p q r) | eval p = eval q
| otherwise = eval r
Lots and lots of of related changes throughout the compiler to make
this fit nicely.
One important change, only loosely related to GADTs, is that skolem
constants in the typechecker are genuinely immutable and constant, so
we often get better error messages from the type checker. See
TcType.TcTyVarDetails.
There's a new module types/Unify.lhs, which has purely-functional
unification and matching for Type. This is used both in the typechecker
(for type refinement of GADTs) and in Core Lint (also for type refinement).
|
|
|
|
|
|
| |
Add -I- after the include paths when running gcc. This prevents
accidental shadowing of system includes by putting a file called
eg. stdint.h in the current directory.
|
|
|
|
| |
export errMsgContext
|
|
|
|
| |
On Windows default to main.exe instead of a.out.
|
|
|
|
| |
Fix newline wibbles in new message API
|
|
|
|
|
| |
Minor updates required by VS: return the typechecker's abstract syntax
tree from hscBufferFrontEnd.
|
|
|
|
|
|
|
|
| |
Minore package GHC fixes, and a couple of changes for Visual Studio.
Messages from the compiler should now go through a new API in
ErrUtils, so that they can be redirected by the GHC client if
necessary. (currently not all messages go through this interface, but
some of them do).
|
|
|
|
|
|
|
| |
Catch exit(127) result from raw system, and report that we couldn't
execute the program. This is a semi-hack; all exec() errors get
reported as exit(127) by rawSystem, but if we treat it just like a
program that does exit(127) then the user sees no output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-------------------------------
Print built-in sytax right
-------------------------------
Built-in syntax, like (:) and [], is not "in scope" via the GlobalRdrEnv
in the usual way. When we print it out, we should also print it in unqualified
form, even though it's not in the environment.
I've finally bitten the (not very big) bullet, and added to Name the information
about whether or not a name is one of these built-in ones. That entailed changing
the calls to mkWiredInName, but those are exactly the places where you have to
decide whether it's built-in or not, which is fine.
Built-in syntax => It's a syntactic form, not "in scope" (e.g. [])
Wired-in thing => The thing (Id, TyCon) is fully known to the compiler,
not read from an interface file.
E.g. Bool, True, Int, Float, and many others
All built-in syntax is for wired-in things.
|
|
|
|
| |
wibble
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-------------------------------
Use merge-sort not quicksort
Nuke quicksort altogether
-------------------------------
Quicksort has O(n**2) behaviour worst case, and this occasionally bites.
In particular, when compiling large files consisting only of static data,
we get loads of top-level delarations -- and that led to more than half the
total compile time being spent in the strongly connected component analysis
for the occurrence analyser. Switching to merge sort completely solved the
problem.
I've nuked quicksort altogether to make sure this does not happen again.
|
|
|
|
|
|
|
|
|
|
| |
Define <arch>_TARGET_ARCH and <os>_TARGET_OS by default when CPP'ing.
This avoids the main reason for needing to #include config.h into
Haskell source, so most files that previously just #include "config.h" can now
#if __GLASGOW_HASKELL__ < 603
#include "config.h"
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-------------------------------
Add instance information to :i
Get rid of the DeclPool
-------------------------------
1. Add instance information to :info command. GHCi now prints out
which instances a type or class belongs to, when you use :i
2. Tidy up printing of unqualified names in user output.
Previously Outputable.PrintUnqualified was
type PrintUnqualified = Name -> Bool
but it's now
type PrintUnqualified = ModuleName -> OccName -> Bool
This turns out to be tidier even for Names, and it's now also usable
when printing IfaceSyn stuff in GHCi, eliminating a grevious hack.
3. On the way to doing this, Simon M had the great idea that we could
get rid of the DeclPool holding pen, which held declarations read from
interface files but not yet type-checked. We do this by eagerly
populating the TypeEnv with thunks what, when poked, do the type
checking. This is just a logical continuation of lazy import
mechanism we've now had for some while.
The InstPool and RulePool still exist, but I plan to get rid of them in
the same way. The new scheme does mean that more rules get sucked in than
before, because previously the TypeEnv was used to mean "this thing was needed"
and hence to control which rules were sucked in. But now the TypeEnv is
populated more eagerly => more rules get sucked in. However this problem
will go away when I get rid of the Inst and Rule pools.
I should have kept these changes separate, but I didn't. Change (1)
affects mainly
TcRnDriver, HscMain, CompMan, InteractiveUI
whereas change (3) is more wide ranging.
|
|
|
|
| |
Merge backend-hacking-branch onto HEAD. Yay!
|
|
|
|
| |
wibble
|
|
|
|
| |
avoid string gaps
|
|
|
|
|
|
| |
Take the timestamp of an interpreted linkable from the timestamp of
the source file. This works better when the local clock is out of
sync with the filesystem, and it's just as accurate.
|
|
|
|
| |
Add location information to :i command
|
|
|
|
|
|
|
|
|
| |
Correction to the construction of .hi filenames in dependency
generation.
Fixes sourceforge bug #978543
Merge to STABLE
|
|
|
|
| |
Tiny perf improvement
|
|
|
|
| |
Renamed Opt_WarnMisc to Opt_WarnDodgyImports
|
|
|
|
| |
Improve error reporting for static flags
|
|
|
|
| |
Documentation typos
|
|
|
|
| |
Use IfaceDeprecs synonym
|
|
|
|
|
|
|
| |
Move the definition of rawSystem into a separate file which we
#include in the places it is needed. This is slightly better than
copying the code, since we now need it in three places
(ghc/utils/runghc is the 3rd).
|
|
|
|
| |
wibble
|
|
|
|
|
|
| |
DoEval is a compilation manager mode too.
MERGE TO STABLE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
----------------------------------------
1. Make primOpIsCheap do something sensible
2. Make the state hack work better
----------------------------------------
1. In March 2001, we changed primOpIsCheap to
primOpIsCheap op = False
thereby making *no* primops seem cheap. But this killed eta
expansion on case (x ==# y) of True -> \s -> ...
which is bad. In particular a loop like
doLoop n = loop 0
where
loop i | i == n = return ()
| otherwise = bar i >> loop (i+1)
allocated a closure every time round because it didn't eta expand.
The problem that made us set primOpIsCheap to False was
let x = a +# b *# c in x +# x
where we don't want to inline x. But primopIsCheap doesn't control
that (it's exprIsDupable that does) so the problem doesn't occur
even if primOpIsCheap sometimes says 'True'. I think that perhaps
something changed since March 2001.
2. Consider this
case x of
True -> \(s:RealWorld) -> e
False -> foo
where foo has arity 1. If we are using the "state hack" we want to
eta expand here. This commit fixes arityType in the Var case (for foo)
to take account of foo's type.
Also add -fno-state-hack to the static flags, to allow the state hack to
be switched off.
|
|
|
|
|
| |
Add :k(ind) command to ghci to find the kind of a type.
This works very, very similarly to :t(ype)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extend the "newtype deriving" feature a little bit more
(at the request of Wolfgang Jeltsch)
Here's the example:
class C a b
instance C [a] Char
newtype T = T Char deriving( C [a] )
Perfectly sensible, and no reason it should not work.
Fixing this required me to generalise the abstract syntax of
a 'deriving' item, hence the non-local effects.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a flag -fno-state-hack, which switches off the "state hack".
It's claims that every function over realWorldStatePrimTy is a
one-shot function. This is pretty true in practice, and makes a big
difference. For example, consider
a `thenST` \ r -> ...E...
The early full laziness pass, if it doesn't know that r is one-shot
will pull out E (let's say it doesn't mention r) to give
let lvl = E in a `thenST` \ r -> ...lvl...
When `thenST` gets inlined, we end up with
let lvl = E in \s -> case a s of (r, s') -> ...lvl...
and we don't re-inline E.
|
|
|
|
| |
-i on its own didn't delete the list of search paths as advertised.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove all known hacks in rawSystem:
- no splitting of the program name using toArgs
- no avoiding translate when the string already appears to be quoted
- no avoiding translate for the command name
We now keep separate program name & args for various SysTools
programs: gcc, as, ld, mkdll.
MERGE TO STABLE
|
|
|
|
|
|
|
| |
Remove -static flag from non-darwin PowerPC builds
(this was a relic from the long-dead AIX support)
Merge to STABLE.
|
|
|
|
| |
Fix #ifdef'ed flags for FreeBSD.
|
|
|
|
| |
comments
|
|
|
|
| |
Add a -fno-full-laziness flag
|
|
|
|
| |
Combined build tags get '_' between them
|
|
|
|
| |
Add missing case to allowedWith
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Experimental support for RTS-only "ways"
HEADS UP! This changes the way that the threaded RTS is used, and
also the use of debugging RTSs:
- We always build threaded and debugging variants of the RTS now.
The --enable-threaded-rts configure option is ignored (and will
be removed at some point).
- New option: -debug enables the debugging RTS
- New option: -threaded enables the threaded RTS. When the threaded
RTS is stable enough, we might make it the default.
The new options just cause a different variant of the RTS to be linked
in, and they cause one or two extra options to be enabled too. The
implementation is via the usual ways machinery in the compiler, except
that these ways are labelled as RTS-only, and so don't require
rebuilding all the libraries too.
All of this means we can ship threaded and debugging RTSs with GHC, so
that users don't need to fetch and build a GHC source tree to use
them.
I'd like to get this functionality into 6.2.1 if possible, so please
test (I'm willing to stretch the definition of "interface change" to
accomodate this, since having a threaded RTS available without having
to build GHC will be a big win for the Visual Studio project).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
---------------------------------------
Record dependency on Template Haskell package
---------------------------------------
An unforseen consequence of making the Template Haskell package separate
is that we need to record dependency on the package, even if no TH module
is imported. So we carry round (another) mutable variable tcg_th_used in
the tyepchecker monad, and zap it when $(...) and [| ... |] are used.
I did a little tidy-up and documentation in ListSetOps too
|
|
|
|
|
|
| |
New version of translate for mingw32, which correctly (allegedly)
reverses the command-line translation done by the standard C runtime
on Windows.
|
|
|
|
| |
Make trace message more accurate
|
|
|
|
| |
Fix build
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
---------------------------------------
Fix the WinME/98/95 double-backslash bug
---------------------------------------
Merge to stable branch, at least
once we are sure it's right
Backslashes should not be escaped in command-line arguments for rawSystem,
on Win32. This only actually causes failures on WinME/98/95, and we can't
test that since we don't have it. But this fix seems right regardless.
There are extensive new comments in libraries/base/System/Cmd.hs which
describe the issues.
|
|
|
|
| |
error message sorting wibble
|
|
|
|
| |
Comments only
|