summaryrefslogtreecommitdiff
path: root/src/analysis/blocks
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/blocks')
-rw-r--r--src/analysis/blocks/flow.c18
-rw-r--r--src/analysis/blocks/virtual.c17
2 files changed, 16 insertions, 19 deletions
diff --git a/src/analysis/blocks/flow.c b/src/analysis/blocks/flow.c
index 305dad0..99d4553 100644
--- a/src/analysis/blocks/flow.c
+++ b/src/analysis/blocks/flow.c
@@ -111,12 +111,20 @@ G_DEFINE_TYPE(GFlowBlock, g_flow_block, G_TYPE_INSTR_BLOCK);
static void g_flow_block_class_init(GFlowBlockClass *class)
{
GObjectClass *object; /* Autre version de la classe */
+ GInstrBlockClass *block_class; /* Version parente du la classe*/
object = G_OBJECT_CLASS(class);
+ block_class = G_INSTR_BLOCK_CLASS(class);
object->dispose = (GObjectFinalizeFunc/* ! */)g_flow_block_dispose;
object->finalize = (GObjectFinalizeFunc)g_flow_block_finalize;
+ block_class->find_by_addr = (find_by_addr_fc)g_flow_block_find_by_addr;
+ block_class->visit_blocks = (visit_all_blocks_fc)g_flow_block_visit;
+ block_class->list_blocks = (list_all_blocks_fc)g_flow_block_list_all_blocks;
+ block_class->list_leafs = (list_leafs_blocks_fc)g_flow_block_list_leafs_blocks;
+ //block_class->list_regs = (list_regs_accesses_fc)g_flow_block_list_regs_accesses;
+
}
@@ -134,16 +142,6 @@ static void g_flow_block_class_init(GFlowBlockClass *class)
static void g_flow_block_init(GFlowBlock *block)
{
- GInstrBlock *parent; /* Instance parente */
-
- parent = G_INSTR_BLOCK(block);
-
- parent->find_by_addr = (find_by_addr_fc)g_flow_block_find_by_addr;
- parent->visit_blocks = (visit_all_blocks_fc)g_flow_block_visit;
- parent->list_blocks = (list_all_blocks_fc)g_flow_block_list_all_blocks;
- parent->list_leafs = (list_leafs_blocks_fc)g_flow_block_list_leafs_blocks;
- //parent->list_regs = (list_regs_accesses_fc)g_flow_block_list_regs_accesses;
-
g_flow_block_set_rank(block, 0);
block->regs = g_raccess_list_new();
diff --git a/src/analysis/blocks/virtual.c b/src/analysis/blocks/virtual.c
index a3e1695..d5b1b5a 100644
--- a/src/analysis/blocks/virtual.c
+++ b/src/analysis/blocks/virtual.c
@@ -107,12 +107,20 @@ G_DEFINE_TYPE(GVirtualBlock, g_virtual_block, G_TYPE_INSTR_BLOCK);
static void g_virtual_block_class_init(GVirtualBlockClass *class)
{
GObjectClass *object; /* Autre version de la classe */
+ GInstrBlockClass *block_class; /* Version parente du la classe*/
object = G_OBJECT_CLASS(class);
+ block_class = G_INSTR_BLOCK_CLASS(class);
object->dispose = (GObjectFinalizeFunc/* ! */)g_virtual_block_dispose;
object->finalize = (GObjectFinalizeFunc)g_virtual_block_finalize;
+ block_class->find_by_addr = (find_by_addr_fc)g_virtual_block_find_by_addr;
+ block_class->visit_blocks = (visit_all_blocks_fc)g_virtual_block_visit;
+ block_class->list_blocks = (list_all_blocks_fc)g_virtual_block_list_all_blocks;
+ block_class->list_leafs = (list_leafs_blocks_fc)g_virtual_block_list_leafs_blocks;
+ //block_class->list_regs = (list_regs_accesses_fc)g_virtual_block_list_regs_accesses;
+
}
@@ -130,15 +138,6 @@ static void g_virtual_block_class_init(GVirtualBlockClass *class)
static void g_virtual_block_init(GVirtualBlock *block)
{
- GInstrBlock *parent; /* Instance parente */
-
- parent = G_INSTR_BLOCK(block);
-
- parent->find_by_addr = (find_by_addr_fc)g_virtual_block_find_by_addr;
- parent->visit_blocks = (visit_all_blocks_fc)g_virtual_block_visit;
- parent->list_blocks = (list_all_blocks_fc)g_virtual_block_list_all_blocks;
- parent->list_leafs = (list_leafs_blocks_fc)g_virtual_block_list_leafs_blocks;
- //parent->list_regs = (list_regs_accesses_fc)g_virtual_block_list_regs_accesses;
}