Skip to content

Commit b1a9f23

Browse files
committed
Use LLVMDIBuilderGetOrCreateSubrange
1 parent 2f4dfc7 commit b1a9f23

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ fn build_fixed_size_array_di_node<'ll, 'tcx>(
117117
.try_to_target_usize(cx.tcx)
118118
.expect("expected monomorphic const in codegen") as c_longlong;
119119

120-
let subrange = unsafe { llvm::LLVMRustDIBuilderGetOrCreateSubrange(DIB(cx), 0, upper_bound) };
120+
let subrange = unsafe { llvm::LLVMDIBuilderGetOrCreateSubrange(DIB(cx), 0, upper_bound) };
121121
let subscripts = &[subrange];
122122

123123
let di_node = unsafe {

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use rustc_target::spec::SymbolVisibility;
2525
use super::RustString;
2626
use super::debuginfo::{
2727
DIArray, DIBuilder, DIDerivedType, DIDescriptor, DIEnumerator, DIFile, DIFlags,
28-
DIGlobalVariableExpression, DILocation, DISPFlags, DIScope, DISubprogram, DISubrange,
28+
DIGlobalVariableExpression, DILocation, DISPFlags, DIScope, DISubprogram,
2929
DITemplateTypeParameter, DIType, DIVariable, DebugEmissionKind, DebugNameTableKind,
3030
};
3131
use crate::llvm;
@@ -890,7 +890,6 @@ pub(crate) mod debuginfo {
890890
pub(crate) type DIVariable = DIDescriptor;
891891
pub(crate) type DIGlobalVariableExpression = DIDescriptor;
892892
pub(crate) type DIArray = DIDescriptor;
893-
pub(crate) type DISubrange = DIDescriptor;
894893
pub(crate) type DIEnumerator = DIDescriptor;
895894
pub(crate) type DITemplateTypeParameter = DIDescriptor;
896895

@@ -1989,6 +1988,12 @@ unsafe extern "C" {
19891988
Scope: Option<&'ll Metadata>,
19901989
AlignInBits: u32, // (optional; default is 0)
19911990
) -> &'ll Metadata;
1991+
1992+
pub(crate) fn LLVMDIBuilderGetOrCreateSubrange<'ll>(
1993+
Builder: &DIBuilder<'ll>,
1994+
LowerBound: i64,
1995+
Count: i64,
1996+
) -> &'ll Metadata;
19921997
}
19931998

19941999
#[link(name = "llvm-wrapper", kind = "static")]
@@ -2370,12 +2375,6 @@ unsafe extern "C" {
23702375
AlignInBits: u32,
23712376
) -> &'a DIVariable;
23722377

2373-
pub(crate) fn LLVMRustDIBuilderGetOrCreateSubrange<'a>(
2374-
Builder: &DIBuilder<'a>,
2375-
Lo: i64,
2376-
Count: i64,
2377-
) -> &'a DISubrange;
2378-
23792378
pub(crate) fn LLVMRustDIBuilderGetOrCreateArray<'a>(
23802379
Builder: &DIBuilder<'a>,
23812380
Ptr: *const Option<&'a DIDescriptor>,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,12 +1142,6 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateVariable(
11421142
}
11431143
}
11441144

1145-
extern "C" LLVMMetadataRef
1146-
LLVMRustDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Builder, int64_t Lo,
1147-
int64_t Count) {
1148-
return wrap(unwrap(Builder)->getOrCreateSubrange(Lo, Count));
1149-
}
1150-
11511145
extern "C" LLVMMetadataRef
11521146
LLVMRustDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder,
11531147
LLVMMetadataRef *Ptr, unsigned Count) {

0 commit comments

Comments
 (0)