-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdm_ssa.h
58 lines (52 loc) · 2.04 KB
/
dm_ssa.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Copyright (c) 2011, Ed Robbins <[email protected]>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef __DM_SSA_H
#define __DM_SSA_H
#include "common.h"
#include "dm_dom.h"
#include "dm_cfg.h"
struct dm_ssa_index {
enum ud_type reg;
int count;
int *stack;
int s_size;
struct dm_cfg_node **def_nodes; /* Nodes where var defined */
int dn_count;
struct dm_cfg_node **phi_nodes; /* Nodes with phi funcs for var*/
int pn_count;
};
void dm_free_ssa();
struct ptrs* mergeSort(struct ptrs *list);
struct ptrs* merge(struct ptrs *left, struct ptrs *right);
struct ptrs* split(struct ptrs *list);
void dm_print_ssa();
int dm_print_block_header(struct dm_cfg_node *node);
int dm_print_phi_function(struct phi_function *phi);
int dm_print_ssa_instruction(struct instruction *insn);
void dm_phi_remove_duplicates(struct phi_function *phi);
void dm_ssa_index_stack_push(enum ud_type reg, int i);
int dm_ssa_index_stack_pop(enum ud_type reg);
void dm_rename_variables(struct dm_cfg_node *n);
void gen_operand_ssa(struct ud* u, struct ud_operand* op, int syn_cast,
int *index);
void dm_translate_intel_ssa(struct instruction *insn);
void dm_place_phi_functions();
void dm_ssa_find_var_defs();
void dm_ssa_index_init();
int dm_cmd_ssa(char **args);
int dm_array_contains(struct dm_cfg_node **list, int c,
struct dm_cfg_node *term);
#endif