pub struct AttrSet(/* private fields */);Expand description
The attributes that are either set or not.
A bitset for the same reason crate::Flags is one, though the pressure is lower here since
there is one of these per function rather than one per instruction.
Implementations§
Source§impl AttrSet
impl AttrSet
Sourcepub const NOUNWIND: Self
pub const NOUNWIND: Self
No exception unwinds out of this function. Every C function compiled without
-fexceptions is one, and it is what lets a call be moved and lets the caller skip the
landing pad.
Sourcepub const NORETURN: Self
pub const NORETURN: Self
Control never comes back. _Noreturn, and __attribute__((noreturn)) for the same
thing under the older spelling. The instruction after a call to one is unreachable.
Sourcepub const RETURNS_TWICE: Self
pub const RETURNS_TWICE: Self
Control may come back twice from one call. setjmp and vfork, under
__attribute__((returns_twice)). Every value live across a call to one has to be in
memory, so this switches off a large amount of the optimizer for the caller.
Sourcepub const WILLRETURN: Self
pub const WILLRETURN: Self
Control comes back, eventually. This is what says an empty infinite loop is not in here, and without it a call cannot be deleted even when nothing uses its result.
Sourcepub const COLD: Self
pub const COLD: Self
Rarely called, from __attribute__((cold)). Its code goes in the cold section and the
path leading to a call to it is the unlikely one.
Sourcepub const INLINE_HINT: Self
pub const INLINE_HINT: Self
The programmer wrote inline, which in C is a hint about linkage and about inlining and
which the inliner treats as a small nudge rather than as an instruction.
Sourcepub const ALWAYS_INLINE: Self
pub const ALWAYS_INLINE: Self
__attribute__((always_inline)), which is not a hint. Failing to inline one of these is
an error, because the header that wrote it usually meant a target-specific builtin that
does not work any other way.
Sourcepub const OPTNONE: Self
pub const OPTNONE: Self
__attribute__((optimize("O0"))) and the pragma for it. Nothing in this function is
rewritten, which is what somebody debugging one function of a release build asks for.
Sourcepub const READNONE: Self
pub const READNONE: Self
Reads no memory and writes none, so its result depends only on its arguments and two
calls with the same arguments are one call. __attribute__((const)).
Sourcepub const READONLY: Self
pub const READONLY: Self
Writes no memory, though it may read it. __attribute__((pure)). Two calls with the
same arguments are one call only if nothing wrote memory in between.
Sourcepub const ARGMEM_ONLY: Self
pub const ARGMEM_ONLY: Self
Touches no memory except through the pointers it was passed. This is what makes a call stop clobbering everything the caller knew about its own locals.
Sourcepub const NAKED: Self
pub const NAKED: Self
__attribute__((naked)). No prologue and no epilogue are emitted, the body is inline
assembly, and the code generator does exactly what it is told.
Sourcepub const USED: Self
pub const USED: Self
Keep it even if nothing refers to it. __attribute__((used)), which is how a section of
initializers survives a linker that garbage collects.
Sourcepub const STACK_PROTECT: Self
pub const STACK_PROTECT: Self
Emit a stack protector for this frame, from -fstack-protector and the attribute.
Sourcepub const NO_STACK_PROTECTOR: Self
pub const NO_STACK_PROTECTOR: Self
Emit none, whatever the command line said.
__attribute__((no_stack_protector)), which the kernel needs on the functions that run
before the canary exists.
Trait Implementations§
Source§impl BitOrAssign for AttrSet
impl BitOrAssign for AttrSet
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
|= operation. Read more