Make mir_opt_level default to 2 for optimized levels

This commit is contained in:
Santiago Pastorino 2021-03-03 19:45:33 -03:00
parent 782c7b04cf
commit 421fd8ebbc
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF

View File

@ -641,7 +641,10 @@ 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(1)
self.opts
.debugging_opts
.mir_opt_level
.unwrap_or_else(|| if self.opts.optimize != config::OptLevel::No { 2 } else { 1 })
}
/// Gets the features enabled for the current compilation session.