Remove write_data_funcaddr and write_data_dataaddr
They are unimplemented by all backends
This commit is contained in:
@@ -103,25 +103,6 @@ where
|
|||||||
contents: &ModuleContents<Self>,
|
contents: &ModuleContents<Self>,
|
||||||
) -> ModuleResult<Self::CompiledData>;
|
) -> ModuleResult<Self::CompiledData>;
|
||||||
|
|
||||||
/// Write the address of `what` into the data for `data` at `offset`. `data` must refer to a
|
|
||||||
/// defined data object.
|
|
||||||
fn write_data_funcaddr(
|
|
||||||
&mut self,
|
|
||||||
data: &mut Self::CompiledData,
|
|
||||||
offset: usize,
|
|
||||||
what: ir::FuncRef,
|
|
||||||
);
|
|
||||||
|
|
||||||
/// Write the address of `what` plus `addend` into the data for `data` at `offset`. `data` must
|
|
||||||
/// refer to a defined data object.
|
|
||||||
fn write_data_dataaddr(
|
|
||||||
&mut self,
|
|
||||||
data: &mut Self::CompiledData,
|
|
||||||
offset: usize,
|
|
||||||
what: ir::GlobalValue,
|
|
||||||
addend: binemit::Addend,
|
|
||||||
);
|
|
||||||
|
|
||||||
/// Perform all outstanding relocations on the given function. This requires all `Local`
|
/// Perform all outstanding relocations on the given function. This requires all `Local`
|
||||||
/// and `Export` entities referenced to be defined.
|
/// and `Export` entities referenced to be defined.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -639,49 +639,6 @@ where
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Write the address of `what` into the data for `data` at `offset`. `data` must refer to a
|
|
||||||
/// defined data object.
|
|
||||||
pub fn write_data_funcaddr(&mut self, data: DataId, offset: usize, what: ir::FuncRef) {
|
|
||||||
let info = &mut self.contents.data_objects[data];
|
|
||||||
debug_assert!(
|
|
||||||
info.decl.linkage.is_definable(),
|
|
||||||
"imported data cannot contain references"
|
|
||||||
);
|
|
||||||
self.backend.write_data_funcaddr(
|
|
||||||
&mut info
|
|
||||||
.compiled
|
|
||||||
.as_mut()
|
|
||||||
.expect("`data` must refer to a defined data object"),
|
|
||||||
offset,
|
|
||||||
what,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Write the address of `what` plus `addend` into the data for `data` at `offset`. `data` must
|
|
||||||
/// refer to a defined data object.
|
|
||||||
pub fn write_data_dataaddr(
|
|
||||||
&mut self,
|
|
||||||
data: DataId,
|
|
||||||
offset: usize,
|
|
||||||
what: ir::GlobalValue,
|
|
||||||
addend: binemit::Addend,
|
|
||||||
) {
|
|
||||||
let info = &mut self.contents.data_objects[data];
|
|
||||||
debug_assert!(
|
|
||||||
info.decl.linkage.is_definable(),
|
|
||||||
"imported data cannot contain references"
|
|
||||||
);
|
|
||||||
self.backend.write_data_dataaddr(
|
|
||||||
&mut info
|
|
||||||
.compiled
|
|
||||||
.as_mut()
|
|
||||||
.expect("`data` must refer to a defined data object"),
|
|
||||||
offset,
|
|
||||||
what,
|
|
||||||
addend,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Return the target isa
|
/// Return the target isa
|
||||||
pub fn isa(&self) -> &dyn isa::TargetIsa {
|
pub fn isa(&self) -> &dyn isa::TargetIsa {
|
||||||
self.backend.isa()
|
self.backend.isa()
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use cranelift_codegen::binemit::{
|
|||||||
};
|
};
|
||||||
use cranelift_codegen::entity::SecondaryMap;
|
use cranelift_codegen::entity::SecondaryMap;
|
||||||
use cranelift_codegen::isa::TargetIsa;
|
use cranelift_codegen::isa::TargetIsa;
|
||||||
use cranelift_codegen::{self, binemit, ir};
|
use cranelift_codegen::{self, ir};
|
||||||
use cranelift_module::{
|
use cranelift_module::{
|
||||||
Backend, DataContext, DataDescription, DataId, FuncId, FuncOrDataId, Init, Linkage,
|
Backend, DataContext, DataDescription, DataId, FuncId, FuncOrDataId, Init, Linkage,
|
||||||
ModuleContents, ModuleError, ModuleResult,
|
ModuleContents, ModuleError, ModuleResult,
|
||||||
@@ -400,25 +400,6 @@ impl Backend for ObjectBackend {
|
|||||||
Ok(ObjectCompiledData)
|
Ok(ObjectCompiledData)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_data_funcaddr(
|
|
||||||
&mut self,
|
|
||||||
_data: &mut ObjectCompiledData,
|
|
||||||
_offset: usize,
|
|
||||||
_what: ir::FuncRef,
|
|
||||||
) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn write_data_dataaddr(
|
|
||||||
&mut self,
|
|
||||||
_data: &mut ObjectCompiledData,
|
|
||||||
_offset: usize,
|
|
||||||
_what: ir::GlobalValue,
|
|
||||||
_usize: binemit::Addend,
|
|
||||||
) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn finalize_function(
|
fn finalize_function(
|
||||||
&mut self,
|
&mut self,
|
||||||
_id: FuncId,
|
_id: FuncId,
|
||||||
|
|||||||
@@ -460,25 +460,6 @@ impl<'simple_jit_backend> Backend for SimpleJITBackend {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_data_funcaddr(
|
|
||||||
&mut self,
|
|
||||||
_data: &mut Self::CompiledData,
|
|
||||||
_offset: usize,
|
|
||||||
_what: ir::FuncRef,
|
|
||||||
) {
|
|
||||||
unimplemented!();
|
|
||||||
}
|
|
||||||
|
|
||||||
fn write_data_dataaddr(
|
|
||||||
&mut self,
|
|
||||||
_data: &mut Self::CompiledData,
|
|
||||||
_offset: usize,
|
|
||||||
_what: ir::GlobalValue,
|
|
||||||
_usize: Addend,
|
|
||||||
) {
|
|
||||||
unimplemented!();
|
|
||||||
}
|
|
||||||
|
|
||||||
fn finalize_function(
|
fn finalize_function(
|
||||||
&mut self,
|
&mut self,
|
||||||
_id: FuncId,
|
_id: FuncId,
|
||||||
|
|||||||
Reference in New Issue
Block a user