Remove thin_link_data method from ThinBufferMethods
It is only used within cg_llvm.
This commit is contained in:
parent
bea625f327
commit
e3d0b7d648
3 changed files with 8 additions and 13 deletions
|
|
@ -650,10 +650,6 @@ impl ThinBufferMethods for ThinBuffer {
|
|||
fn data(&self) -> &[u8] {
|
||||
&[]
|
||||
}
|
||||
|
||||
fn thin_link_data(&self) -> &[u8] {
|
||||
unimplemented!();
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ThinData; //(Arc<TempDir>);
|
||||
|
|
|
|||
|
|
@ -698,6 +698,14 @@ impl ThinBuffer {
|
|||
let mut ptr = NonNull::new(ptr).unwrap();
|
||||
ThinBuffer(unsafe { ptr.as_mut() })
|
||||
}
|
||||
|
||||
pub(crate) fn thin_link_data(&self) -> &[u8] {
|
||||
unsafe {
|
||||
let ptr = llvm::LLVMRustThinLTOBufferThinLinkDataPtr(self.0) as *const _;
|
||||
let len = llvm::LLVMRustThinLTOBufferThinLinkDataLen(self.0);
|
||||
slice::from_raw_parts(ptr, len)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ThinBufferMethods for ThinBuffer {
|
||||
|
|
@ -708,14 +716,6 @@ impl ThinBufferMethods for ThinBuffer {
|
|||
slice::from_raw_parts(ptr, len)
|
||||
}
|
||||
}
|
||||
|
||||
fn thin_link_data(&self) -> &[u8] {
|
||||
unsafe {
|
||||
let ptr = llvm::LLVMRustThinLTOBufferThinLinkDataPtr(self.0) as *const _;
|
||||
let len = llvm::LLVMRustThinLTOBufferThinLinkDataLen(self.0);
|
||||
slice::from_raw_parts(ptr, len)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for ThinBuffer {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ pub trait WriteBackendMethods: Clone + 'static {
|
|||
|
||||
pub trait ThinBufferMethods: Send + Sync {
|
||||
fn data(&self) -> &[u8];
|
||||
fn thin_link_data(&self) -> &[u8];
|
||||
}
|
||||
|
||||
pub trait ModuleBufferMethods: Send + Sync {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue