| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
| |
I also tidied up the interfaces for LoadIface to be a bit simpler
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently export list in .hi files are partitioned by module
export M T(C1,C2)
N f,g
In each list we only have OccNames, all assumed to come from
the parent module M or N resp.
This patch changes the representatation so that export lists
have full Names:
export M.T(M.C1,M.C2), N.f, N.g
Numerous advatages
* AvailInfo no longer needs to be parameterised; it always
contains Names
* Fixes Trac #5306. This was the main provocation
* Less to-and-fro conversion when reading interface files
It's all generally simpler. Interface files should not get bigger,
becuase they have a nice compact representation for Names.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
being used.
We now track whether a module used any TH splices in the ModIface (and
at compile time in the TcGblEnv and ModGuts). If a module used TH
splices last time it was compiled, then we ignore the results of the
normal recompilation check and recompile anyway, *unless* the module
is "stable" - that is, none of its dependencies (direct or indirect)
have changed. The stability test is pretty important - otherwise ghc
--make would always recompile TH modules even if nothing at all had
changed, but it does require some extra plumbing to get this
information from GhcMake into HscMain.
test in driver/recomp009
|
|
|
|
| |
trustworthy module in the same package.
|
|
|
|
|
|
|
|
|
|
| |
While we previously checked the safety of safe imported modules we
didn't do this check transitively. This can be a problem when we depend
on a trustworthy module in a package that is no longer trusted, so we
should fail compilation. We already stored in an interface file the
transitive list of packages a module depends on. Now we extend that list
to include a flag saying if we depend on that package being trusted as
well.
|
|
|
|
|
|
| |
For instance decls we no longer store the SafeHaskell mode
in this data structure but instead store it as a bool field
in the overlap flag structure.
|
|
|
|
|
| |
OverlappingInstances in Safe modules can only overlap instances
defined in the same module.
|
| |
|
| |
|
|
|
|
| |
'HscTypes.VectInfo'.
|
|
|
|
| |
and adjust imports accordingly
|
|
|
|
|
|
|
|
|
| |
This major patch implements the new OutsideIn constraint solving
algorithm in the typecheker, following our JFP paper "Modular type
inference with local assumptions".
Done with major help from Dimitrios Vytiniotis and Brent Yorgey.
|
| |
|
|
|
|
|
| |
Without this, concurrent updates to the EPS could introduce
overlapping instances (even though they came from the same module).
|
|
|
|
|
|
|
| |
This patch tides up Ian's fix a little. In particular, if if you
{-# SOURCE #-} import a module from a different package, you now
get a much more civlised error message.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Suppose we import anotherPackage:M, which exports things from
anotherPackage:Internal. Then GHC will want to read
anotherPackage:Internal.hi.
However, if we have also SOURCE-imported thisPackage:Internal then
we don't want GHC to try to read anotherPackage:Internal.hi-boot
instead.
The mapping that tells us whether a module is SOURCE-imported uses just
the module name for the key, so we have to check the package ID before
looking it up.
Fixes #3007.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This biggish patch addresses Trac #2670. The main effect is to make
record selectors into ordinary functions, whose unfoldings appear in
interface files, in contrast to their previous existence as magic
"implicit Ids". This means that the usual machinery of optimisation,
analysis, and inlining applies to them, which was failing before when
the selector was somewhat complicated. (Which it can be when
strictness annotations, unboxing annotations, and GADTs are involved.)
The change involves the following points
* Changes in Var.lhs to the representation of Var. Now a LocalId can
have an IdDetails as well as a GlobalId. In particular, the
information that an Id is a record selector is kept in the
IdDetails. While compiling the current module, the record selector
*must* be a LocalId, so that it participates properly in compilation
(free variables etc).
This led me to change the (hidden) representation of Var, so that there
is now only one constructor for Id, not two.
* The IdDetails is persisted into interface files, so that an
importing module can see which Ids are records selectors.
* In TcTyClDecls, we generate the record-selector bindings in renamed,
but not typechecked form. In this way, we can get the typechecker
to add all the types and so on, which is jolly helpful especially
when GADTs or type families are involved. Just like derived
instance declarations.
This is the big new chunk of 180 lines of code (much of which is
commentary). A call to the same function, mkAuxBinds, is needed in
TcInstDcls for associated types.
* The typechecker therefore has to pin the correct IdDetails on to
the record selector, when it typechecks it. There was a neat way
to do this, by adding a new sort of signature to HsBinds.Sig, namely
IdSig. This contains an Id (with the correct Name, Type, and IdDetails);
the type checker uses it as the binder for the final binding. This
worked out rather easily.
* Record selectors are no longer "implicit ids", which entails changes to
IfaceSyn.ifaceDeclSubBndrs
HscTypes.implicitTyThings
TidyPgm.getImplicitBinds
(These three functions must agree.)
* MkId.mkRecordSelectorId is deleted entirely, some 300+ lines (incl
comments) of very error prone code. Happy days.
* A TyCon no longer contains the list of record selectors:
algTcSelIds is gone
The renamer is unaffected, including the way that import and export of
record selectors is handled.
Other small things
* IfaceSyn.ifaceDeclSubBndrs had a fragile test for whether a data
constructor had a wrapper. I've replaced that with an explicit flag
in the interface file. More robust I hope.
* I renamed isIdVar to isId, which touched a few otherwise-unrelated files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch, written by Max Bolingbroke, does two things
1. It adds a new CoreM monad (defined in simplCore/CoreMonad),
which is used as the top-level monad for all the Core-to-Core
transformations (starting at SimplCore). It supports
* I/O (for debug printing)
* Unique supply
* Statistics gathering
* Access to the HscEnv, RuleBase, Annotations, Module
The patch therefore refactors the top "skin" of every Core-to-Core
pass, but does not change their functionality.
2. It adds a completely new facility to GHC: Core "annotations".
The idea is that you can say
{#- ANN foo (Just "Hello") #-}
which adds the annotation (Just "Hello") to the top level function
foo. These annotations can be looked up in any Core-to-Core pass,
and are persisted into interface files. (Hence a Core-to-Core pass
can also query the annotations of imported things.) Furthermore,
a Core-to-Core pass can add new annotations (eg strictness info)
of its own, which can be queried by importing modules.
The design of the annotation system is somewhat in flux. It's
designed to work with the (upcoming) dynamic plug-ins mechanism,
but is meanwhile independently useful.
Do not merge to 6.10!
|
|
|
|
|
|
| |
nameModule fails on an InternalName. These ASSERTS tell you
which call failed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now you can say
import "network" Network.Socket
and get Network.Socket from package "network", even if there are
multiple Network.Socket modules in scope from different packages
and/or the current package.
This is not really intended for general use, it's mainly so that we
can build backwards-compatible versions of packages, where we need to
be able to do
module GHC.Base (module New.GHC.Base) where
import "base" GHC.Base as New.GHC.Base
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a much more robust way to do recompilation checking. The idea
is to create a fingerprint of the ABI of an interface, and track
dependencies by recording the fingerprints of ABIs that a module
depends on. If any of those ABIs have changed, then we need to
recompile.
In bug #1372 we weren't recording dependencies on package modules,
this patch fixes that by recording fingerprints of package modules
that we depend on. Within a package there is still fine-grained
recompilation avoidance as before.
We currently use MD5 for fingerprints, being a good compromise between
efficiency and security. We're not worried about attackers, but we
are worried about accidental collisions.
All the MD5 sums do make interface files a bit bigger, but compile
times on the whole are about the same as before. Recompilation
avoidance should be a bit more accurate than in 6.8.2 due to fixing
#1959, especially when using -O.
|
| |
|
| |
|
|
|
|
| |
Modules that need it import it themselves instead.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Very little parameter passing is needed without it, so there was no real
benefit to it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements three new features:
* view patterns (syntax: expression -> pat in a pattern)
* working versions of record wildcards and record puns
See the manual for detailed descriptions.
Other minor observable changes:
* There is a check prohibiting local fixity declarations
when the variable being fixed is not defined in the same let
* The warn-unused-binds option now reports warnings for do and mdo stmts
Implementation notes:
* The pattern renamer is now in its own module, RnPat, and the
implementation is now in a CPS style so that the correct context is
delivered to pattern expressions.
* These features required a fairly major upheaval to the renamer.
Whereas the old version used to collect up all the bindings from a let
(or top-level, or recursive do statement, ...) and put them into scope
before renaming anything, the new version does the collection as it
renames. This allows us to do the right thing with record wildcard
patterns (which need to be expanded to see what names should be
collected), and it allows us to implement the desired semantics for view
patterns in lets. This change had a bunch of domino effects brought on
by fiddling with the top-level renaming.
* Prior to this patch, there was a tricky bug in mkRecordSelId in HEAD,
which did not maintain the invariant necessary for loadDecl. See note
[Tricky iface loop] for details.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the long-standing bug that prevents some code with
mutally-recursive modules from being compiled with --make and -O,
including GHC itself. See the comments for details.
There are some additional cleanups that were forced/enabled by this
patch: I removed importedSrcLoc/importedSrcSpan: it wasn't adding any
useful information, since a Name already contains its defining Module.
In fact when re-typechecking an interface file we were wrongly
replacing the interesting SrcSpans in the Names with boring
importedSrcSpans, which meant that location information could degrade
after reloading modules. Also, recreating all these Names was a waste
of space/time.
|
| |
|
|
|
|
|
|
|
| |
Older GHCs can't parse OPTIONS_GHC.
This also changes the URL referenced for the -w options from
WorkingConventions#Warnings to CodingStyle#Warnings for the compiler
modules.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Now, if a single module *anywhere* on the module tree is built with
-fhpc, the binary will enable reading/writing of <bin>.tix.
Previously, you needed to compile Main to allow coverage to operate.
This changes the file format for .hi files; you will need to recompile every library.
|
|
|
|
|
|
| |
For the most part, this patch simply renames functions which had been used
for closure conversion and hence have CC in their name. It also changes the
OccNames generated by vectorisation.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The renamer used to be responsible for making sure that all interfaces
with instance decls (other than orphans) were loaded. But TH makes that
impossible, so the typechecker does it, via checkWiredInTyCon.
This patch simply removes redundant additions to the free-variable set
in the renamer, which were there, I believe, solely to ensure that the
instances came in. Removing them should change nothing, but it's a
useful clean up.
|
| |
|
|
|
|
| |
This has been a long-standing ToDo.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- We need to keep pairs of (f, f_CC) in VectInfo as it is difficult
to obtain Names from OccNames (of imported modules) in Core passes.
- There is a choice of keeping Names or Vars in VectInfo. We go with Vars
for now; mainly to avoid converting between Names and Vars repeatedly for
the same VectInfo in other than one-shot mode.
Again goes to the HEAD straight away to avoid conflicts down the road.
|
| |
|