pub struct Gates { /* private fields */ }Expand description
The rules -fdisable-<pass> and -fenable-<pass> left behind, in the order they were given.
Empty by default, and an empty set of gates answers yes to everything, so the cost of the
feature on a compilation nobody is debugging is one test of a Vec for emptiness per pass.
Implementations§
Source§impl Gates
impl Gates
Sourcepub fn add(&mut self, on: bool, spec: &str) -> Result<(), String>
pub fn add(&mut self, on: bool, spec: &str) -> Result<(), String>
Adds one -fdisable-<pass>[=<range>] or -fenable-<pass>[=<range>], with on saying
which of the two it was and spec being everything after the second hyphen.
§Errors
When the pass is not one this compiler has, when the range list is empty, when an item of it is empty, or when a span runs backwards. A misspelled pass name is the error worth catching here: it would otherwise look exactly like a pass that is not guilty, and the bisection would carry on past the one thing it was looking for.
Sourcepub fn allows(&self, pass: &str, default: bool, id: u32, name: &str) -> bool
pub fn allows(&self, pass: &str, default: bool, id: u32, name: &str) -> bool
Whether that pass runs over that function, where default is what the optimization level
already decided about the pass.
The function is identified both ways at once because both spellings are useful and neither
is available in both places. A script bisecting a file it has never read counts functions
and gives numbers. A person who has just read -fopt-info gives the name it printed.
Sourcepub fn enabled(&self) -> Vec<&str>
pub fn enabled(&self) -> Vec<&str>
Every pass some rule turns on, in the order the rules were given, without repeats.
A pass named by -fenable- that the level did not choose has to join the pipeline, or the
flag would be a way of asking for something and being given nothing. That is also how the
flag reaches a pass at -O0, which is where a bisection would rather start.
Sourcepub fn note(&self, pass: &str) -> Option<String>
pub fn note(&self, pass: &str) -> Option<String>
What --print-pipeline says after a pass a rule mentions, or nothing when no rule does.
The listing is the answer to why a program came out the way it did, and a pass that is in the list and did not run on the function being asked about is exactly the kind of thing that answer has to include.