pub struct Flags {
pub frame_pointer: bool,
pub red_zone: bool,
pub stack_clash: bool,
pub landing: bool,
pub profile: Profile,
pub patch: Room,
pub reorder: bool,
pub reuse: bool,
pub schedule: bool,
pub accurate: Option<bool>,
pub verify: bool,
pub goal: Goal,
}Expand description
What the command line says, as opposed to what the machine says.
Most of it is about a frame, which is what this held to begin with, and the rest is passes being
asked for or turned off by name. Flags::goal is neither: it is the one thing here that no
flag names on its own and that every pass below selection may read.
Fields§
§frame_pointer: boolWhether every function keeps a frame pointer, which -fno-omit-frame-pointer asks for.
red_zone: boolWhether the red zone may be used, which -mno-red-zone and every kernel turns off.
stack_clash: boolWhether a frame is taken a page at a time, which -fstack-clash-protection asks for.
landing: boolWhether every address an indirect branch may arrive at opens with a landing pad, which
-fcf-protection=branch asks for. That is every function, and every label of a function
whose address the program took.
profile: ProfileWhether every function calls a profiler on the way in, which -pg asks for.
patch: RoomHow much room every function opens with for a patcher, which
-fpatchable-function-entry= asks for. See Room.
reorder: boolWhether the blocks are put in the order the weights say rather than in the order the
shape of the graph says, which -freorder-blocks asks for and every level above -O0
turns on. See crate::layout.
reuse: boolWhether two things in the frame that are never both wanted may be the same bytes, which
-fstack-reuse=none turns off. See crate::slots.
schedule: boolWhether the instructions of a block are put in the order the machine finishes soonest,
which -fschedule-insns2 asks for and every level from -O2 turns on. See
crate::schedule.
accurate: Option<bool>Whether the target’s timing model is believed about the machine’s units as well as about
its latencies, which -Zcycle-accurate-model= says and the model itself answers otherwise.
None is a command line that did not say, which is nearly every one, and then the model’s
own answer decides. It is here rather than only on the model because section 38.1 asks for
a way to say the model is better or worse than it claims without editing the model, and
because the measurement section 38.8 owes is the same corpus compiled both ways.
verify: boolWhether the register allocator runs its own checks on a build that has assertions compiled
out, which -Zverify-each asks for. See rucc_regalloc::run.
goal: GoalWhether the level asked for small code or for fast code.
The level itself lives in rucc-session, which is above this crate, so what arrives here is
the answer rather than the question. It is on the flags rather than on the Machine
because it is not a fact about a machine: the same machine compiles the same function both
ways, and which way is what the command line said.
tamnd/rucc#741 is the issue about this not being here at all, and about -Os having been a
shorter list of middle end passes and nothing else. crate::shorten is the first pass
below selection to read it.
Trait Implementations§
impl Copy for Flags
Source§impl Default for Flags
impl Default for Flags
Source§fn default() -> Self
fn default() -> Self
No frame pointer, the red zone allowed, the frame taken in one subtraction, no landing pad,
no profiling, no room for a patcher, the blocks in the order the graph’s shape gives,
nothing in the frame sharing with anything, no scheduling and code that is meant to be fast
rather than small, which is what a convention that has a red zone says at -O0 when nobody
on the command line has said otherwise.