From 8962a4e61411c8362d5f4be63496977164b886a8 Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Wed, 20 Apr 2016 11:01:52 +0200
Subject: Deleted code dealing with links between instructions in the old
 fashion.

---
 ChangeLog                     |  8 +++++
 src/arch/dalvik/instruction.c | 78 -------------------------------------------
 src/arch/instruction-int.h    |  1 -
 src/arch/instruction.c        | 20 -----------
 src/arch/instruction.h        |  3 --
 5 files changed, 8 insertions(+), 102 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3b1f34b..2951823 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 16-04-20  Cyrille Bagard <nocbos@gmail.com>
 
+	* src/arch/dalvik/instruction.c:
+	* src/arch/instruction-int.h:
+	* src/arch/instruction.c:
+	* src/arch/instruction.h:
+	Delete code dealing with links between instructions in the old fashion.
+
+16-04-20  Cyrille Bagard <nocbos@gmail.com>
+
 	* src/arch/arm/v456/Makefile.am:
 	* src/arch/arm/v456/addressing.c:
 	* src/arch/arm/v456/addressing.h:
diff --git a/src/arch/dalvik/instruction.c b/src/arch/dalvik/instruction.c
index 4c1dee0..e4e2ba2 100644
--- a/src/arch/dalvik/instruction.c
+++ b/src/arch/dalvik/instruction.c
@@ -336,9 +336,6 @@ static dalvik_instruction _instructions[DOP_COUNT] = {
 /* Reconstruit le cache complet d'une désignation d'instruction. */
 static void dalvik_build_instruction_keyword(const GDalvikInstruction *, AsmSyntax);
 
-/* Informe sur une éventuelle référence à une autre instruction. */
-static InstructionLinkType dalvik_get_instruction_link(const GDalvikInstruction *, vmpa_t *);
-
 /* Indique si l'instruction correspond à un retour de fonction. */
 static bool dalvik_instruction_is_return(const GDalvikInstruction *);
 
@@ -401,7 +398,6 @@ static void g_dalvik_instruction_init(GDalvikInstruction *instr)
     parent = G_ARCH_INSTRUCTION(instr);
 
     parent->get_rw_regs = (get_instruction_rw_regs_fc)g_dalvik_instruction_get_rw_registers;
-    parent->get_link = (get_instruction_link_fc)dalvik_get_instruction_link;
     //parent->is_return = (is_instruction_return_fc)dalvik_instruction_is_return;
     parent->decomp = (decomp_instr_fc)dalvik_instruction_decompile;
 
@@ -592,80 +588,6 @@ static void dalvik_build_instruction_keyword(const GDalvikInstruction *instr, As
 /******************************************************************************
 *                                                                             *
 *  Paramètres  : instr = instruction à consulter.                             *
-*                addr  = eventuelle adresse associée à faire connaître. [OUT] *
-*                                                                             *
-*  Description : Informe sur une éventuelle référence à une autre instruction.*
-*                                                                             *
-*  Retour      : Type de lien trouvé ou ILT_NONE si aucun.                    *
-*                                                                             *
-*  Remarques   : -                                                            *
-*                                                                             *
-******************************************************************************/
-
-static InstructionLinkType dalvik_get_instruction_link(const GDalvikInstruction *instr, vmpa_t *addr)
-{
-    InstructionLinkType result;             /* Type de lien à retourner    */
-    GArchOperand *operand;                  /* Opérande à manipuler        */
-    const GImmOperand *imm;                 /* Valeur immédiate            */
-
-    switch (instr->type)
-    {
-        case DOP_GOTO:
-        case DOP_GOTO_16:
-        case DOP_GOTO_32:
-
-            operand = g_arch_instruction_get_operand(G_ARCH_INSTRUCTION(instr), 0);
-            imm = g_dalvik_target_operand_get_value(G_DALVIK_TARGET_OPERAND(operand));
-
-            if (g_imm_operand_to_vmpa_t(imm, addr)) result = ILT_JUMP;
-            else result = ILT_NONE;
-
-            break;
-
-        case DOP_IF_EQ:
-        case DOP_IF_NE:
-        case DOP_IF_LT:
-        case DOP_IF_GE:
-        case DOP_IF_GT:
-        case DOP_IF_LE:
-
-            operand = g_arch_instruction_get_operand(G_ARCH_INSTRUCTION(instr), 2);
-            imm = g_dalvik_target_operand_get_value(G_DALVIK_TARGET_OPERAND(operand));
-
-            if (g_imm_operand_to_vmpa_t(imm, addr)) result = ILT_JUMP_IF_TRUE;
-            else result = ILT_NONE;
-
-            break;
-
-        case DOP_IF_EQZ:
-        case DOP_IF_NEZ:
-        case DOP_IF_LTZ:
-        case DOP_IF_GEZ:
-        case DOP_IF_GTZ:
-        case DOP_IF_LEZ:
-
-            operand = g_arch_instruction_get_operand(G_ARCH_INSTRUCTION(instr), 1);
-            imm = g_dalvik_target_operand_get_value(G_DALVIK_TARGET_OPERAND(operand));
-
-            if (g_imm_operand_to_vmpa_t(imm, addr)) result = ILT_JUMP_IF_TRUE;
-            else result = ILT_NONE;
-
-            break;
-
-        default:
-            result = ILT_NONE;
-            break;
-
-    }
-
-    return result;
-
-}
-
-
-/******************************************************************************
-*                                                                             *
-*  Paramètres  : instr = instruction à consulter.                             *
 *                                                                             *
 *  Description : Indique si l'instruction correspond à un retour de fonction. *
 *                                                                             *
diff --git a/src/arch/instruction-int.h b/src/arch/instruction-int.h
index 2d3a6a6..eca2807 100644
--- a/src/arch/instruction-int.h
+++ b/src/arch/instruction-int.h
@@ -88,7 +88,6 @@ struct _GArchInstruction
     get_instruction_rw_regs_fc get_rw_regs; /* Liste des registres liés    */
     //print_instruction_fc print;             /* Imprime l'ensemble          */
     //get_instruction_keyword_fc get_key;     /* Texte humain équivalent     */
-    get_instruction_link_fc get_link;       /* Référence à une instruction */
     //is_instruction_return_fc is_return;     /* Retour de fonction ou pas ? */
     decomp_instr_fc decomp;                 /* Procédure de décompilation  */
 
diff --git a/src/arch/instruction.c b/src/arch/instruction.c
index 021bdd4..46f533e 100644
--- a/src/arch/instruction.c
+++ b/src/arch/instruction.c
@@ -538,26 +538,6 @@ void g_arch_instruction_get_rw_registers(const GArchInstruction *instr, GArchReg
 
 /******************************************************************************
 *                                                                             *
-*  Paramètres  : instr = instruction à consulter.                             *
-*                addr  = eventuelle adresse associée à faire connaître. [OUT] *
-*                                                                             *
-*  Description : Informe sur une éventuelle référence à une autre instruction.*
-*                                                                             *
-*  Retour      : Type de lien trouvé ou ILT_NONE si aucun.                    *
-*                                                                             *
-*  Remarques   : -                                                            *
-*                                                                             *
-******************************************************************************/
-
-InstructionLinkType g_arch_instruction_get_link(const GArchInstruction *instr, vmpa_t *addr)
-{
-    return instr->get_link(instr, addr);
-
-}
-
-
-/******************************************************************************
-*                                                                             *
 *  Paramètres  : instr = instruction dont les informations sont à consulter.  *
 *                dest  = ligne visée par la liaison (côté destination).       *
 *                type  = type de lien à construire.                           *
diff --git a/src/arch/instruction.h b/src/arch/instruction.h
index d75cf54..95d2e22 100644
--- a/src/arch/instruction.h
+++ b/src/arch/instruction.h
@@ -183,9 +183,6 @@ typedef union _link_extra_info
 } link_extra_info;
 
 
-/* Informe sur une éventuelle référence à une autre instruction. */
-InstructionLinkType g_arch_instruction_get_link(const GArchInstruction *, vmpa_t *);
-
 /* Etablit un lien entre deux instructions. */
 void g_arch_instruction_link_with(GArchInstruction *, GArchInstruction *, InstructionLinkType, ...);
 
-- 
cgit v0.11.2-87-g4458