Skip to content

Commit e3d0b7d

Browse files
committed
Remove thin_link_data method from ThinBufferMethods
It is only used within cg_llvm.
1 parent bea625f commit e3d0b7d

File tree

3 files changed

+8
-13
lines changed
  • compiler
    • rustc_codegen_gcc/src/back
    • rustc_codegen_llvm/src/back
    • rustc_codegen_ssa/src/traits

3 files changed

+8
-13
lines changed

compiler/rustc_codegen_gcc/src/back/lto.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -650,10 +650,6 @@ impl ThinBufferMethods for ThinBuffer {
650650
fn data(&self) -> &[u8] {
651651
&[]
652652
}
653-
654-
fn thin_link_data(&self) -> &[u8] {
655-
unimplemented!();
656-
}
657653
}
658654

659655
pub struct ThinData; //(Arc<TempDir>);

compiler/rustc_codegen_llvm/src/back/lto.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -698,21 +698,21 @@ impl ThinBuffer {
698698
let mut ptr = NonNull::new(ptr).unwrap();
699699
ThinBuffer(unsafe { ptr.as_mut() })
700700
}
701-
}
702701

703-
impl ThinBufferMethods for ThinBuffer {
704-
fn data(&self) -> &[u8] {
702+
pub(crate) fn thin_link_data(&self) -> &[u8] {
705703
unsafe {
706-
let ptr = llvm::LLVMRustThinLTOBufferPtr(self.0) as *const _;
707-
let len = llvm::LLVMRustThinLTOBufferLen(self.0);
704+
let ptr = llvm::LLVMRustThinLTOBufferThinLinkDataPtr(self.0) as *const _;
705+
let len = llvm::LLVMRustThinLTOBufferThinLinkDataLen(self.0);
708706
slice::from_raw_parts(ptr, len)
709707
}
710708
}
709+
}
711710

712-
fn thin_link_data(&self) -> &[u8] {
711+
impl ThinBufferMethods for ThinBuffer {
712+
fn data(&self) -> &[u8] {
713713
unsafe {
714-
let ptr = llvm::LLVMRustThinLTOBufferThinLinkDataPtr(self.0) as *const _;
715-
let len = llvm::LLVMRustThinLTOBufferThinLinkDataLen(self.0);
714+
let ptr = llvm::LLVMRustThinLTOBufferPtr(self.0) as *const _;
715+
let len = llvm::LLVMRustThinLTOBufferLen(self.0);
716716
slice::from_raw_parts(ptr, len)
717717
}
718718
}

compiler/rustc_codegen_ssa/src/traits/write.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ pub trait WriteBackendMethods: Clone + 'static {
5959

6060
pub trait ThinBufferMethods: Send + Sync {
6161
fn data(&self) -> &[u8];
62-
fn thin_link_data(&self) -> &[u8];
6362
}
6463

6564
pub trait ModuleBufferMethods: Send + Sync {

0 commit comments

Comments
 (0)