summary refs log tree commit diff
path: root/src/librustc/dep_graph/dep_node.rs
AgeCommit message (Collapse)AuthorLines
2018-07-27Better Option handlingShotaro Yamada-5/+2
2018-07-21Convert implied_outlives_bounds to a queryTyler Mandry-0/+1
2018-07-10Upgrade to LLVM's master branch (LLVM 7)Alex Crichton-2/+0
This commit upgrades the main LLVM submodule to LLVM's current master branch. The LLD submodule is updated in tandem as well as compiler-builtins. Along the way support was also added for LLVM 7's new features. This primarily includes the support for custom section concatenation natively in LLD so we now add wasm custom sections in LLVM IR rather than having custom support in rustc itself for doing so. Some other miscellaneous changes are: * We now pass `--gc-sections` to `wasm-ld` * The optimization level is now passed to `wasm-ld` * A `--stack-first` option is passed to LLD to have stack overflow always cause a trap instead of corrupting static data * The wasm target for LLVM switched to `wasm32-unknown-unknown`. * The syntax for aligned pointers has changed in LLVM IR and tests are updated to reflect this. * The `thumbv6m-none-eabi` target is disabled due to an [LLVM bug][llbug] Nowadays we've been mostly only upgrading whenever there's a major release of LLVM but enough changes have been happening on the wasm target that there's been growing motivation for quite some time now to upgrade out version of LLD. To upgrade LLD, however, we need to upgrade LLVM to avoid needing to build yet another version of LLVM on the builders. The revision of LLVM in use here is arbitrarily chosen. We will likely need to continue to update it over time if and when we discover bugs. Once LLVM 7 is fully released we can switch to that channel as well. [llbug]: https://bugs.llvm.org/show_bug.cgi?id=37382
2018-07-02introduce `predicates_defined_on` for traitsNiko Matsakis-0/+1
This new query returns only the predicates *directly defined* on an item (in contrast to the more common `predicates_of`, which returns the predicates that must be proven to reference an item). These two sets are almost always identical except for traits, where `predicates_of` includes an artificial `Self: Trait<...>` predicate (basically saying that you cannot use a trait item without proving that the trait is implemented for the type parameters). This new query is only used in chalk lowering, where this artificial `Self: Trait` predicate is problematic. We encode it in metadata but only where needed since it is kind of repetitive with existing information. Co-authored-by: Tyler Mandry <tmandry@gmail.com>
2018-06-28Merge `ConstVal` and `ConstValue`Oliver Schneider-3/+3
2018-06-26introduce `Normalizable` trait for things directly normalizableNiko Matsakis-2/+7
2018-06-26convert `prove_predicate` into a queryNiko Matsakis-1/+2
2018-06-26make `Subtype` a true queryNiko Matsakis-1/+3
2018-06-26make `Eq` a true queryNiko Matsakis-2/+4
2018-06-10create separate dep-nodes for predicates_of and explicit_predicates_oftoidiu-0/+1
2018-05-17Rename trans to codegen everywhere.Irina Popa-3/+3
2018-05-11Add a query to convert from ConstValue to AllocationJohn Kåre Alsaker-5/+6
2018-05-11Introduce ConstValue and use it instead of miri's Value for constant valuesJohn Kåre Alsaker-1/+1
2018-04-26Create a canonical trait query for `evaluate_obligation`Aravind Gollakota-1/+3
2018-04-23first draft of `program_clauses_for_env`Niko Matsakis-0/+1
This computes the transitive closure of traits that appear in the environment and then appends their clauses. It needs some work, but it's in the right direction.
2018-04-19Remove HIR inliningWesley Wiser-2/+1
Fixes #49690
2018-04-12Auto merge of #45298 - toidiu:ak-44493-infer-predicate, r=nikomatsakisbors-0/+1
Ak 44493 infer predicate **WIP** Implements #44493 Things to do: - [x] add feature gate and appropriate tests (see [forge](https://forge.rust-lang.org/feature-guide.html) for some details) - [x] add a unit testing system similar to `#[rustc_variance]` - [x] to see how, maybe `rg rustc_variance` and take some notes - [ ] add more tests: - [x] we need to decide how to handle `struct Foo<'a, T> { x: &'a T::Item }` - [x] handle explicit predicates on types - [ ] handle explicit predicates on `dyn Trait` (this could be put off to a follow-up PR) - [ ] handle explicit predicates on projections (this could be put off to a follow-up PR)
2018-04-12Implement inferring outlives requirements for references, structs, enum, ↵toidiu-0/+1
union, and projection types. added a feature gate and tests for these scenarios.
2018-04-10Querify all_traitsJohn Kåre Alsaker-0/+1
2018-04-06Allow for internalizing monomorphizations that cannot be shared.Michael Woerister-0/+1
2018-04-06Remove the (inaccurate) symbol_export_level query.Michael Woerister-2/+0
2018-04-06Allow for re-using monomorphizations from upstream crates.Michael Woerister-0/+3
2018-03-28Take the original extra-filename passed to a crate into account whenChris Manchester-0/+1
resolving it as a dependency. Fixes #46816
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 #48939 - wesleywiser:incr_query_wf_checking, r=michaelwoeristerkennytm-0/+3
Querify WF-checking so it can be cached r? @michaelwoerister
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-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-02-19Rename is_translated_fn query to is_translated_item and make it support statics.Michael Woerister-1/+1
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