summary refs log tree commit diff
path: root/src/librustc_metadata
AgeCommit message (Collapse)AuthorLines
2018-04-20Fix path attribute in rustdocGuillaume Gomez-4/+7
2018-04-17Difference between master and betaOliver Schneider-1/+1
2018-04-17Get rid of redundant `HashSet`Oliver Schneider-13/+12
2018-04-17Reduce the number of calls to `cdata`Oliver Schneider-2/+2
2018-04-17Encode items before encoding the list of AllocIdsOliver Schneider-10/+13
2018-04-17Use `LazySeq` instead of `Vec`Oliver Schneider-23/+40
2018-04-17Don't recurse into allocations, use a global table insteadOliver Schneider-53/+65
2018-03-28Auto merge of #49019 - phil-opp:target-spec, r=pnkfelixbors-11/+14
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-26Auto merge of #49101 - mark-i-m:stabilize_i128, r=nagisabors-1/+1
Stabilize 128-bit integers :tada: cc #35118 EDIT: This should be merged only after the following have been merged: - [x] https://github.com/rust-lang-nursery/compiler-builtins/pull/236 - [x] https://github.com/rust-lang/book/pull/1230
2018-03-26Introduce a TargetTriple enum to support absolute target pathsPhilipp Oppermann-11/+14
2018-03-26Stabilize i128_typeMark Mansi-1/+1
2018-03-26Auto merge of #48346 - emilio:pgo, r=alexcrichtonbors-1/+3
Add basic PGO support. This PR adds two mutually exclusive options for profile usage and generation using LLVM's instruction profile generation (the same as clang uses), `-C pgo-use` and `-C pgo-gen`. See each commit for details.
2018-03-26Stabilize conservative_impl_traitTaylor Cramer-1/+1
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-25Rollup merge of #49299 - SimonSapin:ubiquity, r=nikomatsakiskennytm-13/+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-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-23Stabilize the copy_closures and clone_closures featuresSimon Sapin-13/+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-39/+90
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/+25
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-22Auto merge of #49041 - nikomatsakis:issue-46541-impl-trait-hidden-lifetimes, ↵bors-1/+5
r=cramertj Detect illegal hidden lifetimes in `impl Trait` This branch fixes #46541 -- however, it presently doesn't build because it also *breaks* a number of existing usages of impl Trait. I'm opening it as a WIP for now, just because we want to move on impl Trait, but I'll try to fix the problem in a bit. ~~(The problem is due to the fact that we apparently infer stricter lifetimes in closures that we need to; for example, if you capture a variable of type `&'a &'b u32`, we will put *precisely* those lifetimes into the closure, even if the closure would be happy with `&'a &'a u32`. This causes the present chance to affect things that are not invariant.)~~ fixed r? @cramertj
2018-03-21work around fallout from these changes in rustcNiko Matsakis-1/+5
2018-03-20Encode/decode extern statics in metadata and incremental cacheOliver Schneider-2/+2
2018-03-19Auto merge of #49079 - oli-obk:cross_miri, r=michaelwoeristerbors-62/+50
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-18Auto merge of #48917 - petrochenkov:import, r=oli-obkbors-8/+10
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-17Rename `Span::empty` to `Span::shrink_to_lo`, add `Span::shrink_to_hi`Vadim Petrochenkov-1/+1
2018-03-17AST/HIR: Clarify what the optional name in extern crate items meanVadim Petrochenkov-7/+9
2018-03-17Auto merge of #48936 - Zoxc:cstore, r=michaelwoeristerbors-38/+63
Make CrateMetadata and CStore thread-safe r? @michaelwoerister
2018-03-16Cleanup metadata and incremental cache processing of constantsOliver Schneider-62/+50
2018-03-13add `canonicalize` method to `InferCtxt` [VIC]Niko Matsakis-0/+2
2018-03-12Make CStore thread-safeJohn Kåre Alsaker-4/+6
2018-03-12Make CrateMetadata thread-safeJohn Kåre Alsaker-32/+55
2018-03-12Require the metadata loader to be thread-safeJohn Kåre Alsaker-2/+2
2018-03-08Hide the RefCell inside InterpretInternerOliver Schneider-9/+8
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-08Add InterpretInterner to StableHashingContext for AllocId serializationOliver Schneider-4/+4
2018-03-08Fully use miri in transOliver Schneider-8/+4
2018-03-08Initial changes to librustc to support const trait fns.Alexander Regueiro-2/+16
2018-03-08Nuke the entire ctfe from orbit, it's the only way to be sureOliver Schneider-20/+8
2018-03-08Produce instead of pointersOliver Schneider-17/+35
2018-03-08Add a variant to ConstVal for storing miri resultsOliver Schneider-2/+83
2018-03-07Merge branch 'incr_attr_queries' of https://github.com/wesleywiser/rust into ↵Alex Crichton-2/+2
update-cargo
2018-03-07Merge branch 'metadata-send-sync' of https://github.com/Zoxc/rust into ↵Alex Crichton-7/+9
update-cargo
2018-03-06Add `inline` to `TransFnAttrs`Wesley Wiser-2/+2
Part of #47320
2018-03-07Make metadata references Send + SyncJohn Kåre Alsaker-7/+9
2018-03-06Don't show crate metadata symbol as exported symbol to downstream crates.Michael Woerister-3/+19
2018-03-06Fix export level of plugin and procmacro registrars.Michael Woerister-4/+3
2018-03-06Don't recompute SymbolExportLevel for upstream crates.Michael Woerister-21/+50
2018-03-06Clean up handling of symbol export information.Michael Woerister-14/+12