Make builtin_deref just return a Ty

This commit is contained in:
Michael Goulet 2024-05-09 22:45:14 -04:00
parent 8c7c151a7a
commit d50c2b0a52
43 changed files with 92 additions and 116 deletions

View file

@ -583,7 +583,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
let element_type_index = unsafe { llvm::LLVMRustGetElementTypeArgIndex(callsite) };
if element_type_index >= 0 {
let arg_ty = self.args[element_type_index as usize].layout.ty;
let pointee_ty = arg_ty.builtin_deref(true).expect("Must be pointer argument").ty;
let pointee_ty = arg_ty.builtin_deref(true).expect("Must be pointer argument");
let element_type_attr = unsafe {
llvm::LLVMRustCreateElementTypeAttr(bx.llcx, bx.layout_of(pointee_ty).llvm_type(bx))
};

View file

@ -2383,7 +2383,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
let pointee = in_elem.builtin_deref(true).unwrap_or_else(|| {
span_bug!(span, "must be called with a vector of pointer types as first argument")
});
let layout = bx.layout_of(pointee.ty);
let layout = bx.layout_of(pointee);
let ptrs = args[0].immediate();
// The second argument must be a ptr-sized integer.
// (We don't care about the signedness, this is wrapping anyway.)