@@ -156,17 +156,12 @@ fn build_pointer_or_reference_di_node<'ll, 'tcx>(
156156 "ptr_type={ptr_type}, pointee_type={pointee_type}" ,
157157 ) ;
158158
159- let di_node = unsafe {
160- llvm:: LLVMRustDIBuilderCreatePointerType (
161- DIB ( cx) ,
162- pointee_type_di_node,
163- data_layout. pointer_size . bits ( ) ,
164- data_layout. pointer_align . abi . bits ( ) as u32 ,
165- 0 , // Ignore DWARF address space.
166- ptr_type_debuginfo_name. as_c_char_ptr ( ) ,
167- ptr_type_debuginfo_name. len ( ) ,
168- )
169- } ;
159+ let di_node = DIB ( cx) . create_pointer_type (
160+ pointee_type_di_node,
161+ data_layout. pointer_size ,
162+ data_layout. pointer_align . abi ,
163+ & ptr_type_debuginfo_name,
164+ ) ;
170165
171166 DINodeCreationResult { di_node, already_stored_in_typemap : false }
172167 }
@@ -214,17 +209,12 @@ fn build_pointer_or_reference_di_node<'ll, 'tcx>(
214209
215210 // The data pointer type is a regular, thin pointer, regardless of whether this
216211 // is a slice or a trait object.
217- let data_ptr_type_di_node = unsafe {
218- llvm:: LLVMRustDIBuilderCreatePointerType (
219- DIB ( cx) ,
220- pointee_type_di_node,
221- addr_field. size . bits ( ) ,
222- addr_field. align . abi . bits ( ) as u32 ,
223- 0 , // Ignore DWARF address space.
224- std:: ptr:: null ( ) ,
225- 0 ,
226- )
227- } ;
212+ let data_ptr_type_di_node = DIB ( cx) . create_pointer_type (
213+ pointee_type_di_node,
214+ addr_field. size ,
215+ addr_field. align . abi ,
216+ "" ,
217+ ) ;
228218
229219 smallvec ! [
230220 build_field_di_node(
@@ -308,17 +298,7 @@ fn build_subroutine_type_di_node<'ll, 'tcx>(
308298 ty:: FnPtr ( ..) => ( cx. tcx . data_layout . pointer_size , cx. tcx . data_layout . pointer_align . abi ) ,
309299 _ => unreachable ! ( ) ,
310300 } ;
311- let di_node = unsafe {
312- llvm:: LLVMRustDIBuilderCreatePointerType (
313- DIB ( cx) ,
314- fn_di_node,
315- size. bits ( ) ,
316- align. bits ( ) as u32 ,
317- 0 , // Ignore DWARF address space.
318- name. as_c_char_ptr ( ) ,
319- name. len ( ) ,
320- )
321- } ;
301+ let di_node = DIB ( cx) . create_pointer_type ( fn_di_node, size, align, & name) ;
322302
323303 DINodeCreationResult :: new ( di_node, false )
324304}
0 commit comments