Use LLVMDIBuilderCreateArrayType
This commit is contained in:
@@ -32,9 +32,7 @@ use self::type_map::{DINodeCreationResult, Stub, UniqueTypeId};
|
||||
use super::CodegenUnitDebugContext;
|
||||
use super::namespace::mangled_name_of_instance;
|
||||
use super::type_names::{compute_debuginfo_type_name, compute_debuginfo_vtable_name};
|
||||
use super::utils::{
|
||||
DIB, create_DIArray, debug_context, get_namespace_for_item, is_node_local_to_unit,
|
||||
};
|
||||
use super::utils::{DIB, debug_context, get_namespace_for_item, is_node_local_to_unit};
|
||||
use crate::common::{AsCCharPtr, CodegenCx};
|
||||
use crate::debuginfo::dwarf_const;
|
||||
use crate::debuginfo::metadata::type_map::build_type_with_children;
|
||||
@@ -119,17 +117,17 @@ fn build_fixed_size_array_di_node<'ll, 'tcx>(
|
||||
.try_to_target_usize(cx.tcx)
|
||||
.expect("expected monomorphic const in codegen") as c_longlong;
|
||||
|
||||
let subrange =
|
||||
unsafe { Some(llvm::LLVMRustDIBuilderGetOrCreateSubrange(DIB(cx), 0, upper_bound)) };
|
||||
let subrange = unsafe { llvm::LLVMRustDIBuilderGetOrCreateSubrange(DIB(cx), 0, upper_bound) };
|
||||
let subscripts = &[subrange];
|
||||
|
||||
let subscripts = create_DIArray(DIB(cx), &[subrange]);
|
||||
let di_node = unsafe {
|
||||
llvm::LLVMRustDIBuilderCreateArrayType(
|
||||
llvm::LLVMDIBuilderCreateArrayType(
|
||||
DIB(cx),
|
||||
size.bits(),
|
||||
align.bits() as u32,
|
||||
element_type_di_node,
|
||||
subscripts,
|
||||
subscripts.as_ptr(),
|
||||
subscripts.len() as c_uint,
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
@@ -1895,6 +1895,15 @@ unsafe extern "C" {
|
||||
UniqueId: *const c_uchar, // See "PTR_LEN_STR".
|
||||
UniqueIdLen: size_t,
|
||||
) -> &'ll Metadata;
|
||||
|
||||
pub(crate) fn LLVMDIBuilderCreateArrayType<'ll>(
|
||||
Builder: &DIBuilder<'ll>,
|
||||
Size: u64,
|
||||
Align: u32,
|
||||
Ty: &'ll Metadata,
|
||||
Subscripts: *const &'ll Metadata,
|
||||
NumSubscripts: c_uint,
|
||||
) -> &'ll Metadata;
|
||||
}
|
||||
|
||||
#[link(name = "llvm-wrapper", kind = "static")]
|
||||
@@ -2355,14 +2364,6 @@ unsafe extern "C" {
|
||||
AlignInBits: u32,
|
||||
) -> &'a DIVariable;
|
||||
|
||||
pub(crate) fn LLVMRustDIBuilderCreateArrayType<'a>(
|
||||
Builder: &DIBuilder<'a>,
|
||||
Size: u64,
|
||||
AlignInBits: u32,
|
||||
Ty: &'a DIType,
|
||||
Subscripts: &'a DIArray,
|
||||
) -> &'a DIType;
|
||||
|
||||
pub(crate) fn LLVMRustDIBuilderGetOrCreateSubrange<'a>(
|
||||
Builder: &DIBuilder<'a>,
|
||||
Lo: i64,
|
||||
|
||||
Reference in New Issue
Block a user