@@ -40,6 +40,7 @@ use crate::llvm::debuginfo::{
40
40
use crate :: value:: Value ;
41
41
42
42
mod create_scope_map;
43
+ mod di_builder;
43
44
mod dwarf_const;
44
45
mod gdb;
45
46
pub ( crate ) mod metadata;
@@ -321,9 +322,9 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
321
322
let loc = self . lookup_debug_loc ( span. lo ( ) ) ;
322
323
let file_metadata = file_metadata ( self , & loc. file ) ;
323
324
324
- let function_type_metadata = unsafe {
325
+ let function_type_metadata = {
325
326
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 )
327
328
} ;
328
329
329
330
let mut name = String :: with_capacity ( 64 ) ;
@@ -416,9 +417,9 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
416
417
fn get_function_signature < ' ll , ' tcx > (
417
418
cx : & CodegenCx < ' ll , ' tcx > ,
418
419
fn_abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
419
- ) -> & ' ll DIArray {
420
+ ) -> Vec < Option < & ' ll llvm :: Metadata > > {
420
421
if cx. sess ( ) . opts . debuginfo != DebugInfo :: Full {
421
- return create_DIArray ( DIB ( cx ) , & [ ] ) ;
422
+ return vec ! [ ] ;
422
423
}
423
424
424
425
let mut signature = Vec :: with_capacity ( fn_abi. args . len ( ) + 1 ) ;
@@ -459,7 +460,7 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
459
460
. extend ( fn_abi. args . iter ( ) . map ( |arg| Some ( type_di_node ( cx, arg. layout . ty ) ) ) ) ;
460
461
}
461
462
462
- create_DIArray ( DIB ( cx ) , & signature[ .. ] )
463
+ signature
463
464
}
464
465
465
466
fn get_template_parameters < ' ll , ' tcx > (
0 commit comments