Merge reloc_func and reloc_globalsym into reloc_external.

This commit is contained in:
Dan Gohman
2017-10-31 12:06:13 -07:00
parent b60b2ce135
commit 5d063eb8bc
12 changed files with 52 additions and 55 deletions

View File

@@ -75,12 +75,13 @@ impl binemit::CodeSink for TextSink {
write!(self.text, "{}({}) ", self.rnames[reloc.0 as usize], ebb).unwrap();
}
fn reloc_func(&mut self, reloc: binemit::Reloc, fref: ir::FuncRef) {
write!(self.text, "{}({}) ", self.rnames[reloc.0 as usize], fref).unwrap();
}
fn reloc_globalsym(&mut self, reloc: binemit::Reloc, global: ir::GlobalVar) {
write!(self.text, "{}({}) ", self.rnames[reloc.0 as usize], global).unwrap();
fn reloc_external(&mut self, reloc: binemit::Reloc, name: &ir::ExternalName) {
write!(
self.text,
"{}({}) ",
self.rnames[reloc.0 as usize],
name,
).unwrap();
}
fn reloc_jt(&mut self, reloc: binemit::Reloc, jt: ir::JumpTable) {

View File

@@ -98,7 +98,6 @@ impl binemit::CodeSink for SizeSink {
}
fn reloc_ebb(&mut self, _reloc: binemit::Reloc, _ebb: ir::Ebb) {}
fn reloc_func(&mut self, _reloc: binemit::Reloc, _fref: ir::FuncRef) {}
fn reloc_globalsym(&mut self, _reloc: binemit::Reloc, _global: ir::GlobalVar) {}
fn reloc_external(&mut self, _reloc: binemit::Reloc, _name: &ir::ExternalName) {}
fn reloc_jt(&mut self, _reloc: binemit::Reloc, _jt: ir::JumpTable) {}
}