1
Fork 0

Never inline naked functions

The `#[naked]` attribute disabled prologue / epilogue emission for the
function and it is responsibility of a developer to provide them. The
compiler is no position to inline such functions correctly.

Disable inlining of naked functions at LLVM and MIR level.
This commit is contained in:
Tomasz Miąsko 2020-11-20 00:00:00 +00:00
parent fe982319aa
commit c2fb99984c
4 changed files with 45 additions and 4 deletions

View file

@ -67,7 +67,7 @@ fn handle_errors(sess: &ParseSess, span: Span, error: AttrError) {
}
}
#[derive(Clone, PartialEq, Encodable, Decodable)]
#[derive(Copy, Clone, PartialEq, Encodable, Decodable)]
pub enum InlineAttr {
None,
Hint,