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

Method define

crates/asm-to-binary/src/assembler/symbol_table.rs:18–25  ·  view source on GitHub ↗

Define a label at the given address. Returns `false` if it was already defined.

(&mut self, name: impl Into<String>, address: u64)

Source from the content-addressed store, hash-verified

16
17 /// Define a label at the given address. Returns `false` if it was already defined.
18 pub fn define(&mut self, name: impl Into<String>, address: u64) -> bool {
19 let name = name.into();
20 if self.symbols.contains_key(&name) {
21 return false;
22 }
23 self.symbols.insert(name, address);
24 true
25 }
26
27 pub fn resolve(&self, name: &str) -> Option<u64> {
28 self.symbols.get(name).copied()

Callers 5

mark_global_and_queryFunction · 0.80
globals_no_duplicatesFunction · 0.80
compute_layoutFunction · 0.80

Calls 1

insertMethod · 0.45

Tested by 4

mark_global_and_queryFunction · 0.64
globals_no_duplicatesFunction · 0.64