summaryrefslogtreecommitdiff
path: root/compiler/iface/LoadIface.lhs
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve import and export of vectorisation informationManuel M T Chakravarty2011-08-191-10/+9
|
* Refactor to replace hscGetModuleExports by hscGetModuleInterfaceSimon Peyton Jones2011-08-031-30/+35
| | | | I also tidied up the interfaces for LoadIface to be a bit simpler
* Change the representation of export lists in .hi filesSimon Peyton Jones2011-08-021-12/+9
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix #481: use a safe recompilation check when Template Haskell isSimon Marlow2011-07-201-0/+1
| | | | | | | | | | | | | | | | 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
* SafeHaskell: Fix trust check for when safe module importsDavid Terei2011-06-291-0/+4
| | | | trustworthy module in the same package.
* SafeHaskell: Transitively check safety when compiling a module.David Terei2011-06-171-1/+3
| | | | | | | | | | 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.
* SafeHaskell: Move safe haskell flag into Overlap flagDavid Terei2011-06-171-1/+1
| | | | | | 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.
* SafeHaskell: Restrict OverlappingInstances.David Terei2011-06-171-1/+1
| | | | | OverlappingInstances in Safe modules can only overlap instances defined in the same module.
* SafeHaskell: Add safe import flag (not functional)David Terei2011-06-171-4/+10
|
* SafeHaskell: Add Safe & Trustworthy pragmasDavid Terei2011-06-171-0/+5
|
* Propagate scalar variables and tycons for vectorisation through ↵Manuel M T Chakravarty2011-06-031-3/+7
| | | | 'HscTypes.VectInfo'.
* Move error-ids to MkCore (from PrelRules)simonpj@microsoft.com2010-09-141-0/+1
| | | | and adjust imports accordingly
* Super-monster patch implementing the new typechecker -- at lastsimonpj@microsoft.com2010-09-131-1/+0
| | | | | | | | | 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.
* Remove LazyUniqFM; fixes trac #3880Ian Lynagh2010-03-201-1/+1
|
* Make updates to external package state idempotent.Thomas Schilling2009-08-211-0/+1
| | | | | Without this, concurrent updates to the EPS could introduce overlapping instances (even though they came from the same module).
* Improve fix to Trac #3007simonpj@microsoft.com2009-08-141-14/+36
| | | | | | | 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.
* Only look up whether a module's SOURCE-imported if it's in the current packageIan Lynagh2009-08-131-3/+5
| | | | | | | | | | | | | | | | 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.
* Remove unused importsIan Lynagh2009-07-071-5/+0
|
* Support for -fwarn-unused-do-bind and -fwarn-wrong-do-bind, as per #3263Max Bolingbroke2009-07-011-1/+1
|
* Make record selectors into ordinary functionssimonpj@microsoft.com2009-01-021-22/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add (a) CoreM monad, (b) new Annotations featuresimonpj@microsoft.com2008-10-301-14/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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!
* Add ASSERTs to all calls of nameModulesimonpj@microsoft.com2008-10-031-1/+2
| | | | | | nameModule fails on an InternalName. These ASSERTS tell you which call failed.
* Add -XPackageImports, new syntax for package-qualified importsSimon Marlow2008-08-051-3/+8
| | | | | | | | | | | | | | | | | 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
* Fix Haddock errors.Thomas Schilling2008-07-201-1/+1
|
* Add a WARNING pragmaIan Lynagh2008-07-201-7/+10
|
* Use MD5 checksums for recompilation checking (fixes #1372, #1959)Simon Marlow2008-05-281-27/+21
| | | | | | | | | | | | | | | | | | | | | | 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.
* Make LoadIface warning-freeIan Lynagh2008-05-041-22/+16
|
* (F)SLIT -> (f)sLit in LoadIfaceIan Lynagh2008-04-121-41/+41
|
* Don't import FastString in HsVersions.hIan Lynagh2008-03-291-0/+1
| | | | Modules that need it import it themselves instead.
* DEBUG removalIan Lynagh2008-03-291-8/+10
|
* Revert an accidental changeIan Lynagh2008-03-171-1/+0
|
* Print some extra debugging info when doing --show-ifaceIan Lynagh2008-03-171-2/+4
|
* Eliminate a global variableIan Lynagh2008-03-171-4/+4
| | | | | Very little parameter passing is needed without it, so there was no real benefit to it.
* Convert more UniqFM's back to LazyUniqFM'sIan Lynagh2008-02-071-1/+1
| | | | | | | | | | | | | | | 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
* White space onlysimonpj@microsoft.com2008-02-051-1/+2
|
* Monadify iface/LoadIface: use return and liftIOTwan van Laarhoven2008-01-171-14/+14
|
* View patterns, record wildcards, and record punsDan Licata2007-10-101-25/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* error message fix (#1758)Simon Marlow2007-10-081-2/+2
|
* FIX #903: mkWWcpr: not a productSimon Marlow2007-09-101-11/+2
| | | | | | | | | | | | | | | 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.
* Fix CodingStyle#Warnings URLsIan Lynagh2007-09-041-1/+1
|
* Use OPTIONS rather than OPTIONS_GHC for pragmasIan Lynagh2007-09-031-2/+2
| | | | | | | 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.
* Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modulesIan Lynagh2007-09-011-0/+7
|
* Adding pushing of hpc translation status through hi files.andy@galois.com2007-07-171-1/+2
| | | | | | | | | | 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.
* Adapt interface file code for vectorisationRoman Leshchinskiy2007-07-161-6/+6
| | | | | | 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.
* Remove unnecessary free-variables from renamersimonpj@microsoft.com2007-06-061-0/+22
| | | | | | | | | | | | 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.
* Add data type information to VectInfoManuel M T Chakravarty2007-05-221-2/+9
|
* Store a SrcSpan instead of a SrcLoc inside a NameSimon Marlow2007-05-111-2/+1
| | | | This has been a long-standing ToDo.
* Warning fix for unused and redundant importsMichael D. Adams2007-05-101-2/+0
|
* Improved VectInfoManuel M T Chakravarty2007-05-081-6/+8
| | | | | | | | | | - 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.
* IfaceVectInfo and propagation through EPSManuel M T Chakravarty2007-05-041-2/+12
|