Remove end_codegen method from CodeSink
This commit is contained in:
@@ -36,8 +36,6 @@ pub struct MemoryCodeSink<'a> {
|
||||
offset: isize,
|
||||
relocs: &'a mut dyn RelocSink,
|
||||
traps: &'a mut dyn TrapSink,
|
||||
/// Information about the generated code and read-only data.
|
||||
pub info: CodeInfo,
|
||||
}
|
||||
|
||||
impl<'a> MemoryCodeSink<'a> {
|
||||
@@ -55,11 +53,17 @@ impl<'a> MemoryCodeSink<'a> {
|
||||
Self {
|
||||
data,
|
||||
offset: 0,
|
||||
info: CodeInfo { total_size: 0 },
|
||||
relocs,
|
||||
traps,
|
||||
}
|
||||
}
|
||||
|
||||
/// Information about the generated code and read-only data.
|
||||
pub fn info(&self) -> CodeInfo {
|
||||
CodeInfo {
|
||||
total_size: self.offset as CodeOffset,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A trait for receiving relocations for code that is emitted directly into memory.
|
||||
@@ -119,10 +123,6 @@ impl<'a> CodeSink for MemoryCodeSink<'a> {
|
||||
self.traps.trap(ofs, srcloc, code);
|
||||
}
|
||||
|
||||
fn end_codegen(&mut self) {
|
||||
self.info.total_size = self.offset as CodeOffset;
|
||||
}
|
||||
|
||||
fn add_call_site(&mut self, opcode: Opcode, loc: SourceLoc) {
|
||||
debug_assert!(
|
||||
opcode.is_call(),
|
||||
|
||||
Reference in New Issue
Block a user