Skip to content

Commit 923d1be

Browse files
committed
Use LLVMDIBuilderCreateMemberType
1 parent 2ebb126 commit 923d1be

File tree

3 files changed

+16
-27
lines changed

3 files changed

+16
-27
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,10 +1034,10 @@ fn create_member_type<'ll, 'tcx>(
10341034
type_di_node: &'ll DIType,
10351035
) -> &'ll DIType {
10361036
unsafe {
1037-
llvm::LLVMRustDIBuilderCreateMemberType(
1037+
llvm::LLVMDIBuilderCreateMemberType(
10381038
DIB(cx),
10391039
owner,
1040-
name.as_c_char_ptr(),
1040+
name.as_ptr(),
10411041
name.len(),
10421042
file_metadata,
10431043
line_number,

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,6 +1943,20 @@ unsafe extern "C" {
19431943
UniqueId: *const c_uchar, // See "PTR_LEN_STR".
19441944
UniqueIdLen: size_t,
19451945
) -> &'ll Metadata;
1946+
1947+
pub(crate) fn LLVMDIBuilderCreateMemberType<'ll>(
1948+
Builder: &DIBuilder<'ll>,
1949+
Scope: &'ll Metadata,
1950+
Name: *const c_uchar, // See "PTR_LEN_STR".
1951+
NameLen: size_t,
1952+
File: &'ll Metadata,
1953+
LineNo: c_uint,
1954+
SizeInBits: u64,
1955+
AlignInBits: u32,
1956+
OffsetInBits: u64,
1957+
Flags: DIFlags,
1958+
Ty: &'ll Metadata,
1959+
) -> &'ll Metadata;
19461960
}
19471961

19481962
#[link(name = "llvm-wrapper", kind = "static")]
@@ -2288,20 +2302,6 @@ unsafe extern "C" {
22882302
Scope: Option<&'a DIScope>,
22892303
) -> &'a DIDerivedType;
22902304

2291-
pub(crate) fn LLVMRustDIBuilderCreateMemberType<'a>(
2292-
Builder: &DIBuilder<'a>,
2293-
Scope: &'a DIDescriptor,
2294-
Name: *const c_char,
2295-
NameLen: size_t,
2296-
File: &'a DIFile,
2297-
LineNo: c_uint,
2298-
SizeInBits: u64,
2299-
AlignInBits: u32,
2300-
OffsetInBits: u64,
2301-
Flags: DIFlags,
2302-
Ty: &'a DIType,
2303-
) -> &'a DIDerivedType;
2304-
23052305
pub(crate) fn LLVMRustDIBuilderCreateVariantMemberType<'a>(
23062306
Builder: &DIBuilder<'a>,
23072307
Scope: &'a DIScope,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,17 +1088,6 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateVariantPart(
10881088
StringRef(UniqueId, UniqueIdLen)));
10891089
}
10901090

1091-
extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateMemberType(
1092-
LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1093-
size_t NameLen, LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits,
1094-
uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags,
1095-
LLVMMetadataRef Ty) {
1096-
return wrap(unwrap(Builder)->createMemberType(
1097-
unwrapDI<DIDescriptor>(Scope), StringRef(Name, NameLen),
1098-
unwrapDI<DIFile>(File), LineNo, SizeInBits, AlignInBits, OffsetInBits,
1099-
fromRust(Flags), unwrapDI<DIType>(Ty)));
1100-
}
1101-
11021091
extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateVariantMemberType(
11031092
LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
11041093
size_t NameLen, LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits,

0 commit comments

Comments
 (0)