diff options
author | Richard Henderson <rth@twiddle.net> | 2014-04-08 00:17:53 -0700 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2014-05-28 09:33:54 -0700 |
commit | 72866e823ed31bc26c07f974943386c59d8b2b5a (patch) | |
tree | 07af4b83f52c42d9a9e07602eda0a2bb69c954b4 /tcg/tcg.c | |
parent | a5ed2de10ab3c33eea245848c0642cd67fee60a9 (diff) |
tcg: Register the helper info struct rather than the name
This will let us find all the info from the hash table.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg/tcg.c')
-rw-r--r-- | tcg/tcg.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -356,7 +356,7 @@ void tcg_context_init(TCGContext *s) for (i = 0; i < ARRAY_SIZE(all_helpers); ++i) { g_hash_table_insert(helper_table, (gpointer)all_helpers[i].func, - (gpointer)all_helpers[i].name); + (gpointer)&all_helpers[i]); } tcg_target_init(s); @@ -1149,7 +1149,10 @@ static inline const char *tcg_find_helper(TCGContext *s, uintptr_t val) { const char *ret = NULL; if (s->helpers) { - ret = g_hash_table_lookup(s->helpers, (gpointer)val); + TCGHelperInfo *info = g_hash_table_lookup(s->helpers, (gpointer)val); + if (info) { + ret = info->name; + } } return ret; } |