about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
AgeCommit message (Collapse)AuthorLines
2019-09-06rustc_codegen_llvm: give names to non-alloca variable values.Eduard-Mihai Burtescu-3/+34
2019-09-05Remove rustc_diagnostic_macros featureMark Rousskov-1/+0
2019-09-05Remove codegen dependenciesMark Rousskov-4/+0
Not doing this leads to building two copies of e.g. num_cpus in the sysroot and _llvm deps, leading to conflicts between the two when compiling librustc_codegen_llvm. It's not entirely clear why this is the case after the changes in this PR but likely has something to do with a subtle difference in ordering or similar.
2019-09-05Replace diagnostic plugins with macro_rulesMark Rousskov-4/+2
2019-09-05Rollup merge of #64003 - Dante-Broggi:place-align-in-layout, r=matthewjasperMazdak Farrokhzad-3/+3
place: Passing `align` = `layout.align.abi`, when also passing `layout` Of the calls changed: 7/12 use `align` = `layout.align.abi`. `from_const_alloc` uses `alloc.align`, but that is `assert_eq!` to `layout.align.abi`. only 4/11 use something interesting for `align`.
2019-09-05Rollup merge of #64141 - nnethercote:minimize-LocalInternedString, ↵Mazdak Farrokhzad-21/+23
r=petrochenkov Minimize uses of `LocalInternedString` `LocalInternedString` is described as "An alternative to `Symbol` and `InternedString`, useful when the chars within the symbol need to be accessed. It is best used for temporary values." This PR makes the code match that comment, by removing all non-local uses of `LocalInternedString`. This allows the removal of a number of operations on `LocalInternedString` and a couple of uses of `unsafe`.
2019-09-04Remove `LocalInternedString` uses from `librustc_codegen_llvm`.Nicholas Nethercote-11/+12
2019-09-04Remove `LocalInternedString` uses from `librustc_codegen_llvm/consts.rs`.Nicholas Nethercote-7/+8
2019-09-04Remove `LocalInternedString` uses from `librustc/ty/`.Nicholas Nethercote-4/+4
This is not a compelling change in isolation, but it is a necessary step.
2019-09-02Auto merge of #63561 - HeroicKatora:alloc-private-bytes, r=oli-obkbors-9/+50
Make Allocation::bytes private Fixes #62931. Direct immutable access to the bytes is still possible but redirected through the new method `raw_bytes_with_undef_and_ptr`, similar to `get_bytes_with_undef_and_ptr` but without requiring an interpretation context and not doing *any* relocation or bounds checks. The `size` of the allocation is stored separately which makes access as `Size` and `usize` more ergonomic. cc: @RalfJung
2019-08-30Fixup remaining direct relocation field referencesAndreas Molzer-4/+4
2019-08-29`new_sized` is mostly used without alignDante-Broggi-3/+3
so rename it `new_sized_aligned`. 6/11 use `align` = `layout.align.abi`. `from_const_alloc` uses `alloc.align`, but that is `assert_eq!` to `layout.align.abi`. only 4/11 use something interesting for `align`.
2019-08-29Rollup merge of #63956 - alexcrichton:fix-lto-all-cached, r=michaelwoeristerMazdak Farrokhzad-48/+45
rustc: Handle modules in "fat" LTO more robustly When performing a "fat" LTO the compiler has a whole mess of codegen units that it links together. To do this it needs to select one module as a "base" module and then link everything else into this module. Previously LTO passes assume that there's at least one module in-memory to link into, but nowadays that's not always true! With incremental compilation modules may actually largely be cached and it may be possible that there's no in-memory modules to work with. This commit updates the logic of the LTO backend to handle modules a bit more uniformly during a fat LTO. This commit immediately splits them into two lists, one serialized and one in-memory. The in-memory list is then searched for the largest module and failing that we simply deserialize the first serialized module and link into that. This refactoring avoids juggling three lists, two of which are serialized modules and one of which is half serialized and half in-memory. Closes #63349
2019-08-28Address naming and comments from reviewsAndreas Molzer-3/+3
2019-08-27rustc: Handle modules in "fat" LTO more robustlyAlex Crichton-48/+45
When performing a "fat" LTO the compiler has a whole mess of codegen units that it links together. To do this it needs to select one module as a "base" module and then link everything else into this module. Previously LTO passes assume that there's at least one module in-memory to link into, but nowadays that's not always true! With incremental compilation modules may actually largely be cached and it may be possible that there's no in-memory modules to work with. This commit updates the logic of the LTO backend to handle modules a bit more uniformly during a fat LTO. This commit immediately splits them into two lists, one serialized and one in-memory. The in-memory list is then searched for the largest module and failing that we simply deserialize the first serialized module and link into that. This refactoring avoids juggling three lists, two of which are serialized modules and one of which is half serialized and half in-memory. Closes #63349
2019-08-25debuginfo: give unique names to closure and generator typesPhilip Craig-3/+7
Closure types have been moved to the namespace where they are defined, and both closure and generator type names now include the disambiguator. This fixes an exception when lldb prints nested closures. Fixes #57822
2019-08-21Fix codegen with explicit allocation byte accessAndreas Molzer-7/+48
2019-08-18Auto merge of #63635 - oli-obk:default-slice-dangles, r=eddybbors-9/+15
Do not generate allocations for zero sized allocations Alternative to https://github.com/rust-lang/rust/issues/62487 r? @eddyb There are other places where we could do this, too, but that would cause `static FOO: () = ();` to not have a unique address
2019-08-17Cast only where necessaryOliver Scherer-4/+5
2019-08-17Remove SyntaxContext from {ast, hir}::{GlobalAsm, InlineAsm}Matthew Jasper-3/+4
We now store it in the `Span` of the expression or item.
2019-08-16Rename overflowing_{add,sub,mul} intrinsics to wrapping_{add,sub,mul}.Eduard-Mihai Burtescu-4/+4
2019-08-16Do not generate allocations for zero sized allocationsOliver Scherer-8/+13
2019-08-11Auto merge of #63343 - ishitatsuyuki:revert-62150, r=RalfJungbors-1/+1
Back out #62150 Ref: #62825 cc @RalfJung
2019-08-10Revert "Rollup merge of #62150 - alex:mem-uninit-refactor, r=RalfJung"Tatsuyuki Ishi-1/+1
This reverts commit 1d45156866b54c3fc36edfdfcdd8149ad9cb5711, reversing changes made to 0f92eb8a4a7d8715381f5b5d748d22315f6ff9c7.
2019-08-08Explain why we're sorting the modules.Joel Galenson-0/+1
2019-08-08Sort fat LTO modules later and add a test.Joel Galenson-2/+4
2019-08-07Auto merge of #61919 - alexreg:fix-atb-1, r=nikomatsakisbors-7/+7
Fix for "ambiguous associated type" issue with ATBs Fixes #61752. r? @nikomatsakis CC @Centril
2019-08-07Auto merge of #63152 - estebank:big-array, r=oli-obkbors-1/+6
Always error on `SizeOverflow` during mir evaluation Fix #55878, fix #25116. r? @oli-obk
2019-08-06Rollup merge of #63296 - alexcrichton:deduplicate-demangle, r=Mark-SimulacrumMazdak Farrokhzad-1/+1
Deduplicate rustc_demangle in librustc_codegen_llvm This commit removes the crates.io dependency of `rustc-demangle` from `rustc_codegen_llvm`. This crate is actually already pulled in to part of the `librustc_driver` build and with the upcoming pipelining implementation in Cargo it causes build issues if `rustc-demangle` is left to its own devices. This is not currently required, but once pipelining is enabled for rustc's own build it will be required to build correctly.
2019-08-05Fiddle param env through to `try_eval_bits` in most placesOliver Scherer-1/+1
2019-08-05Don't abort on unevaluated constants without at least tryting to eval themOliver Scherer-1/+1
2019-08-05A few cosmetic improvements.Alexander Regueiro-7/+7
2019-08-04tweak output and testsEsteban Küber-4/+1
2019-08-04review comments: clean upEsteban Küber-3/+3
2019-08-03Simplify change to layout_ofEsteban Küber-4/+0
2019-08-03Point to local place span on "type too big" errorEsteban Küber-1/+13
2019-08-02assert consistencyRalf Jung-3/+3
2019-08-02CTFE: simplify Value type by not checking for alignmentRalf Jung-4/+4
2019-08-01Use Rust integer types instead of libc's fixed-width typesgnzlbg-2/+2
2019-07-31Deduplicate rustc_demangle in librustc_codegen_llvmAlex Crichton-1/+1
This commit removes the crates.io dependency of `rustc-demangle` from `rustc_codegen_llvm`. This crate is actually already pulled in to part of the `librustc_driver` build and with the upcoming pipelining implementation in Cargo it causes build issues if `rustc-demangle` is left to its own devices. This is not currently required, but once pipelining is enabled for rustc's own build it will be required to build correctly.
2019-07-29Rollup merge of #62809 - alexcrichton:wasm-llvm-9, r=nikicMazdak Farrokhzad-2/+20
rustc: Update wasm32 support for LLVM 9 This commit brings in a number of minor updates for rustc's support for the wasm target which has changed in the LLVM 9 update. Notable updates include: * The compiler now no longer manually inserts the `producers` section, instead relying on LLVM to do so. LLVM uses the `llvm.ident` metadata for the `processed-by` directive (which is now emitted on the wasm target in this PR) and it uses debuginfo to figure out what `language` to put in the `producers` section. * Threaded WebAssembly code now requires different flags to be passed with LLD. In LLD we now pass: * `--shared-memory` - required since objects are compiled with atomics. This also means that the generated memory will be marked as `shared`. * `--max-memory=1GB` - required with the `--shared-memory` argument since shared memories in WebAssembly must have a maximum size. The 1GB number is intended to be a conservative estimate for rustc, but it should be overridable with `-C link-arg` if necessary. * `--passive-segments` - this has become the default for multithreaded memory, but when compiling a threaded module all data segments need to be marked as passive to ensure they don't re-initialize memory for each thread. This will also cause LLD to emit a synthetic function to initialize memory which users will have to arrange to call. * The `__heap_base` and `__data_end` globals are explicitly exported since they're now hidden by default due to the `--export` flags we pass to LLD.
2019-07-28Deny `unused_lifetimes` through rustbuildVadim Petrochenkov-1/+0
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-11/+3
rustbuild Remove some random unnecessary lint `allow`s
2019-07-26Rollup merge of #62828 - nikic:fadd-mul-reductions, r=eddybMazdak Farrokhzad-50/+11
Remove vector fadd/fmul reduction workarounds The bugs that this was working around have been fixed in LLVM 9. r? @gnzlbg
2019-07-25Rollup merge of #62735 - petrochenkov:galloc, r=alexcrichtonMazdak Farrokhzad-4/+2
Turn `#[global_allocator]` into a regular attribute macro It was a 99% macro with exception of some diagnostic details. As a result of the change, `#[global_allocator]` now works in nested modules and even in nameless blocks. Fixes https://github.com/rust-lang/rust/issues/44113 Fixes https://github.com/rust-lang/rust/issues/58072
2019-07-25rustc: Update wasm32 support for LLVM 9Alex Crichton-2/+20
This commit brings in a number of minor updates for rustc's support for the wasm target which has changed in the LLVM 9 update. Notable updates include: * The compiler now no longer manually inserts the `producers` section, instead relying on LLVM to do so. LLVM uses the `llvm.ident` metadata for the `processed-by` directive (which is now emitted on the wasm target in this PR) and it uses debuginfo to figure out what `language` to put in the `producers` section. * Threaded WebAssembly code now requires different flags to be passed with LLD. In LLD we now pass: * `--shared-memory` - required since objects are compiled with atomics. This also means that the generated memory will be marked as `shared`. * `--max-memory=1GB` - required with the `--shared-memory` argument since shared memories in WebAssembly must have a maximum size. The 1GB number is intended to be a conservative estimate for rustc, but it should be overridable with `-C link-arg` if necessary. * `--passive-segments` - this has become the default for multithreaded memory, but when compiling a threaded module all data segments need to be marked as passive to ensure they don't re-initialize memory for each thread. This will also cause LLD to emit a synthetic function to initialize memory which users will have to arrange to call. * The `__heap_base` and `__data_end` globals are explicitly exported since they're now hidden by default due to the `--export` flags we pass to LLD.
2019-07-25Rollup merge of #62814 - androm3da:hexagon_19jul_2019, r=alexcrichtonMazdak Farrokhzad-1/+1
add support for hexagon-unknown-linux-musl
2019-07-24Merge `rustc_allocator` into `libsyntax_ext`Vadim Petrochenkov-4/+2
2019-07-22add support for hexagon-unknown-linux-muslBrian Cain-1/+1
2019-07-20Remove vector fadd/fmul reduction workaroundsNikita Popov-50/+11
The bugs that this was working around have been fixed in LLVM 9.