summaryrefslogtreecommitdiff
path: root/src/arch/dalvik/operands/register.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/dalvik/operands/register.c')
-rw-r--r--src/arch/dalvik/operands/register.c45
1 files changed, 43 insertions, 2 deletions
diff --git a/src/arch/dalvik/operands/register.c b/src/arch/dalvik/operands/register.c
index fb95004..9f172dd 100644
--- a/src/arch/dalvik/operands/register.c
+++ b/src/arch/dalvik/operands/register.c
@@ -34,6 +34,7 @@ struct _GDalvikRegisterOperand
GArchOperand parent; /* Instance parente */
GDalvikRegister *reg; /* Registre représenté */
+ bool is_written; /* Changement de contenu */
};
@@ -103,6 +104,8 @@ static void g_dalvik_register_operand_init(GDalvikRegisterOperand *operand)
parent->compare = (operand_compare_fc)g_dalvik_register_operand_compare;
parent->print = (operand_print_fc)g_dalvik_register_operand_print;
+ operand->is_written = false;
+
}
@@ -228,7 +231,7 @@ GDalvikRegister *g_dalvik_register_operand_get(const GDalvikRegisterOperand *ope
static bool g_dalvik_register_operand_compare(const GDalvikRegisterOperand *a, const GDalvikRegisterOperand *b)
{
- return g_dalvik_register_compare(a->reg, b->reg);
+ return (g_dalvik_register_compare(a->reg, b->reg) == 0);
}
@@ -249,6 +252,44 @@ static bool g_dalvik_register_operand_compare(const GDalvikRegisterOperand *a, c
static void g_dalvik_register_operand_print(const GDalvikRegisterOperand *operand, GBufferLine *line, AsmSyntax syntax)
{
- g_dalvik_pool_operand_print(operand->reg, line, syntax);
+ g_dalvik_register_print(operand->reg, line, syntax);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : operand = opérande représentant un registre à mettre à jour. *
+* *
+* Description : Marque l'opérande comme étant écrit plutôt que consulté. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_dalvik_register_operand_mark_as_written(GDalvikRegisterOperand *operand)
+{
+ operand->is_written = true;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : operand = opérande représentant un registre à consulter. *
+* *
+* Description : Indique le type d'accès réalisé sur l'opérande. *
+* *
+* Retour : Type d'accès : true en cas d'écriture, false sinon. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool g_dalvik_register_operand_is_written(const GDalvikRegisterOperand *operand)
+{
+ return operand->is_written;
}