Skip to content

Commit ea8bacc

Browse files
committed
rustc_codegen_llvm: Name major version of LLVM
It makes LLVM version comparison clearer.
1 parent 2ebb126 commit ea8bacc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
228228
} else {
229229
&*sess.target.arch
230230
};
231+
let (major, _, _) = get_version();
231232
match (arch, s) {
232233
("x86", "sse4.2") => Some(LLVMFeature::with_dependencies(
233234
"sse4.2",
@@ -260,7 +261,7 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
260261
("aarch64", "fpmr") => None, // only existed in 18
261262
("arm", "fp16") => Some(LLVMFeature::new("fullfp16")),
262263
// Filter out features that are not supported by the current LLVM version
263-
("loongarch32" | "loongarch64", "32s") if get_version().0 < 21 => None,
264+
("loongarch32" | "loongarch64", "32s") if major < 21 => None,
264265
// Enable the evex512 target feature if an avx512 target feature is enabled.
265266
("x86", s) if s.starts_with("avx512") => Some(LLVMFeature::with_dependencies(
266267
s,

0 commit comments

Comments
 (0)