| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
Improve instance Outputable Linkable (purely cosmetic).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add
DriverPhases.haskellish_src_suffix :: String -> Bool
DriverPhases.haskellish_src_file :: String -> Bool
which return True for suffixes of Haskell source files only. The
existing haskellish_suffix and haskellish_file return True also for
.raw_s and .hc files.
We use these instead of haskellish_file in Main.main when deciding
whether to preprocess a file.
Fixes: compilation of .raw_s files, and potential bugs with
compilation of .hc files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- only read ~/.ghci if it is owned by the current user and isn't
writable by anyone else.
- Only read ./.ghci if both . and ./.ghci are owned by the current
user and aren't writable by anyone else. I think this is
sufficient: we don't need to check .. and ../.. etc. because "."
always refers to the same directory while a process is running.
- Don't load .so libraries in a package if that package is already
linked with GHCi. This stops us re-linking libm, libreadline etc.
- Allow packages to be loaded from within GHCi using
:set -package <name>
NOTE: this will unload all modules currently loaded into the
interpreter. I did this to be on the safe side - I think perhaps
it isn't necessary, but I haven't thought it through fully yet.
- fix CompManager.cmUnload in the process. It was wrong in several
ways.
MERGE WITH 5.00
|
|
|
|
| |
Close files eagerly after analysing their imports.
|
|
|
|
| |
Avoid pattern match failure in getValidLinkable.maybe_old_linkable.
|
|
|
|
| |
Typo.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cleaning up error reporting, 2nd attempt.
- The UserError name is already bagged by Exception (for
userErrors). So we use ProgramError instead, which is
more appropriate.
- some previously UserErrors are now CmdLineErrors. GHCi
catches CmdLineErrors and prints them without the "ghc: "
prefix.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clean up GHC's error reporting.
- the GhcException type has some more constructors: CmdLineError,
UserError, and InstallationError. OtherError has gone.
- most error messages should begin with "<location>:". When the
error is on the command-line or in GHC itself, <location> is
"ghc", for consistency with std Unix semantics.
- GHCi no longer prints a superfluous "ghc: " before certain error
messages.
|
|
|
|
|
|
|
| |
Fix for a harmless assertion failure (reachable_from included package
modules).
Also, clean up the downsweep code, and make it more efficient.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix a problem with the 'it' variable in GHCi. New bindings for 'it'
were getting confused with old bindings, because we always used the
same 'it' name.
Now, we generate a new unique for 'it' each time around.
Also, make sure that any existing variables shadowed by new
command-line bindings are correctly removed from the environments to
avoid space leaks.
|
|
|
|
|
| |
Remove package management support into a separate tool (ghc-pkg), and
don't duplicate the definition of PackageConfig.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do a better job of telling the user whether we're interpreting a
module or using an existing object file.
eg.
Main> :load A
Skipping D ( D.hs, D.o )
Compiling C ( C.hs, interpreted )
Skipping B ( B.hs, B.o )
Compiling Main ( A.hs, interpreted )
Main>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
----------------
First cut at ILX
----------------
This commit puts the ILX .NET code generator into the head.
It's entirely untested, mind you.
Some changes to the Module/Package strutures, mainly of a
naming variety. In particular:
Package ===> PackageConfig
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--------------------
A major hygiene pass
--------------------
1. The main change here is to
Move what was the "IdFlavour" out of IdInfo,
and into the varDetails field of a Var
It was a mess before, because the flavour was a permanent attribute
of an Id, whereas the rest of the IdInfo was ephemeral. It's
all much tidier now.
Main places to look:
Var.lhs Defn of VarDetails
IdInfo.lhs Defn of GlobalIdDetails
The main remaining infelicity is that SpecPragmaIds are right down
in Var.lhs, which seems unduly built-in for such an ephemeral thing.
But that is no worse than before.
2. Tidy up the HscMain story a little. Move mkModDetails from MkIface
into CoreTidy (where it belongs more nicely)
This was partly forced by (1) above, because I didn't want to make
DictFun Ids into a separate kind of Id (which is how it was before).
Not having them separate means we have to keep a list of them right
through, rather than pull them out of the bindings at the end.
3. Add NameEnv as a separate module (to join NameSet).
4. Remove unnecessary {-# SOURCE #-} imports from FieldLabel.
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add a Happy parser for the package config file. This is faster and
compiles to less code than the derived Read instance we had before.
- Add a source_dirs field to the package spec. This isn't used by
GHC, because we currently assume all packages are compiled. It could
be used by Hugs, though.
- Make unspecified fields of type [String] default to the empty list
in a package spec.
|
|
|
|
|
| |
Fix :type again, by resurrecting typecheckExpr. Now the expression
doesn't get the monomorphism restriction applied to it.
|
|
|
|
| |
Let ':t \x->x' work by putting a space before the expression.
|
|
|
|
| |
Move import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GHCi fixes:
- expressions are now compiled in a pseudo-module "$Interactive",
which avoids some problems with storage of demand-loaded declarations.
- compilation manager now detects when it needs to read the interace
for a module, even if it is already compiled. GHCi never demand-loads
interfaces now.
- (from Simon PJ) fix a problem with the recompilation checker, which
meant that modules were sometimes not recompiled when they should
have been.
- ByteCodeGen/Link: move linker related stuff into ByteCodeLink.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Compiling a module outside of a running GHCi and expecting GHCi to
pick it up when you do ':r' ain't gonna work.
We thought it would, but there's a problem with module versions and
the recompilation machinery, namely that the outside compiler doesn't
know about the versions being used internally in the running GHCi.
The "right" solution is to implement a ':compile' command in GHCi, but
we aren't going to do that before the release.
This commit disables the picking up of newly compiled modules, until
you do a full load (i.e. :load).
|
|
|
|
| |
oops, don't export cmTypeOfName when !GHCI.
|
|
|
|
| |
- make flushing and :def work again in the interpreter
|
|
|
|
| |
lookupClosure not used.
|
|
|
|
| |
Update the interactive context in cmRunStmt rather than hscMain.
|
|
|
|
| |
Unload temporary bindings from the ClosureEnv properly at cmLoadModule time.
|
|
|
|
|
|
|
| |
- message wibbles
- in one-shot mode, make sure the interface file follows the module rather
than the filename of the source.
|
|
|
|
| |
Make it build without GHCI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement do-style bindings on the GHCi command line.
The syntax for a command-line is exactly that of a do statement, with
the following meanings:
- `pat <- expr'
performs expr, and binds each of the variables in pat.
- `let pat = expr; ...'
binds each of the variables in pat, doesn't do any evaluation
- `expr'
behaves as `it <- expr' if expr is IO-typed, or `let it = expr'
followed by `print it' otherwise.
|
|
|
|
|
| |
Clean up temporary files between compilations, but cache preprocessed
modules that we might re-use.
|
|
|
|
| |
remove accidentally left-in trace
|
|
|
|
| |
wibble
|
|
|
|
| |
Always have (unload Batch) work, regardless if definedness of GHCI.
|
|
|
|
| |
wibbles
|
|
|
|
|
|
| |
Enforce the restriction that .o files may only depend on other .o
files. Any .o files which don't satisfy this requirement will be
ignored, and the module interpreted instead.
|
|
|
|
| |
#ifndef GHCI wibbles.
|
|
|
|
|
| |
Don't re-link interpreted modules if they haven't changed. Now :r is
almost instantaneous when nothing changes (as it should be).
|
|
|
|
| |
wibble
|
|
|
|
| |
don't re-summarise a module if its source hasn't changed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Try to get the stable modules story right. Things now work much
better: objects aren't unloaded and reloaded unnecessarily, and
compiling modules from with GHCi works:
> :! ghc -c A.hs
> :r
Compiling A ... compilation IS NOT required (using ./A.o)
Compiling B ... compilation IS NOT required
Compiling C ... compilation IS NOT required
Compiling Main ... compilation IS NOT required
Compiled module must not depend on interpreted modules, but we
currently don't enforce this restriction properly.
|
|
|
|
| |
linking fixes
|
|
|
|
| |
Add a list of objects currently loaded to the persistent linker state.
|
|
|
|
| |
Throw away linkables in cmUnload, as well as interfaces.
|
|
|
|
| |
merge PersistentCmState and CmState
|
|
|
|
|
|
| |
Ok, don't throw away interfaces and symbol tables as part of the
pre-upsweep. This seems to fix the recompilation problems (well, some
of them anyway...).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Greatly simplify the story about linkables, source_unchanged, and the
pre-upsweep.
Now we pre-generate the list of valid linkables; that is, for each
module if a linkable exists and is newer than the source, we keep it.
If a module has a valid linkable, then it is "source unchanged", and
it is also possibly "stable" as far as the pre-upsweep is concerned
(as long as its imports are also stable).
The pre-upsweep is no longer dependent on the mode
(interactive/batch).
There's still a bug here, though: the pre-upsweep removes old
interfaces from the HIT, so we don't get an opportunity to avoid
compilation for non-stable modules. That's the next job.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A big improvement to the way command-line expressions are typechecked.
Now we don't wrap in "print" and hope for the best (the wrong "print"
might be in scope). Instead we work on the renamed epxression and
do the Right Thing by using the correct "print".
Also do generalisation, so that we get the right type back from
the :t command.
WARNING: it's possible that these files overlap with my fortcoming
Big Commit of typechecker stuff, so you may need to hang on for
a few mins.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem 1
=========
The typechecker, when deciding whether to extend the Package
environment with any new typechecked declarations in its hand, was
inserting new declarations into the environment only if the
declaration's module differed from the "current" module. This doesn't
work if the "current" module is a package module, as it could be at
the GHCi command line, for example.
The solution is to filter the declarations only if the current module
is not a package module.
Problem 2
=========
The "current" module, as obtained from the compilation manager, was
always bogusly a Home module (it used mkHomeModule). To properly fix
this, the GHCi state has to carry around Modules instead of
ModuleNames, and CompMan.cmLoadModule needs to return a list of
Modules.
|
|
|
|
| |
Various ghci interactive UI fixes/improvements.
|
|
|
|
| |
Wire in the bytecode interpreter and delete the old one.
|
|
|
|
| |
import wibbles
|