about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
AgeCommit message (Collapse)AuthorLines
2018-07-30rustc_codegen_llvm: remove #![allow(dead_code)] from llvm.Irina Popa-37/+2
2018-07-30rustc_codegen_llvm: remove unused ExecutionEngineRef type.Irina Popa-2/+0
2018-07-30rustc_codegen_llvm: use safe references for Metadata and DI*.Irina Popa-377/+411
2018-07-30rustc_codegen_llvm: use safe references for DIBuilder.Irina Popa-34/+33
2018-07-30rustc_codegen_llvm: use safe references for Builder.Irina Popa-144/+142
2018-07-30rustc_codegen_llvm: use safe references for Type.Irina Popa-533/+568
2018-07-30rustc_codegen_llvm: use safe references for Context and Module.Irina Popa-556/+549
2018-07-30rustc_codegen_llvm: move from empty enums to extern types.Irina Popa-197/+178
2018-07-30rustc_llvm: move to rustc_codegen_llvm::llvm.Irina Popa-2/+2437
2018-07-30Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkovbors-17/+17
Don't format!() string literals Prefer `to_string()` to `format!()` take 2, this time targetting string literals. In some cases (`&format!("...")` -> `"..."`) also removes allocations. Occurences of `format!("")` are changed to `String::new()`.
2018-07-29Auto merge of #52738 - ljedrz:push_to_extend, r=eddybbors-18/+16
Replace push loops with extend() where possible Or set the vector capacity where I couldn't do it. According to my [simple benchmark](https://gist.github.com/ljedrz/568e97621b749849684c1da71c27dceb) `extend`ing a vector can be over **10 times** faster than `push`ing to it in a loop: 10 elements (6.1 times faster): ``` test bench_extension ... bench: 75 ns/iter (+/- 23) test bench_push_loop ... bench: 458 ns/iter (+/- 142) ``` 100 elements (11.12 times faster): ``` test bench_extension ... bench: 87 ns/iter (+/- 26) test bench_push_loop ... bench: 968 ns/iter (+/- 3,528) ``` 1000 elements (11.04 times faster): ``` test bench_extension ... bench: 311 ns/iter (+/- 9) test bench_push_loop ... bench: 3,436 ns/iter (+/- 233) ``` Seems like a good idea to use `extend` as much as possible.
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-18/+16
2018-07-29Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkovbors-2/+2
Prefer to_string() to format!() Simple benchmarks suggest in some cases it can be faster by even 37%: ``` test converting_f64_long ... bench: 339 ns/iter (+/- 199) test converting_f64_short ... bench: 136 ns/iter (+/- 34) test converting_i32_long ... bench: 87 ns/iter (+/- 16) test converting_i32_short ... bench: 87 ns/iter (+/- 49) test converting_str ... bench: 54 ns/iter (+/- 15) test formatting_f64_long ... bench: 349 ns/iter (+/- 176) test formatting_f64_short ... bench: 145 ns/iter (+/- 14) test formatting_i32_long ... bench: 98 ns/iter (+/- 14) test formatting_i32_short ... bench: 93 ns/iter (+/- 15) test formatting_str ... bench: 86 ns/iter (+/- 23) ```
2018-07-29Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakisbors-3/+2
Misc cleanups
2018-07-28Don't format!() string literalsljedrz-17/+17
2018-07-28Rollup merge of #52703 - ljedrz:vec_improvements, r=nikomatsakiskennytm-2/+3
Improve a few vectors - calculate capacity or build from iterators Collecting from iterators improves readability and tailoring vector capacities should be beneficial in terms of performance.
2018-07-27Auto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrumbors-1/+0
Rollup of bare_trait_objects PRs All deny attributes were moved into bootstrap so they can be disabled with a line of config. Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free. r? @Mark-Simulacrum cc @ljedrz @kennytm
2018-07-27Unnecessary `to_string`Shotaro Yamada-3/+2
2018-07-27Prefer to_string() to format!()ljedrz-2/+2
2018-07-26Improve a few vectors - calculate capacity or build from iteratorsljedrz-2/+3
2018-07-26Auto merge of #52735 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-64/+99
Rollup of 16 pull requests Successful merges: - #52558 (Add tests for ICEs which no longer repro) - #52610 (Clarify what a task is) - #52617 (Don't match on region kinds when reporting NLL errors) - #52635 (Fix #[linkage] propagation though generic functions) - #52647 (Suggest to take and ignore args while closure args count mismatching) - #52649 (Point spans to inner elements of format strings) - #52654 (Format linker args in a way that works for gcc and ld) - #52667 (update the stdsimd submodule) - #52674 (Impl Executor for Box<E: Executor>) - #52690 (ARM: expose `rclass` and `dsp` target features) - #52692 (Improve readability in a few sorts) - #52695 (Hide some lints which are not quite right the way they are reported to the user) - #52718 (State default capacity for BufReader/BufWriter) - #52721 (std::ops::Try impl for std::task::Poll) - #52723 (rustc: Register crates under their real names) - #52734 (sparc ABI issue - structure returning from function is returned in 64bit registers (with tests)) Failed merges: - #52678 ([NLL] Use better spans in some errors) r? @ghost
2018-07-26Auto merge of #52488 - nikomatsakis:nll-issue-48071-universe-and-sub, r=pnkfelixbors-10/+10
introduce universes to NLL type check This branch aims to fix #48071 and also advance chalk integration a bit at the same time. It re-implements the subtyping/type-equating check so that NLL doesn't "piggy back" on the subtyping code of the old type checker. This new code uses the "universe-based" approach to handling higher-ranked lifetimes, which sidesteps some of the limitations of the current "leak-based" scheme. This avoids the ICE in #48071. At the same time, I aim for this to potentially be a kind of optimization. This NLL code is (currently) not cached, but it also generates constraints without doing as much instantiation, substitution, and folding. Right now, though, it still piggy backs on the `relate_tys` trait, which is a bit unfortunate -- it means we are doing more hashing and things than we have to. I want to measure the see the perf. Refactoring that trait is something I'd prefer to leave for follow-up work. r? @pnkfelix -- but I want to measure perf etc first
2018-07-26Rollup merge of #52690 - paoloteti:rclass-dsp, r=alexcrichtonMark Rousskov-0/+2
ARM: expose `rclass` and `dsp` target features - `dsp`: the subtarget supports the DSP (saturating arith. and such) instructions - `rclass`: target is a Cortex-R Both features are useful to support ARM MCUs on `coresimd`. Note: Cortex-R52 is the first Armv8-R with `neon` support. r? @alexcrichton cc @japaric
2018-07-26Rollup merge of #52654 - alecmocatta:master, r=alexcrichtonMark Rousskov-17/+19
Format linker args in a way that works for gcc and ld Pass multiple linker arguments rather than concatenate with commas (fixes #52634). `-l library` -> `-llibrary` to work with apple's ld. To build with apple's ld I'm currently also passing `-C link-args="-arch x86_64 -macosx_version_min 10.13.0"`. I'll try and understand the latter flag better before PRing that. This PR currently works for me. Hopefully CI will pick up any grievous ramifications in other toolchains? Thanks to @alexcrichton for the pointer to the relevant code!
2018-07-26Rollup merge of #52635 - yodaldevoid:issue_18804, r=oli-obkMark Rousskov-47/+78
Fix #[linkage] propagation though generic functions Fixes #18804 In the non-local branch of `get_static` (where the fix was implemented) `span_fatal` had to be replaced with `bug!` as we have no span in that case.
2018-07-25ARM: expose `rclass` and `dsp` target featuresPaolo Teti-0/+2
- `dsp`: the subtarget supports the DSP (saturating arith. and such) instructions - `rclass`: target is a Cortex-R Both features are useful to support ARM MCUs on `coresimd`. Note: Cortex-R52 is the first Armv8-R with `neon` support
2018-07-25parameterize `BitVector` and `BitMatrix` by their index typesNiko Matsakis-10/+10
2018-07-25Deny bare_trait_objects globallyTatsuyuki Ishi-1/+0
2018-07-24Deduplicate linkage checking code for staticsGabriel Smith-85/+69
Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
2018-07-24Properly set the linkage type on non-local staticsGabriel Smith-6/+53
Fixes issue #18804 Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
2018-07-24Rollup merge of #52391 - Amanieu:volatile_unaligned, r=alexcrichtonMark Rousskov-3/+23
Add unaligned volatile intrinsics Surprisingly enough, it turns out that unaligned volatile loads are actually useful for certain (very niche) types of lock-free code. I included unaligned volatile stores for completeness, but I currently do not know of any use cases for them. These are only exposed as intrinsics for now. If they turn out to be useful in practice, we can work towards stabilizing them. r? @alexcrichton
2018-07-24Auto merge of #52597 - oli-obk:promotion_simplify, r=nagisabors-55/+100
Promoteds are statics and statics have a place, not just a value r? @eddyb This makes everything around promoteds a little simpler
2018-07-24break --subsystem=x into 2 args; closer to former presumably known-good ↵alecmocatta-1/+2
incantation
2018-07-24Pass multiple linker arguments rather than concatenate with commas; -l ↵alecmocatta-17/+18
library -> -llibrary to work with apple's ld
2018-07-23Replace a few expect+format combos with unwrap_or_else+panicljedrz-3/+3
2018-07-23Fix tidyOliver Schneider-1/+2
2018-07-23Explain promoted extraction for simd shuffleOliver Schneider-0/+3
2018-07-23Promoteds are statics and statics have a place, not just a valueOliver Schneider-55/+96
2018-07-23Auto merge of #52571 - oli-obk:promotion_abort, r=nagisabors-3/+8
Abort if a promoted fails to be const evaluable and its runtime checks didn't trigger r? @eddyb cc @RalfJung @nagisa cc https://github.com/rust-lang/rust/issues/49760
2018-07-21Auto merge of #52438 - ljedrz:rustc_vec_capacity, r=eddybbors-1/+7
Calculate Vec capacities in librustc Calculate the required capacity of a few vectors in rustc based on the number of elements they are populated with.
2018-07-21Rollup merge of #52573 - oli-obk:cleanups, r=RalfJungkennytm-18/+1
Cleanups r? @RalfJung
2018-07-21Rollup merge of #52505 - alexcrichton:remove-thinlto-hack, r=nikomatsakiskennytm-14/+0
rustc: Remove a workaround in ThinLTO fixed upstream This commit removes a hack in our ThinLTO passes which removes available externally functions manually. The [upstream bug][1] has long since been fixed, so we should be able to rely on LLVM natively for this now! [1]: https://bugs.llvm.org/show_bug.cgi?id=35736
2018-07-20Refactor a few push loops to iterators in librustcljedrz-1/+7
2018-07-20Abort instead of UB if promotion failsOliver Schneider-3/+8
2018-07-20Remove unused methodOliver Schneider-18/+1
2018-07-18rustc: Remove a workaroudn in ThinLTO fixed upstreamAlex Crichton-14/+0
This commit removes a hack in our ThinLTO passes which removes available externally functions manually. The [upstream bug][1] has long since been fixed, so we should be able to rely on LLVM natively for this now! [1]: https://bugs.llvm.org/show_bug.cgi?id=35736
2018-07-18rustc: Stabilize #[wasm_import_module] as #[link(...)]Alex Crichton-32/+54
This commit stabilizes the `#[wasm_import_module]` attribute as `#[link(wasm_import_module = "...")]`. Tracked by #52090 this new directive in the `#[link]` attribute is used to configured the module name that the imports are listed with. The WebAssembly specification indicates two utf-8 names are associated with all imported items, one for the module the item comes from and one for the item itself. The item itself is configurable in Rust via its identifier or `#[link_name = "..."]`, but the module name was previously not configurable and defaulted to `"env"`. This commit ensures that this is also configurable. Closes #52090
2018-07-16rustc: Use link_section, not wasm_custom_sectionAlex Crichton-79/+47
This commit transitions definitions of custom sections on the wasm target from the unstable `#[wasm_custom_section]` attribute to the already-stable-for-other-targets `#[link_section]` attribute. Mostly the same restrictions apply as before, except that this now applies only to statics. Closes #51088
2018-07-16ItemKindcsmoe-4/+4
2018-07-16ForeignItemKindcsmoe-1/+1