about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/back/write.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-09-17 16:18:32 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-09-19 20:10:41 +1000
commit0d78f1e86bf073f3c7d4c0e6d30bd549657c8026 (patch)
tree344e708fe95f4d7b31b1f0b45bf4700b7bf75c37 /compiler/rustc_codegen_llvm/src/back/write.rs
parent9429e64c243ceab2c70aee63a59cc8b1374f38ea (diff)
downloadrust-0d78f1e86bf073f3c7d4c0e6d30bd549657c8026.tar.gz
rust-0d78f1e86bf073f3c7d4c0e6d30bd549657c8026.zip
Reduce repetition in `target_is_apple`.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/back/write.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/back/write.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs
index 1a53bdaa0b7..d6bdb82dc43 100644
--- a/compiler/rustc_codegen_llvm/src/back/write.rs
+++ b/compiler/rustc_codegen_llvm/src/back/write.rs
@@ -944,11 +944,12 @@ fn create_section_with_flags_asm(section_name: &str, section_flags: &str, data:
 }
 
 fn target_is_apple(cgcx: &CodegenContext<LlvmCodegenBackend>) -> bool {
-    cgcx.opts.target_triple.triple().contains("-ios")
-        || cgcx.opts.target_triple.triple().contains("-darwin")
-        || cgcx.opts.target_triple.triple().contains("-tvos")
-        || cgcx.opts.target_triple.triple().contains("-watchos")
-        || cgcx.opts.target_triple.triple().contains("-visionos")
+    let triple = cgcx.opts.target_triple.triple();
+    triple.contains("-ios")
+        || triple.contains("-darwin")
+        || triple.contains("-tvos")
+        || triple.contains("-watchos")
+        || triple.contains("-visionos")
 }
 
 fn target_is_aix(cgcx: &CodegenContext<LlvmCodegenBackend>) -> bool {