pub struct Shared<'str> {
pub default_space: SpaceId,
pub pcode_ops: Registry<PCodeOpId, Box<str>>,
pub named_spaces: FxHashMap<Box<str>, SpaceId>,
pub registers: FxHashMap<RegisterId, VarnodeId>,
pub values: ValueRegistry<'str>,
pub types: TypeManager,
/* private fields */
}Expand description
Module-shared IR state: regimes 1–3 of the context-split design (see
docs/plans/context-split/00-overview.md). Holds the frozen architecture
(spaces, registers, memory image), the append-interned value arenas
(literals, bytes, varnodes, types) inside values, and the
phase-mutable module maps (names, truths, discoveries, call
sites). Everything here is reachable through a frozen &Shared view; nothing
per-function-body lives here.
Fields§
§default_space: SpaceId§pcode_ops: Registry<PCodeOpId, Box<str>>A mapping of pcode ops to their names
named_spaces: FxHashMap<Box<str>, SpaceId>A mapping of names to spaces
registers: FxHashMap<RegisterId, VarnodeId>A mapping of register IDs to their corresponding value IDs
values: ValueRegistry<'str>The values available in the context, indexed by their ID
types: TypeManagerImplementations§
Sourcepub fn get_named(&self, name: &str) -> Option<ValueId>
pub fn get_named(&self, name: &str) -> Option<ValueId>
The value id currently bound to the module-global name, if any.
Shared-only mirror of Context::get_named.
Sourcepub fn varnode(&self, id: VarnodeId) -> &Varnode<'str>
pub fn varnode(&self, id: VarnodeId) -> &Varnode<'str>
The varnode id. Shared-only accessor (varnodes live in the interners).
Sourcepub fn space(&self, id: SpaceId) -> &Space
pub fn space(&self, id: SpaceId) -> &Space
The space id. Shared-only accessor (spaces are frozen architecture).
Sourcepub fn spaces(&self) -> impl Iterator<Item = Identified<SpaceId, &Space>> + '_
pub fn spaces(&self) -> impl Iterator<Item = Identified<SpaceId, &Space>> + '_
Iterates over every space registered in this module, in id order, each
paired with its SpaceId.
Sourcepub fn get_const(&self, value: u64, size: usize) -> ValueId
pub fn get_const(&self, value: u64, size: usize) -> ValueId
An interned integer constant of the given byte width, as a ValueId.
Shared-only mirror of Context::get_const returning the id directly
(the LiteralRef wrapper needs a whole &Context).
Sourcepub fn get_bool_const(&self, value: bool) -> ValueId
pub fn get_bool_const(&self, value: bool) -> ValueId
A bool-typed constant (true/false), byte-stored. Shared-only mirror
of Context::get_bool_const returning the id directly.
Sourcepub fn get_typed_const(&self, value: u64, type_id: TypeId) -> ValueId
pub fn get_typed_const(&self, value: u64, type_id: TypeId) -> ValueId
A typed constant literal. Shared-only mirror of
Context::get_typed_const returning the id directly.
Sourcepub fn get_bytes(&self, data: Vec<u8>) -> ValueId
pub fn get_bytes(&self, data: Vec<u8>) -> ValueId
An opaque Array(i8, len) byte-blob constant, as a ValueId.
Shared-only mirror of Context::get_bytes returning the id directly.
Sourcepub fn bytes_display(&self, id: BytesId) -> BytesDisplay
pub fn bytes_display(&self, id: BytesId) -> BytesDisplay
The forced rendering mode for a Bytes blob, or
BytesDisplay::Auto if unset.
Shared-only mirror of Context::bytes_display (the override map lives in
the interners), for the &Shared-backed BytesRef.
Sourcepub fn get_typed_bytes(&self, data: Vec<u8>, type_id: TypeId) -> ValueId
pub fn get_typed_bytes(&self, data: Vec<u8>, type_id: TypeId) -> ValueId
Like get_bytes but with an explicit array/sequence
TypeId. Shared-only mirror of Context::get_typed_bytes returning
the id directly.
Sourcepub fn truth(&self, prop: Proposition) -> Option<Truth>
pub fn truth(&self, prop: Proposition) -> Option<Truth>
The recorded Truth of prop, if any. Shared-only
mirror of Context::truth (truths live in the phase-mutable shared
maps), for &Shared-served pass reads.
Sourcepub fn assumed_call_convention(&self) -> Option<&AssumedCallEffect>
pub fn assumed_call_convention(&self) -> Option<&AssumedCallEffect>
The cached AssumedCallEffect for
the opt-in AssumeCallingConvention hypothesis, if the
assume_calling_convention pass installed one this round. Shared-only
accessor so the &Shared-served mem2reg / alias register classifier can
consult it. None when the hypothesis is inactive.
Sourcepub fn varnodes(&self) -> impl Iterator<Item = VarnodeRef<'str, '_>> + '_
pub fn varnodes(&self) -> impl Iterator<Item = VarnodeRef<'str, '_>> + '_
Iterate every varnode as a VarnodeRef. Shared-only mirror of
Context::varnodes (varnodes live in the interners).
Sourcepub fn varnode_count(&self) -> usize
pub fn varnode_count(&self) -> usize
Number of varnodes. Shared-only mirror of Context::varnode_count;
append-only, so an unchanged value means an unchanged varnode set.
Sourcepub fn stored_type_of(&self, id: ValueId) -> Option<TypeId>
pub fn stored_type_of(&self, id: ValueId) -> Option<TypeId>
The stored TypeId of a shared-leaf value (literal, bytes, or
varnode-with-override). Shared-only mirror of Context::stored_type_of:
instruction/block-param/block/function ids live in function bodies and are
out of a &Shared’s reach, so they return None here (callers route those
through the body). Matches the actual call pattern, where only shared-leaf
ids are passed to the shared path.