about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
AgeCommit message (Collapse)AuthorLines
2018-08-19mv (mod) codemap source_mapDonato Sciarra-1/+1
2018-08-19mv FileMap SourceFileDonato Sciarra-1/+1
2018-08-19Fix typos found by codespell.Matthias Krüger-3/+3
2018-08-19Auto merge of #51131 - qnighy:unsized-locals, r=eddybbors-43/+222
Implement Unsized Rvalues This PR is the first step to implement RFC1909: unsized rvalues (#48055). ## Implemented - `Sized` is removed for arguments and local bindings. (under `#![feature(unsized_locals)]`) - Unsized locations are allowed in MIR - Unsized places and operands are correctly translated at codegen ## Not implemented in this PR - Additional `Sized` checks: - tuple struct constructor (accidentally compiles now) - closure arguments at closure generation (accidentally compiles now) - upvars (ICEs now) - Generating vtable for `fn method(self)` (ICEs now) - VLAs: `[e; n]` where `n` isn't const - Reduce unnecessary allocations ## Current status - [x] Fix `__rust_probestack` (rust-lang-nursery/compiler-builtins#244) - [x] Get the fix merged - [x] `#![feature(unsized_locals)]` - [x] Give it a tracking issue number - [x] Lift sized checks in typeck and MIR-borrowck - [ ] <del>Forbid `A(unsized-expr)`</del> will be another PR - [x] Minimum working codegen - [x] Add more examples and fill in unimplemented codegen paths - [ ] <del>Loosen object-safety rules (will be another PR)</del> - [ ] <del>Implement `Box<FnOnce>` (will be another PR)</del> - [ ] <del>Reduce temporaries (will be another PR)</del>
2018-08-19fix: use detected MSVC's link.exeJorge Aparicio-2/+5
2018-08-19LinkerFlavor::Gcc defaults to cc, not gccJorge Aparicio-1/+1
2018-08-19Integrate OperandValue::UnsizedRef into OperandValue::Ref.Masaki Hara-43/+27
2018-08-19Integrate PassMode::UnsizedIndirect into PassMode::Indirect.Masaki Hara-24/+19
2018-08-19Implement simple codegen for unsized rvalues.Masaki Hara-20/+196
2018-08-19Add Builder::array_alloca.Masaki Hara-0/+24
2018-08-18Auto merge of #52592 - eddyb:or-default, r=Mark-Simulacrumbors-5/+4
Use the new Entry::or_default method where possible.
2018-08-18Use the new Entry::or_default method where possible.Eduard-Mihai Burtescu-5/+4
2018-08-18fatal -> bugJorge Aparicio-1/+1
2018-08-18Auto merge of #53286 - nagisa:cast-assumes, r=eddybbors-1/+3
Do not generate assumes for plain integer casts I gave up on making anything more elegant for now. r? @eddyb
2018-08-18add lld_flavor info to target specJorge Aparicio-0/+2
this field defaults to the LD / GNU flavor
2018-08-18Remove LinkMeta structbjorn3-19/+14
2018-08-18Auto merge of #53437 - alexcrichton:fix-target-features, r=michaelwoeristerbors-35/+44
Set more llvm function attributes for __rust_try This shim is generated elsewhere in the compiler so this commit adds support to ensure it goes through similar paths as the rest of the compiler to set llvm function attributes like target features. cc #53372
2018-08-17Auto merge of #53356 - michaelwoerister:itlto, r=alexcrichtonbors-61/+31
Preliminary work for incremental ThinLTO (CGU name edition) Bring back the first half of #52266 but hopefully without the performance regression.
2018-08-16Set more llvm function attributes for __rust_tryAlex Crichton-35/+44
This shim is generated elsewhere in the compiler so this commit adds support to ensure it goes through similar paths as the rest of the compiler to set llvm function attributes like target features. cc #53372
2018-08-16wasm: Remove --strip-debug argument to LLDAlex Crichton-12/+0
Originally added in #52887 this commit disables passing `--strip-debug` to LLD when optimized. This bring back the original bug of emitting broken debuginfo but currently it *also* strips the `name` section which makes it very difficult to inspect the final binary. A real fix is happening at https://reviews.llvm.org/D50729 and we can reevaluate once we've updated LLD to have that commit.
2018-08-15Auto merge of #53237 - overdrivenpotato:wasm-export-table, r=alexcrichtonbors-0/+3
Export WASM table by default This allows loading a rust-generated `.wasm` binary in a host and using the exported table much like the `memory` export.
2018-08-15Use CGU name as LLVM module name and add some caching to CGU name generation.Michael Woerister-61/+31
2018-08-14Rollup merge of #53290 - whitequark:fix-35741, r=nagisakennytm-1/+5
Make LLVM emit assembly comments with -Z asm-comments Fixes #35741, and makes `-Z asm-comments` actually do something useful. Before: ``` .section .text.main,"ax",@progbits .globl main .p2align 4, 0x90 .type main,@function main: .cfi_startproc pushq %rax .cfi_def_cfa_offset 16 movslq %edi, %rax leaq _ZN1t4main17he95a7d4f1843730eE(%rip), %rdi movq %rsi, (%rsp) movq %rax, %rsi movq (%rsp), %rdx callq _ZN3std2rt10lang_start17h3121da83b2bc3697E movl %eax, %ecx movl %ecx, %eax popq %rcx .cfi_def_cfa_offset 8 retq .Lfunc_end8: .size main, .Lfunc_end8-main .cfi_endproc ``` After: ``` .section .text.main,"ax",@progbits .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: pushq %rax .cfi_def_cfa_offset 16 movslq %edi, %rax leaq _ZN1t4main17he95a7d4f1843730eE(%rip), %rdi movq %rsi, (%rsp) # 8-byte Spill movq %rax, %rsi movq (%rsp), %rdx # 8-byte Reload callq _ZN3std2rt10lang_start17h3121da83b2bc3697E movl %eax, %ecx movl %ecx, %eax popq %rcx .cfi_def_cfa_offset 8 retq .Lfunc_end8: .size main, .Lfunc_end8-main .cfi_endproc # -- End function ```
2018-08-14Rollup merge of #53274 - bjorn3:remove_statics_field, r=nagisakennytm-7/+0
Remove statics field from CodegenCx It doesnt seem to be used anywhere.
2018-08-14Rollup merge of #53239 - cuviper:llvm5-closure-alloca, r=eddybkennytm-2/+24
rustc_codegen_llvm: Restore the closure env alloca hack for LLVM 5. This hack was removed in #50949, but without it I found that building `std` with full debuginfo would print many LLVM `DW_OP_LLVM_fragment` errors, then die `LLVM ERROR: Failed to strip malformed debug info`. It doesn't seem to be a problem for LLVM 6, so we can re-enable the hack just for older LLVM. This reverts commit da579ef75e4a8ca11fb98b24a0a3ea0c7ccffeeb. Fixes #53204. r? @eddyb
2018-08-13Auto merge of #53161 - michaelwoerister:cstrings, r=wesleywiserbors-92/+81
Avoid many allocations for CStrings during codegen. Giving in to my irrational fear of dynamic allocations. Let's see what perf says to this.
2018-08-12Rollup merge of #53230 - memoryruins:nll_bootstrap_4, r=nikomatsakisGuillaume Gomez-2/+3
[nll] enable feature(nll) on various crates for bootstrap: part 4 #53172 r? @nikomatsakis
2018-08-12Make LLVM emit assembly comments with -Z asm-comments.whitequark-1/+5
Fixes #35741.
2018-08-12Do not generate assumes for plain integer castsSimonas Kazlauskas-1/+3
2018-08-11Remove statics field from CodegenCxbjorn3-7/+0
2018-08-10[nll] librustc_codegen_llvm: remove unused mut annotationmemoryruins-1/+1
2018-08-10[nll] librustc_codegen_llvm: change Child signature to fix error pointed out ↵memoryruins-1/+1
by nll As explained by eddyb in #53221, "An &ArchiveChild doesn't point into the archive itself, it points to an owned object that itself points to the archive, and LLVMRustArchiveMemberNew copies the ArchiveChild (whereas the current signature suggests it keeps the &ArchiveChild)."
2018-08-10[nll] librustc_codegen_llvm: enable feature(nll) for bootstrapmemoryruins-0/+1
2018-08-10Introduce SmallCStr and use it where applicable.Michael Woerister-75/+68
2018-08-10Introduce const_cstr!() macro and use it where applicable.Michael Woerister-17/+13
2018-08-10Auto merge of #53073 - Mark-Simulacrum:data-structures, r=pnkfelixbors-8/+9
Cleanup to librustc::session and related code No functional changes, just some cleanup. This also creates the `rustc_fs_util` crate, but I can remove that change if desired. It felt a little odd to force crates to depend on librustc for some fs utilities; and also seemed good to generally keep the size of librustc lower (for compile times); fs_util will compile in parallel with essentially the first crate since it has no dependencies beyond std.
2018-08-09rustc_codegen_llvm: Restore the closure env alloca hack for LLVM 5.Josh Stone-2/+24
This hack was removed in #50949, but without it I found that building `std` with full debuginfo would print many LLVM `DW_OP_LLVM_fragment` errors, then die `LLVM ERROR: Failed to strip malformed debug info`. It doesn't seem to be a problem for LLVM 6, so we can re-enable the hack just for older LLVM. This reverts commit da579ef75e4a8ca11fb98b24a0a3ea0c7ccffeeb. Fixes #53204. r? @eddyb
2018-08-09address review commentsJorge Aparicio-60/+43
2018-08-09try to infer linker flavor from linker name and vice versaJorge Aparicio-34/+96
2018-08-09Export WASM table by defaultMarko Mijalkovic-0/+3
2018-08-09Auto merge of #53216 - kennytm:rollup, r=kennytmbors-0/+6
Rollup of 15 pull requests Successful merges: - #52773 (Avoid unnecessary pattern matching against Option and Result) - #53082 (Fix doc link (again)) - #53094 (Automatically expand section if url id point to one of its component) - #53106 (atomic ordering docs) - #53110 (Account for --remap-path-prefix in save-analysis) - #53116 (NetBSD: fix signedess of char) - #53179 (Whitelist wasm32 simd128 target feature) - #53183 (Suggest comma when missing in macro call) - #53207 (Add individual docs for rotate_{left, right}) - #53211 ([nll] enable feature(nll) on various crates for bootstrap) - #53214 ([nll] enable feature(nll) on various crates for bootstrap: part 2) - #53215 (Slightly refactor syntax_ext/format) - #53217 (inline some short functions) - #53219 ([nll] enable feature(nll) on various crates for bootstrap: part 3) - #53222 (A few cleanups for rustc_target)
2018-08-10Rollup merge of #53179 - gnzlbg:patch-3, r=alexcrichtonkennytm-0/+6
Whitelist wasm32 simd128 target feature r? @alexcrichton
2018-08-09Move Fingerprint to data structuresMark Rousskov-2/+3
2018-08-09Move path2cstr to rustc_fs_utilMark Rousskov-5/+4
2018-08-09Move rustc::util::fs into separate (new) crateMark Rousskov-2/+3
2018-08-09Auto merge of #53031 - michaelwoerister:cross-lto, r=alexcrichtonbors-14/+70
Apply some fixes to cross-language LTO (especially when targeting MSVC) This PR contains a few fixes that were needed in order to get Firefox compiling with Rust/C++ cross-language ThinLTO on Windows. The commits are self-contained and should be self-explanatory. r? @alexcrichton
2018-08-08Address review comments for #53031 and fix some merge fallout.Michael Woerister-6/+6
2018-08-08Add wasm32 simd128 target featuregnzlbg-0/+6
2018-08-07rustc: Tweak visibility of some lang itemsAlex Crichton-5/+26
This commit tweaks the linker-level visibility of some lang items that rustc uses and defines. Notably this means that `#[panic_implementation]` and `#[alloc_error_handler]` functions are never marked as `internal`. It's up to the linker to eliminate these, not rustc. Additionally `#[global_allocator]` generated symbols are no longer forced to `Default` visibility (fully exported), but rather they're relaxed to `Hidden` visibility). This symbols are *not* needed across DLL boundaries, only as a local implementation detail of the compiler-injected allocator symbols, so `Hidden` should suffice. Closes #51342 Closes #52795
2018-08-07Annotate functions in LLVM with target-cpu, same as Clang does.Michael Woerister-0/+22