diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-03-15 19:28:02 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-03-15 19:28:02 (GMT) |
commit | 46cf7042cf511215001bb28c072821998a83d011 (patch) | |
tree | 2aa12b84c2f01d124cafe788ad5b314e9e94ae59 /plugins/itanium/component.c | |
parent | 0df5bc8635819dcb268cf8ca1f82b9713417a6cb (diff) |
Added support for packed template arguments in Itanium demangling.
Diffstat (limited to 'plugins/itanium/component.c')
-rw-r--r-- | plugins/itanium/component.c | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/plugins/itanium/component.c b/plugins/itanium/component.c index f5aad1d..f035e36 100644 --- a/plugins/itanium/component.c +++ b/plugins/itanium/component.c @@ -254,6 +254,9 @@ static void visit_comp(itanium_component *comp, visit_comp_fc visitor) break; + case ICT_PACKED_EMPTY: + break; + case ICT_EXPR_LIST: visit_comp(comp->binary.left, visitor); @@ -810,6 +813,46 @@ itanium_component *itd_append_right_to_binary(ItaniumComponentType type, itanium /****************************************************************************** * * * Paramètres : type = type du composant à mettre en place. * +* left = second composant à associer. * +* * +* Description : Construit un composant dans un contexte Itanium. * +* * +* Retour : Composant extrait ou NULL en cas d'échec. * +* * +* Remarques : - * +* * +******************************************************************************/ + +itanium_component *itd_merge_list_right_to_binary(ItaniumComponentType type, itanium_component *parent, itanium_component *left) +{ + itanium_component *result; /* Composant à renvoyer */ + itanium_component *iter; /* Boucle de parcours */ + + if (left->type != ICT_TYPES_LIST) + result = itd_append_right_to_binary(type, parent, left); + + else + { + if (parent == NULL) + result = left; + + else + { + for (iter = parent; iter->binary.right != NULL; iter = iter->binary.right) + ; + iter->binary.right = left; + } + + } + + return (parent != NULL ? parent : result); + +} + + +/****************************************************************************** +* * +* Paramètres : type = type du composant à mettre en place. * * c0 = premier composant à associer. * * c1 = second composant à associer. * * c2 = troisième composant à associer. * @@ -1146,6 +1189,9 @@ char *itd_translate_component(const itanium_component *comp, char *base) break; + case ICT_PACKED_EMPTY: + break; + case ICT_EXPR_LIST: /** @@ -1751,12 +1797,15 @@ GDataType *itd_translate_component_to_type(const itanium_component *comp, Routin case ICT_TEMPLATE_ARGS: - assert(comp->unary->type == ICT_TYPES_LIST); + assert(comp->unary->type == ICT_TYPES_LIST || comp->unary->type == ICT_PACKED_EMPTY); result = g_template_type_new(); for (iter = comp->unary; iter != NULL && result != NULL; iter = iter->binary.right) { + if (iter->type == ICT_PACKED_EMPTY) + continue; + assert(iter->type == ICT_TYPES_LIST); param = itd_translate_component_to_type(iter->binary.left, rtype); @@ -1774,6 +1823,7 @@ GDataType *itd_translate_component_to_type(const itanium_component *comp, Routin break; case ICT_TYPES_LIST: + case ICT_PACKED_EMPTY: /** * Les listes doient être rassemblées par l'appelant ! |