llvm: Accept new LLVM lifetime format

LLVM removed the size parameter from the lifetime format.
Tolerate not having that size parameter.
This commit is contained in:
Matthew Maurer
2025-08-08 17:38:03 +00:00
parent 2886b36df4
commit 258915a555
8 changed files with 42 additions and 38 deletions

View File

@@ -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> {