@@ -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;
@@ -321,9 +322,9 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
321322 let loc = self . lookup_debug_loc ( span. lo ( ) ) ;
322323 let file_metadata = file_metadata ( self , & loc. file ) ;
323324
324- let function_type_metadata = unsafe {
325+ let function_type_metadata = {
325326 let fn_signature = get_function_signature ( self , fn_abi) ;
326- llvm :: LLVMRustDIBuilderCreateSubroutineType ( DIB ( self ) , fn_signature )
327+ DIB ( self ) . create_subroutine_type ( & fn_signature , DIFlags :: FlagZero )
327328 } ;
328329
329330 let mut name = String :: with_capacity ( 64 ) ;
@@ -416,9 +417,9 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
416417 fn get_function_signature < ' ll , ' tcx > (
417418 cx : & CodegenCx < ' ll , ' tcx > ,
418419 fn_abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
419- ) -> & ' ll DIArray {
420+ ) -> Vec < Option < & ' ll llvm :: Metadata > > {
420421 if cx. sess ( ) . opts . debuginfo != DebugInfo :: Full {
421- return create_DIArray ( DIB ( cx ) , & [ ] ) ;
422+ return vec ! [ ] ;
422423 }
423424
424425 let mut signature = Vec :: with_capacity ( fn_abi. args . len ( ) + 1 ) ;
@@ -459,7 +460,7 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
459460 . extend ( fn_abi. args . iter ( ) . map ( |arg| Some ( type_di_node ( cx, arg. layout . ty ) ) ) ) ;
460461 }
461462
462- create_DIArray ( DIB ( cx ) , & signature[ .. ] )
463+ signature
463464 }
464465
465466 fn get_template_parameters < ' ll , ' tcx > (
0 commit comments