MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / fixed_size

Method fixed_size

crates/asm-to-binary/src/assembler/token.rs:80–93  ·  view source on GitHub ↗

Fixed byte size contributed to the output section, or None for alignment tokens.

(&self)

Source from the content-addressed store, hash-verified

78 file: String,
79 line: u32,
80 },
81}
82
83impl AsmToken {
84 /// Fixed byte size contributed to the output section, or None for alignment tokens.
85 pub fn fixed_size(&self) -> Option<usize> {
86 match self {
87 Self::Real(_) | Self::Branch { .. } | Self::Jal { .. } => Some(4),
88 Self::Call { .. } | Self::Tail { .. } | Self::La { .. } => Some(8),
89 Self::DataU8(_) => Some(1),
90 Self::DataU16(_) => Some(2),
91 Self::DataU32(_) => Some(4),
92 Self::DataU64(_) => Some(8),
93 Self::DataAsciz(s) => Some(s.len() + 1),
94 Self::Space(n) => Some(*n as usize),
95 Self::Align(_) | Self::Balign(_) => None,
96 Self::Section(_)

Callers 1

compute_layoutFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected