Move mir_opt_level
getter into Options
This commit is contained in:
parent
ff23ad3179
commit
386b1c5f57
2 changed files with 9 additions and 4 deletions
|
@ -101,6 +101,14 @@ macro_rules! top_level_options {
|
|||
);
|
||||
}
|
||||
|
||||
impl Options {
|
||||
pub fn mir_opt_level(&self) -> usize {
|
||||
self.debugging_opts
|
||||
.mir_opt_level
|
||||
.unwrap_or_else(|| if self.optimize != OptLevel::No { 2 } else { 1 })
|
||||
}
|
||||
}
|
||||
|
||||
top_level_options!(
|
||||
/// The top-level command-line options struct.
|
||||
///
|
||||
|
|
|
@ -562,10 +562,7 @@ impl Session {
|
|||
self.opts.debugging_opts.binary_dep_depinfo
|
||||
}
|
||||
pub fn mir_opt_level(&self) -> usize {
|
||||
self.opts
|
||||
.debugging_opts
|
||||
.mir_opt_level
|
||||
.unwrap_or_else(|| if self.opts.optimize != config::OptLevel::No { 2 } else { 1 })
|
||||
self.opts.mir_opt_level()
|
||||
}
|
||||
|
||||
/// Gets the features enabled for the current compilation session.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue