about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
AgeCommit message (Collapse)AuthorLines
2019-11-12Rename in librustc_codegen_llvm.Camille GILLOT-2/+2
2019-11-10Merge hir::Mutability into ast::Mutability.Camille GILLOT-1/+1
2019-11-07rustc_target: inline abi::FloatTy into abi::Primitive.Eduard-Mihai Burtescu-8/+8
2019-11-07syntax: use distinct FloatTy from rustc_target.Mazdak Farrokhzad-6/+6
We also sever syntax's dependency on rustc_target as a result. This should slightly improve pipe-lining. Moreover, some cleanup is done in related code.
2019-11-06Auto merge of #65134 - davidtwco:issue-19834-improper-ctypes-in-extern-C-fn, ↵bors-3/+2
r=rkruppe improper_ctypes: `extern "C"` fns cc #19834. Fixes #65867. This pull request implements the change [described in this comment](https://github.com/rust-lang/rust/issues/19834#issuecomment-466671572). cc @rkruppe @varkor @shepmaster
2019-11-06Rollup merge of #66062 - smaeul:patch/pic-level, r=estebankMazdak Farrokhzad-0/+5
Configure LLVM module PIC level As of LLVM 9, this is required for 32-bit PowerPC to properly generate PLT references. Previously, only BigPIC was supported; now LLVM supports both BigPIC and SmallPIC, and there is no default value provided.
2019-11-06Rollup merge of #65776 - nnethercote:rename-LocalInternedString-and-more, ↵Mazdak Farrokhzad-4/+4
r=estebank Rename `LocalInternedString` and more This PR renames `LocalInternedString` as `SymbolStr`, removes an unnecessary `impl` from it, improves comments, and cleans up some `SymbolStr` uses. r? @estebank
2019-11-05Rollup merge of #65953 - keystone-enclave:llvm_abiname, r=alexcrichtonPietro Albini-1/+3
Allow specifying LLVM's MCTargetOptions::ABIName in target specification files This addresses #65024, as it allows RISC-V target specification files to set `"llvm-abiname": "lp64d"`. Other languages (read: C) usually expose this codegen parameter under a compiler argument like `-mabi=<XYZ>`.
2019-11-05codegen_llvm: remove unnecessary "extern C"David Wood-4/+1
Signed-off-by: David Wood <david@davidtw.co>
2019-11-05improper_ctypes: `extern "C"` fnsDavid Wood-0/+2
2019-11-05Auto merge of #66109 - pietroalbini:rollup-2npidna, r=pietroalbinibors-0/+1
Rollup of 10 pull requests Successful merges: - #65136 (Update codegen option documentation.) - #65574 (docs: improve disclaimer regarding LinkedList) - #65720 (Add FFI bindings for LLVM's Module::getInstructionCount()) - #65905 ([doc] fixes for unix/vxworks `OpenOptionsExt::mode`) - #65962 (Fix logic in example.) - #66019 (Improved std::iter::Chain documentation) - #66038 (doc(str): show example of chars().count() under len()) - #66042 (Suggest correct code when encountering an incorrect trait bound referencing the current trait) - #66073 (Do not needlessly write-lock) - #66096 (Add a failing UI test for multiple loops of all kinds in a `const`) Failed merges: r? @ghost
2019-11-05Rollup merge of #65720 - icefoxen:LLVMgetInstructionCount, r=rkruppePietro Albini-0/+1
Add FFI bindings for LLVM's Module::getInstructionCount() Just to make it usable for profiling and such inside rustc itself. It was vaguely useful in https://wiki.alopex.li/WhereRustcSpendsItsTime and I figured I might as well upstream it; I may or may not ever get around to doing more with it (hopefully I will), but it may be useful for others.
2019-11-05Auto merge of #65938 - eddyb:fn-abi-rename, r=oli-obkbors-37/+37
rustc_target: rename {Fn,Arg}Type to {Fn,Arg}Abi. I was trying to tweak the API of `FnType` (now `FnAbi`) and the name kept bothering me. `FnAbi` is to a function signature a bit like a layout is to a type, so the name still isn't perfect yet, but at least it doesn't have the misleading `Type` in it anymore. If this can't land I think I can continue my original refactor without it, so I'm not strongly attached to it. r? @nagisa cc @oli-obk
2019-11-03Configure LLVM module PIC levelSamuel Holland-0/+5
As of LLVM 9, this is required for 32-bit PowerPC to properly generate PLT references. Previously, only BigPIC was supported; now LLVM supports both BigPIC and SmallPIC, and there is no default value provided.
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-03rustc_codegen_ssa: rename FnTypeLlvmExt to FnAbiLlvmExt.Eduard-Mihai Burtescu-4/+4
2019-11-03rustc_codegen_ssa: rename ArgTypeMethods to ArgAbiMethods.Eduard-Mihai Burtescu-1/+1
2019-11-03rustc: rename {Fn,Arg}TypeExt to {Fn,Arg}AbiExt.Eduard-Mihai Burtescu-4/+4
2019-11-03rustc_target: rename {Fn,Arg}Type to {Fn,Arg}Abi.Eduard-Mihai Burtescu-31/+31
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-11-02Add FFI bindings for Module::getInstructionCount()Simon Heath-0/+1
Just to make it useable for profiling and such inside rustc itself. It was vaguely useful in https://wiki.alopex.li/WhereRustcSpendsItsTime and I figured I might as well upstream it; I may or may not ever get around to doing more with it (hopefully I will), but it may be useful for others.
2019-11-02Simplify various `Symbol` use points.Nicholas Nethercote-4/+4
Including removing a bunch of unnecessary `.as_str()` calls, and a bunch of unnecessary sigils.
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-29Allow specifying key "llvm-abiname" in target specificationGui Andrade-1/+3
This addresses #65024, as it allows RISC-V target specification files to set "llvm-abiname": "lp64d". In general, it is useful for the programmer to be able to set this codegen parameter, which other languages usually expose under a compiler argument like "-mabi=<XYZ>".
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>