Merge pull request #3680 from bjorn3/remove_code_sink

Remove the CodeSink interface in favor of MachBufferFinalized
This commit is contained in:
Chris Fallin
2022-01-12 10:47:23 -08:00
committed by GitHub
30 changed files with 342 additions and 899 deletions

View File

@@ -13,7 +13,6 @@
//! -- isa::x64::inst::emit_tests::test_x64_emit
use super::*;
use crate::isa::test_utils;
use crate::isa::x64;
use alloc::vec::Vec;
@@ -4460,7 +4459,6 @@ fn test_x64_emit() {
// Check the printed text is as expected.
let actual_printing = insn.show_rru(Some(&rru));
assert_eq!(expected_printing, actual_printing);
let mut sink = test_utils::TestCodeSink::new();
let mut buffer = MachBuffer::new();
insn.emit(&mut buffer, &emit_info, &mut Default::default());
@@ -4470,8 +4468,7 @@ fn test_x64_emit() {
buffer.bind_label(label);
let buffer = buffer.finish();
buffer.emit(&mut sink);
let actual_encoding = &sink.stringify();
let actual_encoding = &buffer.stringify_code_bytes();
assert_eq!(expected_encoding, actual_encoding, "{}", expected_printing);
}
}

View File

@@ -122,7 +122,7 @@ impl TargetIsa for X64Backend {
Some(UnwindInfo::SystemV(
crate::isa::unwind::systemv::create_unwind_info_from_insts(
&result.buffer.unwind_info[..],
result.buffer.data.len(),
result.buffer.data().len(),
&mapper,
)?,
))