summary refs log tree commit diff
path: root/src/librustc_driver
AgeCommit message (Collapse)AuthorLines
2017-06-01fix librustc_driver testsNiko Matsakis-16/+14
2017-05-24Rollup merge of #42150 - citizen428:feature/error-count-messages, ↵Mark Simulacrum-2/+1
r=Mark-Simulacrum Change error count messages See #33525 for details. r? @Mark-Simulacrum
2017-05-24Change error count messagesMichael Kohl-2/+1
See #33525 for details.
2017-05-23Rollup merge of #42016 - pietroalbini:stabilize/loop_break_value, r=nikomatsakisCorey Farwell-1/+1
Stabilize the loop_break_value feature Tracking issue: #37339. Documentation PRs already sent to the various repositories.
2017-05-18Give a nicer error for non-Unicode arguments to rustc and rustdocJosh Stone-1/+10
Previously, any non-Unicode argument would panic rustc: ``` $ rustc $'foo\x80bar' error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: "foo�bar"', /checkout/src/libcore/result.rs:859 note: Run with `RUST_BACKTRACE=1` for a backtrace. ``` Now it gives a clean error: ``` $ rustc $'foo\x80bar' error: Argument 1 is not valid Unicode: "foo�bar" ``` Maybe fixes #15890, although we still can't *compile* arbitrary file names.
2017-05-17Auto merge of #41911 - michaelwoerister:querify_trait_def, r=nikomatsakisbors-0/+3
Remove interior mutability from TraitDef by turning fields into queries This PR gets rid of anything `std::cell` in `TraitDef` by - moving the global list of trait impls from `TraitDef` into a query, - moving the list of trait impls relevent for some self-type from `TraitDef` into a query - moving the specialization graph of trait impls into a query, and - moving `TraitDef::object_safety` into a query. I really like how querifying things not only helps with incremental compilation and on-demand, but also just plain makes the code cleaner `:)` There are also some smaller fixes in the PR. Commits can be reviewed separately. r? @eddyb or @nikomatsakis
2017-05-17Stabilize the loop_break_value featurePietro Albini-1/+1
2017-05-16Auto merge of #41907 - est31:macro_unused, r=jseyfriedbors-0/+2
Add lint for unused macros Addresses parts of #34938, to add a lint for unused macros. We now output warnings by default when we encounter a macro that we didn't use for expansion. Issues to be resolved before this PR is ready for merge: - [x] fix the NodeId issue described above - [x] remove all unused macros from rustc and the libraries or set `#[allow(unused_macros)]` next to them if they should be kept for some reason. This is needed for successful boostrap and bors to accept the PR. -> #41934 - [x] ~~implement the full extent of #34938, that means the macro match arm checking as well.~~ *let's not do this for now*
2017-05-15Remove interior mutability from TraitDef by turning fields into queries.Michael Woerister-0/+3
2017-05-15Remove (direct) rustc_llvm dependency from rustc_driverRobin Kruppe-49/+11
This does not actually improve build times, since it still depends on rustc_trans, but is better layering and fits the multi-backend future slightly better.
2017-05-15Remove rustc_llvm dependency from librustcRobin Kruppe-0/+3
Consequently, session creation can no longer initialize LLVM. The few places that use the compiler without going through rustc_driver/CompilerCalls thus need to be careful to manually initialize LLVM (via rustc_trans!) immediately after session creation. This means librustc is not rebuilt when LLVM changes.
2017-05-14Remove rustc_llvm dependency from rustc_metadataRobin Kruppe-4/+9
Move the code for loading metadata from rlibs and dylibs from rustc_metadata into rustc_trans, and introduce a trait to avoid introducing a direct dependency on rustc_trans. This means rustc_metadata is no longer rebuilt when LLVM changes.
2017-05-13rustc: stop interning CodeExtent, it's small enough.Eduard-Mihai Burtescu-6/+5
2017-05-13rustc: treat ReEarlyBound as free without replacing it with ReFree.Eduard-Mihai Burtescu-2/+3
2017-05-13rustc: use DefId instead of CodeExtent for FreeRegion's scope.Eduard-Mihai Burtescu-14/+14
2017-05-13Add lint for unused macrosest31-0/+2
2017-05-13Auto merge of #41847 - alexcrichton:less-unstable-annotations, r=eddybbors-5/+6
rustc: Add a new `-Z force-unstable-if-unmarked` flag This commit adds a new `-Z` flag to the compiler for use when bootstrapping the compiler itself. We want to be able to use crates.io crates, but we also want the usage of such crates to be as ergonomic as possible! To that end compiler crates are a little tricky in that the crates.io crates are not annotated as unstable, nor do they expect to pull in unstable dependencies. To cover all these situations it's intended that the compiler will forever now bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose of forcing crates.io crates to themselves be unstable while also allowing them to use other "unstable" crates.io crates. This should mean that adding a dependency to compiler no longer requires upstream modification with unstable/staged_api attributes for inclusion!
2017-05-12Auto merge of #41757 - alexcrichton:stabilize-crt-static, r=japaricbors-14/+16
rustc: Stabilize `-C target-feature=+crt-static` This commit stabilizes the `crt-static` feature accepted by the compiler. Note that this does not stabilize the `#[cfg]` attribute for `crt-static` as that's going to be covered by #29717. This only stabilizes a few small pieces: * The `crt-static` feature as accepted by the `-C target-feature` flag, and its connection with the platform-specific definition of `crt-static`. * The semantics of `--print cfg` printing out activated `crt-static` feature, if available. This should be enough to get the benefits of `crt-static` on stable Rust with MSVC and with musl, but sidsteps the issue of stabilizing #29717 first. Closes #37406
2017-05-11rustc: Remove #![unstable] annotationAlex Crichton-3/+4
These are now no longer necessary with `-Z force-unstable-if-unmarked`
2017-05-10rustc: Add a new `-Z force-unstable-if-unmarked` flagAlex Crichton-2/+2
This commit adds a new `-Z` flag to the compiler for use when bootstrapping the compiler itself. We want to be able to use crates.io crates, but we also want the usage of such crates to be as ergonomic as possible! To that end compiler crates are a little tricky in that the crates.io crates are not annotated as unstable, nor do they expect to pull in unstable dependencies. To cover all these situations it's intended that the compiler will forever now bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose of forcing crates.io crates to themselves be unstable while also allowing them to use other "unstable" crates.io crates. This should mean that adding a dependency to compiler no longer requires upstream modification with unstable/staged_api attributes for inclusion!
2017-05-08incr.comp.: Hash more pieces of crate metadata to detect changes there.Michael Woerister-2/+1
2017-05-07Add support for Hexagon v60 HVX intrinsicsMichael Wu-0/+3
2017-05-04rustc: Stabilize `-C target-feature=+crt-static`Alex Crichton-14/+16
This commit stabilizes the `crt-static` feature accepted by the compiler. Note that this does not stabilize the `#[cfg]` attribute for `crt-static` as that's going to be covered by #29717. This only stabilizes a few small pieces: * The `crt-static` feature as accepted by the `-C target-feature` flag, and its connection with the platform-specific definition of `crt-static`. * The semantics of `--print cfg` printing out activated `crt-static` feature, if available. This should be enough to get the benefits of `crt-static` on stable Rust with MSVC and with musl, but sidsteps the issue of stabilizing #29717 first. Closes #37406
2017-05-02remove `mir_passes` from `Session` and add a FIXMENiko Matsakis-3/+4
2017-05-02fix librustc_driverNiko Matsakis-0/+1
2017-05-02pacify the mercilous tidyNiko Matsakis-1/+2
2017-05-02support inlining by asking for optimizer mir for calleesNiko Matsakis-1/+1
I tested this with it enabled 100% of the time, and we were able to run mir-opt tests successfully.
2017-05-02remove `Pass` and (temporarily) drop `Inline`Niko Matsakis-1/+1
2017-05-02rename `mir_map` to `queries` and remove `build_mir_for_crate`Niko Matsakis-10/+1
2017-05-02convert the `inline` pass to use the new multi resultNiko Matsakis-1/+1
This involves changing various details about that system, though the basic shape remains the same.
2017-05-02retool MIR passes completelyNiko Matsakis-19/+0
The new setup is as follows. There is a pipeline of MIR passes that each run **per def-id** to optimize a particular function. You are intended to request MIR at whatever stage you need it. At the moment, there is only one stage you can request: - `optimized_mir(def_id)` This yields the final product. Internally, it pulls the MIR for the given def-id through a series of steps. Right now, these are still using an "interned ref-cell" but they are intended to "steal" from one another: - `mir_build` -- performs the initial construction for local MIR - `mir_pass_set` -- performs a suite of optimizations and transformations - `mir_pass` -- an individual optimization within a suite So, to construct the optimized MIR, we invoke: mir_pass_set((MIR_OPTIMIZED, def_id)) which will build up the final MIR.
2017-05-02move to only def-id passesNiko Matsakis-1/+1
this temporary disables `inline`
2017-05-02rewrite `Passes` to have sets of passesNiko Matsakis-36/+38
Also, store the completed set of passes in the tcx.
2017-05-02introduce `DefIdPass` and remove all impls of `Pass` but `Inline`Niko Matsakis-22/+22
2017-05-02simplify the MirPass traits and passes dramaticallyNiko Matsakis-2/+1
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-02rework `MirPass` API to be stateless and extract helper fnsNiko Matsakis-1/+1
2017-05-02introduce `mir_keys()`Niko Matsakis-13/+4
Each MIR key is a DefId that has MIR associated with it
2017-05-02Rollup merge of #41693 - est31:anon_params_removal, r=eddybCorey Farwell-1/+1
Removal pass for anonymous parameters Removes occurences of anonymous parameters from the rustc codebase, as they are to be deprecated. See issue #41686 and RFC 1685. r? @frewsxcv
2017-05-02Removal pass for anonymous parametersest31-1/+1
Removes occurences of anonymous parameters from the rustc codebase, as they are to be deprecated. See issue #41686 and RFC 1685.
2017-05-01patch the `librustc_driver` unit testsNiko Matsakis-28/+25
2017-04-30introduce per-fn RegionMapsTaylor Cramer-5/+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-30intern CodeExtentsNiko Matsakis-4/+4
Make a `CodeExtent<'tcx>` be something allocated in an arena instead of an index into the `RegionMaps`.
2017-04-30On-demandify region mappingTaylor Cramer-5/+6
2017-04-28Auto merge of #41508 - michaelwoerister:generic-path-remapping, r=alexcrichtonbors-3/+3
Implement a file-path remapping feature in support of debuginfo and reproducible builds This PR adds the `-Zremap-path-prefix-from`/`-Zremap-path-prefix-to` commandline option pair and is a more general implementation of #41419. As opposed to the previous attempt, this implementation should enable reproducible builds regardless of the working directory of the compiler. This implementation of the feature is more general in the sense that the re-mapping will affect *all* paths the compiler emits, including the ones in error messages. r? @alexcrichton
2017-04-26cache symbol names in ty::mapsAriel Ben-Yehuda-2/+2
this fixes a performance regression introduced in commit 39a58c38a0b9ac9e822a1732f073abe8ddf65cfb.
2017-04-26Implement a file-path remapping feature in support of debuginfo and ↵Michael Woerister-3/+3
reproducible builds.
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.