refactor(ir): use u64 directly instead of spans for instructions
This commit is contained in:
parent
87343f0a38
commit
cdf42417da
3 changed files with 10 additions and 46 deletions
|
@ -6,10 +6,8 @@
|
|||
//!
|
||||
//! Instead, this module offers an alternative way to refer to specific instances:
|
||||
//!
|
||||
//! - [`Instruction`]s are referred to as their **byte [`Span`]s** in the source code,
|
||||
//! so effectively where they are written in the source code.
|
||||
//! (Or if coming from [`crate::semi_human::GraphIr`],
|
||||
//! it's just a fictional number floating in space.)
|
||||
//! - [`Instruction`]s are effectively just a number floating in space,
|
||||
//! incremented each time a new instruction is referred to.
|
||||
//! - [`Socket`]s contain
|
||||
//! - what [`Instruction`] they belong to
|
||||
//! - which index they occupy on it
|
||||
|
@ -19,22 +17,12 @@
|
|||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::Span;
|
||||
|
||||
/// One specific instruction, and where it is found in code.
|
||||
/// One specific instruction.
|
||||
///
|
||||
/// It does **not** contain what kind of instruction this is.
|
||||
/// Refer to [`crate::instruction::Kind`] for this instead.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
|
||||
pub struct Instruction(pub(super) Span);
|
||||
|
||||
impl Instruction {
|
||||
/// Where this instruction is written down.
|
||||
#[must_use]
|
||||
pub fn span(&self) -> &Span {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
pub struct Instruction(pub(super) u64);
|
||||
|
||||
/// On an **instruction**, accepts incoming data.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue