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

Method import_global_value

cranelift/module/src/data_context.rs:147–149  ·  view source on GitHub ↗

Declares a global value import. TODO: Rename to import_data? Users of the `Module` API generally should call `Module::declare_data_in_data` instead, as it takes care of generating the appropriate `ExternalName`.

(&mut self, name: ModuleRelocTarget)

Source from the content-addressed store, hash-verified

145 /// `Module::declare_data_in_data` instead, as it takes care of generating
146 /// the appropriate `ExternalName`.
147 pub fn import_global_value(&mut self, name: ModuleRelocTarget) -> ir::GlobalValue {
148 self.data_decls.push(name)
149 }
150
151 /// Write the address of `func` into the data at offset `offset`.
152 pub fn write_function_addr(&mut self, offset: CodeOffset, func: ir::FuncRef) {

Callers 2

basic_data_contextFunction · 0.80
declare_data_in_dataMethod · 0.80

Calls 1

pushMethod · 0.45

Tested by 1

basic_data_contextFunction · 0.64