mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
Rollup merge of #155656 - durin42:llvm-23-back-in-kansas, r=nikic
rustc_llvm: update opt-level handling for LLVM 23 LLVM 23 removed Os and Oz optimization pipelines and the PR says to use O2 with optsize or minsize instead as appropriate. See https://github.com/llvm/llvm-project/pull/191363 for more details.
This commit is contained in:
@@ -165,10 +165,17 @@ static OptimizationLevel fromRust(LLVMRustPassBuilderOptLevel Level) {
|
||||
return OptimizationLevel::O2;
|
||||
case LLVMRustPassBuilderOptLevel::O3:
|
||||
return OptimizationLevel::O3;
|
||||
#if LLVM_VERSION_GE(23, 0)
|
||||
case LLVMRustPassBuilderOptLevel::Os:
|
||||
return OptimizationLevel::O2;
|
||||
case LLVMRustPassBuilderOptLevel::Oz:
|
||||
return OptimizationLevel::O2;
|
||||
#else
|
||||
case LLVMRustPassBuilderOptLevel::Os:
|
||||
return OptimizationLevel::Os;
|
||||
case LLVMRustPassBuilderOptLevel::Oz:
|
||||
return OptimizationLevel::Oz;
|
||||
#endif
|
||||
default:
|
||||
report_fatal_error("Bad PassBuilderOptLevel.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user