oxilean_codegen/opt_alias/
memlocation_traits.rs1use super::types::MemLocation;
12use std::fmt;
13
14impl std::fmt::Display for MemLocation {
15 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16 match self {
17 MemLocation::Stack(id) => write!(f, "stack#{}", id),
18 MemLocation::Heap(id) => write!(f, "heap#{}", id),
19 MemLocation::Global(name) => write!(f, "global:{}", name),
20 MemLocation::Field(base, field) => write!(f, "{}.{}", base, field),
21 MemLocation::Index(base, i) => write!(f, "{}[{}]", base, i),
22 MemLocation::Unknown => write!(f, "??"),
23 }
24 }
25}