提交 72866e82 编写于 作者: R Richard Henderson

tcg: Register the helper info struct rather than the name

This will let us find all the info from the hash table.
Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
Signed-off-by: NRichard Henderson <rth@twiddle.net>
上级 a5ed2de1
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册