about summary refs log tree commit diff
path: root/src/librustc/dep_graph
AgeCommit message (Collapse)AuthorLines
2017-06-01rewrite layout to take a (param-env, ty) pair instead of infcxNiko Matsakis-0/+2
2017-06-01Syntax highlight rust code in librustc/dep_graph/README.mdbjorn3-1/+1
2017-05-29Remove DepGraph::write() and its callers.Michael Woerister-25/+0
2017-05-23incr.comp.: Track expanded spans instead of FileMaps.Michael Woerister-2/+0
2017-05-22rename `ParameterEnvironment` to `ParamEnv`Niko Matsakis-2/+2
2017-05-22move `needs_drop` into a queryNiko Matsakis-0/+2
2017-05-22make parameter-environment a queryNiko Matsakis-0/+2
2017-05-22centralize the caching for is-copy, is-sized, and is-freezeNiko Matsakis-0/+6
Use the trait-environment+type as the key. Note that these are only invoked on types that live for the entire compilation (no inference artifacts). We no longer need the various special-case bits and caches that were in place before.
2017-05-15Remove interior mutability from TraitDef by turning fields into queries.Michael Woerister-0/+4
2017-05-15ICH: Hash lists of local trait impls as part of the HIR.Michael Woerister-0/+3
2017-05-09resolved merge conflictsachernyak-81/+27
2017-05-08incr.comp.: Hash more pieces of crate metadata to detect changes there.Michael Woerister-2/+20
2017-05-07is_exported_symbolachernyak-0/+2
2017-05-05Rollup merge of #41734 - nikomatsakis:incr-comp-refactor-variance, r=pnkfelixCorey Farwell-79/+7
Refactor variance and remove last `[pub]` map This PR refactors variance to work in a more red-green friendly way. Because red-green doesn't exist yet, it has to be a bit hacky. The basic idea is this: - We compute a big map with the variance for all items in the crate; when you request variances for a particular item, we read it from the crate - We now hard-code that traits are invariant (which they are, for deep reasons, not gonna' change) - When building constraints, we compute the transitive closure of all things within the crate that depend on what using `TransitiveRelation` - this lets us gin up the correct dependencies when requesting variance of a single item Ah damn, just remembered, one TODO: - [x] Update the variance README -- ah, I guess the README updates I did are sufficient r? @michaelwoerister
2017-05-04impl_parentachernyak-0/+2
2017-05-04trait_of_itemachernyak-0/+2
2017-05-03allow tests to refer to `ItemVariances`Niko Matsakis-0/+1
2017-05-03kill the old `visit_all_item_likes` infrastructureNiko Matsakis-79/+0
2017-05-03factor variances into a proper queryNiko Matsakis-0/+6
There are now two queries: crate and item. The crate one computes the variance of all items in the crate; it is sort of an implementation detail, and not meant to be used. The item one reads from the crate one, synthesizing correct deps in lieu of the red-green algorithm. At the same time, remove the `variance_computed` flag, which was a horrible hack used to force invariance early on (e.g. when type-checking constants). This is only needed because of trait applications, and traits are always invariant anyway. Therefore, we now change to take advantage of the query system: - When asked to compute variances for a trait, just return a vector saying 'all invariant'. - Remove the corresponding "inferreds" from traits, and tweak the constraint generation code to understand that traits are always inferred.
2017-05-03fn_arg_namesachernyak-0/+2
2017-05-03item_attrsachernyak-0/+2
2017-05-03all queries use dep nodesachernyak-0/+6
2017-05-02Rollup merge of #41653 - achernyak:master, r=nikomatsakisCorey Farwell-0/+4
Queries for Crate Metadata This resolves following parts of #41417: * `fn stability(&self, def: DefId) -> Option<attr::Stability>;` * `fn deprecation(&self, def: DefId) -> Option<attr::Deprecation>;` r? @nikomatsakis
2017-05-02simplify the MirPass traits and passes dramaticallyNiko Matsakis-0/+6
Overall goal: reduce the amount of context a mir pass needs so that it resembles a query. - The hooks are no longer "threaded down" to the pass, but rather run automatically from the top-level (we also thread down the current pass number, so that the files are sorted better). - The hook now receives a *single* callback, rather than a callback per-MIR. - The traits are no longer lifetime parameters, which moved to the methods -- given that we required `for<'tcx>` objecs, there wasn't much point to that. - Several passes now store a `String` instead of a `&'l str` (again, no point).
2017-05-02introduce `mir_keys()`Niko Matsakis-13/+2
Each MIR key is a DefId that has MIR associated with it
2017-05-02query for deprecationachernyak-0/+4
2017-04-30introduce per-fn RegionMapsTaylor Cramer-2/+2
Instead of requesting the region maps for the entire crate, request for a given item etc. Several bits of code were modified to take `&RegionMaps` as input (e.g., the `resolve_regions_and_report_errors()` function). I am not totally happy with this setup -- I *think* I'd rather have the region maps be part of typeck tables -- but at least the `RegionMaps` works in a "parallel" way to `FreeRegionMap`, so it's not too bad. Given that I expect a lot of this code to go away with NLL, I didn't want to invest *too* much energy tweaking it.
2017-04-29removed custom functions and commentachernyak-1/+0
2017-04-29chaned dep nodes implachernyak-2/+2
2017-04-29added dep nodes and commentachernyak-0/+6
2017-04-26cache symbol names in ty::mapsAriel Ben-Yehuda-0/+2
this fixes a performance regression introduced in commit 39a58c38a0b9ac9e822a1732f073abe8ddf65cfb.
2017-04-23cache ADT dtorck resultsAriel Ben-Yehuda-0/+2
This avoids visiting the fields of all structs multiple times, improving item-bodies checking time by 10% (!).
2017-04-23rustc: make the const-eval cache polymorphic.Eduard-Mihai Burtescu-2/+2
2017-04-21introduce `is_foreign_item` queryNiko Matsakis-0/+3
This may seem like overkill, but it's exactly what we want/need for incremental compilation I think. In particular, while generating code for some codegen unit X, we can wind up querying about any number of external items, and we only want to be forced to rebuild X is some of those changed from a foreign item to otherwise. Factoring this into a query means we would re-run only if some `false` became `true` (or vice versa).
2017-04-18kill a bunch of one off tasksNiko Matsakis-20/+0
2017-04-18convert calls to `visit_all_item_likes_in_krate`Niko Matsakis-20/+0
We no longer need to track the tasks in these cases since these particular tasks have no outputs (except, potentially, errors...) and they always execute.
2017-04-04kill `Liveness`Niko Matsakis-2/+0
2017-04-04remove `EffectCheck`Niko Matsakis-2/+0
2017-04-04kill `CheckStaticRecursion`Niko Matsakis-2/+0
2017-04-04kill the `CheckLoops` DepNodeNiko Matsakis-2/+0
2017-03-27Rollup merge of #40683 - nikomatsakis:incr-comp-coerce-unsized-info, r=eddybAlex Crichton-17/+0
on-demand-ify `custom_coerce_unsized_kind` and `inherent-impls` This "on-demand" task both checks for errors and computes the custom unsized kind, if any. This task is only defined on impls of `CoerceUnsized`; invoking it on any other kind of impl results in a bug. This is just to avoid having an `Option`, could easily be changed. r? @eddyb
2017-03-23convert privacy access levels into a queryNiko Matsakis-2/+3
2017-03-23ignore reads of tracked state when there is no current taskNiko Matsakis-6/+16
I realized that, even in the current system, such reads can't really do any harm. Because they are not part of a task, they will occur no matter what (only tasks can be skipped). If you leak the data you read into a task, that is bad, but that is equally bad if you are in a task. *Writes* to tracked state, on the other hand, should never occur except from within a task (and the task then records what things you read to compute it). Once we complete the shift to on-demand, these properties will hold by construction (because the on-demand struct enforces stateless tasks where leaks are impossible -- except by having shared mutable state in the tcx).
2017-03-23convert inherent-impl-related things to on-demand queriesNiko Matsakis-17/+0
There are now 3 queries: - inherent_impls(def-id): for a given type, get a `Rc<Vec<DefId>>` with all its inherent impls. This internally uses `crate_inherent_impls`, doing some hacks to keep the current deps (which, btw, are not clearly correct). - crate_inherent_impls(crate): gathers up a map from types to `Rc<Vec<DefId>>`, touching the entire krate, possibly generating errors. - crate_inherent_impls_overlap_check(crate): performs overlap checks between the inherent impls for a given type, generating errors.
2017-03-18move Instance to rustc and use it in the collectorAriel Ben-Yehuda-0/+5
2017-03-13some style fixesTshepang Lekhonkhobe-4/+7
2017-03-10add comments and remove unused code pathsNiko Matsakis-32/+49
2017-03-10isolate dep-graph tasksNiko Matsakis-3/+80
A task function is now given as a `fn` pointer to ensure that it carries no state. Each fn can take two arguments, because that worked out to be convenient -- these two arguments must be of some type that is `DepGraphSafe`, a new trait that is intended to prevent "leaking" information into the task that was derived from tracked state. This intentionally leaves `DepGraph::in_task()`, the more common form, alone. Eventually all uses of `DepGraph::in_task()` should be ported to `with_task()`, but I wanted to start with a smaller subset. Originally I wanted to use closures bound by an auto trait, but that approach has some limitations: - the trait cannot have a `read()` method; since the current method is unused, that may not be a problem. - more importantly, we would want the auto trait to be "undefined" for all types *by default* -- that is, this use case doesn't really fit the typical auto trait scenario. For example, imagine that there is a `u32` loaded out of a `hir::Node` -- we don't really want to be passing that `u32` into the task!
2017-03-03Auto merge of #40178 - arielb1:provide-destructors, r=eddybbors-5/+2
convert AdtDef::destructor to on-demand This removes the `Cell` from `AdtDef`. Also, moving destructor validity checking to on-demand (forced during item-type checking) ensures that invalid destructors can't cause ICEs. Fixes #38868. Fixes #40132. r? @eddyb
2017-03-01convert AdtDef::destructor to on-demandAriel Ben-Yehuda-5/+2
This removes the Cell from AdtDef. Also, moving destructor validity checking to on-demand (forced during item-type checking) ensures that invalid destructors can't cause ICEs. Fixes #38868. Fixes #40132.