summary refs log tree commit diff
path: root/src/librustc_metadata/creader.rs
AgeCommit message (Collapse)AuthorLines
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-3/+3
2018-09-19Use full name to identify a macro in a `FileName`.Diogo Sousa-0/+1
Before this two macros with same name would be indistinguishable inside a `FileName`. This caused a bug in incremental compilation (see #53097) since two different macros would map out to the same `StableFilemapId`. Fixes #53097.
2018-09-15rustc_resolve: always include core, std and meta in the extern prelude.Eduard-Mihai Burtescu-20/+61
2018-09-15rustc: add unstable support for --extern crate_name without a path.Eduard-Mihai Burtescu-1/+2
2018-08-26create a valid DefIdTable for proc macro cratesAriel Ben-Yehuda-4/+11
At least the incremental compilation code, and a few other places in the compiler, require the CrateMetadata for a loaded target crate to contain a valid DefIdTable for the DefIds in the target. Previously, the CrateMetadata for a proc macro contained the crate's "host" DefIdTable, which is of course incompatible with the "target" DefIdTable, causing ICEs. This creates a DefIdTable that properly refers to the "proc macro" DefIds. Fixes #49482.
2018-08-19mv codemap source_mapDonato Sciarra-1/+1
2018-08-14rustc_resolve: fix special-case for one-segment import paths.Eduard-Mihai Burtescu-28/+0
2018-08-09Move SVH structure to data structuresMark Rousskov-1/+1
2018-08-04Normalize variants of CrateType to standard styleMark Rousskov-14/+14
This is a clippy-breaking change.
2018-08-03Store concrete crate stores where possibleMark Rousskov-6/+7
2018-08-03Move validate_crate_name to rustc_metadataMark Rousskov-1/+3
2018-07-28Don't format!() string literalsljedrz-1/+1
2018-07-25rustc: Register crates under their real namesAlex Crichton-4/+3
Whenever we register a crate into the crate store, make sure to use the real name mentioned in the metadata instead of the name mentioned in the `extern crate` statement, as the statement can be wrong! Closes #51796
2018-07-11Deny bare trait objects in in src/librustc_metadataljedrz-2/+2
2018-06-30expansion: Give names to some fields of `SyntaxExtension`Vadim Petrochenkov-3/+5
2018-06-23hygiene: Do not reset expansion info for `quote!`Vadim Petrochenkov-1/+1
2018-06-19Update the error message for a missing global allocatorSimon Sapin-2/+4
Don’t mention `#[default_lib_allocator]` (which is an implementation detail irrelevant to most users) and instead suggest using `#[global_allocator]`, which is often the correct fix.
2018-06-01Make metadata decoding use AllocDecodingState/Session.Michael Woerister-0/+5
2018-05-18Remove unnecessary impl methods for CrateMetadataIsaac Whitfield-23/+23
2018-05-18Serialize attributes into the CrateRootIsaac Whitfield-28/+9
2018-05-18Attempt to pass CrateMetadata flags on creationIsaac Whitfield-18/+28
2018-05-18Avoid generating attributes more than once for CrateMetadataIsaac Whitfield-11/+18
2018-05-18Remove attribute_cache from CrateMetadataIsaac Whitfield-1/+0
2018-05-17Pass crate editions to macro expansions, update testsVadim Petrochenkov-9/+15
2018-05-10Rollup merge of #50538 - michaelwoerister:atomic-cnums, r=ZoxcAlex Crichton-4/+1
Make CrateNum allocation more thread-safe. This PR makes sure that we can't have race conditions when assigning CrateNums. It's a slight improvement but a larger refactoring of the CrateStore/CrateLoader infrastructure would be good, I think. r? @Zoxc
2018-05-09Make CrateNum allocation more thread-safe.Michael Woerister-4/+1
2018-05-08Don't use Lock for heavily accessed CrateMetadata::cnum_map.Michael Woerister-3/+6
2018-04-26Rename rustc_back::target to rustc_target::spec.Irina Popa-2/+1
2018-04-26rustc_back: move LinkerFlavor, PanicStrategy, and RelroLevel to target.Irina Popa-1/+1
2018-04-16Auto merge of #49847 - sinkuu:save_analysis_implicit_extern, r=petrochenkovbors-13/+75
Fix save-analysis generation with extern_in_paths/extern_absolute_paths Fixes #48742.
2018-04-13Move `path_len` to ExternCrateShotaro Yamada-12/+8
2018-04-11Extend `ExternCrate` to cover externs inferred from `use` or pathsShotaro Yamada-13/+79
2018-04-10Make Session.injected_panic_runtime thread-safeJohn Kåre Alsaker-0/+2
2018-04-10Make Session.injected_allocator and Session.allocator_kind thread-safeJohn Kåre Alsaker-0/+8
2018-04-10Make Session.has_global_allocator thread-safeJohn Kåre Alsaker-3/+1
2018-03-28Take the original extra-filename passed to a crate into account whenChris Manchester-7/+15
resolving it as a dependency. Fixes #46816
2018-03-28Auto merge of #49019 - phil-opp:target-spec, r=pnkfelixbors-5/+7
Introduce a TargetTriple enum to support absolute target paths This PR replaces target triple strings with a `TargetTriple` enum, which represents either a target triple or a path to a JSON target file. The path variant is used if the `--target` argument has a `.json` extension, else the target triple variant is used. The motivation of this PR is support for absolute target paths to avoid the need for setting the `RUST_TARGET_PATH` environment variable (see rust-lang/cargo#4905 for more information). For places where some kind of triple is needed (e.g. in the sysroot folder), we use the file name (without extension). For compatibility, we keep the old behavior of searching for a file named `$(target_triple).json` in `RUST_TARGET_PATH` for non-official target triples.
2018-03-26Introduce a TargetTriple enum to support absolute target pathsPhilipp Oppermann-5/+7
2018-03-25librustc: Convert -C pgo-gen and -C pgo-use into -Z flags.Emilio Cobos Álvarez-1/+1
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25rustc_metadata: Load the profiler runtime if we're generating PGO profile data.Emilio Cobos Álvarez-1/+3
This contains all the actual profiling code. Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-22rustc: Add a `#[wasm_import_module]` attributeAlex Crichton-19/+1
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-18Auto merge of #48917 - petrochenkov:import, r=oli-obkbors-7/+9
syntax: Make imports in AST closer to the source and cleanup their parsing This is a continuation of https://github.com/rust-lang/rust/pull/45846 in some sense.
2018-03-17AST/HIR: Clarify what the optional name in extern crate items meanVadim Petrochenkov-7/+9
2018-03-12Make CrateMetadata thread-safeJohn Kåre Alsaker-13/+16
2018-03-06Rename exported_symbol_ids query to something more explicit and document ↵Michael Woerister-4/+0
what it is doing.
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-11/+11
2018-01-16Don't include DefIndex in plugin- and proc-macro registrar fn symbol.Michael Woerister-9/+7
2018-01-07Try to fix a perf regression by updating logMalo Jaffré-1/+1
Upgrade `log` to `0.4` in multiple crates.
2017-12-13Resolve absolute paths as extern under a feature flagVadim Petrochenkov-0/+4
2017-12-12rustc_metadata: Refactor away `ExternCrateInfo`Vadim Petrochenkov-54/+26