Create a safe wrapper around LLVMRustDIBuilderCreateSubroutineType

This commit is contained in:
Oli Scherer
2025-03-17 16:34:24 +00:00
parent 6adc2c1fd6
commit e19e4e3a4b
2 changed files with 13 additions and 12 deletions

View File

@@ -6,6 +6,7 @@ use std::ptr;
use std::sync::Arc;
use libc::c_uint;
use metadata::create_subroutine_type;
use rustc_abi::Size;
use rustc_codegen_ssa::debuginfo::type_names;
use rustc_codegen_ssa::mir::debuginfo::VariableKind::*;
@@ -341,10 +342,8 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
let loc = self.lookup_debug_loc(span.lo());
let file_metadata = file_metadata(self, &loc.file);
let function_type_metadata = unsafe {
let fn_signature = get_function_signature(self, fn_abi);
llvm::LLVMRustDIBuilderCreateSubroutineType(DIB(self), fn_signature)
};
let function_type_metadata =
create_subroutine_type(self, get_function_signature(self, fn_abi));
let mut name = String::with_capacity(64);
type_names::push_item_name(tcx, def_id, false, &mut name);