Browse Source

added `jit_insn_nop()`: you may need it to create empty blocks which later should be moved

pull/1/head
Ketmar Dark 9 years ago
committed by Aleksey Demakov
parent
commit
a976ba810a
  1. 1
      include/jit/jit-insn.h
  2. 16
      jit/jit-insn.c

1
include/jit/jit-insn.h

@ -94,6 +94,7 @@ int jit_insn_store_elem
(jit_function_t func, jit_value_t base_addr,
jit_value_t index, jit_value_t value) JIT_NOTHROW;
int jit_insn_check_null(jit_function_t func, jit_value_t value) JIT_NOTHROW;
int jit_insn_nop(jit_function_t func) JIT_NOTHROW;
jit_value_t jit_insn_add
(jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW;

16
jit/jit-insn.c

@ -279,6 +279,22 @@ static jit_intrinsic_descr_t const descr_i_D = {
0
};
int jit_insn_nop(jit_function_t func)
{
jit_insn_t insn;
if(!_jit_function_ensure_builder(func))
{
return 0;
}
insn = _jit_block_add_insn(func->builder->current_block);
if(!insn)
{
return 0;
}
insn->opcode = JIT_OP_NOP;
return 1;
}
/*
* Apply a unary operator.
*/

Loading…
Cancel
Save