@@ -40,6 +40,7 @@ use crate::llvm::debuginfo::{
4040use crate :: value:: Value ;
4141
4242mod create_scope_map;
43+ mod di_builder;
4344mod dwarf_const;
4445mod gdb;
4546pub ( crate ) mod metadata;
@@ -325,9 +326,9 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
325326 let loc = self . lookup_debug_loc ( span. lo ( ) ) ;
326327 let file_metadata = file_metadata ( self , & loc. file ) ;
327328
328- let function_type_metadata = unsafe {
329+ let function_type_metadata = {
329330 let fn_signature = get_function_signature ( self , fn_abi) ;
330- llvm :: LLVMRustDIBuilderCreateSubroutineType ( DIB ( self ) , fn_signature )
331+ DIB ( self ) . create_subroutine_type ( & fn_signature , DIFlags :: FlagZero )
331332 } ;
332333
333334 let mut name = String :: with_capacity ( 64 ) ;
@@ -420,9 +421,9 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
420421 fn get_function_signature < ' ll , ' tcx > (
421422 cx : & CodegenCx < ' ll , ' tcx > ,
422423 fn_abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
423- ) -> & ' ll DIArray {
424+ ) -> Vec < Option < & ' ll llvm :: Metadata > > {
424425 if cx. sess ( ) . opts . debuginfo != DebugInfo :: Full {
425- return create_DIArray ( DIB ( cx ) , & [ ] ) ;
426+ return vec ! [ ] ;
426427 }
427428
428429 let mut signature = Vec :: with_capacity ( fn_abi. args . len ( ) + 1 ) ;
@@ -463,7 +464,7 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
463464 . extend ( fn_abi. args . iter ( ) . map ( |arg| Some ( type_di_node ( cx, arg. layout . ty ) ) ) ) ;
464465 }
465466
466- create_DIArray ( DIB ( cx ) , & signature[ .. ] )
467+ signature
467468 }
468469
469470 fn get_template_parameters < ' ll , ' tcx > (
0 commit comments