about summary refs log tree commit diff
path: root/src/librustc_metadata/decoder.rs
AgeCommit message (Collapse)AuthorLines
2018-06-27Make FileMap::{lines, multibyte_chars, non_narrow_chars} non-mutable.Michael Woerister-6/+3
2018-06-07Add existential type definitonsOliver Schneider-0/+1
2018-06-03Remove is_import fieldMark Simulacrum-6/+3
2018-06-01Make metadata decoding use AllocDecodingState/Session.Michael Woerister-34/+10
2018-05-26Use `Ident`s for fields in HIRVadim Petrochenkov-1/+1
2018-05-18Serialize attributes into the CrateRootIsaac Whitfield-10/+6
2018-05-18Remove attribute_cache from CrateMetadataIsaac Whitfield-20/+8
2018-05-08Don't use Lock for heavily accessed CrateMetadata::cnum_map.Michael Woerister-3/+3
2018-04-29Auto merge of #50271 - sinkuu:fix_ice, r=eddybbors-1/+7
Fix ICE #48984 * ~~fbf6423 The tail type was not normalized.~~ * https://github.com/rust-lang/rust/commit/d0839d5680d2a51785eeb0811cf3e2beba90eacb The method had a wrong assumption that something whose parent is a trait is an associated item. Fixes #48984.
2018-04-28Make `trait_of_item` return None for non associated itemsShotaro Yamada-1/+7
It have returned `Some` for constants in a trait definition, and `Instance::resolve` called `tcx.associated_item` for them, causing ICE.
2018-04-27Rename InternedString to LocalInternedString and introduce a new thread-safe ↵John Kåre Alsaker-8/+8
InternedString
2018-04-19Remove HIR inliningWesley Wiser-56/+20
Fixes #49690
2018-04-14Reduce the number of calls to `cdata`Oliver Schneider-2/+2
2018-04-14Use `LazySeq` instead of `Vec`Oliver Schneider-5/+17
2018-04-14Don't recurse into allocations, use a global table insteadOliver Schneider-31/+18
2018-04-10Auto merge of #49386 - GuillaumeGomez:fix-path-attribute, r=eddybbors-3/+6
Add tcx in item_body_nested_bodies Fixes #47391. r? @eddyb
2018-04-06Allow for representing exported monomorphizations in crate metadata.Michael Woerister-5/+7
2018-03-26Fix path attribute in rustdocGuillaume Gomez-3/+6
2018-03-25Rollup merge of #49273 - michaelwoerister:fix-extern-proc-macro-defkey, r=eddybkennytm-2/+19
Fix DefKey lookup for proc-macro crates. Add a special case for proc-macro crates for `def_key()` in the metadata decoder (like we already have for many other methods in there). In the long run, it would be preferable to get rid of the need for special casing proc-macro crates (see #49271). Fixes https://github.com/rust-lang/rust/issues/48739 (though I wasn't able to come up with a regression test, unfortunately) r? @eddyb
2018-03-22rustc: Add a `#[wasm_import_module]` attributeAlex Crichton-5/+5
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/+10
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-22Fix DefKey lookup for proc-macro crates.Michael Woerister-2/+19
2018-03-21work around fallout from these changes in rustcNiko Matsakis-1/+5
2018-03-19Auto merge of #49079 - oli-obk:cross_miri, r=michaelwoeristerbors-38/+30
Cleanup metadata and incremental cache processing of constants fixes #49033 fixes #49081 we really need tests for this. do we have any cross compilation tests? I couldn't find any
2018-03-16Cleanup metadata and incremental cache processing of constantsOliver Schneider-38/+30
2018-03-12Make CrateMetadata thread-safeJohn Kåre Alsaker-5/+16
2018-03-08Hide the RefCell inside InterpretInternerOliver Schneider-6/+5
It was too easy to get this wrong
2018-03-08Fully use miri in transOliver Schneider-3/+1
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-11/+4
2018-03-08Produce instead of pointersOliver Schneider-11/+27
2018-03-08Add a variant to ConstVal for storing miri resultsOliver Schneider-1/+45
2018-03-06Don't recompute SymbolExportLevel for upstream crates.Michael Woerister-4/+3
2018-03-06Rename exported_symbol_ids query to something more explicit and document ↵Michael Woerister-4/+5
what it is doing.
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-6/+6
2018-01-15Reexport -> re-export in prose and documentation commentsCarol (Nichols || Goulding)-2/+2
2018-01-13Remove `impl Foo for ..` in favor of `auto trait Foo`leonardo.yvens-10/+1
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-5/+5
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 #47243 - wesleywiser:incr_fingerprint_encoding, r=michaelwoeristerbors-0/+6
[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/+6
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-08Use different DefIndex representation that is better suited for variable ↵Michael Woerister-5/+5
length integer encodings.
2018-01-04Map invalid Spans to DUMMY_SP during crate metadata encoding.Michael Woerister-17/+11
This mirrors what we for stabilizing the incr. comp. cache and is necessary for reproducible builds.
2017-12-22Auto merge of #46842 - michaelwoerister:fingerprint-vec, r=nikomatsakisbors-1/+1
incr.comp.: Use an array instead of a hashmap for storing result hashes. Doing so should result in some of the core tracking components being faster. r? @nikomatsakis
2017-12-20incr.comp.: Replace Fingerprint::zero() with a constant.Michael Woerister-1/+1
2017-12-19incr.comp.: Precompute small hash for filenames to save some work.Michael Woerister-0/+2
2017-12-15incr.comp.: Revert hashing optimization that caused regression.Michael Woerister-2/+0
2017-12-14incr.comp.: Do less hashing per Span.Michael Woerister-0/+2
2017-12-13Auto merge of #46419 - jseyfried:all_imports_in_metadata, r=nrcbors-4/+19
Record all imports (`use`, `extern crate`) in the crate metadata This PR adds non-`pub` `use` and `extern crate` imports in the crate metadata since hygienic macros invoked in other crates may use them. We already include all other non-`pub` items in the crate metadata. This improves import suggestions in some cases. Fixes #42337. r? @nrc
2017-12-08incr.comp.: Make Span decoding more consistent so it doesn't mess up ↵Michael Woerister-13/+21
-Zincremental-verify-ich
2017-12-05Add field `is_import` to `def::Export`.Jeffrey Seyfried-4/+10