summary refs log tree commit diff
path: root/src/librustc_metadata/creader.rs
AgeCommit message (Collapse)AuthorLines
2019-12-11Rollup merge of #67074 - ehuss:extern-options, r=petrochenkovMazdak Farrokhzad-7/+8
Add options to --extern flag. This changes the `--extern` flag so that it can take a series of options that changes its behavior. The general syntax is `[opts ':'] name ['=' path]` where `opts` is a comma separated list of options. Two options are supported, `priv` which replaces `--extern-private` and `noprelude` which avoids adding the crate to the extern prelude. ```text --extern priv:mylib=/path/to/libmylib.rlib --extern noprelude:alloc=/path/to/liballoc.rlib ``` `noprelude` is to be used by Cargo's build-std feature in order to use `--extern` to reference standard library crates. This also includes a second commit which adds the `aux-crate` directive to compiletest. I can split this off into a separate PR if desired, but it helps with defining these kinds of tests. It is based on #54020, and can be used in the future to replace and simplify some of the Makefile tests.
2019-12-09Add options to --extern flag.Eric Huss-7/+8
2019-12-06Rename to `then_some` and `then`varkor-1/+1
2019-12-06Use `to_option` in various placesvarkor-5/+2
2019-11-28rustc: Move some queries to `rustc_metadata`Vadim Petrochenkov-0/+5
2019-11-28rustc_metadata: Avoid some side effects during speculative crate resolutionVadim Petrochenkov-28/+5
Namely, `update_extern_crate`. Also, stop tracking visited crates in `update_extern_crate`, the rank check does the same thing (prevents visiting dependencies if the rank didn't change), but more precisely.
2019-11-28rustc_metadata: Pass SVH by valueVadim Petrochenkov-6/+5
2019-11-28rustc_metadata: Move `has_global_allocator` from session to cstoreVadim Petrochenkov-17/+16
2019-11-28rustc_metadata: Privatize some fields and methods of `CStore`Vadim Petrochenkov-5/+13
After it's moved to `creader.rs`
2019-11-28rustc_metadata: Merge `cstore.rs` into `creader.rs`Vadim Petrochenkov-16/+93
2019-11-28rustc_metadata: Privatize `CrateMetadata::root`Vadim Petrochenkov-15/+15
2019-11-28rustc_metadata: Privatize all fields of `CrateRoot`Vadim Petrochenkov-34/+33
All of them are read-only
2019-11-28rustc_metadata: Privatize `CrateMetadata::dep_kind`Vadim Petrochenkov-5/+3
2019-11-28rustc_metadata: Privatize `CrateMetadata::source`Vadim Petrochenkov-5/+5
2019-11-28rustc_metadata: Privatize `CrateMetadata::extern_crate`Vadim Petrochenkov-30/+6
2019-11-28rustc_metadata: Privatize `CrateMetadata::dependencies`Vadim Petrochenkov-2/+2
2019-11-28rustc_metadata: Cleanup generation of crate dependency listsVadim Petrochenkov-1/+1
2019-11-25Tweak multiple allocators errorEsteban Küber-1/+3
2019-11-17rustc_metadata: Stop leaking `Lazy` from the `rmeta` moduleVadim Petrochenkov-6/+8
2019-11-17rustc_metadata: Move `CrateMetadata` into `decoder.rs`Vadim Petrochenkov-8/+8
It allows to make most of its fields private
2019-11-17rustc_metadata: Give a constructor to `CratePaths`Vadim Petrochenkov-1/+1
2019-11-17rustc_metadata: Minor cleanupVadim Petrochenkov-1/+1
2019-11-17rustc_metadata: Give a constructor to `CrateMetadata`Vadim Petrochenkov-34/+9
2019-11-17rustc_metadata: Give a constructor to `CrateLocator`Vadim Petrochenkov-16/+9
2019-11-17rustc_metadata: `locator::Context` -> `CrateLocator`Vadim Petrochenkov-17/+17
2019-11-17rustc_metadata: Move some structs from `cstore` to `decoder`Vadim Petrochenkov-2/+2
This allows to privatize their fields.
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-0/+2
2019-11-11Move allocator_kind to CrateStoreMark Rousskov-5/+5
Similarly to the previous commit, there's no need for this to be in Session and have a Once around it.
2019-11-11Move injected_panic_runtime to CrateStoreMark Rousskov-3/+3
This was essentially a "query" previously (with no key, just always run once when resolving the crate dependencies), and remains so, just now in a way that isn't on Session. This removes the need for the `Once` as well.
2019-11-07rustc_metadata: Rename `schema` to `rmeta`Vadim Petrochenkov-1/+1
And change `rmeta.rs` to `rmeta/mod.rs`
2019-11-02Simplify various `Symbol` use points.Nicholas Nethercote-1/+1
Including removing a bunch of unnecessary `.as_str()` calls, and a bunch of unnecessary sigils.
2019-10-31Implement dual proc macro hashingmsizanoen-7/+13
This changes the mechanism of `-Z dual-proc-macro` to record the host proc macro hash in the transistive dependency information and use it during dependency resolution instead of resolving only by name.
2019-10-30Change CrateMetadata's source_map_import_info from RwLock to OnceSantiago Pastorino-2/+2
This field is created lazily on first use and after that is read only. That's exactly what Once is for.
2019-10-27rustc, rustc_passes: don't depend on syntax_expand.Mazdak Farrokhzad-1/+1
This is done by moving some data definitions to syntax::expand.
2019-10-24rustc_metadata: Minimize use of `Lrc` in crate storeVadim Petrochenkov-18/+19
Crate metadatas are still stored as `Lrc<CrateMetadata>` in `CStore` because crate store has to be cloneable due to `Resolver::clone_outputs`.
2019-10-24rustc_metadata: Remove `RwLock` from `CStore`Vadim Petrochenkov-11/+15
2019-10-24Turn crate store into a resolver outputVadim Petrochenkov-5/+21
2019-10-24rustc_metadata: Move some code aroundVadim Petrochenkov-95/+3
Plugin search doesn't need a crate loader, only crate locator
2019-10-24rustc_metadata: Remove unnecessary use of crate store in plugin loaderVadim Petrochenkov-63/+31
2019-10-20Auto merge of #65497 - choller:master, r=tmiaskobors-1/+1
Avoid injecting sanitizer runtimes into staticlibs (#64629). This fixes the remaining issue in `creader.rs` and also fixes the expected test failure. I have explicitly turned the `$(CC)` call into a negative check with the `!` to ensure that this command is really failing (if it is not, then either the runtime is attached to the lib or the lib has not been instrumented and both would be an error). I've also borrowed `program.rs` and the additional `rustc` invocation from @tmiasko 's PR since he pointed out that using `-fsanitize=address` with `$(CC)` for linking could fail if the sanitizer runtimes on the system are incompatible. With this toolchain I was able to compile Firefox locally without any linker errors. I am still seeing races with Rust in TSan but I assume that is because I did not build with `-Z build-std`.
2019-10-17Avoid injecting sanitizer runtimes into staticlibs (#64629).Christian Holler (:decoder)-1/+1
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-1/+1
2019-10-14rustc_metadata: Remove resolutions for extern crate items from `CStore`Vadim Petrochenkov-1/+0
Use a more traditional scheme with providing them as a resolver output
2019-10-14rustc_metadata: Crate loader is immutableVadim Petrochenkov-27/+17
2019-10-14rustc_metadata: Use `CrateSource` where appropriateVadim Petrochenkov-23/+11
2019-10-14rustc_metadata: Privatize private code and remove dead codeVadim Petrochenkov-6/+5
2019-10-09self-profiling: Add events for tracking crate metadata loading related ↵Michael Woerister-0/+3
activities.
2019-10-09Cache the DepNodeIndex of upstream crates in order to avoid multiple locks ↵Michael Woerister-2/+4
and table lookups on each access of crate metadata.
2019-10-04metadata: Remove unused `Option` from `fn dlsym_proc_macros`Vadim Petrochenkov-15/+12
2019-10-04metadata: Remove `CrateMetadata::name`Vadim Petrochenkov-3/+2
It duplicates `CrateRoot::name`