Skip to content

Commit 95133d6

Browse files
committed
Remove thin_link_data method from ThinBufferMethods
It is only used within cg_llvm.
1 parent 71289c3 commit 95133d6

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
@@ -692,21 +692,21 @@ impl ThinBuffer {
692692
let mut ptr = NonNull::new(ptr).unwrap();
693693
ThinBuffer(unsafe { ptr.as_mut() })
694694
}
695-
}
696695

697-
impl ThinBufferMethods for ThinBuffer {
698-
fn data(&self) -> &[u8] {
696+
pub(crate) fn thin_link_data(&self) -> &[u8] {
699697
unsafe {
700-
let ptr = llvm::LLVMRustThinLTOBufferPtr(self.0) as *const _;
701-
let len = llvm::LLVMRustThinLTOBufferLen(self.0);
698+
let ptr = llvm::LLVMRustThinLTOBufferThinLinkDataPtr(self.0) as *const _;
699+
let len = llvm::LLVMRustThinLTOBufferThinLinkDataLen(self.0);
702700
slice::from_raw_parts(ptr, len)
703701
}
704702
}
703+
}
705704

706-
fn thin_link_data(&self) -> &[u8] {
705+
impl ThinBufferMethods for ThinBuffer {
706+
fn data(&self) -> &[u8] {
707707
unsafe {
708-
let ptr = llvm::LLVMRustThinLTOBufferThinLinkDataPtr(self.0) as *const _;
709-
let len = llvm::LLVMRustThinLTOBufferThinLinkDataLen(self.0);
708+
let ptr = llvm::LLVMRustThinLTOBufferPtr(self.0) as *const _;
709+
let len = llvm::LLVMRustThinLTOBufferLen(self.0);
710710
slice::from_raw_parts(ptr, len)
711711
}
712712
}

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)