Added ISDKHooks interface with entity listeners (
bug 5602, r=psychonic).
1 #ifndef _INCLUDE_SP_DECOMP_CODE_ANALYZER_H_
2 #define _INCLUDE_SP_DECOMP_CODE_ANALYZER_H_
4 #include <sp_vm_types.h>
8 _OP_VAR = -1, /* Variable container */
9 _OP_STMT = -2, /* Statement contained */
10 _OP_CONST = -3, /* Constant value */
11 _OP_STORE = -4, /* Store operation (binary assignment) */
12 _OP_NEW = -5, /* Variable declaration */
13 _OP_MODULO = -6, /* Binary modulo operator */
14 _OP_DEFINE = -7, /* "define" node for SSA */
15 _OP_USE = -8, /* "use" node for SSA */
16 #define OPDEF(num,name,str,params) \
18 #include "opcodes.tbl"
32 BaseNode(cell_t _op) : op(_op)
38 struct ConstNode : public BaseNode
40 ConstNode(cell_t _val) : BaseNode(_OP_CONST), val(_val)
46 struct StmtNode : public BaseNode
48 StmtNode(cell_t _op, BaseNode *_node, StmtNode *_next) : BaseNode(_op)
59 struct CallNode : public BaseNode
61 CallNode(FunctionInfo *f, BaseNode **t, unsigned int c) : BaseNode(OP_CALL)
72 struct DefineNode : public BaseNode
74 DefineNode(BaseNode *o, const char *fmt, ...);
79 struct UseNode : public BaseNode
81 UseNode(DefineNode *n) : BaseNode(_OP_USE), def(n)
87 struct UnaryNode : public BaseNode
89 UnaryNode(cell_t _op, BaseNode *_node) : BaseNode(_op), node(_node)
95 struct VarNode : public BaseNode
97 VarNode(FuncVar *_var) : BaseNode(_OP_VAR), var(_var)
103 struct BinOpNode : public BaseNode
105 BinOpNode(cell_t _op, BaseNode *_left, BaseNode *_right) : BaseNode(_op)
114 struct DeclNode : public BaseNode
116 DeclNode(VarNode *_var, BaseNode *_expr) : BaseNode(_OP_NEW), var(_var), expr(_expr)
125 sp_fdbg_symbol_t *sym;
126 sp_fdbg_arraydim_t *dims;
129 unsigned int dimcount;
136 sp_fdbg_symbol_t *sym;
137 FuncVar known_args[SP_MAX_EXEC_PARAMS];
138 unsigned int num_known_args;
145 unsigned int num_known_vars;
150 int Sp_DecompFunction(sp_decomp_t *dc, uint32_t code_addr, bool is_public);
152 #endif //_INCLUDE_SP_DECOMP_CODE_ANALYZER_H_