summary refs log tree commit diff
path: root/src/librustc_metadata/creader.rs
AgeCommit message (Collapse)AuthorLines
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
2017-12-09Use Try syntax for Option in place of macros or matchMatt Brubeck-4/+1
2017-12-04rustc_back: move dynamic_lib to rustc_metadata.Irina-Gabriela Popa-1/+1
2017-11-08incr.comp.: Provide session to some more decoding contexts.Michael Woerister-5/+6
2017-11-07incr.comp.: Always require Session when decoding Spans (as to avoid silently ↵Michael Woerister-9/+10
wrong results).
2017-10-24Introduce CrateDisambiguator newtype and fix testsIgor Matuszewski-3/+2
2017-10-23Use 128 bit instead of Symbol for crate disambiguatorIgor Matuszewski-1/+2
2017-09-18Fix issues uncovered by rebasing:Michael Woerister-1/+4
- Don't hash traits in scope as part of HIR hashing any more. - Some queries returned DefIndexes from other crates. - Provide a generic way of stably hashing maps (not used everywhere yet).
2017-09-10Autodetect the type of allocator crate usedMichal 'vorner' Vaner-36/+63
Annotate the allocator crates (allocator_system, allocator_jemalloc) by the type of allocator they are. If one is requested as an exe allocator, detect its type by the flags. This has the effect that using this (de jure wrong) configuration in the target spec works instead of producing a really unhelpful and arcane linker error: "exe-allocation-crate": "alloc_system" Fixes #43524.
2017-09-09rustc: Remove `DepGraph` handling from rustc_metadataAlex Crichton-43/+23
This should now be entirely tracked through queries, so no need to have a `DepGraph` in the `CStore` object any more!
2017-09-05rustc: Remove `CrateStore::used_crate*`Alex Crichton-2/+2
This commit removes the `use_crates` and `used_crate_source` methods in favor of a mix of queries and helper methods being used now instead.
2017-09-05rustc: Remove a number of mutable fields in cstoreAlex Crichton-220/+1
This commit started by moving methods from `CrateStore` to queries, but it ended up necessitating some deeper refactorings to move more items in general to queries. Before this commit the *resolver* would walk over the AST and process foreign modules (`extern { .. }` blocks) and collect `#[link]` annotations. It would then also process the command line `-l` directives and such. This information was then stored as precalculated lists in the `CrateStore` object for iterating over later. After this, commit, however, this pass no longer happens during resolution but now instead happens through queries. A query for the linked libraries of a crate will crawl the crate for `extern` blocks and then process the linkage annotations at that time.