about summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2017-05-06rustc: treat const bodies like fn bodies in middle::region.Eduard-Mihai Burtescu-95/+65
2017-05-05is_foreign_itemachernyak-3/+1
2017-05-04impl_parentachernyak-2/+0
2017-05-04trait_of_itemachernyak-2/+0
2017-05-03fn_arg_namesachernyak-2/+0
2017-05-03item_attrsachernyak-2/+0
2017-05-02Rollup merge of #41653 - achernyak:master, r=nikomatsakisCorey Farwell-7/+2
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-02Rollup merge of #41662 - nikomatsakis:on-demandify-region-mapping, r=eddybCorey Farwell-415/+410
On demandify region mapping This is an adaptation of @cramertj's PR. I am sort of tempted to keep simplifying it, but also tempted to land it so and we can refactor more in follow-up PRs. As is, it does the following things: - makes the region-maps an on-demand query, per function `tcx.region_maps(def_id)` - interns code extents instead of of having them be integers - remove the "root region extent" and (to some extent) item extents; instead we use `Option<CodeExtent<'tcx>>` in a few places (no space inefficiency since `CodeExtent<'tcx>` is now a pointer). I'm not entirely happy with the way I have it setup though. Here are some of the changes I was considering (I'm not sure if they would work out well): 1. Removing `item_extents` entirely -- they are rarely used now, because most of the relevant places now accept an `Option<Region<'tcx>>` or an `Option<CodeExtent<'tcx>>`, but I think still used in a few places. 2. Merging `RegionMaps` into the typeck tables, instead of having it be its own query. 3. Change `CodeExtent<'tcx>` to store the parent pointer. This would mean that fewer places in the code actually *need* a `RegionMaps` anyhow, since most of them just want to be able to walk "up the tree". On the other hand, you wouldn't be able to intern a `CodeExtent<'tcx>` for some random node-id, you'd need to look it up in the table (since there'd be more information). Most of this code is semi-temporary -- I expect it to largely go away as we move to NLL -- so I'm also not *that* concerned with making it perfect. r? @eddyb
2017-05-02query for deprecationachernyak-7/+2
2017-05-01patch the `librustc_driver` unit testsNiko Matsakis-11/+18
2017-05-01Queryify is_item_mir_availableTaylor Cramer-6/+0
2017-05-01Queryify const_is_rvalue_promotable_to_staticTaylor Cramer-4/+0
2017-05-01Queryify item_body_nested_bodiesTaylor Cramer-5/+0
2017-05-01use `closure_base_def_id` rather than walking up HIRNiko Matsakis-10/+7
2017-05-01pacify the mercilous tidyNiko Matsakis-1/+3
2017-05-01Add profiling support, through the rustc -Z profile flag.whitequark-0/+2
When -Z profile is passed, the GCDAProfiling LLVM pass is added to the pipeline, which uses debug information to instrument the IR. After compiling with -Z profile, the $(OUT_DIR)/$(CRATE_NAME).gcno file is created, containing initial profiling information. After running the program built, the $(OUT_DIR)/$(CRATE_NAME).gcda file is created, containing branch counters. The created *.gcno and *.gcda files can be processed using the "llvm-cov gcov" and "lcov" tools. The profiling data LLVM generates does not faithfully follow the GCC's format for *.gcno and *.gcda files, and so it will probably not work with other tools (such as gcov itself) that consume these files.
2017-04-30modify `ExprUseVisitor` and friends to take region-maps, not def-idNiko Matsakis-9/+9
2017-04-30introduce per-fn RegionMapsTaylor Cramer-93/+168
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-30intern CodeExtentsNiko Matsakis-299/+216
Make a `CodeExtent<'tcx>` be something allocated in an arena instead of an index into the `RegionMaps`.
2017-04-30remove ROOT_CODE_EXTENT and DUMMY_CODE_EXTENTNiko Matsakis-94/+68
Instead, thread around `Option<CodeExtent>` where applicable.
2017-04-30Remove RefCells from RegionMapsTaylor Cramer-53/+51
2017-04-30On-demandify region mappingTaylor Cramer-13/+38
2017-04-30Auto merge of #41643 - frewsxcv:rollup, r=frewsxcvbors-0/+6
Rollup of 6 pull requests - Successful merges: #41449, #41509, #41608, #41613, #41636, #41637 - Failed merges:
2017-04-29Don't ever warn about #[used] items being dead code.Eduard-Mihai Burtescu-0/+6
2017-04-28Merge branch 'master' into def_spanArtem Chernyak-8/+7
2017-04-28query for def_spanachernyak-2/+0
2017-04-28do not access `inherited_impls` map directlyNiko Matsakis-8/+7
2017-04-28Rollup merge of #41534 - achernyak:master, r=eddybCorey Farwell-4/+2
query for describe_def Resolves `fn describe_def(&self, def: DefId) -> Option<Def>;` of #41417. r? @nikomatsakis I would greatly appreciate a review. I hope I covered everything described in the pr.
2017-04-27query for describe_defachernyak-4/+2
2017-04-27typeck: resolve type vars before calling `try_index_step`Ariel Ben-Yehuda-2/+9
`try_index_step` does not resolve type variables by itself and would fail otherwise. Also harden the failure path in `confirm` to cause less confusing errors.
2017-04-27Auto merge of #37860 - giannicic:defaultimpl, r=nagisabors-4/+6
#37653 support `default impl` for specialization this commit implements the first step of the `default impl` feature: > all items in a `default impl` are (implicitly) `default` and hence > specializable. In order to test this feature I've copied all the tests provided for the `default` method implementation (in run-pass/specialization and compile-fail/specialization directories) and moved the `default` keyword from the item to the impl. See [referenced](https://github.com/rust-lang/rust/issues/37653) issue for further info r? @aturon
2017-04-25 support `default impl` for specializationGianni Ciccarelli-0/+2
pr review
2017-04-24rustc: use tcx.at(span) to set the location of a query.Eduard-Mihai Burtescu-2/+2
2017-04-24rustc: expose the common DUMMY_SP query case as tcx methods.Eduard-Mihai Burtescu-6/+4
2017-04-24rustc: rename some of the queries to match tcx methods.Eduard-Mihai Burtescu-7/+7
2017-04-24support `default impl` for specializationGianni Ciccarelli-4/+4
this commit implements the first step of the `default impl` feature: all items in a `default impl` are (implicitly) `default` and hence specializable. In order to test this feature I've copied all the tests provided for the `default` method implementation (in run-pass/specialization and compile-fail/specialization directories) and moved the `default` keyword from the item to the impl. See referenced issue for further info
2017-04-23rustc_const_eval: support all unit enum variants.Eduard-Mihai Burtescu-2/+4
2017-04-23rustc_const_eval: CallOn isn't needed, typeck/const-qualif handle those cases.Eduard-Mihai Burtescu-2/+0
2017-04-23rustc: make the const-eval cache polymorphic.Eduard-Mihai Burtescu-6/+7
2017-04-22add a cache to impl_polarityAriel Ben-Yehuda-2/+0
this is another one of these things that looks *much* worse on valgrind.
2017-04-22weak_lang_items: check for `lang` attribute before calling `value_str`Ariel Ben-Yehuda-3/+4
improves trans performance by *another* 10%.
2017-04-22cache attributes of items from foreign cratesAriel Ben-Yehuda-2/+2
this avoids parsing item attributes on each call to `item_attrs`, which takes off 33% (!) of translation time and 50% (!) of trans-item collection time.
2017-04-22avoid calling `mk_region` unnecessarilyAriel Ben-Yehuda-3/+3
this improves typeck & trans performance by 1%. This looked hotter on callgrind than it is on a CPU.
2017-04-21make `reachable_set` ref-countedNiko Matsakis-3/+4
Once it is computed, no need to deep clone the set.
2017-04-20rustc: replace interior_unsafe with a Freeze trait.Eduard-Mihai Burtescu-0/+1
2017-04-18kill a bunch of one off tasksNiko Matsakis-13/+0
2017-04-18convert calls to `visit_all_item_likes_in_krate`Niko Matsakis-3/+2
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-17Rollup merge of #41310 - eddyb:demand-const-eval, r=nikomatsakisCorey Farwell-5/+194
[on-demand] Turn monomorphic_const_eval into a proper query, not just a cache. The error definitions and reporting logic, alongside with `eval_length` were moved to `librustc`. Both local and cross-crate constant evaluation is on-demand now, but the latter is only used for `enum` discriminants, to replace the manual insertion into the cache which was done when decoding variants. r? @nikomatsakis
2017-04-16Compress ReprOptions a little bitSimonas Kazlauskas-2/+2
2017-04-16rustc: expose monomorphic const_eval through on-demand.Eduard-Mihai Burtescu-1/+36