summaryrefslogtreecommitdiff
path: root/src/arch/instruction.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-12-04 22:59:30 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-12-04 22:59:30 (GMT)
commit12154652c576144405011b5bd267c15c9667f223 (patch)
treebe552b2b7bc563a58892e8950afd920a45132a6e /src/arch/instruction.c
parent6803c5d5b86416d1748d4d37a5cc5cb44fe007b1 (diff)
Provided a new way to build the full name of each instruction and cached it.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@435 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r--src/arch/instruction.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c
index d91e110..c8640b4 100644
--- a/src/arch/instruction.c
+++ b/src/arch/instruction.c
@@ -147,6 +147,26 @@ static void g_arch_instruction_finalize(GArchInstruction *instr)
/******************************************************************************
* *
+* 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 : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_arch_instruction_append_suffix(GArchInstruction *instr, const char *suffix)
+{
+ instr->suffix = suffix;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : instr = instruction quelconque à modifier. *
* address = adresse virtuelle et/ou position physique. *
* length = taille de l'instruction. *
@@ -662,7 +682,10 @@ size_t g_arch_instruction_compute_group_index(GArchInstruction **iter, GArchInst
const char *g_arch_instruction_get_keyword(const GArchInstruction *instr, AsmSyntax syntax)
{
- return G_ARCH_INSTRUCTION_GET_CLASS(instr)->get_key(instr, syntax);
+ if (instr->cached_keyword == NULL)
+ G_ARCH_INSTRUCTION_GET_CLASS(instr)->build_key(instr, syntax);
+
+ return instr->cached_keyword;
}