package bap-std
BIR interpreter
constraint 'a = Biri.context
inherit 'a Biri.Expi.t
called for each term, just after the position is updated, but before any side effect of term evaluation had occurred.
eval cls t
evaluates a term t
of the cls
class. The method implementation will call the enter_term
method, and then will dispatch to the eval_XXX
method, where XXX
is a name of a term corresponding to cls
. Finally, the leave_term
method is called.
called after all side effects of the term has occurred
Evaluates a subroutine with the following algorithm:
0. next <- first block of subroutine and goto 1 1. eval all in and in/out arguments and goto 2 2. if next is some blk then eval it and goto 2 else goto 3 3. if next is some sub then eval it and goto 2 else goto 4 4. eval all out and in/out arguments.
evaluate argument by first evaluating its right hand side, and then assigning the result to the left hand side.
evaluate all terms in a given block, starting with phi nodes, then proceeding to def nodes and finally evaluating all jmp terms until either jump is taken or jump condition is undefined. After the evaluation the context#next will point next destination.
evaluate definition by assigning the result of the right hand side to the definition variable
based on trace select an expression and assign its value to the left hand side of phi node.
evaluate condition, and if it is false, then do nothing, otherwise evaluate jump target (see below)
evaluate label, using eval_direct
or eval_indirect
, based on the label variant
evaluate target label, using eval_direct
or eval_indirect
, based on the label variant. Ignores return label.
evaluate label, using eval_direct
or eval_indirect
, based on the label variant