summary refs log tree commit diff
path: root/src/librustc_driver
AgeCommit message (Collapse)AuthorLines
2017-04-22cache attributes of items from foreign cratesAriel Ben-Yehuda-0/+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-2/+2
this improves typeck & trans performance by 1%. This looked hotter on callgrind than it is on a CPU.
2017-04-21sort `provide`Niko Matsakis-1/+2
2017-04-21make `reachable_set` ref-countedNiko Matsakis-1/+1
Once it is computed, no need to deep clone the set.
2017-04-19propagate other obligations that were left outNiko Matsakis-3/+3
cc #32730 -- I left exactly one instance where I wasn't sure of the right behavior.
2017-04-18kill a bunch of one off tasksNiko Matsakis-2/+0
2017-04-16rustc: use monomorphic const_eval for cross-crate enum discriminants.Eduard-Mihai Burtescu-0/+2
2017-04-16rustc: expose monomorphic const_eval through on-demand.Eduard-Mihai Burtescu-1/+2
2017-04-15rustc: provide adt_sized_constraint as an on-demand query.Eduard-Mihai Burtescu-0/+1
2017-04-14Rollup merge of #40702 - mrhota:global_asm, r=nagisaCorey Farwell-0/+1
Implement global_asm!() (RFC 1548) This is a first attempt. ~~One (potential) problem I haven't solved is how to handle multiple usages of `global_asm!` in a module/crate. It looks like `LLVMSetModuleInlineAsm` overwrites module asm, and `LLVMAppendModuleInlineAsm` is not provided in LLVM C headers 😦~~ I can provide more detail as needed, but honestly, there's not a lot going on here. r? @eddyb CC @Amanieu @jackpot51 Tracking issue: #35119
2017-04-13use `tcx.crate_name(LOCAL_CRATE)` rather than `LinkMeta::crate_name`Niko Matsakis-1/+1
2017-04-12Add global_asm testsA.J. Gardner-0/+1
2017-04-12Rollup merge of #41232 - arielb1:mir-rvalues, r=eddybTim Neumann-6/+2
move rvalue checking to MIR
2017-04-12Rollup merge of #41141 - michaelwoerister:direct-metadata-ich-final, ↵Tim Neumann-0/+1
r=nikomatsakis ICH: Replace old, transitive metadata hashing with direct hashing approach. This PR replaces the old crate metadata hashing strategy with a new one that directly (but stably) hashes all values we encode into the metadata. Previously we would track what data got accessed during metadata encoding and then hash the input nodes (HIR and upstream metadata) that were transitively reachable from the accessed data. While this strategy was sound, it had two major downsides: 1. It was susceptible to generating false positives, i.e. some input node might have changed without actually affecting the content of the metadata. That metadata entry would still show up as changed. 2. It was susceptible to quadratic blow-up when many metadata nodes shared the same input nodes, which would then get hashed over and over again. The new method does not have these disadvantages and it's also a first step towards caching more intermediate results in the compiler. Metadata hashing/cross-crate incremental compilation is still kept behind the `-Zincremental-cc` flag even after this PR. Once the new method has proven itself with more tests, we can remove the flag and enable cross-crate support by default again. r? @nikomatsakis cc @rust-lang/compiler
2017-04-12Rollup merge of #41063 - nikomatsakis:issue-40746-always-exec-loops, r=eddybTim Neumann-0/+1
remove unnecessary tasks Remove various unnecessary tasks. All of these are "always execute" tasks that don't do any writes to tracked state (or else an assert would trigger, anyhow). In some cases, they issue lints or errors, but we''ll deal with that -- and anyway side-effects outside of a task don't cause problems for anything that I can see. The one non-trivial refactoring here is the borrowck conversion, which adds the requirement to go from a `DefId` to a `BodyId`. I tried to make a useful helper here. r? @eddyb cc #40746 cc @cramertj @michaelwoerister
2017-04-12ICH: Replace old, transitive metadata hashing with direct hashing approach.Michael Woerister-0/+1
Instead of collecting all potential inputs to some metadata entry and hashing those, we directly hash the values we are storing in metadata. This is more accurate and doesn't suffer from quadratic blow-up when many entries have the same dependencies.
2017-04-11Move rvalue checking to MIRAriel Ben-Yehuda-6/+2
Fixes #41139.
2017-04-11Fix some nitsSimonas Kazlauskas-1/+3
2017-04-11Initial attempt at implementing optimization fuel and re-enabling struct ↵Austin Hicks-0/+8
field reordering.
2017-04-07Rollup merge of #41056 - michaelwoerister:central-defpath-hashes, r=nikomatsakisCorey Farwell-2/+6
Handle DefPath hashing centrally as part of DefPathTable (+ save work during SVH calculation) In almost all cases where we construct a `DefPath`, we just hash it and throw it away again immediately. With this PR, the compiler will immediately compute and store the hash for each `DefPath` as it is allocated. This way we + can get rid of any subsequent `DefPath` hash caching (e.g. the `DefPathHashes`), + don't need to allocate a transient `Vec` for holding the `DefPath` (although I'm always surprised how little these small, dynamic allocations seem to hurt performance), and + we don't hash `DefPath` prefixes over and over again. That last part is because we construct the hash for `prefix::foo` by hashing `(hash(prefix), foo)` instead of hashing every component of prefix. The last commit of this PR is pretty neat, I think: ``` The SVH (Strict Version Hash) of a crate is currently computed by hashing the ICHes (Incremental Computation Hashes) of the crate's HIR. This is fine, expect that for incr. comp. we compute two ICH values for each HIR item, one for the complete item and one that just includes the item's interface. The two hashes are are needed for dependency tracking but if we are compiling non-incrementally and just need the ICH values for the SVH, one of them is enough, giving us the opportunity to save some work in this case. ``` r? @nikomatsakis This PR depends on https://github.com/rust-lang/rust/pull/40878 to be merged first (you can ignore the first commit for reviewing, that's just https://github.com/rust-lang/rust/pull/40878).
2017-04-07ICH: Centrally compute and cache DefPath hashes as part of DefPathTable.Michael Woerister-2/+6
2017-04-07Auto merge of #40873 - cramertj:on-demandify-queries, r=nikomatsakisbors-0/+1
On demandify reachability cc https://github.com/rust-lang/rust/issues/40746 I tried following this guidance from #40746: > The following tasks currently execute before a tcx is built, but they could be easily converted into queries that are requested after tcx is built. The main reason they are the way they are was to avoid a gratuitious refcell (but using the refcell map seems fine)... but the result of moving `region_maps` out of `TyCtxt` and into a query caused a lot of churn, and seems like it could potentially result in a rather large performance hit, since it means a dep-graph lookup on every use of `region_maps` (rather than just a field access). Possibly `TyCtxt` could store a `RefCell<Option<RegionMap>>` internally and use that to prevent repeat lookups, but that feels like it's duplicating the work of the dep-graph. @nikomatsakis What did you have in mind for this?
2017-04-05Properly adjust filenames when multiple emissionsSimonas Kazlauskas-4/+3
Fixes #40993
2017-04-04push `borrowck` into its own taskNiko Matsakis-0/+1
2017-04-04On-demandify reachabilityTaylor Cramer-0/+1
2017-03-29Merge `ExpnId` and `SyntaxContext`.Jeffrey Seyfried-2/+2
2017-03-27Rollup merge of #40751 - nrc:save-callback, r=eddybAlex Crichton-6/+5
save-analysis: allow clients to get data directly without writing to a file.
2017-03-27Fix various useless derefs and slicingsOliver Schneider-9/+9
2017-03-26Auto merge of #40826 - frewsxcv:rollup, r=frewsxcvbors-14/+10
Rollup of 7 pull requests - Successful merges: #40642, #40734, #40740, #40771, #40807, #40820, #40821 - Failed merges:
2017-03-26Auto merge of #40347 - alexcrichton:rm-liblog, r=brsonbors-3/+6
Remove internal liblog This commit deletes the internal liblog in favor of the implementation that lives on crates.io. Similarly it's also setting a convention for adding crates to the compiler. The main restriction right now is that we want compiler implementation details to be unreachable from normal Rust code (e.g. requires a feature), and by default everything in the sysroot is reachable via `extern crate`. The proposal here is to require that crates pulled in have these lines in their `src/lib.rs`: #![cfg_attr(rustbuild, feature(staged_api, rustc_private))] #![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))] This'll mean that by default they're not using these attributes but when compiled as part of the compiler they do a few things: * Mark themselves as entirely unstable via the `staged_api` feature and the `#![unstable]` attribute. * Allow usage of other unstable crates via `feature(rustc_private)` which is required if the crate relies on any other crates to compile (other than std).
2017-03-23convert privacy access levels into a queryNiko Matsakis-12/+8
2017-03-23Remove internal liblogAlex Crichton-3/+6
This commit deletes the internal liblog in favor of the implementation that lives on crates.io. Similarly it's also setting a convention for adding crates to the compiler. The main restriction right now is that we want compiler implementation details to be unreachable from normal Rust code (e.g. requires a feature), and by default everything in the sysroot is reachable via `extern crate`. The proposal here is to require that crates pulled in have these lines in their `src/lib.rs`: #![cfg_attr(rustbuild, feature(staged_api, rustc_private))] #![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))] This'll mean that by default they're not using these attributes but when compiled as part of the compiler they do a few things: * Mark themselves as entirely unstable via the `staged_api` feature and the `#![unstable]` attribute. * Allow usage of other unstable crates via `feature(rustc_private)` which is required if the crate relies on any other crates to compile (other than std).
2017-03-23move `export_map` into the tcxNiko Matsakis-3/+3
2017-03-23Rollup merge of #40668 - cramertj:on-demandify-more, r=nikomatsakisCorey Farwell-0/+1
On-demandify associated item retrieval Part of #40614. I also started converting `adt_def`, but I decided to open a PR with just this bit first to make sure I'm going about this correctly. r? @nikomatsakis
2017-03-22Rollup merge of #40678 - michaelwoerister:dmi-prep, r=nikomatsakisCorey Farwell-1/+1
Some preparations for directly computing the ICH of crate-metadata. This PR contains some small fixes in preparation for direct metadata hashing. It mostly just moves stuff into places where it will be needed (making the module structure slightly cleaner along the way) and it fixes some omissions in the MIR region eraser. r? @nikomatsakis
2017-03-23save-analysis: allow clients to get data directly without writing to a fileNick Cameron-6/+5
2017-03-22Move Fingerprint to rustc::ich::Fingerprint.Michael Woerister-1/+1
2017-03-21Teach rustc --emit=mirJake Goulding-0/+7
2017-03-20On-demandify associated item retrievalTaylor Cramer-0/+1
2017-03-18move the drop expansion code to rustc_mirAriel Ben-Yehuda-2/+1
2017-03-12Improve wording in the -{W,A,F,D} optionsTobias Schottdorf-1/+1
Fixes #28708.
2017-03-12Auto merge of #40446 - arielb1:rollup, r=alexcrichtonbors-1/+1
Rollup of 12 pull requests - Successful merges: #40146, #40299, #40315, #40319, #40344, #40345, #40372, #40373, #40400, #40404, #40419, #40431 - Failed merges:
2017-03-11Auto merge of #40220 - jseyfried:ast_macro_def, r=nrcbors-3/+0
syntax: add `ast::ItemKind::MacroDef`, simplify hygiene info This PR - adds a new variant `MacroDef` to `ast::ItemKind` for `macro_rules!` and eventually `macro` items, - [breaking-change] forbids macro defs without a name (`macro_rules! { () => {} }` compiles today), - removes `ast::MacroDef`, and - no longer uses `Mark` and `Invocation` to identify and characterize macro definitions. - We used to apply (at least) two `Mark`s to an expanded identifier's `SyntaxContext` -- the definition mark(s) and the expansion mark(s). We now only apply the latter. r? @nrc
2017-03-11Rollup merge of #40431 - fsasm:master, r=BurntSushiAriel Ben-Yehuda-1/+1
rustc: Whitelist the FMA target feature This commit adds the entry `"fma\0"` to the whitelist for the x86 target. LLVM already supports fma but rustc did not directly. Previously rustc permitted `+fma` in the target-feature argument and enabled the use of FMA instructions, but it did not list it in the configuration and attributes. fixes #40406
2017-03-11Auto merge of #39648 - Aatch:mir-inlining-2, r=eddybbors-0/+1
[MIR] Implement Inlining Fairly basic implementation of inlining for MIR. Uses conservative heuristics for inlining. Doesn't handle a number of cases, but can be extended later. This is basically the same as the previous inlining PR, but without the span-related changes (as the bugs it was dealing with have since been fixed). /cc @rust-lang/compiler
2017-03-10Rollup merge of #40336 - alexcrichton:fast-dep-info, r=nrcAlex Crichton-0/+4
rustc: Exit quickly on only `--emit dep-info` This commit alters the compiler to exit quickly if the only output being emitted is `dep-info`, which doesn't need a lot of other information to generate. Closes #40328
2017-03-10rustc: Whitelist the FMA target featureFabjan Sukalia-1/+1
This commit adds the entry `"fma\0"` to the whitelist for the x86 target. LLVM already supports fma but rustc did not directly. Previously rustc permitted `+fma` in the target-feature argument and enabled the use of FMA instructions, but it did not list it in the configuration and attributes. fixes #40406
2017-03-10rustc: Exit quickly on only `--emit dep-info`Alex Crichton-0/+4
This commit alters the compiler to exit quickly if the only output being emitted is `dep-info`, which doesn't need a lot of other information to generate. Closes #40328
2017-03-10Remove ability for plugins to register a MIR passSimonas Kazlauskas-2/+1
In recent months there have been a few different people investigating how to make a plugin that registers a MIR-pass – one that isn’t intended to be eventually merged into rustc proper. The interface to register MIR passes was added primarily for miri (& later was found to make prototyping of rustc-proper MIR passes a tiny bit faster). Since miri does not use this interface anymore it seems like a good time to remove this "feature". For prototyping purposes a similar interface can be added by developers themselves in their custom rustc build.
2017-03-10Refactor out `ast::ItemKind::MacroDef`.Jeffrey Seyfried-3/+0