diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-10-29 11:37:13 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-10-29 11:37:13 (GMT) |
commit | 38e455ebbbbf90ddbf552f95a1dfb3c544907587 (patch) | |
tree | c6e2a4763baef01c87dd0954116fb2c457e10c23 /src/arch/instruction.c | |
parent | 8c71b36d401b2473342daddcb9b7eb4b83ba3295 (diff) |
Reduced once again the size of the main instruction structure.
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r-- | src/arch/instruction.c | 59 |
1 files changed, 3 insertions, 56 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c index b57b49d..f77a20b 100644 --- a/src/arch/instruction.c +++ b/src/arch/instruction.c @@ -30,7 +30,6 @@ #include "instruction-int.h" -#include "../common/extstr.h" @@ -176,56 +175,6 @@ const char *g_arch_instruction_get_encoding(const GArchInstruction *instr) /****************************************************************************** * * -* Paramètres : instr = instruction quelconque à modifier. * -* encoding = encodage de l'instruction. * -* * -* Description : Précise l'encodage d'une instruction de façon détaillée. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -void g_arch_instruction_set_encoding(GArchInstruction *instr, const char *encoding) -{ - instr->encoding = encoding; - -} - - -/****************************************************************************** -* * -* Paramètres : instr = instruction quelconque à modifier. * -* suffix = chaîne de caractères fournie en complément. * -* * -* Description : Etend la désignation d'un nom d'instruction. * -* * -* Retour : true. * -* * -* Remarques : - * -* * -******************************************************************************/ - -bool g_arch_instruction_extend_keyword(GArchInstruction *instr, const char *suffix) -{ - instr->suffix = stradd(instr->suffix, suffix); - - if (instr->cached_keyword != NULL) - { - free(instr->cached_keyword); - instr->cached_keyword = NULL; - } - - /* TODO : signal ? */ - - return true; - -} - - -/****************************************************************************** -* * * Paramètres : instr = instruction quelconque à modifier. * * flag = drapeau d'information complémentaire à planter. * * * @@ -900,13 +849,11 @@ size_t g_arch_instruction_compute_group_index(GArchInstruction **iter, GArchInst const char *g_arch_instruction_get_keyword(GArchInstruction *instr, AsmSyntax syntax) { - if (instr->cached_keyword == NULL) - G_ARCH_INSTRUCTION_GET_CLASS(instr)->build_key(instr, syntax); + const char *result; /* Désignation à retourner */ - if (instr->suffix != NULL) - instr->cached_keyword = stradd(instr->cached_keyword, instr->suffix); + result = G_ARCH_INSTRUCTION_GET_CLASS(instr)->get_keyword(instr, syntax); - return instr->cached_keyword; + return result; } |