about summary refs log tree commit diff
path: root/src/librustc_metadata
AgeCommit message (Collapse)AuthorLines
2017-09-11rustc: intern ConstVal's in TyCtxt.Eduard-Mihai Burtescu-0/+15
2017-09-10Autodetect the type of allocator crate usedMichal 'vorner' Vaner-36/+63
Annotate the allocator crates (allocator_system, allocator_jemalloc) by the type of allocator they are. If one is requested as an exe allocator, detect its type by the flags. This has the effect that using this (de jure wrong) configuration in the target spec works instead of producing a really unhelpful and arcane linker error: "exe-allocation-crate": "alloc_system" Fixes #43524.
2017-09-09rustc: Remove `DepGraph` handling from rustc_metadataAlex Crichton-238/+95
This should now be entirely tracked through queries, so no need to have a `DepGraph` in the `CStore` object any more!
2017-09-07rustc: Remove `CrateStore::crates` as a methodAlex Crichton-3/+8
This commit moves the `crates` method to a query and then migrates all callers to use a query instead of the now-renamed `crates_untracked` method where possible. Closes #41417
2017-09-05Clarify failure condition on testsAlex Crichton-3/+3
2017-09-05rustc: Store InternedString in `DefPathData`Alex Crichton-10/+10
Previously a `Symbol` was stored there, but this ended up causing hash collisions in situations that otherwise shouldn't have a hash collision. Only the symbol's string value was hashed, but it was possible for distinct symbols to have the same string value, fooling various calcuations into thinking that these paths *didn't* need disambiguating data when in fact they did! By storing `InternedString` instead we're hopefully triggering all the exising logic to disambiguate paths with same-name `Symbol` but actually distinct locations.
2017-09-05rustc: Move stability functionality into queriesAlex Crichton-2/+10
This commit primarily removes the `stability` field from `TyCtxt` as well as its internal mutable state, instead using a query to build the stability index as well as primarily using queries for other related lookups. Like previous commits the calculation of the stability index is wrapped in a `with_ignore` node to avoid regressing the current tests, and otherwise this commit also introduces #44232 but somewhat intentionally so.
2017-09-05rustc: Rename item_body query to extern_const_bodyAlex Crichton-9/+6
Should hopefully more accurately reflect what's happening! This commit also removes the cache in the cstore implementation as it's already cached through the query infrastructure.
2017-09-05rustc: Remove `CrateStore::used_crate*`Alex Crichton-56/+17
This commit removes the `use_crates` and `used_crate_source` methods in favor of a mix of queries and helper methods being used now instead.
2017-09-05rustc: Classify two more CrateStore methods untrackedAlex Crichton-2/+2
These are only called pre-TyCtxt (e.g. lowering/resolve), so make it explicit in the name that they're untracked and therefore unsuitable to called elsewhere.
2017-09-05rustc: Migrate `visible_parent_map` to a queryAlex Crichton-66/+66
Turns out it was basically already a query if you squinted hard enough!
2017-09-05rustc: Migrate `CrateStore::item_body` to a queryAlex Crichton-15/+8
This commit migrates the `item_body` method on `CrateStore` to a query instead to enable better tracking of dependencies and whatnot.
2017-09-05rustc: Remove lang item methods from CrateStoreAlex Crichton-13/+3
Given the previous commit, these are now trivially representable as queries!
2017-09-05rustc: Migrate lang items to a queryAlex Crichton-3/+4
This commit moves the calculation of the `LanguageItems` structure into a query rather than being calculated before the `TyCtxt` exists, with the eventual end goal of removing some `CrateStore` methods.
2017-09-05rustc: Flag some CrateStore methods as "untracked"Alex Crichton-13/+24
The main use of `CrateStore` *before* the `TyCtxt` is created is during resolution, but we want to be sure that any methods used before resolution are not used after the `TyCtxt` is created. This commit starts moving the methods used by resolve to all be named `{name}_untracked` where the rest of the compiler uses just `{name}` as a query. During this transition a number of new queries were added to account for post-resolve usage of these methods.
2017-09-05rustc: Remove a number of mutable fields in cstoreAlex Crichton-288/+325
This commit started by moving methods from `CrateStore` to queries, but it ended up necessitating some deeper refactorings to move more items in general to queries. Before this commit the *resolver* would walk over the AST and process foreign modules (`extern { .. }` blocks) and collect `#[link]` annotations. It would then also process the command line `-l` directives and such. This information was then stored as precalculated lists in the `CrateStore` object for iterating over later. After this, commit, however, this pass no longer happens during resolution but now instead happens through queries. A query for the linked libraries of a crate will crawl the crate for `extern` blocks and then process the linkage annotations at that time.
2017-09-05rustc: Move implementations_of_trait to a queryAlex Crichton-20/+31
While we're at it, make it two separate queries so one's for rustdoc and one's for the compiler, hopefully being a bit more targeted.
2017-09-05rustc: Move original_crate_name to a queryAlex Crichton-6/+2
2017-09-05rustc: Move crate_hash to a queryAlex Crichton-11/+1
2017-09-05rustc: Move crate_disambiguator to queriesAlex Crichton-5/+3
2017-09-05rustc: Move {plugin,derive}_registrar_fn to queriesAlex Crichton-16/+10
2017-09-05rustc: Migrate `CStore::native_libraries` to a queryAlex Crichton-5/+1
2017-09-05rustc: Migrate `CStore::expored_symbols` to a queryAlex Crichton-5/+1
2017-09-05rustc: Move `impl_defaultness` to a queryAlex Crichton-6/+1
2017-09-05rustc: Move a few more cstore methods to queriesAlex Crichton-23/+21
This comit applies the following changes: * Deletes the `is_allocator` query as it's no longer used * Moves the `is_sanitizer_runtime` method to a query * Moves the `is_profiler_runtime` method to a query * Moves the `panic_strategy` method to a query * Moves the `is_no_builtins` method to a query * Deletes the cstore method of `is_compiler_builtins`. The query was added in #42588 but the `CrateStore` method was not deleted A good bit of these methods were used late in linking during trans so a new dedicated structure was created to ship a calculated form of this information over to the linker rather than having to ship the whole of `TyCtxt` over to linking.
2017-09-03Auto merge of #44263 - durka:stabilize-discriminant, r=dtolnaybors-1/+0
stabilize mem::discriminant (closes #24263)
2017-09-02stabilize mem::discriminant (closes #24263)Alex Burka-1/+0
2017-09-02rustc_mir: actually "promote" constants' MIR to 'static by removing ↵Eduard-Mihai Burtescu-4/+7
StorageDead's.
2017-08-30Merge branch 'hide-trait-map' into rollupAlex Crichton-2/+3
2017-08-29rustc: Make the `export_map` of TyCtxt privateAlex Crichton-2/+3
This map, like `trait_map`, is calculated in resolve, but we want to be sure to track it for incremental compliation. Hide it behind a query to get more refactorings later.
2017-08-30Make fields of `Span` privateVadim Petrochenkov-3/+3
2017-08-28Merge branch 'master' of https://github.com/rust-lang/rust into genJohn Kåre Alsaker-5/+2
2017-08-27Move unused-extern-crate to late passTatsuyuki Ishi-2/+2
2017-08-25*: remove crate_{name,type} attributesTamir Duberstein-3/+0
Fixes #41701.
2017-08-25Merge remote-tracking branch 'origin/master' into genAlex Crichton-1/+1
2017-08-23Auto merge of #42565 - murarth:rc-from-slice, r=aturonbors-1/+1
Implement From<&[T]> and others for Arc/Rc (RFC 1845) * Implements `From<`{`&[T]`, `&str`, `String`, `Box<T> where T: ?Sized`, `Vec<T>`}`>` for `Arc`/`Rc` * Removes `rustc_private`-marked methods `Rc::__from_array` and `Rc::__from_str`, replacing their use with `Rc::from` Tracking issue: #40475
2017-08-21Merge remote-tracking branch 'origin/master' into genAlex Crichton-41/+1
2017-08-19Implement `From<&[T]>` and others for `Arc`/`Rc`Murarth-1/+1
Implements RFC 1845, adding implementations of: * `From<&[T]>` for `Rc<[T]>` * `From<&str>` for `Rc<str>` * `From<String>` for `Rc<str>` * `From<Box<T: ?Sized>>` for `Rc<T>` * `From<Vec<T>>` for `Rc<[T]>` * and likewise for `Arc<_>` Also removes now-obsolete internal methods `Rc::__from_array` and `Rc::__from_str`, replacing their use with `Rc::from`.
2017-08-19rustc: Remove some dead codeVadim Petrochenkov-41/+1
2017-08-16Merge remote-tracking branch 'origin/master' into genAlex Crichton-72/+72
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-72/+72
Like #43008 (f668999), but _much more aggressive_.
2017-08-11Merge remote-tracking branch 'origin/master' into genAlex Crichton-1/+1
2017-08-11Rollup merge of #43739 - ibabushkin:master, r=eddybGuillaume Gomez-1/+1
Encode proper module spans in crate metadata. The spans previously encoded only span the first token after the opening brace, up to the closing brace of inline `mod` declarations. Thus, when examining exports from an external crate, the spans don't include the header of inline `mod` declarations. r? @eddyb
2017-08-10Merge remote-tracking branch 'origin/master' into genAlex Crichton-1/+1
2017-08-09Merge remote-tracking branch 'origin/master' into genAlex Crichton-7/+6
2017-08-08Encode proper spans in crate metadata.Inokentiy Babushkin-1/+1
The spans previously encoded only span the first token after the opening brace, up to the closing brace of inline `mod` declarations. Thus, when examining exports from an external crate, the spans don't include the header of inline `mod` declarations.
2017-08-01Fixed all unnecessary muts in language coreIsaac van Bakel-1/+1
2017-07-31async-llvm(18): Instantiate OngoingCrateTranslation before starting translation.Michael Woerister-7/+5
2017-07-28syntax: Add `tokens: Option<TokenStream>` to ItemAlex Crichton-0/+1
This commit adds a new field to the `Item` AST node in libsyntax to optionally contain the original token stream that the item itself was parsed from. This is currently `None` everywhere but is intended for use later with procedural macros.
2017-07-28Generator literal supportJohn Kåre Alsaker-4/+44