about summary refs log tree commit diff
path: root/src/librustc_trans
AgeCommit message (Collapse)AuthorLines
2016-05-30Auto merge of #33909 - michaelwoerister:frame-pointer-fix, r=nikomatsakisbors-12/+21
Emit "no-frame-pointer-elim" attribute for closures, shims, and glue. This will hopefully let `perf` give better backtraces. r? @nikomatsakis
2016-05-30Rollup merge of #33793 - GuillaumeGomez:compile_fail, r=GuillaumeGomezManish Goregaokar-2/+2
Fix compile_fail tag Fixes #33780 r? @steveklabnik
2016-05-28Refactor away some functions from hir::pat_utilVadim Petrochenkov-22/+13
2016-05-28Separate bindings from other patterns in HIRVadim Petrochenkov-123/+102
2016-05-27Emit "no-frame-pointer-elim" attribute for closures, shims, and glue.Michael Woerister-12/+21
2016-05-27Rollup merge of #33639 - petrochenkov:dotdot, r=nmatsakisManish Goregaokar-42/+44
cc https://github.com/rust-lang/rust/issues/33627 r? @nikomatsakis plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645 @Manishearth
2016-05-27* Fix compile_fail tag (in some cases, it compiled whereas it wasn't ↵Guillaume Gomez-2/+2
expected to and was still considered 'ok') * Fix error explanations tests/tags
2016-05-26Auto merge of #33783 - michaelwoerister:collector-cleanup-2, r=nikomatsakisbors-14/+18
trans::collector: Remove some redundant calls to erase_regions(). r? @Aatch
2016-05-26Auto merge of #33872 - nagisa:undef-is-llvm-for-sigsegv, r=eddybbors-32/+48
Fix handling of FFI arguments r? @eddyb @nikomatsakis or whoever else. cc @alexcrichton @rust-lang/core The strategy employed here was to essentially change code we generate from ```llvm %s = alloca %S ; potentially smaller than argument, but never larger %1 = bitcast %S* %s to { i64, i64 }* store { i64, i64 } %0, { i64, i64 }* %1, align 4 ``` to ```llvm %1 = alloca { i64, i64 } ; the copy of argument itself store { i64, i64 } %0, { i64, i64 }* %1, align 4 %s = bitcast { i64, i64 }* %1 to %S* ; potentially truncate by casting to a pointer of smaller type. ```
2016-05-26Do not forget to schedule the drop for the argumentSimonas Kazlauskas-2/+3
2016-05-26Replace pat_adjust_pos with an iterator adapterVadim Petrochenkov-10/+7
2016-05-26Implement `..` in tuple (struct) patternsVadim Petrochenkov-42/+47
2016-05-26Fix nit/Refine the datum constructionSimonas Kazlauskas-3/+1
2016-05-26Fix the fix/hack interaction with debuginfoSimonas Kazlauskas-10/+13
2016-05-25Auto merge of #33732 - nikomatsakis:incr-comp-empty-cgu, r=mwbors-0/+11
always make at least one codegen-unit this allows us to remove the dummy `foo` fn r? @michaelwoerister
2016-05-26Fix handling of C argumentsSimonas Kazlauskas-20/+34
Fixes #33868
2016-05-25trans: save metadata even with -Z no-trans.Eduard Burtescu-28/+50
2016-05-25trans: remove item_symbols from metadata and CrateContext.Eduard Burtescu-41/+2
2016-05-25trans: move the linker support to compute symbols on-demand.Eduard Burtescu-45/+88
2016-05-25trans: move exported_symbol to Instance::symbol_name.Eduard Burtescu-125/+126
2016-05-25trans: force absolute item paths within symbols.Eduard Burtescu-2/+9
2016-05-25trans: move exported_name's logic into symbol_names.Eduard Burtescu-70/+62
2016-05-25trans: remove unused symbol_names::exported_name_with_suffix.Eduard Burtescu-24/+6
2016-05-25rustc: use a simpler scheme for plugin registrar symbol names.Eduard Burtescu-0/+6
2016-05-24correct typo in commentNiko Matsakis-1/+1
2016-05-23trans::collector: Remove some redundant calls to erase_regions().Michael Woerister-14/+18
2016-05-20Rollup merge of #33734 - luqmana:33387-mir_fat_ptr_coerce, r=arielb1Guillaume Gomez-4/+24
[MIR] Add PointerCast for Unsize casts of fat pointers. Fixes #33387. r? @eddyb
2016-05-20Auto merge of #33553 - alexcrichton:cdylibs, r=brsonbors-89/+164
rustc: Add a new crate type, cdylib This commit is an implementation of [RFC 1510] which adds a new crate type, `cdylib`, to the compiler. This new crate type differs from the existing `dylib` crate type in a few key ways: * No metadata is present in the final artifact * Symbol visibility rules are the same as executables, that is only reachable `extern` functions are visible symbols * LTO is allowed * All libraries are always linked statically This commit is relatively simple by just plubming the compiler with another crate type which takes different branches here and there. The only major change is an implementation of the `Linker::export_symbols` function on Unix which now actually does something. This helps restrict the public symbols from a cdylib on Unix. With this PR a "hello world" `cdylib` is 7.2K while the same `dylib` is 2.4MB, which is some nice size savings! [RFC 1510]: https://github.com/rust-lang/rfcs/pull/1510 Closes #33132
2016-05-19debuginfo: Make DW_TAG_subroutine DIEs for inherent methods children of ↵Michael Woerister-4/+46
their self-type DIEs.
2016-05-19Mark the metadata symbol as reachable to fix OSX not finding dylibs.Eduard Burtescu-3/+11
2016-05-19rustc: Add a new crate type, cdylibAlex Crichton-86/+153
This commit is an implementation of [RFC 1510] which adds a new crate type, `cdylib`, to the compiler. This new crate type differs from the existing `dylib` crate type in a few key ways: * No metadata is present in the final artifact * Symbol visibility rules are the same as executables, that is only reachable `extern` functions are visible symbols * LTO is allowed * All libraries are always linked statically This commit is relatively simple by just plubming the compiler with another crate type which takes different branches here and there. The only major change is an implementation of the `Linker::export_symbols` function on Unix which now actually does something. This helps restrict the public symbols from a cdylib on Unix. With this PR a "hello world" `cdylib` is 7.2K while the same `dylib` is 2.4MB, which is some nice size savings! [RFC 1510]: https://github.com/rust-lang/rfcs/pull/1510 Closes #33132
2016-05-19[MIR] Add PointerCast for Unsize casts of fat pointers.Luqman Aden-4/+24
2016-05-18always make at least one codegen-unitNiko Matsakis-0/+11
this allows us to remove the dummy `foo` fn
2016-05-18add task for linkingNiko Matsakis-0/+3
In MSVC (at least), linking requires accessing metadata, which generates reads.
2016-05-18identify inputs of `MetaData(X)` nodesNiko Matsakis-1/+2
Generate a second hash file that contains the metadata for an X node.
2016-05-16Remove hir::IdentVadim Petrochenkov-10/+10
2016-05-14Rollup merge of #33576 - soltanmm:vtable, r=nikomatsakisManish Goregaokar-3/+6
Plumb inference obligations through selection, take 2 Using a `SnapshotVec` and dumping inferred obligations into `Vtable` variants. r? @nikomatsakis
2016-05-14Rollup merge of #33574 - michaelwoerister:collector-cleanup, r=nikomatsakisManish Goregaokar-514/+559
trans-collector: Assorted fixes and refactorings needed for making trans collector-driven. As the title says. The messages on the individual commits should do a good job of explaining what they are about. r? @nikomatsakis
2016-05-14Rollup merge of #33566 - dotdash:biased_switch, r=nagisaManish Goregaokar-10/+26
[MIR trans] Optimize trans for biased switches Currently, all switches in MIR are exhausitive, meaning that we can have a lot of arms that all go to the same basic block, the extreme case being an if-let expression which results in just 2 possible cases, be might end up with hundreds of arms for large enums. To improve this situation and give LLVM less code to chew on, we can detect whether there's a pre-dominant target basic block in a switch and then promote this to be the default target, not translating the corresponding arms at all. In combination with #33544 this makes unoptimized MIR trans of nickel.rs as fast as using old trans and greatly improves the times for optimized builds, which are only 30-40% slower instead of ~300%. cc #33111
2016-05-13Auto merge of #33508 - alexcrichton:always-lower-frem, r=nikomatsakisbors-77/+2
trans: Always lower to `frem` Long ago LLVM unfortunately didn't handle the 32-bit MSVC case of `frem` where it can't be lowered to `fmodf` because that symbol doesn't exist. That was since fixed in http://reviews.llvm.org/D12099 (landed as r246615) and was released in what appears to be LLVM 3.8. Now that we're using that branch of LLVM let's remove our own hacks and help LLVM optimize a little better by giving it knowledge about what we're doing.
2016-05-13Allow repr attribute on single variant enum.Luqman Aden-3/+1
2016-05-12Auto merge of #33282 - alexcrichton:rustbuild-crate-tests, r=brsonbors-0/+1
rustbuild: Add support for crate tests + doctests This commit adds support to rustbuild to run crate unit tests (those defined by `#[test]`) as well as documentation tests. All tests are powered by `cargo test` under the hood. Each step requires the `libtest` library is built for that corresponding stage. Ideally the `test` crate would be a dev-dependency, but for now it's just easier to ensure that we sequence everything in the right order. Currently no filtering is implemented, so there's not actually a method of testing *only* libstd or *only* libcore, but rather entire swaths of crates are tested all at once. A few points of note here are: * The `coretest` and `collectionstest` crates are just listed as `[[test]]` entires for `cargo test` to naturally pick up. This mean that `cargo test -p core` actually runs all the tests for libcore. * Libraries that aren't tested all mention `test = false` in their `Cargo.toml` * Crates aren't currently allowed to have dev-dependencies due to rust-lang/cargo#860, but we can likely alleviate this restriction once workspaces are implemented. cc #31590
2016-05-12rustbuild: Add support for crate tests + doctestsAlex Crichton-0/+1
This commit adds support to rustbuild to run crate unit tests (those defined by `#[test]`) as well as documentation tests. All tests are powered by `cargo test` under the hood. Each step requires the `libtest` library is built for that corresponding stage. Ideally the `test` crate would be a dev-dependency, but for now it's just easier to ensure that we sequence everything in the right order. Currently no filtering is implemented, so there's not actually a method of testing *only* libstd or *only* libcore, but rather entire swaths of crates are tested all at once. A few points of note here are: * The `coretest` and `collectionstest` crates are just listed as `[[test]]` entires for `cargo test` to naturally pick up. This mean that `cargo test -p core` actually runs all the tests for libcore. * Libraries that aren't tested all mention `test = false` in their `Cargo.toml` * Crates aren't currently allowed to have dev-dependencies due to rust-lang/cargo#860, but we can likely alleviate this restriction once workspaces are implemented. cc #31590
2016-05-11Add inferred obligation storage to all Vtable variants and SelectionContextMasood Malekghassemi-3/+6
2016-05-11trans: Use CrateContext::empty_substs_for_def_id() instead of ↵Michael Woerister-18/+48
Substs::empty() where appropriate.
2016-05-11[MIR trans] Optimize trans for biased switchesBjörn Steinbrink-10/+26
Currently, all switches in MIR are exhausitive, meaning that we can have a lot of arms that all go to the same basic block, the extreme case being an if-let expression which results in just 2 possible cases, be might end up with hundreds of arms for large enums. To improve this situation and give LLVM less code to chew on, we can detect whether there's a pre-dominant target basic block in a switch and then promote this to be the default target, not translating the corresponding arms at all. In combination with #33544 this makes unoptimized MIR trans of nickel.rs as fast as using old trans and greatly improves the times for optimized builds, which are only 30-40% slower instead of ~300%. cc #33111
2016-05-11trans: Make collector handle the drop_in_place() intrinsic.Michael Woerister-3/+48
2016-05-11Add test for collecting items in staticsJames Miller-4/+3
2016-05-11Inspect MIR for statics in item collectionJames Miller-0/+19
2016-05-11trans: Don't try to place declarations during codegen unit partitioning.Michael Woerister-128/+64