diff options
author | Ben Bridle <ben@derelict.engineering> | 2025-02-04 18:17:28 +1300 |
---|---|---|
committer | Ben Bridle <ben@derelict.engineering> | 2025-02-04 18:18:40 +1300 |
commit | cf1af202e01cdcbac437ac96f21c4437bf27bb0d (patch) | |
tree | 8817d87fe2061c8710a6f3d608bb77218826781b /src/locators/bytecode.rs | |
parent | c25cfe6829c509297af77fe3a468e81243c3589b (diff) | |
download | bedrock-asm-cf1af202e01cdcbac437ac96f21c4437bf27bb0d.zip |
Use locator types from assembler crate
Work-in-progress commit while functionality is moved over to the
assembler crate. This commit doesn't compile.
Diffstat (limited to 'src/locators/bytecode.rs')
-rw-r--r-- | src/locators/bytecode.rs | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/locators/bytecode.rs b/src/locators/bytecode.rs deleted file mode 100644 index 500e9f0..0000000 --- a/src/locators/bytecode.rs +++ /dev/null @@ -1,39 +0,0 @@ -pub struct BytecodeSpan { - /// The location of this span in the assembled bytecode. - pub location: BytecodeLocation, - /// The bytes which this span represents. - pub bytes: Vec<u8>, -} - - -impl Default for BytecodeSpan { - fn default() -> Self { - Self { - location: BytecodeLocation { - address: 0, - length: 0, - }, - bytes: Vec::new(), - } - } -} - - -#[derive(Clone, Copy)] -pub struct BytecodeLocation { - // Address of the first byte. - pub address: usize, - // Length as a number of bytes. - pub length: usize, -} - - -impl std::fmt::Display for BytecodeLocation { - fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { - write!(f, "0x{:>04x}", self.address)?; - if self.length > 0 { - write!(f, "-0x{:>04x}", self.address + self.length)?; - } - Ok(()) - } -} |