Add ability to relocate constants using RelocSink

This commit is contained in:
Andrew Brown
2019-07-23 10:47:03 -07:00
committed by Dan Gohman
parent c20b13d5a9
commit 7b2d055f78
8 changed files with 79 additions and 5 deletions

View File

@@ -56,6 +56,22 @@ impl binemit::RelocSink for PrintRelocs {
write!(&mut self.text, "reloc_jt: {} {} at {}\n", r, jt, where_).unwrap();
}
}
fn reloc_constant(
&mut self,
code_offset: binemit::CodeOffset,
reloc: binemit::Reloc,
constant: ir::ConstantOffset,
) {
if self.flag_print {
write!(
&mut self.text,
"reloc_constant: {} {} at {}\n",
reloc, constant, code_offset
)
.unwrap();
}
}
}
pub struct PrintTraps {