summaryrefslogtreecommitdiff
path: root/tools/d2c/spec.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/d2c/spec.c')
-rw-r--r--tools/d2c/spec.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/d2c/spec.c b/tools/d2c/spec.c
index 5aa7066..e6f65df 100644
--- a/tools/d2c/spec.c
+++ b/tools/d2c/spec.c
@@ -26,10 +26,12 @@
#include <malloc.h>
#include <regex.h>
+#include <stdio.h>
#include <string.h>
#include "helpers.h"
+#include "qckcall.h"
@@ -304,6 +306,8 @@ bool write_encoding_spec_disass(const encoding_spec *spec, int fd, const char *a
char *keyword; /* Mot clef appelable en code */
bool quick_exit; /* Inclusion de sortie rapide ?*/
const char *new_ins; /* Nouvelle définition de nom */
+ char *encoding_fc; /* Spécification d'encodage */
+ char *cast; /* Conversion vers le format */
result = true;
@@ -386,7 +390,19 @@ bool write_encoding_spec_disass(const encoding_spec *spec, int fd, const char *a
dprintf(fd, "\n");
}
- dprintf(fd, "\t\tg_arch_instruction_set_encoding(instr, \"%s\");\n", spec->prefix);
+ /* Encodage en dernier lieu */
+
+ asprintf(&encoding_fc, "g_%s_instruction_set_encoding", arch);
+
+ cast = build_cast_if_needed(encoding_fc);
+
+ dprintf(fd, "\t\t%s(%s(instr), \"%s\");\n", encoding_fc, cast, spec->prefix);
+
+ free(cast);
+
+ free(encoding_fc);
+
+ /* Conclusion globale */
dprintf(fd, "\n");