summary refs log tree commit diff
path: root/src/librustc/dep_graph
AgeCommit message (Collapse)AuthorLines
2018-03-25Rollup merge of #49299 - SimonSapin:ubiquity, r=nikomatsakiskennytm-2/+0
Stabilize the copy_closures and clone_closures features In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do. Tracking issue: https://github.com/rust-lang/rust/issues/44490
2018-03-23Stabilize the copy_closures and clone_closures featuresSimon Sapin-2/+0
In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do.
2018-03-22rustc: Add a `#[wasm_import_module]` attributeAlex Crichton-0/+3
This commit adds a new attribute to the Rust compiler specific to the wasm target (and no other targets). The `#[wasm_import_module]` attribute is used to specify the module that a name is imported from, and is used like so: #[wasm_import_module = "./foo.js"] extern { fn some_js_function(); } Here the import of the symbol `some_js_function` is tagged with the `./foo.js` module in the wasm output file. Wasm-the-format includes two fields on all imports, a module and a field. The field is the symbol name (`some_js_function` above) and the module has historically unconditionally been `"env"`. I'm not sure if this `"env"` convention has asm.js or LLVM roots, but regardless we'd like the ability to configure it! The proposed ES module integration with wasm (aka a wasm module is "just another ES module") requires that the import module of wasm imports is interpreted as an ES module import, meaning that you'll need to encode paths, NPM packages, etc. As a result, we'll need this to be something other than `"env"`! Unfortunately neither our version of LLVM nor LLD supports custom import modules (aka anything not `"env"`). My hope is that by the time LLVM 7 is released both will have support, but in the meantime this commit adds some primitive encoding/decoding of wasm files to the compiler. This way rustc postprocesses the wasm module that LLVM emits to ensure it's got all the imports we'd like to have in it. Eventually I'd ideally like to unconditionally require this attribute to be placed on all `extern { ... }` blocks. For now though it seemed prudent to add it as an unstable attribute, so for now it's not required (as that'd force usage of a feature gate). Hopefully it doesn't take too long to "stabilize" this! cc rust-lang-nursery/rust-wasm#29
2018-03-22rustc: Add a `#[wasm_custom_section]` attributeAlex Crichton-0/+2
This commit is an implementation of adding custom sections to wasm artifacts in rustc. The intention here is to expose the ability of the wasm binary format to contain custom sections with arbitrary user-defined data. Currently neither our version of LLVM nor LLD supports this so the implementation is currently custom to rustc itself. The implementation here is to attach a `#[wasm_custom_section = "foo"]` attribute to any `const` which has a type like `[u8; N]`. Other types of constants aren't supported yet but may be added one day! This should hopefully be enough to get off the ground with *some* custom section support. The current semantics are that any constant tagged with `#[wasm_custom_section]` section will be *appended* to the corresponding section in the final output wasm artifact (and this affects dependencies linked in as well, not just the final crate). This means that whatever is interpreting the contents must be able to interpret binary-concatenated sections (or each constant needs to be in its own custom section). To test this change the existing `run-make` test suite was moved to a `run-make-fulldeps` folder and a new `run-make` test suite was added which applies to all targets by default. This test suite currently only has one test which only runs for the wasm target (using a node.js script to use `WebAssembly` in JS to parse the wasm output).
2018-03-22Rollup merge of #49069 - wesleywiser:incr_soa, r=michaelwoeristerkennytm-9/+12
Convert SerializedDepGraph to be a struct-of-arrays Fixes #47326 I did not try the "`mem::swap()` to avoid copying the arrays" idea because that would leave the DepGraph in an incorrect state and that doesn't seem like a good idea for me. r? @michaelwoerister
2018-03-22Rollup merge of #48939 - wesleywiser:incr_query_wf_checking, r=michaelwoeristerkennytm-0/+3
Querify WF-checking so it can be cached r? @michaelwoerister
2018-03-19Convert SerializedDepGraph to be a struct-of-arraysWesley Wiser-9/+12
Fixes #47326
2018-03-20Rollup merge of #49092 - mark-i-m:deptrack_readme, r=nikomatsakiskennytm-294/+3
Replace many of the last references to readmes In particular, this removes the dep track readme, so it should not be merged before https://github.com/rust-lang-nursery/rustc-guide/pull/92 Fix #47935 cc #48478 r? @nikomatsakis
2018-03-18Auto merge of #48985 - scalexm:lowering, r=nikomatsakisbors-0/+2
MVP for chalkification r? @nikomatsakis
2018-03-16Replace many of the last references to readmesMark Mansi-294/+3
2018-03-16incr.comp.: Make sanity check in try_mark_green() aware of error conditions.Michael Woerister-2/+9
2018-03-15Queryify check_impl_item_well_formedWesley Wiser-0/+1
Fixes #46753
2018-03-15Queryify check_trait_item_well_formedWesley Wiser-0/+1
Fixes #46753
2018-03-15Queryify check_item_well_formedWesley Wiser-0/+1
Fixes #46753
2018-03-14Add MVP for chalkificationscalexm-0/+2
2018-03-13transition various normalization functions to the new methodsNiko Matsakis-1/+0
In particular: - `fully_normalize_monormophic_ty` => `normalize_erasing_regions` - `normalize_associated_type_in_env` => `normalize_erasing_regions` - `fully_normalize_associated_types_in` => `normalize_erasing_regions` - `erase_late_bound_regions_and_normalize` => `normalize_erasing_late_bound_regions`
2018-03-13introduce `infcx.at(..).dropck_outlives(..)` operaton [VIC]Niko Matsakis-1/+3
Backed by a canonicalized query. This computes all the types/regions that need to be live when the destructor runs (i.e., that the dtor may access).
2018-03-13introduce `infcx.at(..).normalize(..)` operation [VIC]Niko Matsakis-2/+4
It is backed by the new `normalize_projection_ty` query, which uses canonicalization.
2018-03-13in `Foo(X)` dep-nodes, allow X to be a `ty` not a `tt`Niko Matsakis-21/+24
Before, the identifier `X` was also used when generating a pattern to match against the dep-node. So `Foo(DefId)` would generate a match pattern like: match foo { Foo(DefId) => ... } This does not scale to more general types like `&'tcx Ty<'tcx>`. Therefore, we now require *exactly one* argument (the macro was internally tupling anyway, and no actual nodes use more than one argument), and then we can generate a fixed pattern like: match foo { Foo(arg) => ... } Huzzah. (Also, hygiene is nice.)
2018-03-09Move PROFQ_CHAN to a Session fieldJohn Kåre Alsaker-18/+19
2018-03-08Add InterpretInterner to StableHashingContext for AllocId serializationOliver Schneider-1/+1
2018-03-08Prepare for using miri in transAlexander Regueiro-4/+4
2018-03-08Move librustc_const_eval to librustc_mirOliver Schneider-1/+0
2018-03-08Produce instead of pointersOliver Schneider-0/+1
2018-03-06Add target_features to TransFnAttrsWesley Wiser-1/+0
Part of #47320
2018-03-06Remove the contains_extern_indicator queryWesley Wiser-1/+0
Part of #47320
2018-03-06Remove export_name queryWesley Wiser-1/+0
Part of #47320
2018-03-06Add query for trans fn attributesWesley Wiser-0/+1
Part of #47320
2018-03-06Rename exported_symbol_ids query to something more explicit and document ↵Michael Woerister-2/+2
what it is doing.
2018-03-05Turn features() into a query.Michael Woerister-4/+6
2018-03-02Run Rustfix on librustcManish Goregaokar-1/+1
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-6/+6
2018-02-28Rollup merge of #48479 - mark-i-m:rustc-guide, r=nikomatsakiskennytm-2/+2
Start moving to the rustc guide! r? @nikomatsakis cc #48478
2018-02-25Change links to readmesMark Mansi-2/+2
2018-02-24Rollup merge of #48353 - michaelwoerister:monoitem-static-defid, r=eddybManish Goregaokar-1/+1
Allow for instantiating statics from upstream crates This PR makes the infrastructure around translating statics a bit more flexible so that it can also instantiate statics from upstream crates if the need arises. This is preparatory work for a MIR-only RLIBs prototype, where the instantiation of a `static` may be deferred until a leaf crate. r? @eddyb (feel free to assign to someone else if you're busy)
2018-02-19Rename is_translated_fn query to is_translated_item and make it support statics.Michael Woerister-1/+1
2018-02-14incr.comp.: Store DepNode colors in a dense array instead of a hashmap.Michael Woerister-44/+109
2018-01-30rustc: Add an option to default hidden visibilityAlex Crichton-0/+3
This commit adds a new option to target specifictions to specify that symbols should be "hidden" visibility by default in LLVM. While there are no existing targets that take advantage of this the `wasm32-unknown-unknown` target will soon start to use this visibility. The LLD linker currently interprets `hidden` as "don't export this from the wasm module" which is what we want for 90% of our functions. While the LLD linker does have a "export this symbol" argument which is what we use for other linkers, it was also somewhat easier to do this change instead which'll involve less arguments flying around. Additionally there's no need for non-`hidden` visibility for most of our symbols! This change should not immediately impact the wasm targets as-is, but rather this is laying the foundations for soon integrating LLD as a linker for wasm code.
2018-01-19Add instance_def_size_estimate queryvarkor-0/+1
2018-01-14Auto merge of #47223 - alexcrichton:new-target-feature, r=eddybbors-0/+4
rustc: Tweak `#[target_feature]` syntax This is an implementation of the `#[target_feature]` syntax-related changes of [RFC 2045][rfc]. Notably two changes have been implemented: * The new syntax is `#[target_feature(enable = "..")]` instead of `#[target_feature = "+.."]`. The `enable` key is necessary instead of the `+` to indicate that a feature is being enabled, and a sub-list is used for possible expansion in the future. Additionally within this syntax the feature names being enabled are now whitelisted against a known set of target feature names that we know about. * The `#[target_feature]` attribute can only be applied to unsafe functions. It was decided in the RFC that invoking an instruction possibly not defined for the current processor is undefined behavior, so to enable this feature for now it requires an `unsafe` intervention. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/2045-target-feature.md
2018-01-13rustc: Tweak `#[target_feature]` syntaxAlex Crichton-0/+4
This is an implementation of the `#[target_feature]` syntax-related changes of [RFC 2045][rfc]. Notably two changes have been implemented: * The new syntax is `#[target_feature(enable = "..")]` instead of `#[target_feature = "+.."]`. The `enable` key is necessary instead of the `+` to indicate that a feature is being enabled, and a sub-list is used for possible expansion in the future. Additionally within this syntax the feature names being enabled are now whitelisted against a known set of target feature names that we know about. * The `#[target_feature]` attribute can only be applied to unsafe functions. It was decided in the RFC that invoking an instruction possibly not defined for the current processor is undefined behavior, so to enable this feature for now it requires an `unsafe` intervention. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/2045-target-feature.md
2018-01-13Remove `impl Foo for ..` in favor of `auto trait Foo`leonardo.yvens-1/+0
No longer parse it. Remove AutoTrait variant from AST and HIR. Remove backwards compatibility lint. Remove coherence checks, they make no sense for the new syntax. Remove from rustdoc.
2018-01-09Replace uses of DepGraph.in_ignore with DepGraph.with_ignoreJohn Kåre Alsaker-3/+11
2018-01-08Auto merge of #47200 - BurntPizza:query-snatp, r=nikomatsakisbors-0/+2
Make normalize_and_test_predicates into a query From #44891. I'm not real solid on how `dep_graph` stuff works, but if a node is going to have a key (again, not sure how important that is), then the key needs to be `Copy`. So since `normalize_and_test_predicates` only had one out-of-module use, I changed that call site to use a new function, `substitute_normalize_and_test_predicates` which is the query and enables having the arguments be `Copy`. Hopefully this makes sense. r? @nikomatsakis and/or @michaelwoerister
2018-01-01Fix docs for future pulldown migrationMalo Jaffré-1/+1
2018-01-01Fix broken links in internal docsMalo Jaffré-3/+3
2017-12-27Make normalize_and_test_predicates into a queryBurntPizza-0/+2
2017-12-20incr.comp.: Replace Fingerprint::zero() with a constant.Michael Woerister-8/+8
2017-12-20incr.comp.: Use an IndexVec instead of a hashmap for storing result hashes.Michael Woerister-37/+77
2017-12-18incr.comp.: Mark DepKind node as input.Michael Woerister-1/+1