about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/builder.rs
diff options
context:
space:
mode:
authorMatthew Maurer <mmaurer@google.com>2025-08-08 17:38:03 +0000
committerMatthew Maurer <mmaurer@google.com>2025-08-11 22:00:41 +0000
commit258915a55539593423c3d4c30f7b741f65c56e51 (patch)
tree2ea8753167070a017ea7324a13141521478ac65b /compiler/rustc_codegen_llvm/src/builder.rs
parent2886b36df4a646dd8d82fb65bf0c9d8d96c1f71a (diff)
downloadrust-258915a55539593423c3d4c30f7b741f65c56e51.tar.gz
rust-258915a55539593423c3d4c30f7b741f65c56e51.zip
llvm: Accept new LLVM lifetime format
LLVM removed the size parameter from the lifetime format.
Tolerate not having that size parameter.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/builder.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs
index bd175e560c7..35a619da710 100644
--- a/compiler/rustc_codegen_llvm/src/builder.rs
+++ b/compiler/rustc_codegen_llvm/src/builder.rs
@@ -1686,7 +1686,11 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
             return;
         }
 
-        self.call_intrinsic(intrinsic, &[self.val_ty(ptr)], &[self.cx.const_u64(size), ptr]);
+        if crate::llvm_util::get_version() >= (22, 0, 0) {
+            self.call_intrinsic(intrinsic, &[self.val_ty(ptr)], &[ptr]);
+        } else {
+            self.call_intrinsic(intrinsic, &[self.val_ty(ptr)], &[self.cx.const_u64(size), ptr]);
+        }
     }
 }
 impl<'a, 'll, CX: Borrow<SCx<'ll>>> GenericBuilder<'a, 'll, CX> {