summary refs log tree commit diff
path: root/src/librustc_trans_utils
AgeCommit message (Collapse)AuthorLines
2018-03-26Stabilize i128_typeMark Mansi-1/+1
2018-03-26Stabilize conservative_impl_traitTaylor Cramer-1/+1
2018-03-22Rollup merge of #49117 - nivkner:fixme_fixup3, r=estebankkennytm-15/+6
address some FIXME whose associated issues were marked as closed part of #44366
2018-03-20Stabilize slice patterns without `..`Vadim Petrochenkov-1/+0
Merge `feature(advanced_slice_patterns)` into `feature(slice_patterns)`
2018-03-17remove FIXME(#37712) and implement ItemLikeVisitor instead of VisitorNiv Kaminer-15/+6
2018-03-12Require the metadata loader to be thread-safeJohn Kåre Alsaker-3/+3
2018-03-07Merge branch 'incr_attr_queries' of https://github.com/wesleywiser/rust into ↵Alex Crichton-71/+6
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 target_features to TransFnAttrsWesley Wiser-2/+4
Part of #47320
2018-03-06Remove the contains_extern_indicator queryWesley Wiser-6/+0
Part of #47320
2018-03-06Remove export_name queryWesley Wiser-61/+2
Part of #47320
2018-03-06Add `inline` to `TransFnAttrs`Wesley Wiser-3/+1
Part of #47320
2018-03-07Make metadata references Send + SyncJohn Kåre Alsaker-7/+9
2018-03-06Clean up handling of symbol export information.Michael Woerister-56/+2
2018-03-05Turn features() into a query.Michael Woerister-1/+1
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-2/+2
2018-02-20stage0 cfg cleanupMark Simulacrum-1/+0
2018-02-17fix more typos found by codespell.Matthias Krüger-1/+1
2018-01-27rustc: Load the `rustc_trans` crate at runtimeAlex Crichton-5/+11
Building on the work of # 45684 this commit updates the compiler to unconditionally load the `rustc_trans` crate at runtime instead of linking to it at compile time. The end goal of this work is to implement # 46819 where rustc will have multiple backends available to it to load. This commit starts off by removing the `extern crate rustc_trans` from the driver. This involved moving some miscellaneous functionality into the `TransCrate` trait and also required an implementation of how to locate and load the trans backend. This ended up being a little tricky because the sysroot isn't always the right location (for example `--sysroot` arguments) so some extra code was added as well to probe a directory relative to the current dll (the rustc_driver dll). Rustbuild has been updated accordingly as well to have a separate compilation invocation for the `rustc_trans` crate and assembly it accordingly into the sysroot. Finally, the distribution logic for the `rustc` package was also updated to slurp up the trans backends folder. A number of assorted fallout changes were included here as well to ensure tests pass and such, and they should all be commented inline.
2018-01-20Fix ICEbjorn3-0/+4
2018-01-19Remove accidential libloading dependencybjorn3-1/+0
2018-01-19Fix ICEbjorn3-0/+1
2018-01-19Remove use of RUSTC_COMPILETEST env varbjorn3-2/+0
2018-01-19Fix review commentsbjorn3-33/+1
2018-01-19Cleanup hot plug codegen backend codebjorn3-166/+15
2018-01-19Hot plug rustc_transbjorn3-0/+186
2018-01-19Allow runtime switching between trans backendsbjorn3-68/+691
2018-01-07Try to fix a perf regression by updating logMalo Jaffré-1/+1
Upgrade `log` to `0.4` in multiple crates.
2018-01-01Update crates and submodules to pull doc fixesMalo Jaffré-2/+2
Update `rand` crate to `0.3.19`. Update `log` crate to `0.3.9` and `0.4.1`. Update `parking_lot_core` crate to `0.2.9`. Upgrade all flate2 dependencies to `1.0.1`. - Update `rust-installer` submodule.
2017-12-28Prefer to use attr::contains_name() and attr::find_by_name()Seiichi Uchida-3/+3
2017-12-20incr.comp.: Use an IndexVec instead of a hashmap for storing result hashes.Michael Woerister-7/+4
2017-12-18Add rustc_data_structures for trans_utils/lib.rsMaik Klein-0/+1
2017-12-18Remove duplicated functions from trans::common.rsMaik Klein-3/+1
2017-12-18Move common.rs functionality into TyCtxtMaik Klein-93/+2
2017-12-18Move trans_item and monomorphize to rustc_mirMaik Klein-594/+0
2017-12-18Move collector to monomorphizeMaik Klein-1084/+0
2017-12-17Add sync module to rustc_data_structuresJohn Kåre Alsaker-3/+1
2017-12-14add trait aliases to HIRAlex Burka-0/+1
2017-12-07make `fn_sig().subst()` ICE when used with a closureNiko Matsakis-2/+2
It's inefficient, and the substitution there doesn't account for the extra regions used by NLL inference, so it's a bad thing to encourage. As it happens all callers already know if they have a closure or not, from what I can tell.
2017-12-01MIR: s/Lvalue/Place in type names.Eduard-Mihai Burtescu-1/+1
2017-11-29incr.comp.: Remove on-export crate metadata hashing.Michael Woerister-1/+1
2017-11-21Auto merge of #45879 - nikomatsakis:nll-kill-cyclic-closures, r=arielb1bors-1/+1
move closure kind, signature into `ClosureSubsts` Instead of using side-tables, store the closure-kind and signature in the substitutions themselves. This has two key effects: - It means that the closure's type changes as inference finds out more things, which is very nice. - As a result, it avoids the need for the `freshen_closure_like` code (though we still use it for generators). - It avoids cyclic closures calls. - These were never meant to be supported, precisely because they make a lot of the fancy inference that we do much more complicated. However, due to an oversight, it was previously possible -- if challenging -- to create a setup where a closure *directly* called itself (see e.g. #21410). We have to see what the effect of this change is, though. Needs a crater run. Marking as [WIP] until that has been assessed. r? @arielb1
2017-11-20Auto merge of #45905 - alexcrichton:add-wasm-target, r=aturonbors-10/+25
std: Add a new wasm32-unknown-unknown target This commit adds a new target to the compiler: wasm32-unknown-unknown. This target is a reimagining of what it looks like to generate WebAssembly code from Rust. Instead of using Emscripten which can bring with it a weighty runtime this instead is a target which uses only the LLVM backend for WebAssembly and a "custom linker" for now which will hopefully one day be direct calls to lld. Notable features of this target include: * There is zero runtime footprint. The target assumes nothing exists other than the wasm32 instruction set. * There is zero toolchain footprint beyond adding the target. No custom linker is needed, rustc contains everything. * Very small wasm modules can be generated directly from Rust code using this target. * Most of the standard library is stubbed out to return an error, but anything related to allocation works (aka `HashMap`, `Vec`, etc). * Naturally, any `#[no_std]` crate should be 100% compatible with this new target. This target is currently somewhat janky due to how linking works. The "linking" is currently unconditional whole program LTO (aka LLVM is being used as a linker). Naturally that means compiling programs is pretty slow! Eventually though this target should have a linker. This target is also intended to be quite experimental. I'm hoping that this can act as a catalyst for further experimentation in Rust with WebAssembly. Breaking changes are very likely to land to this target, so it's not recommended to rely on it in any critical capacity yet. We'll let you know when it's "production ready". ### Building yourself First you'll need to configure the build of LLVM and enable this target ``` $ ./configure --target=wasm32-unknown-unknown --set llvm.experimental-targets=WebAssembly ``` Next you'll want to remove any previously compiled LLVM as it needs to be rebuilt with WebAssembly support. You can do that with: ``` $ rm -rf build ``` And then you're good to go! A `./x.py build` should give you a rustc with the appropriate libstd target. ### Test support Currently testing-wise this target is looking pretty good but isn't complete. I've got almost the entire `run-pass` test suite working with this target (lots of tests ignored, but many passing as well). The `core` test suite is [still getting LLVM bugs fixed](https://reviews.llvm.org/D39866) to get that working and will take some time. Relatively simple programs all seem to work though! In general I've only tested this with a local fork that makes use of LLVM 5 rather than our current LLVM 4 on master. The LLVM 4 WebAssembly backend AFAIK isn't broken per se but is likely missing bug fixes available on LLVM 5. I'm hoping though that we can decouple the LLVM 5 upgrade and adding this wasm target! ### But the modules generated are huge! It's worth nothing that you may not immediately see the "smallest possible wasm module" for the input you feed to rustc. For various reasons it's very difficult to get rid of the final "bloat" in vanilla rustc (again, a real linker should fix all this). For now what you'll have to do is: cargo install --git https://github.com/alexcrichton/wasm-gc wasm-gc foo.wasm bar.wasm And then `bar.wasm` should be the smallest we can get it! --- In any case for now I'd love feedback on this, particularly on the various integration points if you've got better ideas of how to approach them!
2017-11-19std: Add a new wasm32-unknown-unknown targetAlex Crichton-10/+25
This commit adds a new target to the compiler: wasm32-unknown-unknown. This target is a reimagining of what it looks like to generate WebAssembly code from Rust. Instead of using Emscripten which can bring with it a weighty runtime this instead is a target which uses only the LLVM backend for WebAssembly and a "custom linker" for now which will hopefully one day be direct calls to lld. Notable features of this target include: * There is zero runtime footprint. The target assumes nothing exists other than the wasm32 instruction set. * There is zero toolchain footprint beyond adding the target. No custom linker is needed, rustc contains everything. * Very small wasm modules can be generated directly from Rust code using this target. * Most of the standard library is stubbed out to return an error, but anything related to allocation works (aka `HashMap`, `Vec`, etc). * Naturally, any `#[no_std]` crate should be 100% compatible with this new target. This target is currently somewhat janky due to how linking works. The "linking" is currently unconditional whole program LTO (aka LLVM is being used as a linker). Naturally that means compiling programs is pretty slow! Eventually though this target should have a linker. This target is also intended to be quite experimental. I'm hoping that this can act as a catalyst for further experimentation in Rust with WebAssembly. Breaking changes are very likely to land to this target, so it's not recommended to rely on it in any critical capacity yet. We'll let you know when it's "production ready". --- Currently testing-wise this target is looking pretty good but isn't complete. I've got almost the entire `run-pass` test suite working with this target (lots of tests ignored, but many passing as well). The `core` test suite is still getting LLVM bugs fixed to get that working and will take some time. Relatively simple programs all seem to work though! --- It's worth nothing that you may not immediately see the "smallest possible wasm module" for the input you feed to rustc. For various reasons it's very difficult to get rid of the final "bloat" in vanilla rustc (again, a real linker should fix all this). For now what you'll have to do is: cargo install --git https://github.com/alexcrichton/wasm-gc wasm-gc foo.wasm bar.wasm And then `bar.wasm` should be the smallest we can get it! --- In any case for now I'd love feedback on this, particularly on the various integration points if you've got better ideas of how to approach them!
2017-11-19rustc_trans: use more of the trans::mir and ty::layout APIs throughout.Eduard-Mihai Burtescu-10/+1
2017-11-18stop using the `closure_kinds` query / table for anythingNiko Matsakis-1/+1
Closure Kind is now extracted from the closure substs exclusively.
2017-11-12rustc_driver: base extern query providers on local ones.Eduard-Mihai Burtescu-4/+4
2017-11-07Always treat #[rustc_std_internal_symbol]s as root TransItems.Michael Woerister-1/+5
2017-11-07Don't duplicate logic of when an Instance requests to be inlined.Michael Woerister-7/+5
2017-11-07Fix translation item collection for inline and const fns.Michael Woerister-10/+24