summary refs log tree commit diff
path: root/src/librustc_metadata/encoder.rs
AgeCommit message (Collapse)AuthorLines
2018-06-07Add existential type definitonsOliver Schneider-26/+5
2018-05-23Auto merge of #50528 - whitfin:issue-50508, r=michaelwoeristerbors-2/+10
Remove attribute_cache from CrateMetadata This PR will fix #50508 by removing the `attribute_cache` from the `CrateMetadata` struct. Seeing as performance was referenced in the original issue, I also cleaned up a `self.entry(node_id);` call which might have occasionally happened redundantly. r? @michaelwoerister
2018-05-19rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded ↵Eduard-Mihai Burtescu-8/+8
constants".
2018-05-18Serialize attributes into the CrateRootIsaac Whitfield-2/+10
2018-05-17Keep crate edition in metadataVadim Petrochenkov-1/+2
2018-05-17Rename trans to codegen everywhere.Irina Popa-4/+5
2018-05-15Rename `has_type_parameters` to `requires_monomorphization`varkor-1/+1
2018-05-15Reduce parent_params to parent_countvarkor-4/+3
2018-05-15Consolidate ty::Genericsvarkor-1/+1
2018-04-20Clean up `IsolatedEncoder::encode_info_for_impl_item()` a bitWesley Wiser-12/+13
2018-04-20Fix bad merge in #49991Wesley Wiser-1/+1
When I rebased #49991 on `master`, I messed up the merge for this line. I'm reverting this back to the way it was in f15e5c1.
2018-04-19Remove HIR inliningWesley Wiser-44/+59
Fixes #49690
2018-04-16Auto merge of #49433 - varkor:metadata-skip-mir-opt, r=michaelwoeristerbors-2/+9
Skip MIR encoding for cargo check Resolves #48662. r? @michaelwoerister
2018-04-14Get rid of redundant `HashSet`Oliver Schneider-13/+12
2018-04-14Encode items before encoding the list of AllocIdsOliver Schneider-10/+13
2018-04-14Use `LazySeq` instead of `Vec`Oliver Schneider-17/+22
2018-04-14Don't recurse into allocations, use a global table insteadOliver Schneider-22/+46
2018-04-12Auto merge of #49558 - Zoxc:sync-misc, r=michaelwoeristerbors-1/+1
Even more thread-safety changes r? @michaelwoerister
2018-04-10Make Session.has_global_allocator thread-safeJohn Kåre Alsaker-1/+1
2018-04-09Take OutputType::DepInfo into account for metadata_output_onlyvarkor-3/+2
2018-04-09Convert sort_unstable_by_key to sort_by_cached_keyvarkor-2/+2
2018-04-06Allow for representing exported monomorphizations in crate metadata.Michael Woerister-4/+8
2018-04-04Add len() method to OutputTypesvarkor-1/+1
2018-03-28Take the original extra-filename passed to a crate into account whenChris Manchester-0/+2
resolving it as a dependency. Fixes #46816
2018-03-27Skip MIR optimisation for cargo checkvarkor-3/+11
2018-03-22rustc: Add a `#[wasm_import_module]` attributeAlex Crichton-1/+11
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/+12
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-20Encode/decode extern statics in metadata and incremental cacheOliver Schneider-2/+2
2018-03-16Cleanup metadata and incremental cache processing of constantsOliver Schneider-24/+20
2018-03-08Hide the RefCell inside InterpretInternerOliver Schneider-3/+3
It was too easy to get this wrong
2018-03-08Don't borrow the interpret_interner for anything but a direct function callOliver Schneider-5/+4
2018-03-08Fully use miri in transOliver Schneider-5/+3
2018-03-08Initial changes to librustc to support const trait fns.Alexander Regueiro-1/+8
2018-03-08Nuke the entire ctfe from orbit, it's the only way to be sureOliver Schneider-9/+4
2018-03-08Produce instead of pointersOliver Schneider-6/+8
2018-03-08Add a variant to ConstVal for storing miri resultsOliver Schneider-1/+38
2018-03-06Add `inline` to `TransFnAttrs`Wesley Wiser-2/+2
Part of #47320
2018-03-06Don't show crate metadata symbol as exported symbol to downstream crates.Michael Woerister-3/+19
2018-03-06Don't recompute SymbolExportLevel for upstream crates.Michael Woerister-15/+13
2018-03-06Clean up handling of symbol export information.Michael Woerister-10/+9
2018-03-06Rename exported_symbol_ids query to something more explicit and document ↵Michael Woerister-11/+14
what it is doing.
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-3/+3
2018-02-22Implement --remap-path-prefixJeremy Fitzhardinge-1/+1
Remove experimental -Zremap-path-prefix-from/to, and replace it with the stabilized --remap-path-prefix=from=to variant. This is an implementation for issue of #41555.
2018-01-13Remove `impl Foo for ..` in favor of `auto trait Foo`leonardo.yvens-12/+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-13Auto merge of #47181 - michaelwoerister:var-len-def-index, r=eddybbors-1/+1
Use DefIndex encoding that works better with on-disk variable length integer representations. Use the least instead of the most significant bit for representing the address space. r? @eddyb
2018-01-11Auto merge of #47087 - Zoxc:incr_no_in_ignore, r=michaelwoeristerbors-8/+9
Replace uses of DepGraph.in_ignore with DepGraph.with_ignore I currently plan to track tasks in thread local storage. Ignoring things in a closure ensures that the ignore tasks do not overlap the beginning or end of any other task. The TLS API will also use a closure to change a TLS value, so having the ignore task be a closure also helps there. It also adds `assert_ignored` which is used before a `TyCtxt` is created. Instead of adding a new ignore task this simply ensures that we are in a context where reads are ignored. r? @michaelwoerister
2018-01-11Auto merge of #47243 - wesleywiser:incr_fingerprint_encoding, r=michaelwoeristerbors-0/+7
[incremental] Specialize encoding and decoding of Fingerprints This saves the storage space used by about 32 bits per `Fingerprint`. On average, this reduces the size of the `/target/{mode}/incremental` folder by roughly 5% [Full details here](https://gist.github.com/wesleywiser/264076314794fbd6a4c110d7c1adc43e). Fixes #45875 r? @michaelwoerister
2018-01-09[incremental] Specialize encoding and decoding of FingerprintsWesley Wiser-0/+7
This saves the storage space used by about 32 bits per `Fingerprint`. On average, this reduces the size of the `/target/{mode}/incremental` folder by roughly 5%. Fixes #45875
2018-01-09Replace uses of DepGraph.in_ignore with DepGraph.with_ignoreJohn Kåre Alsaker-8/+9
2018-01-09Rollup merge of #47258 - rkruppe:struct-assert, r=eddybkennytm-4/+4
rustc::ty: Rename struct_variant to non_enum_variant r? @eddyb