summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
AgeCommit message (Collapse)AuthorLines
2019-11-03Make Emscripten unwinding use a valid type_infoAmanieu d'Antras-3/+10
This allows catch_panic to ignore C++ exceptions.
2019-11-03Make SEH exceptions use a rust_panic type instead of unsigned __int64*Amanieu d'Antras-17/+14
2019-11-02Auto merge of #63810 - oli-obk:const_offset_from, r=RalfJung,nikicbors-1/+18
Make <*const/mut T>::offset_from `const fn` This reenables offset_of cc @mjbshaw after https://github.com/rust-lang/rust/pull/63075 broke it
2019-10-31rustc_codegen_ssa: hide address ops from the declare_local interface.Eduard-Mihai Burtescu-48/+54
2019-10-31rustc_codegen_ssa: move debuginfo scopes into FunctionDebugContext.Eduard-Mihai Burtescu-74/+50
2019-10-31rustc_codegen_ssa: change set_var_name back to taking a &str.Eduard-Mihai Burtescu-2/+2
2019-10-31rustc_codegen_ssa: move debuginfo-related things to a new mir::debuginfo module.Eduard-Mihai Burtescu-12/+13
2019-10-29Rollup merge of #65832 - tlively:emscripten-exception-handling, r=alexcrichtonTyler Mandry-1/+6
Re-enable Emscripten's exception handling support Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests. r? @alexcrichton
2019-10-29Auto merge of #65435 - michaelwoerister:fix-issue-64153, r=alexcrichtonbors-2/+4
Fix #64153 This PR changes how the compiler detects if an object file from an upstream crate is a Rust object file or not. Instead of checking if the name starts with the crate name and ends with `.o` (which is not always the case, as described in #64153), it now just checks if the filename ends with `.rcgu.o`. This fixes #64153. However, ideally we'd clean up the code around filename generation some more. Then this check could be made more robust. r? @alexcrichton
2019-10-28Rollup merge of #65792 - Centril:split-syntax-2, r=petrochenkovMazdak Farrokhzad-3/+2
rustc, rustc_passes: reduce deps on rustc_expand Part of #65324. r? @petrochenkov
2019-10-27Always use consteval to codegen caller_location.Adam Perry-16/+0
2019-10-27Panicking infra uses &core::panic::Location.Adam Perry-48/+0
This allows us to remove `static_panic_msg` from the SSA<->LLVM boundary, along with its fat pointer representation for &str. Also changes the signature of PanicInfo::internal_contructor to avoid copying. Closes #65856.
2019-10-27Implement core::intrinsics::caller_location.Adam Perry-0/+22
Returns a `&core::panic::Location` corresponding to where it was called, also making `Location` a lang item.
2019-10-27rustc, rustc_passes: don't depend on syntax_expand.Mazdak Farrokhzad-3/+2
This is done by moving some data definitions to syntax::expand.
2019-10-25FormattingThomas Lively-1/+2
2019-10-25Re-enable Emscripten's exception handling supportThomas Lively-1/+5
Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests.
2019-10-24rustc: Add a convenience alias for `dyn MetadataLoader + Sync`Vadim Petrochenkov-2/+2
2019-10-23Rollup merge of #65657 - nnethercote:rm-InternedString-properly, r=eddybMazdak Farrokhzad-11/+10
Remove `InternedString` This PR removes `InternedString` by converting all occurrences to `Symbol`. There are a handful of places that need to use the symbol chars instead of the symbol index, e.g. for stable sorting; local conversions `LocalInternedString` is used in those places. r? @eddyb
2019-10-22Fix issue #64153 by checking for .rcgu.o suffix when trying to identify Rust ↵Michael Woerister-2/+4
generated object files.
2019-10-22Auto merge of #65501 - alexcrichton:remove-emscripten-backend, r=Mark-Simulacrumbors-6/+0
Remove `src/llvm-emscripten` submodule With #65251 landed there's no need to build two LLVM backends and ship them with rustc, every target we have now uses the same LLVM backend! This removes the `src/llvm-emscripten` submodule and additionally removes all support from rustbuild for building the emscripten LLVM backend. Multiple codegen backend support is left in place for now, and this is intended to be an easy 10-15 minute win on CI times by avoiding having to build LLVM twice.
2019-10-21Remove `src/llvm-emscripten` submoduleAlex Crichton-6/+0
With #65251 landed there's no need to build two LLVM backends and ship them with rustc, every target we have now uses the same LLVM backend! This removes the `src/llvm-emscripten` submodule and additionally removes all support from rustbuild for building the emscripten LLVM backend. Multiple codegen backend support is left in place for now, and this is intended to be an easy 10-15 minute win on CI times by avoiding having to build LLVM twice.
2019-10-21Rollup merge of #65647 - nnethercote:rm-unnecessary-traits, r=CentrilMazdak Farrokhzad-2/+1
Remove unnecessary trait bounds and derivations This PR removes unnecessary trait bounds and derivations from many types. r? @nikomatsakis
2019-10-21Remove many unnecessary trait derivations.Nicholas Nethercote-2/+1
2019-10-21Use `Symbol` for codegen unit names.Nicholas Nethercote-5/+4
This is a straightforward replacement except for two places where we have to convert to `LocalInternedString` to get a stable sort.
2019-10-21Change `SymbolName::name` from `InternedString` to `Symbol`.Nicholas Nethercote-1/+1
This requires changing the `PartialOrd`/`Ord` implementations to look at the chars rather than the symbol index.
2019-10-21Convert fields within `DefPathData` from `InternedString` to `Symbol`.Nicholas Nethercote-1/+1
It's a full conversion, except in `DefKey::compute_stable_hash()` where a `Symbol` now is converted to an `InternedString` before being hashed. This was necessary to avoid test failures.
2019-10-21Convert some `InternedString`s to `Symbols`.Nicholas Nethercote-4/+4
This avoids the needs for various conversions, and makes the code slightly faster, because `Symbol` comparisons and hashing is faster.
2019-10-21Rollup merge of #65460 - sinkuu:contains_insert, r=varkorYuki Okushi-3/+1
Clean up `contains()` `insert()` chains on HashSet They can be merged to a single `insert()` call, which may avoid double-hashing/lookup of the value.
2019-10-18Use dedicated method for getting the type sizeOliver Scherer-1/+1
Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
2019-10-18Avoid realloc in `CString::new`Shotaro Yamada-3/+1
2019-10-17Rollup merge of #65465 - Centril:split-syntax-1, r=petrochenkovMazdak Farrokhzad-2/+3
Move syntax::ext to a syntax_expand and refactor some attribute logic Part of https://github.com/rust-lang/rust/pull/65324. r? @petrochenkov
2019-10-16Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-2/+1
- Compatible with Emscripten 1.38.46-upstream or later upstream. - Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the old incorrect wasm32 C call ABI with the correct one, preserving the old one as wasm32_bindgen_compat for wasm-bindgen compatibility. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-2/+3
2019-10-16Make use of the return value of `HashSet::insert`Shotaro Yamada-3/+1
2019-10-14Rollup merge of #65340 - bjorn3:cg_ssa_refactor4, r=eddybTyler Mandry-87/+47
Several changes to the codegen backend organization * Split functions from values in cg_ssa `BackendTypes`. * Remove `is_const_integral` function from `ConstMethods`. * Actually register the invalid monomorphization of intrinsic long diagnostic and remove the `diagnostics` method from `CodegenBackends`, as it was unused. * Add cg_ssa and cg_utils provided methods to `default_provide`, so codegen backend don't have to do it themself.
2019-10-13Improve type safetybjorn3-24/+17
2019-10-13Remove MiscMethods::instancesbjorn3-7/+7
2019-10-13Inline functions from cg_ssa::callee and remove the modbjorn3-3/+16
Fixes #65271
2019-10-13s/FuncId/Functionbjorn3-2/+2
2019-10-13Move span_invalid_monomorphization_error from cg_llvm to cg_ssabjorn3-46/+2
The associated long diagnostic didn't get registered before
2019-10-13Move some provides from cg_llvm to rustc_interfacebjorn3-5/+0
2019-10-13Remove unused method CodegenBackend::diagnosticsbjorn3-4/+0
2019-10-13Remove is_const_integral method from ConstMethodsbjorn3-10/+14
2019-10-13Introduce FuncId backend typebjorn3-0/+3
2019-10-12some typographyRalf Jung-2/+2
2019-10-12remove old branch of unwind logicRalf Jung-21/+1
2019-10-12Auto merge of #65020 - ↵bors-13/+39
pnkfelix:targetted-fix-for-always-marking-rust-abi-unwind-issue-64655, r=alexcrichton Always mark rust and rust-call abi's as unwind PR #63909 identified a bug that had been injected by PR #55982. As discussed on https://github.com/rust-lang/rust/issues/64655#issuecomment-537517428 , we started marking extern items as nounwind, *even* extern items that said they were using "Rust" or "rust-call" ABI. This is a more targeted variant of PR #63909 that fixes the above bug. Fix #64655 ---- I personally suspect we will want PR #63909 to land in the long-term But: * it is not certain that PR #63909 *will* land, * more importantly, PR #63909 almost certainly will not be backported to beta/stable. The identified bug was more severe than I think anyone realized (apart from perhaps @gnzlbg, as noted [here](https://github.com/rust-lang/rust/pull/63909#issuecomment-524818838)). Thus, I was motivated to write this PR, which fixes *just* the issue with extern rust/rust-call functions, and deliberately avoids injecting further deviation from current behavior (you can see further notes on this in the comments of the code added here).
2019-10-11Auto merge of #64716 - jonhoo:stabilize-mem-take, r=SimonSapinbors-1/+0
Stabilize mem::take (mem_take) Tracking issue: https://github.com/rust-lang/rust/issues/61129 r? @matklad
2019-10-11Make <*const/mut T>::offset_from `const fn`Oliver Scherer-1/+18
2019-10-10Auto merge of #59546 - sfanxiang:interminable-ub, r=nagisabors-0/+11
Add llvm.sideeffect to potential infinite loops and recursions LLVM assumes that a thread will eventually cause side effect. This is not true in Rust if a loop or recursion does nothing in its body, causing undefined behavior even in common cases like `loop {}`. Inserting llvm.sideeffect fixes the undefined behavior. As a micro-optimization, only insert llvm.sideeffect when jumping back in blocks or calling a function. A patch for LLVM is expected to allow empty non-terminate code by default and fix this issue from LLVM side. https://github.com/rust-lang/rust/issues/28728 **UPDATE:** [Mentoring instructions here](https://github.com/rust-lang/rust/pull/59546#issuecomment-515072429) to unstall this PR