MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / declare_anonymous_data

Method declare_anonymous_data

cranelift/object/src/backend.rs:417–444  ·  view source on GitHub ↗
(&mut self, writable: bool, tls: bool)

Source from the content-addressed store, hash-verified

415 }
416
417 fn declare_anonymous_data(&mut self, writable: bool, tls: bool) -> ModuleResult<DataId> {
418 let id = self.declarations.declare_anonymous_data(writable, tls)?;
419
420 let kind = if tls {
421 SymbolKind::Tls
422 } else {
423 SymbolKind::Data
424 };
425
426 let symbol_id = self.object.add_symbol(Symbol {
427 name: self
428 .declarations
429 .get_data_decl(id)
430 .linkage_name(id)
431 .into_owned()
432 .into_bytes(),
433 value: 0,
434 size: 0,
435 kind,
436 scope: SymbolScope::Compilation,
437 weak: false,
438 section: SymbolSection::Undefined,
439 flags: SymbolFlags::None,
440 });
441 self.data_objects[id] = Some((symbol_id, false));
442
443 Ok(id)
444 }
445
446 fn define_function_with_control_plane(
447 &mut self,

Callers

nothing calls this directly

Calls 5

OkFunction · 0.85
into_bytesMethod · 0.80
into_ownedMethod · 0.80
linkage_nameMethod · 0.80
get_data_declMethod · 0.80

Tested by

no test coverage detected