Go to the previous, next section.

Destination Operands

The base instruction class includes a field for the destination operand, even though not all instructions use it. The dst_op method returns the value of this operand. If an instruction does not produce a result, the destination operand should always be a null operand. Moreover, the destination may be null even if an instruction does produce a result. In that case, the result value is computed and then discarded.

If the destination operand is a variable, its type must be compatible with the result type of the instruction.

If the result of an instruction is a temporary value, the destination operand is a pointer to the instruction where the value is used. Note that this is different than an instruction pointer in a source operand. The source operands of an instruction point to the children in an expression tree, while the destination operand points to the parent instruction.

The set_dst method may be used to set the destination operand for an instruction. However, there are some important restrictions on using this method:

Go to the previous, next section.