about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
AgeCommit message (Collapse)AuthorLines
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
2018-08-07Set 'PrepareForThinLTO' whenever doing cross-language LTO.Michael Woerister-1/+2
2018-08-07Make sure upstream object files are added to staticlibs when compilingMichael Woerister-1/+5
with ThinLTO and cross-lang-lto. Normally, when compiling with whole-crate-graph ThinLTO, we expect rustc's LTO step to "uplift" upstream object files/LLVM modules to the current set of compilation artifacts. Therefore the staticlib creation code skips this uplifting. However, when compiling with "cross-language LTO" (i.e. defer LTO to the actual linker), the LTO step in rustc is not performed, so we have to take care of copying upstream object files during archive creation (like we already do when compiling without any LTO).
2018-08-07Fix issue around dllimport and ThinLTO as LLD runs it.Michael Woerister-7/+36
2018-08-07Rollup merge of #53028 - Mark-Simulacrum:split-out-codegen, r=alexcrichtonkennytm-27/+0
Building librustc_codegen_llvm in a separate directory This allows clearing it out and building it separately from the compiler. Since it's essentially a different and separate crate this makes sense to do, each cargo invocation should generally happen in its own directory. r? @alexcrichton
2018-08-07Auto merge of #51007 - AstralSorcerer:master, r=nagisabors-14/+60
Make globals with private linkage unnamed. Fixes #50862. cc @oli-obk @nagisa
2018-08-06Building librustc_codegen_llvm in a separate directoryMark Rousskov-27/+0
This allows clearing it out and building it separately from the compiler. Since it's essentially a different and separate crate this makes sense to do, each cargo invocation should generally happen in its own directory.
2018-08-05Remove unnecessary feature attributes that sneaked invarkor-1/+0
2018-08-04Move share_generics getter onto options directlyMark Rousskov-2/+2
2018-08-04Simplify some handling of target_pointer_widthMark Rousskov-35/+6
2018-08-04Normalize DebugInfoLevel to standard styleMark Rousskov-23/+23
2018-08-04Normalize EntryFnType variants to standard styleMark Rousskov-3/+3
2018-08-04Normalize variants of Passes to standard styleMark Rousskov-4/+3
2018-08-04Normalize variants of CrateType to standard styleMark Rousskov-46/+46
This is a clippy-breaking change.
2018-08-03Auto merge of #52712 - oli-obk:const_eval_cleanups, r=RalfJungbors-11/+17
Reintroduce `Undef` and properly check constant value sizes r? @RalfJung cc @eddyb basically all kinds of silent failures that never occurred are assertions now
2018-08-03Auto merge of #52887 - yurydelendik:disable-lld-symbols, r=alexcrichtonbors-0/+12
Disable debug sections when optimization flags is set for LLD. Currently LLD does not error when optimization is set and debugging information sections are present. (See discussion at https://reviews.llvm.org/D47901) Using `--strip-debug` along with the `-O` option.
2018-08-02Basic profilingWesley Wiser-0/+6
2018-08-02Second field of ScalarPair can be undef in some casesOliver Schneider-7/+11
2018-08-01Rollup merge of #52799 - Mark-Simulacrum:attr-id-bitvecs, r=michaelwoeristerPietro Albini-10/+10
Use BitVector for global sets of AttrId
2018-08-01Reintroduce `Undef` and properly check constant value sizesOliver Schneider-4/+6
2018-08-01Split out growth functionality into BitVector typeMark Rousskov-10/+10
2018-08-01Make sure we prepare for thin LTO whenever we are emitting bitcodeColin Pronovost-0/+31
Emitting LLVM bitcode uses ThinLTOBuffers, so we need to prepare for thin LTO or we will likely cause errors in LLVM.