| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
preprocessFile: return the source filename rather than "<buffer>"
|
|
|
|
|
|
|
|
|
|
|
| |
Add :
loadMsg :: Session -> LoadHowMuch
-> (Messages-> IO ()) -> IO SuccessFlag
ie. just like load, except it takes a message callback and plumbs it
down to hscMain. checkModule now uses loadMsgs. Better name
suggestions welcome.
|
|
|
|
|
|
|
|
|
|
|
|
| |
- checkModule is back, and now returns a ModuleInfo
- added:
modInfoTopLevelScope :: [Name]
modInfoExports :: [Name]
- in order to implement modInfoExports, ModDetails now contains
md_exports::NameSet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Few changes to GHC API:
* The Instance type is removed. Each instance is represented as dictonary Id.
Now there is:
isDictonaryId :: Id -> Bool
predicate which allows to distinguish them.
* The full list of all available predicates of type (Id -> Bool) is exported
* Few predicates for TyCon are exported
* checkModule is removed. It isn't used anymore. Instead the full load is made.
The hook API will be required at some time in order to make available the
parsed/typechecked source.
|
|
|
|
|
|
|
|
|
|
|
| |
GHC API work:
- add parseName :: Session -> String -> IO [Name]
- make lookupName look up in the global type environment
- add data ModuleInfo
- add a few ModuleInfo-related functions
- add getModuleInfo :: Session -> Module -> IO ModuleInfo
|
|
|
|
|
|
| |
- add initPackages
- add showGhcException
- tidy up the export list a bit
|
|
|
|
| |
Haddock comment on initPackages
|
|
|
|
| |
Add the -hide-all-packages flag.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In many places there was a common pattern
when (verbose >= n) $ putMsg "..."
It is now replaced with
debutTraceMsg dflags n "..."
In few places hPutStrLn stderr or putStrLn was used instead of putMsg in
the above pattern. They are replaced too. Now putMsg is used only in places
where the verbosity flag was not checked.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit combines three overlapping things:
1. Make rebindable syntax work for do-notation. The idea
here is that, in particular, (>>=) can have a type that
has class constraints on its argument types, e.g.
(>>=) :: (Foo m, Baz a) => m a -> (a -> m b) -> m b
The consequence is that a BindStmt and ExprStmt must have
individual evidence attached -- previously it was one
batch of evidence for the entire Do
Sadly, we can't do this for MDo, because we use bind at
a polymorphic type (to tie the knot), so we still use one
blob of evidence (now in the HsStmtContext) for MDo.
For arrow syntax, the evidence is in the HsCmd.
For list comprehensions, it's all built-in anyway.
So the evidence on a BindStmt is only used for ordinary
do-notation.
2. Tidy up HsSyn. In particular:
- Eliminate a few "Out" forms, which we can manage
without (e.g.
- It ought to be the case that the type checker only
decorates the syntax tree, but doesn't change one
construct into another. That wasn't true for NPat,
LitPat, NPlusKPat, so I've fixed that.
- Eliminate ResultStmts from Stmt. They always had
to be the last Stmt, which led to awkward pattern
matching in some places; and the benefits didn't seem
to outweigh the costs. Now each construct that uses
[Stmt] has a result expression too (e.g. GRHS).
3. Make 'deriving( Ix )' generate a binding for unsafeIndex,
rather than for index. This is loads more efficient.
(This item only affects TcGenDeriv, but some of point (2)
also affects TcGenDeriv, so it has to be in one commit.)
|
|
|
|
| |
build fix when !GHCI
|
|
|
|
|
|
|
| |
DriverPipeline.compile: we should be grabbing the OPTIONS from the
StringBuffer, not reading the file again (duh!)
SysTools: some message cleanups
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
More hacking on the GHC API to get it into shape for VS
- load now takes a LoadHowMuch argument, which is either
LoadAllTargets
LoadUpTo Module
LoadDependenciesOf Module
which should be self-explanatory. LoadDependenciesOf might go
away in the future, it's necessary at the moment because it is
used in the implementation of:
- checkModule :: Session -> Module -> MessageHandler -> IO CheckResult
which is currently the only way to get at the parsed & typechecked
abstract syntax for a module.
|
|
|
|
|
|
|
| |
Tweaks to get the GHC sources through Haddock. Doesn't quite work
yet, because Haddock complains about the recursive modules. Haddock
needs to understand SOURCE imports (it can probably just ignore them
as a first attempt).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for partial reloads in the GHC API.
This is mainly for VS: when editing a file you don't want to
continually reload the entire project whenever the current file
changes, you want to reload up to and including the current file only.
However, you also want to retain any other modules in the session that
are still stable.
I added a variant of :reload in GHCi to test this. You can say
':reload M' to reload up to module M only. This will bring M up to
date, and throw away any invalidated modules from the session.
|
|
|
|
|
| |
Avoid a (rather verbose) GHC warning from being issued -- initialize the
runPhase.mod_summary.ms_obj_date field.
|
|
|
|
| |
Track recent dynamic flags changes; fixes the build for Mac OS X.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cleanup the upsweep strategy in GHC.load.
Now it's hopefully clearer how we decide what modules to recompile,
and which are "stable" (not even looked at) during a reload. See the
comments for details.
Also, I've taken some trouble to explicitly prune out things that
aren't required before a reload, which should reduce the memory
requirements for :reload in GHCi. Currently I believe it keeps most
of the old program until the reload is complete, now it shouldn't
require any extra memory.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rename the filenames used for the 'win32' package to {lib}HSwin_32{1.o,2.o,.a}
so as to avoid conflicts with the 'Win32' package when installing to a common
library directory on a case-insensitive filesystem (as we do when building
binary dists under Windows.) This fixes the off-the-bat brokenness experienced
by people trying to load the 'Win32' package with ghci-6.4.
Note: package creators may want to make a note of this if they haven't already,
i.e., while the package infrastructure is case-sensitive, it's unsafe to assume
that the underlying filesystem is.
Merge to STABLE.
|
|
|
|
| |
Windows wibbles
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A start on the GHC API:
Flesh out the GHC module so that it can replace CompManager. Now, the
clients that used CompManager consume the GHC API instead (namely
Main, DriverMkDepend, and InteractiveUI). Main is significantly
cleaner as a result.
The interface needs more work: in particular, getInfo returns results
in the form of IfaceDecls but we want to use full HsSyn and
Id/DataCon/Class across the boundary instead.
The interfaces for inspecting loaded modules are not yet implemented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Complete the transition of -split-objs into a dynamic flag (looks like I
half-finished it in the last commit).
Also: complete the transition of -tmpdir into a dynamic flag, which
involves some rearrangement of code from SysTools into DynFlags.
Someday, initSysTools should move wholesale into initDynFlags, because
most of the state that it initialises is now part of the DynFlags
structure, and the rest could be moved in easily.
|
|
|
|
|
|
|
|
|
|
|
|
| |
[Windows only]
for System.Directory / Compat.Directory functionality that probes the OS
for local details re: misc user directories, perform late binding of
SHGetFolderPath() from shell32.dll, as it may not be present.
(cf. ghc-6.4's failure to operate on Win9x / NT boxes.) If the API isn't
there, fail with UnsupportedOperation.
Packages.readPackageConfigs: gracefully handle excns from getAppUserDataDirectory.
Merge to STABLE.
|
|
|
|
| |
Import wibble
|
|
|
|
| |
Fix stage-2 build
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Flags cleanup.
Basically the purpose of this commit is to move more of the compiler's
global state into DynFlags, which is moving in the direction we need
to go for the GHC API which can have multiple active sessions
supported by a single GHC instance.
Before:
$ grep 'global_var' */*hs | wc -l
78
After:
$ grep 'global_var' */*hs | wc -l
27
Well, it's an improvement. Most of what's left won't really affect
our ability to host multiple sessions.
Lots of static flags have become dynamic flags (yay!). Notably lots
of flags that we used to think of as "driver" flags, like -I and -L,
are now dynamic. The most notable static flags left behind are the
"way" flags, eg. -prof. It would be nice to fix this, but it isn't
urgent.
On the way, lots of cleanup has happened. Everything related to
static and dynamic flags lives in StaticFlags and DynFlags
respectively, and they share a common command-line parser library in
CmdLineParser. The flags related to modes (--makde, --interactive
etc.) are now private to the front end: in fact private to Main
itself, for now.
|
|
|
|
|
|
|
| |
ghc --make should check for a module graph that
contains a hs-boot file with no corresponding parent module
Merge to STABLE
|
|
|
|
|
| |
A very rough start at the GHC API, here so that others can look and
modify it.
|
|
|
|
| |
Print full instances in ghci; merge
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-----------------------------------------
Fix a long-standing indirection-zapping bug
-----------------------------------------
Merge to STABLE
Up to now we zap indirections as part of the occurence analyser.
But this is bogus. The indirection zapper does the following:
x_local = <expression>
...bindings...
x_exported = x_local
where x_exported is exported, and x_local is not, then we
replace it with this:
x_exported = <expression>
x_local = x_exported
...bindings...
But this is plain wrong if x_exported has a RULE that mentions
something (f, say) in ...bindings.., because 'f' will then die.
After hacking a few solutions, I've eventually simply made the indirection
zapping into a separate pass (which is cleaner anyway), which wraps the
entire program back into a single Rec if the bad thing can happen.
On the way I've made indirection-zapping work in Recs too, which wasn't the
case before.
* Move the zapper from OccurAnal into SimplCore
* Tidy up the printing of pragmas (PprCore and friends)
* Add a new function Rules.addRules
* Merge rules in the indirection zapper (previously one set was discarded)
|
|
|
|
| |
We shouldn't be including ghcconfig.h here
|
|
|
|
| |
Change "Reading" to "Using" in -v output to keep hmake happy.
|
|
|
|
|
| |
fix for findPackageModule: if we find the module in the cache, check
that it actually is a package module before returning it.
|
|
|
|
|
|
|
|
|
|
|
| |
-------------------------------------------------------
Change -include-prelude to -include-pkg-deps for ghc -M
-------------------------------------------------------
Merge to STABLE
This commit just renames the flag for ghc -M to something more
sensible.
|
|
|
|
|
|
| |
Fix a recompilation bug caused by the fact that typecheckIface wasn't
going via loadDecl to create the binders properly. The fix actually
results in slightly cleaner code.
|
|
|
|
| |
Track InstalledPackageInfo updates
|
|
|
|
| |
Fix --mk-dll
|
|
|
|
| |
Fix endMkDependHS
|
|
|
|
|
|
| |
Improve the module-not-found error message when we didn't actually
search for it anywhere. This happens when we know all the places it
might be: either in the current program, or a package.
|
|
|
|
| |
-d*-lint shouldn't turn off recompilation checking
|
|
|
|
|
| |
Put the GlobalRdrEnv back into the ModIface, so it gets preserved when
we reload a module without recompiling it.
|
|
|
|
|
| |
Print the banner before the "reading package config file" messages in
verbose mode.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-----------------------------------------------------
Switch off derivable type class generation by default
-----------------------------------------------------
Merge to STABLE
This commit switches off the generation of the support code for 'Derivable
Type Classes' by default. Use -fgenerics to switch it on.
Motivation: seldom used, and there's a nasty blowup in Core types for data
types that have lots of constructors or lots of fields.
We now put -fgenerics in the GhcLibOpts, so that the libraries have the
support code, as before.
|
|
|
|
| |
Respect --exclude-module in ghc -M; some tidying up as well
|
|
|
|
| |
Comments and type sig
|
|
|
|
|
| |
Dump package config only with -v4
Dump module dependencies (ghc -M) with -v2
|
|
|
|
| |
Import trimming
|
|
|
|
| |
Fix isLinkMode and adjust formatting a little
|
|
|
|
| |
Fix the source_unchanged test in the Hsc phase
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--------------------
Command-flag cleanup
--------------------
* Fewer cases in GhcMode: eliminate DoMkDLL, DoLink, both in favour of
StopBefore StopLn
* Replace the NoLink boolean with a GhcLink three-way flag:
NoLink, StaticLink, MakeDLL
* Corresponding plumbing to link it all up.
|