Skip to content

Commit b167331

Browse files
committed
use LLVMDIBuilderCreatePointerType
1 parent e423380 commit b167331

File tree

3 files changed

+13
-22
lines changed

3 files changed

+13
-22
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ fn build_pointer_or_reference_di_node<'ll, 'tcx>(
173173
);
174174

175175
let di_node = unsafe {
176-
llvm::LLVMRustDIBuilderCreatePointerType(
176+
llvm::LLVMDIBuilderCreatePointerType(
177177
DIB(cx),
178178
pointee_type_di_node,
179179
pointer_size.bits(),
@@ -231,7 +231,7 @@ fn build_pointer_or_reference_di_node<'ll, 'tcx>(
231231
// The data pointer type is a regular, thin pointer, regardless of whether this
232232
// is a slice or a trait object.
233233
let data_ptr_type_di_node = unsafe {
234-
llvm::LLVMRustDIBuilderCreatePointerType(
234+
llvm::LLVMDIBuilderCreatePointerType(
235235
DIB(cx),
236236
pointee_type_di_node,
237237
addr_field.size.bits(),
@@ -327,7 +327,7 @@ fn build_subroutine_type_di_node<'ll, 'tcx>(
327327
_ => unreachable!(),
328328
};
329329
let di_node = unsafe {
330-
llvm::LLVMRustDIBuilderCreatePointerType(
330+
llvm::LLVMDIBuilderCreatePointerType(
331331
DIB(cx),
332332
fn_di_node,
333333
size.bits(),

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,6 +1836,16 @@ unsafe extern "C" {
18361836
Tag: c_uint,
18371837
Type: &'ll DIType,
18381838
) -> &'ll DIDerivedType;
1839+
1840+
pub(crate) fn LLVMDIBuilderCreatePointerType<'ll>(
1841+
Builder: &DIBuilder<'ll>,
1842+
PointeeTy: &'ll DIType,
1843+
SizeInBits: u64,
1844+
AlignInBits: u32,
1845+
AddressSpace: c_uint,
1846+
Name: *const c_char,
1847+
NameLen: size_t,
1848+
) -> &'ll DIDerivedType;
18391849
}
18401850

18411851
#[link(name = "llvm-wrapper", kind = "static")]
@@ -2195,16 +2205,6 @@ unsafe extern "C" {
21952205
Scope: Option<&'a DIScope>,
21962206
) -> &'a DIDerivedType;
21972207

2198-
pub(crate) fn LLVMRustDIBuilderCreatePointerType<'a>(
2199-
Builder: &DIBuilder<'a>,
2200-
PointeeTy: &'a DIType,
2201-
SizeInBits: u64,
2202-
AlignInBits: u32,
2203-
AddressSpace: c_uint,
2204-
Name: *const c_char,
2205-
NameLen: size_t,
2206-
) -> &'a DIDerivedType;
2207-
22082208
pub(crate) fn LLVMRustDIBuilderCreateStructType<'a>(
22092209
Builder: &DIBuilder<'a>,
22102210
Scope: Option<&'a DIDescriptor>,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,15 +1076,6 @@ LLVMRustDIBuilderCreateTypedef(LLVMDIBuilderRef Builder, LLVMMetadataRef Type,
10761076
LineNo, unwrapDIPtr<DIScope>(Scope)));
10771077
}
10781078

1079-
extern "C" LLVMMetadataRef LLVMRustDIBuilderCreatePointerType(
1080-
LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy, uint64_t SizeInBits,
1081-
uint32_t AlignInBits, unsigned AddressSpace, const char *Name,
1082-
size_t NameLen) {
1083-
return wrap(unwrap(Builder)->createPointerType(
1084-
unwrapDI<DIType>(PointeeTy), SizeInBits, AlignInBits, AddressSpace,
1085-
StringRef(Name, NameLen)));
1086-
}
1087-
10881079
extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateStructType(
10891080
LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
10901081
size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,

0 commit comments

Comments
 (0)