about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/abi.rs
AgeCommit message (Collapse)AuthorLines
2021-10-01Fix clippy lintsGuillaume Gomez-1/+1
2021-09-12Auto merge of #88759 - Amanieu:panic_in_drop, r=nagisa,eddybbors-1/+6
Add -Z panic-in-drop={unwind,abort} command-line option This PR changes `Drop` to abort if an unwinding panic attempts to escape it, making the process abort instead. This has several benefits: - The current behavior when unwinding out of `Drop` is very unintuitive and easy to miss: unwinding continues, but the remaining drops in scope are simply leaked. - A lot of unsafe code doesn't expect drops to unwind, which can lead to unsoundness: - https://github.com/servo/rust-smallvec/issues/14 - https://github.com/bluss/arrayvec/issues/3 - There is a code size and compilation time cost to this: LLVM needs to generate extra landing pads out of all calls in a drop implementation. This can compound when functions are inlined since unwinding will then continue on to process drops in the callee, which can itself unwind, etc. - Initial measurements show a 3% size reduction and up to 10% compilation time reduction on some crates (`syn`). One thing to note about `-Z panic-in-drop=abort` is that *all* crates must be built with this option for it to be sound since it makes the compiler assume that dropping `Box<dyn Any>` will never unwind. cc https://github.com/rust-lang/lang-team/issues/97
2021-09-11Apply noreturn and nounwind LLVM attributes to callsitesAmanieu d'Antras-1/+6
2021-09-09rename `is_valid_for` to `is_valid`Andreas Liljeqvist-1/+1
2021-09-09Make `abi::Abi` `Copy` and remove a *lot* of refsAndreas Liljeqvist-2/+2
fix fix Remove more refs and clones fix more fix
2021-09-09Add methods for checking for full ranges to `Scalar` and `WrappingRange`Andreas Liljeqvist-5/+2
Move *_max methods back to util change to inline instead of inline(always) Remove valid_range_exclusive from scalar Use WrappingRange instead implement always_valid_for in a safer way Fix accidental edit
2021-09-02rustc_target: move `LayoutOf` to `ty::layout`.Eduard-Mihai Burtescu-1/+2
2021-08-05Remove the `decl` arg from `FnAbi::llvm_type`Josh Stone-6/+6
We can apply the `c_variadic` fix all the time, rather than trying to distinguish between declarations and any other use.
2021-08-05Prepare call/invoke for opaque pointersJosh Stone-5/+9
Rather than relying on `getPointerElementType()` from LLVM function pointers, we now pass the function type explicitly when building `call` or `invoke` instructions.
2021-03-21Enable mutable noalias by default for LLVM 12Nikita Popov-12/+10
We don't have any known noalias bugs for LLVM 12 ... yet.
2021-03-21Convert -Z mutable-noalias to Optional<bool>Nikita Popov-1/+1
The default value will dependend on the LLVM version in the future, so don't specify one to start with.
2021-03-21Move decision aboute noalias into codegen_llvmNikita Popov-18/+49
The frontend shouldn't be deciding whether or not to use mutable noalias attributes, as this is a pure LLVM concern. Only provide the necessary information and do the actual decision in codegen_llvm.
2021-02-28Support LLVM 12 in rustcNikita Popov-3/+14
2021-02-14Replace const_cstr with cstr crateXidorn Quan-1/+1
2021-02-02Add a new ABI to support cmse_nonsecure_callHugues de Valon-1/+13
This commit adds a new ABI to be selected via `extern "C-cmse-nonsecure-call"` on function pointers in order for the compiler to apply the corresponding cmse_nonsecure_call callsite attribute. For Armv8-M targets supporting TrustZone-M, this will perform a non-secure function call by saving, clearing and calling a non-secure function pointer using the BLXNS instruction. See the page on the unstable book for details. Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2020-11-21Rename prefix_chunk to prefix_chunk_sizebjorn3-1/+1
2020-11-21Remove StructRet arg attrbjorn3-3/+6
It is applied exactly when the return value has an indirect pass mode. Except for InReg on x86 fastcall, arg attrs are now only used for optimization purposes and thus are fine to ignore.
2020-11-21Replace ByVal attribute with on_stack field for Indirectbjorn3-42/+79
This makes it clearer that only PassMode::Indirect allows ByVal
2020-11-21Replace ZExt and SExt flags with ArgExtension enumbjorn3-1/+19
Both flags are mutually exclusive
2020-08-30mv compiler to compiler/mark-0/+502