about summary refs log tree commit diff
path: root/src/librustc_trans
AgeCommit message (Collapse)AuthorLines
2018-04-10Fix "fp" feature for AArch64Amanieu d'Antras-0/+1
2018-04-10Make Session.injected_allocator and Session.allocator_kind thread-safeJohn Kåre Alsaker-1/+1
2018-04-10Make Session.crate_types thread-safeJohn Kåre Alsaker-11/+14
2018-04-10Make Session.plugin_registrar_fn and Session.derive_registrar_fn thread-safeJohn Kåre Alsaker-2/+2
2018-04-10Combine Session.entry_fn and Session.entry_type and make them thread-safeJohn Kåre Alsaker-6/+6
2018-04-10Reformat trans skip conditionvarkor-3/+3
2018-04-10Auto merge of #49390 - Zoxc:sync-syntax, r=michaelwoeristerbors-3/+3
More thread-safety changes r? @michaelwoerister
2018-04-09Use cmp::Reverse instead of subtractionvarkor-2/+3
2018-04-09Convert sort_by_key to sort_by_cached_keyvarkor-1/+2
2018-04-08Move deny(warnings) into rustbuildMark Simulacrum-1/+0
This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-07Auto merge of #49672 - alexcrichton:fix-another-std-core-cycle, ↵bors-1/+9
r=michaelwoerister Fix another circular deps link args issue It turns out that the support in #49316 wasn't enough to handle all cases notably the example in #48661. The underlying bug was connected to panic=abort where lang items were listed in the `missing_lang_items` sets but didn't actually exist anywhere. This caused the linker backend to deduce that start-group/end-group wasn't needed because not all items were defined. Instead the missing lang items that don't actually need to have a definition are filtered out and not considered for the start-group/end-group arguments Closes #48661
2018-04-07Auto merge of #49692 - sinkuu:main_fix, r=arielb1bors-4/+8
Fix ICE with `main`'s return type containing lifetimes Fixes #48890
2018-04-07Auto merge of #49661 - alexcrichton:bump-bootstrap, r=nikomatsakisbors-4/+0
Bump the bootstrap compiler to 1.26.0 beta Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-04-07Rollup merge of #49728 - japaric:no-debug_gdb_scripts, r=alexcrichtonkennytm-3/+2
add emit_debug_gdb_scripts target option and .. set it to false for no-std targets like ARM Cortex-M and MSP430. For the rationale of this change see the comment in thumb_base.rs this is a temporary workaround until #44993 is implemented r? @alexcrichton or @michaelwoerister
2018-04-06refactor: simplify `needs_gdb_debug_scripts_section`Jorge Aparicio-2/+0
2018-04-06add emit_debug_gdb_scripts target option and ..Jorge Aparicio-1/+2
set it to false for no-std targets like ARM Cortex-M and MSP430. For the rationale of this change see the comment in thumb_base.rs
2018-04-06Allow for re-using hidden monomorphizations on platforms that don't support ↵Michael Woerister-9/+27
Rust dylibs.
2018-04-06Update a few comments about symbol visibility.Michael Woerister-24/+22
2018-04-06Fix some rebasing fallout.Michael Woerister-1/+0
2018-04-06Select upstream monomorphizations in a stable way.Michael Woerister-5/+35
2018-04-06Allow for internalizing monomorphizations that cannot be shared.Michael Woerister-7/+52
2018-04-06Remove the (inaccurate) symbol_export_level query.Michael Woerister-4/+2
2018-04-06Allow for re-using monomorphizations from upstream crates.Michael Woerister-5/+74
2018-04-06Move export level computation to reachable_non_generics query.Michael Woerister-53/+49
2018-04-06Allow for representing exported monomorphizations in crate metadata.Michael Woerister-1/+2
2018-04-06Use InternedString instead of Symbol for type parameters.Michael Woerister-3/+3
2018-04-06Fix ICE with `main`'s return type containing lifetimesShotaro Yamada-4/+8
2018-04-05Bump the bootstrap compiler to 1.26.0 betaAlex Crichton-4/+0
Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-04-05Rollup merge of #49432 - nabijaczleweli:master, r=michaelwoeristerkennytm-4/+38
Flush executables to disk after linkage A problem caused by not doing so in Chrome has been reported [here](https://randomascii.wordpress.com/2018/02/25/compiler-bug-linker-bug-windows-kernel-bug/amp/). `File::sync_all()` calls `FlushFileBuffers()` down the line, causing potentially unflushed buffers on high I/O-load systems to flush and preventing nasty non-reproducible bugs. Closes #48545
2018-04-04Fix another circulare deps link args issueAlex Crichton-1/+9
It turns out that the support in #49316 wasn't enough to handle all cases notably the example in #48661. The underlying bug was connected to panic=abort where lang items were listed in the `missing_lang_items` sets but didn't actually exist anywhere. This caused the linker backend to deduce that start-group/end-group wasn't needed because not all items were defined. Instead the missing lang items that don't actually need to have a definition are filtered out and not considered for the start-group/end-group arguments Closes #48661
2018-03-31Special-case OutputType::Metadatavarkor-1/+4
2018-03-31Open the file as write before trying to flush itnabijaczleweli-1/+1
This should be enough and shouldn't require append(true) since we're not explicitly writing anything so we're not flushing it so we've no risk of overwriting it
2018-03-29rustc: Group linked libraries where neededAlex Crichton-0/+91
This commit fixes a longstanding issue with the compiler with circular dependencies between libcore and libstd. The `core` crate requires at least one symbol, the ability to unwind. The `std` crate is the crate which actually defines this symbol, but the `std` crate also depends on the `core` crate. This circular dependency is in general disallowed in Rust as crates cannot have cycles amongst them. A special exception is made just for core/std, but this is also unfortunately incompatible with how GNU linkers work. GNU linkers will process undefined symbols in a left-to-right fashion, only actually linking an rlib like libstd if there are any symbols used from it. This strategy is incompatible with circular dependencies because if we otherwise don't use symbols from libstd we don't discover that we needed it until we're later processing libcore's symbols! To fix this GNU linkers support the `--start-group` and `--end-group` options which indicate "libraries between these markers may have circular dependencies amongst them. The linker invocation has been updated to automatically pass these arguments when we're invoking a GNU linker and automatically calculate where the arguments need to go (around libstd and libcore) Closes #18807 Closes #47074
2018-03-29Also protect first attemptnabijaczleweli-1/+5
2018-03-29Flush executables to disk after linkagenabijaczleweli-3/+33
A problem caused by not doing so in Chrome has been reported here: https://randomascii.wordpress.com/2018/02/25/compiler-bug-linker-bug-windows-kernel-bug/amp/ File::sync_all() calls FlushFileBuffers() down the line, causing potentially unflushed buffers on high I/O-load systems to flush and prevent nasty non-reproducible bugs. The force-flush is only done on Windows and if the linker exited successfully Closes #48545
2018-03-28Rollup merge of #49329 - canarysnort01:fix-no-pie, r=pnkfelixkennytm-2/+4
don't pass -no-pie to gnu ld fixes #48884
2018-03-28Auto merge of #49019 - phil-opp:target-spec, r=pnkfelixbors-7/+9
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-28Make LLVM worker channel thread-safeJohn Kåre Alsaker-3/+3
2018-03-27Auto merge of #49249 - gnzlbg:simd_minmax, r=alexcrichtonbors-0/+23
implement minmax intrinsics This adds the `simd_{fmin,fmax}` intrinsics, which do a vertical (lane-wise) `min`/`max` for floating point vectors that's equivalent to Rust's `min`/`max` for `f32`/`f64`. It might make sense to make `{f32,f64}::{min,max}` use the `minnum` and `minmax` intrinsics as well. --- ~~HELP: I need some help with these. Either I should go to sleep or there must be something that I must be missing. AFAICT I am calling the `maxnum` builder correctly, yet rustc/LLVM seem to insert a call to `llvm.minnum` there instead...~~ EDIT: Rust's LLVM version is too old :/
2018-03-26Auto merge of #49101 - mark-i-m:stabilize_i128, r=nagisabors-2/+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-7/+9
2018-03-26Stabilize i128 feature tooMark Mansi-2/+1
2018-03-26Stabilize i128_typeMark Mansi-1/+1
2018-03-26Auto merge of #48346 - emilio:pgo, r=alexcrichtonbors-7/+102
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-26properly handle the case when LLVM does not have min/maxnumgnzlbg-2/+6
2018-03-26require llvm 6gnzlbg-2/+6
2018-03-26implement minmax intrinsicsgnzlbg-0/+15
2018-03-26Auto merge of #49297 - scottmcm:offset-from, r=dtolnaybors-1/+14
Introduce unsafe offset_from on pointers Adds intrinsics::exact_div to take advantage of the unsafe, which reduces the implementation from ```asm sub rcx, rdx mov rax, rcx sar rax, 63 shr rax, 62 lea rax, [rax + rcx] sar rax, 2 ret ``` down to ```asm sub rcx, rdx sar rcx, 2 mov rax, rcx ret ``` (for `*const i32`) See discussion on the `offset_to` tracking issue https://github.com/rust-lang/rust/issues/41079 Some open questions - Would you rather I split the intrinsic PR from the library PR? - Do we even want the safe version of the API? https://github.com/rust-lang/rust/issues/41079#issuecomment-374426786 I've added some text to its documentation that even if it's not UB, it's useless to use it between pointers into different objects. and todos - [x] ~~I need to make a codegen test~~ Done - [x] ~~Can the subtraction use nsw/nuw?~~ No, it can't https://github.com/rust-lang/rust/pull/49297#discussion_r176697574 - [x] ~~Should there be `usize` variants of this, like there are now `add` and `sub` that you almost always want over `offset`? For example, I imagine `sub_ptr` that returns `usize` and where it's UB if the distance is negative.~~ Can wait for later; C gives a signed result https://github.com/rust-lang/rust/issues/41079#issuecomment-375842235, so we might as well, and this existing to go with `offset` makes sense.
2018-03-25Auto merge of #49212 - kyrias:strip-debug-no-debuginfo, r=michaelwoeristerbors-1/+12
Pass --strip-debug to GccLinker when building without debuginfo C.f. #46034 --- This brings a hello-world built by passing rustc no command line options from 2.9M to 592K on Linux. (This might need to special case MacOS or Windows, not sure if the linkers there support `--strip-debug`, and there is an annoying lack of dependable docs for the linkers there.)