about summary refs log tree commit diff
path: root/src/test/codegen/naked-functions.rs
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-32/+0
2022-01-21Reject unsupported naked functionsTomasz Miąsko-25/+15
Transition unsupported naked functions future incompatibility lint into an error: * Naked functions must contain a single inline assembly block. Introduced as future incompatibility lint in 1.50 #79653. Change into an error fixes a soundness issue described in #32489. * Naked functions must not use any forms of inline attribute. Introduced as future incompatibility lint in 1.56 #87652.
2021-04-03Manually set dso_local when its valid to do soSimonas Kazlauskas-4/+4
This should have no real effect in most cases, as e.g. `hidden` visibility already implies `dso_local` (or at least LLVM IR does not preserve the `dso_local` setting if the item is already `hidden`), but it should fix `-Crelocation-model=static` and improve codegen in executables. Note that this PR does not exhaustively port the logic in [clang]. Only the obviously correct portion and what is necessary to fix a regression from LLVM 12 that relates to `-Crelocation_model=static`. Fixes #83335 [clang]: https://github.com/llvm/llvm-project/blob/3001d080c813da20b329303bf8f45451480e5905/clang/lib/CodeGen/CodeGenModule.cpp#L945-L1039
2020-11-25Validate use of parameters in naked functionsTomasz Miąsko-49/+5
* Reject use of parameters inside naked function body. * Reject use of patterns inside function parameters, to emphasize role of parameters a signature declaration (mirroring existing behaviour for function declarations) and avoid generating code introducing specified bindings.
2020-10-26simplify-locals: Remove unused assignments regardless of rvalue kindTomasz Miąsko-1/+1
2020-08-11Revert "Suppress debuginfo on naked function arguments"Nathaniel McCallum-2/+2
This reverts commit 25670749b44a9c7a4cfd3fbf780bbe3344a9a6c5. This commit does not actually fix the problem. It merely removes the name of the argument from the LLVM output. Even without the name, Rust codegen still spills the (nameless) variable onto the stack which is the root cause. The root cause is solved in the next commit.
2020-07-27Suppress debuginfo on naked function argumentsNathaniel McCallum-2/+2
A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes https://github.com/rust-lang/rust/issues/42779 cc https://github.com/rust-lang/rust/issues/32408
2020-02-09rustc_codegen_ssa: use `debug_introduce_local` on Operand call results.Eduard-Mihai Burtescu-5/+3
2020-01-07Update codegen tests with unnamed argumentsNikita Popov-2/+2
2018-12-25Remove licensesMark Rousskov-10/+0
2018-10-11Support for disabling the PLT on ELF targetsGabriel Majeri-5/+5
Disable the PLT where possible to improve performance for indirect calls into shared libraries. This optimization is enabled by default where possible. - Add the `NonLazyBind` attribute to `rustllvm`: This attribute informs LLVM to skip PLT calls in codegen. - Disable PLT unconditionally: Apply the `NonLazyBind` attribute on every function. - Only enable no-plt when full relro is enabled: Ensures we only enable it when we have linker support. - Add `-Z plt` as a compiler option
2017-11-07Update codegen tests.Michael Woerister-10/+10
2017-04-12rustc_trans: avoid a separate entry BB if START_BLOCK has no backedges.Eduard-Mihai Burtescu-10/+37
2016-08-24Disable old trans access via -Z orbit, #[rustc_no_mir] or --disable-orbit.Eduard Burtescu-3/+3
2016-06-20trans: generalize immediate temporaries to all MIR locals.Eduard Burtescu-1/+3
2016-03-22Add testsTicki-0/+69