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

Method emit_int

cranelift/isle/isle/src/codegen.rs:1170–1183  ·  view source on GitHub ↗
(
        &self,
        ctx: &mut BodyContext<W>,
        val: i128,
        ty: TypeId,
    )

Source from the content-addressed store, hash-verified

1168 }
1169
1170 fn emit_int<W: Write>(
1171 &self,
1172 ctx: &mut BodyContext<W>,
1173 val: i128,
1174 ty: TypeId,
1175 ) -> Result<(), std::fmt::Error> {
1176 let ty_data = &self.typeenv.types[ty.index()];
1177 match ty_data {
1178 Type::Builtin(BuiltinType::Int(ty)) => {
1179 write!(ctx.out, "{}", rust_int_literal(*ty, val))
1180 }
1181 _ => write!(ctx.out, "{val:#x}"),
1182 }
1183 }
1184}
1185
1186fn rust_int_literal(ty: IntType, val: i128) -> String {

Callers 2

emit_exprMethod · 0.80
emit_constraintMethod · 0.80

Calls 1

indexMethod · 0.45

Tested by

no test coverage detected