Remove reloc_constant

It is no longer used by the new backends
This commit is contained in:
bjorn3
2021-10-10 14:43:49 +02:00
parent 855ba39217
commit d78f436daf
10 changed files with 2 additions and 89 deletions

View File

@@ -15,7 +15,7 @@
//! `CodeSink::put*` methods, so the performance impact of the virtual callbacks is less severe.
use super::{Addend, CodeInfo, CodeOffset, CodeSink, Reloc};
use crate::binemit::stack_map::StackMap;
use crate::ir::{ConstantOffset, ExternalName, Opcode, SourceLoc, TrapCode};
use crate::ir::{ExternalName, Opcode, SourceLoc, TrapCode};
use core::ptr::write_unaligned;
/// A `CodeSink` that writes binary machine code directly into memory.
@@ -79,9 +79,6 @@ pub trait RelocSink {
_: Addend,
);
/// Add a relocation referencing a constant.
fn reloc_constant(&mut self, _: CodeOffset, _: Reloc, _: ConstantOffset);
/// Track a call site whose return address is the given CodeOffset, for the given opcode. Does
/// nothing in general, only useful for certain embedders (SpiderMonkey).
fn add_call_site(&mut self, _: Opcode, _: CodeOffset, _: SourceLoc) {}
@@ -138,11 +135,6 @@ impl<'a> CodeSink for MemoryCodeSink<'a> {
self.relocs.reloc_external(ofs, srcloc, rel, name, addend);
}
fn reloc_constant(&mut self, rel: Reloc, constant_offset: ConstantOffset) {
let ofs = self.offset();
self.relocs.reloc_constant(ofs, rel, constant_offset);
}
fn trap(&mut self, code: TrapCode, srcloc: SourceLoc) {
let ofs = self.offset();
self.traps.trap(ofs, srcloc, code);
@@ -186,7 +178,6 @@ impl RelocSink for NullRelocSink {
_: Addend,
) {
}
fn reloc_constant(&mut self, _: CodeOffset, _: Reloc, _: ConstantOffset) {}
}
/// A `TrapSink` implementation that does nothing, which is convenient when