about summary refs log tree commit diff
path: root/src/librustc_trans
AgeCommit message (Collapse)AuthorLines
2018-01-08Shorten names of some compiler generated artifacts.Michael Woerister-3/+7
2018-01-08rustc::ty: Rename `struct_variant` to `non_enum_variant`Robin Kruppe-2/+2
It is also intended for use with unions.
2018-01-07Try to fix a perf regression by updating logMalo Jaffré-1/+1
Upgrade `log` to `0.4` in multiple crates.
2018-01-07Remove redundant -Zdebug-llvm optionBjörn Steinbrink-5/+1
The same effect can be achieved using -Cllvm-args=-debug Refs #46437 as it removes LLVMRustSetDebug()
2018-01-07Rollup merge of #47220 - nagisa:nonamellvm, r=rkruppekennytm-2/+4
Use name-discarding LLVM context This is only applicable when neither of --emit=llvm-ir or --emit=llvm-bc are not requested. In case either of these outputs are wanted, but the benefits of such context are desired as well, -Zfewer_names option provides the same functionality regardless of the outputs requested. Should be a viable fix for https://github.com/rust-lang/rust/issues/46449
2018-01-07Rollup merge of #47170 - eddyb:us-vs-usize, r=nikomatsakiskennytm-6/+6
rustc: use {U,I}size instead of {U,I}s shorthands. `Us`/`Is` come from a time when `us` and `is` were the literal suffixes that are now `usize` / `isize`. r? @nikomatsakis
2018-01-06Auto merge of #47141 - alexcrichton:bump-bootstrap, r=alexcrichtonbors-0/+1
Bump to 1.25.0 * Bump the release version to 1.25 * Bump the bootstrap compiler to the recent beta * Allow using unstable rustdoc features on beta - this fix has been applied to the beta branch but needed to go to the master branch as well.
2018-01-06Rollup merge of #47173 - dotdash:cleanup, r=michaelwoeristerGuillaume Gomez-6/+5
Remove some outdated LLVM-related code Ticks two boxes on #46437
2018-01-05Use name-discarding LLVM contextSimonas Kazlauskas-2/+4
This is only applicable when neither of --emit=llvm-ir or --emit=llvm-bc are not requested. In case either of these outputs are wanted, but the benefits of such context are desired as well, -Zfewer_names option provides the same functionality regardless of the outputs requested.
2018-01-04rustc: Don't use relative paths for extended errorsAlex Crichton-0/+1
These no longer work now that Cargo changes the cwd of rustc while it's running. Instead use an absolute path that's set by rustbuild.
2018-01-04Auto merge of #46916 - michaelwoerister:generate-dead-code-plz, r=alexcrichtonbors-1/+7
Generate code for unused const- and inline-fns if -Clink-dead-code is specified. Fixes https://github.com/rust-lang/rust/issues/46467. r? @alexcrichton
2018-01-04Generate code for const- and inline-fns if -Clink-dead-code is specified.Michael Woerister-1/+7
2018-01-04Remove outdated LLVMRustBuildLandingPad() wrapperBjörn Steinbrink-6/+5
The function was added as a wrapper to handle compatibility with older LLVM versions that we no longer support, so it can be removed. Refs #46437
2018-01-04rustc: use {U,I}size instead of {U,I}s shorthands.Eduard-Mihai Burtescu-6/+6
2018-01-02Force appropriate extension when converting from int to ptr #43291projektir-3/+8
2018-01-01Update crates and submodules to pull doc fixesMalo Jaffré-3/+3
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-31Removed unnecessary output of linker options when linker is not installedFelix Schütt-4/+19
It's unnecessary to print the linker options if there is no linker installed. Currently, for libraries, the output is still printed, see #46998 for discussion
2017-12-27Auto merge of #46479 - bkchr:termination_trait, r=arielb1bors-8/+16
Implements RFC 1937: `?` in `main` This is the first part of the RFC 1937 that supports new `Termination` trait in the rust `main` function. Thanks @nikomatsakis, @arielb1 and all other people in the gitter channel for all your help! The support for doctest and `#[test]` is still missing, bu as @nikomatsakis said, smaller pull requests are better :)
2017-12-26Don't use `process::exit` as it is an `unreachable` on wasm32Bastian Köcher-10/+2
2017-12-26rustc_trans: support ZST indexing involving uninhabited types.Eduard-Mihai Burtescu-3/+16
2017-12-26Fixes compile bug caused by upstream changesBastian Köcher-1/+1
2017-12-26Implements RFC 1937: `?` in `main`Bastian Köcher-9/+25
This is the first part of the RFC 1937 that supports new `Termination` trait in the rust `main` function.
2017-12-25Auto merge of #46910 - alexcrichton:thinlto-default, r=michaelwoeristerbors-0/+15
rustc: Set release mode cgus to 16 by default This commit is the next attempt to enable multiple codegen units by default in release mode, getting some of those sweet, sweet parallelism wins by running codegen in parallel. Performance should not be lost due to ThinLTO being on by default as well. Closes #45320
2017-12-24Auto merge of #46899 - m4b:linkage_name_equals_symbol_name, r=michaelwoeristerbors-30/+24
Set the dwarf linkage_name to the mangled name ref #46453 @michaelwoerister or anyone else who knows, i'm not sure if this is the correct instance to pass here (or how to get the correct one precisely): https://github.com//m4b/rust/blob/5a94a48678ec0a20ea6a63a783e63546bf9459b1/src/librustc_trans/debuginfo/namespace.rs#L36 So don't merge this yet, I'd like to learn about correct instance first; however, I think this already fixes a bunch of weirdness i'm seeing debugging from time to time, not to mention backtraces in gdb via `bt` are now ~readable~ meaningful :tada: E.g.: new: ``` (gdb) bt #0 <inline::Foo as core::convert::From<()>>::from () at /home/m4b/tmp/bad_debug/inline.rs:11 #1 0x000055555555a35d in inline::deadbeef () at /home/m4b/tmp/bad_debug/inline.rs:16 #2 0x000055555555a380 in inline::main () at /home/m4b/tmp/bad_debug/inline.rs:20 ``` old: ``` (gdb) bt #0 inline::{{impl}}::from () at /home/m4b/tmp/bad_debug/inline.rs:11 #1 0x000055555555b0ed in inline::deadbeef () at /home/m4b/tmp/bad_debug/inline.rs:16 #2 0x000055555555b120 in inline::main () at /home/m4b/tmp/bad_debug/inline.rs:20 ```
2017-12-24Auto merge of #46833 - diwic:7c-abort-ffi, r=arielb1bors-0/+8
Prevent unwinding past FFI boundaries Second attempt to write a patch to solve this. r? @nikomatsakis ~~So, my biggest issue with this patch is the way the patch determines *what* functions should have an abort landing pad (in `construct_fn`). I would ideally have this code match [src/librustc_trans/callee.rs::get_fn](https://github.com/rust-lang/rust/blob/master/src/librustc_trans/callee.rs#L107-L115) but couldn't find an id that returns true for `is_foreign_item`. Also tried `tcx.has_attr("unwind")` with no luck.~~ FIXED Other issues: * llvm.trap is an SIGILL on amd64. Ideally we could use panic-abort's version of aborting which is nicer but we don't want to depend on that library... * ~~Mir inlining is a stub currently.~~ FIXED (no-op) Also, when reviewing please take into account that I'm new to the code and only partially know what I'm doing... and that I've mostly made made matches on `TerminatorKind::Abort` match either `TerminatorKind::Resume` or `TerminatorKind::Unreachable` based on what looked best.
2017-12-23rustc: Set release mode cgus to 16 by defaultAlex Crichton-0/+15
This commit is the next attempt to enable multiple codegen units by default in release mode, getting some of those sweet, sweet parallelism wins by running codegen in parallel. Performance should not be lost due to ThinLTO being on by default as well. Closes #45320
2017-12-22Auto merge of #46842 - michaelwoerister:fingerprint-vec, r=nikomatsakisbors-3/+2
incr.comp.: Use an array instead of a hashmap for storing result hashes. Doing so should result in some of the core tracking components being faster. r? @nikomatsakis
2017-12-21Auto merge of #46772 - alexcrichton:thinlto-passes, r=michaelwoeristerbors-0/+46
rustc: Work around `DICompileUnit` bugs in LLVM This commit implements a workaround for #46346 which basically just avoids triggering the situation that LLVM's bug https://bugs.llvm.org/show_bug.cgi?id=35562 arises. More details can be found in the code itself but this commit is also intended to ... Closes #46346
2017-12-20dwarf: set dwarf linkage_name for fns and statics to its mangled symbol namem4b-30/+24
2017-12-21Mir: Add Terminatorkind::AbortDavid Henningsson-0/+8
The Abort Terminatorkind will cause an llvm.trap function call to be emitted. Signed-off-by: David Henningsson <diwic@ubuntu.com>
2017-12-20Auto merge of #46583 - scottmcm:fix-static-i128-lower, r=eddybbors-0/+67
Fix -Z lower_128bit_ops handling of statics Avoids ICEs such as the following: > error: internal compiler error: src\librustc_metadata\cstore_impl.rs:131: > get_optimized_mir: missing MIR for `DefId(8/0:40 ~ > compiler_builtins[9532]::int[0]::addsub[0]::rust_i128_addo[0])` r? @nagisa cc #45676 @est31
2017-12-20Auto merge of #46874 - kennytm:rollup, r=kennytmbors-1/+2
Rollup of 14 pull requests - Successful merges: #46359, #46517, #46671, #46751, #46760, #46787, #46794, #46828, #46831, #46835, #46851, #46852, #46856, #46870 - Failed merges:
2017-12-20Rollup merge of #46852 - scottmcm:asm-placecontext, r=arielb1kennytm-0/+1
Split PlaceContext::Store into Store & AsmOutput Outputs in InlineAsm can be read-write, so splitting it out is useful for things like Store-Store folding, as that's unsound for a Store-AsmOutput. This PR is intended to make no changes, just be the mechanical split of the enum. Future changes can use the split, like a MIR pass I'm working on and perhaps two-phase borrows (see this FIXME: https://github.com/rust-lang/rust/pull/46852/files#diff-74dcd7740ab2104cd2b9a3b68dd4f208R543)
2017-12-20Rollup merge of #46751 - michaelwoerister:c-incremental, r=alexcrichtonkennytm-1/+1
incr.comp.: Add `-C incremental` in addition to `-Z incremental` This PR adds a stable commandline option for invoking incremental compilation. r? @alexcrichton
2017-12-20Auto merge of #46457 - m4b:no_mangle_static, r=michaelwoeristerbors-6/+14
Don't set the linkage_name for static variables For `no_mangle` statics: 1. Linkage_name no longer set 2. The static variable also no longer has a dwarf namespace scope This matches C++ output, which does not set the linkage_name and is not scoped: e.g. c++: ``` 0x000000b6: DW_TAG_base_type [8] DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000077] = "long int") DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed) DW_AT_byte_size [DW_FORM_data1] (0x08) 0x000000bd: DW_TAG_variable [9] DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000053] = "TEST") DW_AT_type [DW_FORM_ref4] (cu + 0x0048 => {0x00000048}) DW_AT_external [DW_FORM_flag_present] (true) DW_AT_decl_file [DW_FORM_data1] ("/home/m4b/tmp/bad_debug/test.cpp") DW_AT_decl_line [DW_FORM_data1] (14) DW_AT_location [DW_FORM_exprloc] (<0x9> 03 40 10 20 00 00 00 00 00 ) 0x000000d2: DW_TAG_namespace [2] * DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000009d] = "std") ``` and (now) Rust: ``` 0x0000002a: DW_TAG_variable [2] DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000046] = "TEST") DW_AT_type [DW_FORM_ref4] (cu + 0x0045 => {0x00000045}) DW_AT_external [DW_FORM_flag_present] (true) DW_AT_decl_file [DW_FORM_data1] ("/tmp/test.rs") DW_AT_decl_line [DW_FORM_data1] (8) DW_AT_alignment [DW_FORM_udata] (1) DW_AT_location [DW_FORM_exprloc] (<0x9> 03 c0 4d 06 00 00 00 00 00 ) 0x00000040: DW_TAG_namespace [3] * DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000004b] = "test") ```
2017-12-20incr.comp.: Use an IndexVec instead of a hashmap for storing result hashes.Michael Woerister-3/+2
2017-12-19dwarf: do not set linkage_name for no mangle statics, and do not have a ↵m4b-6/+14
scope. ref #33172
2017-12-19Split PlaceContext::Store into Store & AsmOutputScott McMurray-0/+1
Outputs in InlineAsm can be read-write, so splitting it out is useful for things like Store-Store folding, as it cannot be done for a Store-AsmOutput. This PR is intended to make no changes, just be the mechanical split of the enum. Future changes can use the split, like a MIR pass I'm working on and perhaps two-phase borrows.
2017-12-19Fix -Z lower_128bit_ops handling of staticsScott McMurray-0/+67
Avoids ICEs such as the following: error: internal compiler error: src\librustc_metadata\cstore_impl.rs:131: get_optimized_mir: missing MIR for `DefId(8/0:40 ~ compiler_builtins[9532]::int[0]::addsub[0]::rust_i128_addo[0])`
2017-12-19Auto merge of #46829 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-2/+2
Rollup of 11 pull requests - Successful merges: #46700, #46786, #46790, #46800, #46801, #46802, #46804, #46805, #46812, #46824, #46825 - Failed merges:
2017-12-18rustc: Work around `DICompileUnit` bugs in LLVMAlex Crichton-0/+46
This commit implements a workaround for #46346 which basically just avoids triggering the situation that LLVM's bug https://bugs.llvm.org/show_bug.cgi?id=35562 arises. More details can be found in the code itself but this commit is also intended to ... Closes #46346
2017-12-18normalize the results of `tcx.type_of` after substitutingAriel Ben-Yehuda-3/+2
Also remove `def_ty`, which was a footgun because it did not do the above.
2017-12-18Move partitioning.rs to rustc_mirMaik Klein-685/+4
2017-12-18Prefer type_of().substs over instance::ty()Maik Klein-4/+4
2017-12-18Move has_metadata back to context.rsMaik Klein-1/+11
2017-12-18Remove duplicated functions from trans::common.rsMaik Klein-59/+21
2017-12-18Move meta_data into TySMaik Klein-2/+1
2017-12-18Refactor paths to middle::trans to mir::monoMaik Klein-8/+8
2017-12-18Rename mono_item.rs to item.rsMaik Klein-3/+3
2017-12-18Rename as_trans_item to as_mono_itemMaik Klein-6/+6