Code Listener  [unstable] git snapshot
Data Fields
Insn Struct Reference

high-level representation of an intermediate code instruction More...

#include <storage.hh>

Collaboration diagram for Insn:
Collaboration graph
[legend]

Data Fields

Storagestor
 instance of Storage which owns the Insn object More...
 
Blockbb
 reference to a basic block that owns the Insn object More...
 
enum cl_insn_e code
 kind of instruction, see cl_insn_e documentation More...
 
int subCode
 some extra instructions partitioning, for now used by CL_INSN_UNOP and CL_INSN_BINOP More...
 
struct cl_loc loc
 corresponding location in the original source code More...
 
TOperandList operands
 List of all operands used by the instruction. More...
 
TKillVarList varsToKill
 list of variables you can safely kill after execution of the insn More...
 
TKillPerTarget killPerTarget
 similar to varsToKill, but refined for terminal instructions with more than one target. More...
 
TTargetList targets
 List of all target blocks - useful only for terminal instructions. More...
 
std::vector< unsigned > loopClosingTargets
 list of indexes of targets that are closing a loop at the CFG level More...
 

Detailed Description

high-level representation of an intermediate code instruction

Definition at line 329 of file storage.hh.

Field Documentation

Block* bb

reference to a basic block that owns the Insn object

Definition at line 338 of file storage.hh.

enum cl_insn_e code

kind of instruction, see cl_insn_e documentation

Note
now there can be also CL_INSN_CALL and CL_INSN_SWITCH

Definition at line 344 of file storage.hh.

TKillPerTarget killPerTarget

similar to varsToKill, but refined for terminal instructions with more than one target.

List of kill lists, one kill list per each target of the terminal instruction. If a variable is already killed by varsToKill, it does not appear in killPerTarget again.

Definition at line 406 of file storage.hh.

struct cl_loc loc

corresponding location in the original source code

Definition at line 357 of file storage.hh.

std::vector<unsigned> loopClosingTargets

list of indexes of targets that are closing a loop at the CFG level

Definition at line 431 of file storage.hh.

TOperandList operands

List of all operands used by the instruction.

Their particular semantic is highly dependent on type of the instruction. Let's go to summarize it:

  • (0 operands) CL_INSN_JMP
  • (1 operands) CL_INSN_COND:
    • [0] - value to branch by
  • (1 operands) CL_INSN_RET:
    • [0] - value to return from fnc
  • (0 operands) CL_INSN_ABORT
  • (2 operands) CL_INSN_UNOP:
    • [0] - destination
    • [1] - source
  • (3 operands) CL_INSN_BINOP:
    • [0] - destination
    • [1] - source 1
    • [2] - source 2
  • (2+ operands) CL_INSN_CALL:
    • [0] - destination
    • [1] - what are we going to call (mostly a fnc)
    • [2..n] - call arguments
  • (1+ operands) CL_INSN_SWITCH:
    • [0] - value to switch by
    • [1..n] - case values
  • (1 operand) CL_INSN_LABEL:
    • [0] - name of the label

Definition at line 395 of file storage.hh.

Storage* stor

instance of Storage which owns the Insn object

Definition at line 333 of file storage.hh.

int subCode

some extra instructions partitioning, for now used by CL_INSN_UNOP and CL_INSN_BINOP

Note
this suffers from a little type info lost since it represent both enumeral types cl_unop_e and cl_binop_e by an integer.

Definition at line 352 of file storage.hh.

TTargetList targets

List of all target blocks - useful only for terminal instructions.

Their particular semantic is highly dependent on type of the instruction. Let's go to summarize it:

  • (1 target) CL_INSN_JMP:
    • [0] - target of jump
  • (2 targets) CL_INSN_COND:
    • [0] - where to jump if condition holds
    • [1] - where to jump if condition does not hold
  • (0 targets) CL_INSN_RET
  • (0 targets) CL_INSN_ABORT
  • (1+ targets) CL_INSN_SWITCH:
    • [0] - where to jump by default
    • [1..n] - where to jump in corresponding cases

Definition at line 428 of file storage.hh.

TKillVarList varsToKill

list of variables you can safely kill after execution of the insn

Definition at line 398 of file storage.hh.


The documentation for this struct was generated from the following file: