mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-06 03:52:53 +00:00
Move mir_opt_level
getter into Options
This commit is contained in:
parent
ff23ad3179
commit
386b1c5f57
@ -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…
Reference in New Issue
Block a user