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

Method add_constant

cranelift/reader/src/parser.rs:398–407  ·  view source on GitHub ↗

Allocate a new constant.

(
        &mut self,
        constant: Constant,
        data: ConstantData,
        loc: Location,
    )

Source from the content-addressed store, hash-verified

396
397 // Allocate a new constant.
398 fn add_constant(
399 &mut self,
400 constant: Constant,
401 data: ConstantData,
402 loc: Location,
403 ) -> ParseResult<()> {
404 self.map.def_constant(constant, loc)?;
405 self.function.dfg.constants.set(constant, data);
406 Ok(())
407 }
408
409 // Configure the stack limit of the current function.
410 fn add_stack_limit(&mut self, limit: GlobalValue, loc: Location) -> ParseResult<()> {

Callers 1

parse_preambleMethod · 0.45

Calls 3

OkFunction · 0.85
def_constantMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected