diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2014-12-03 22:41:29 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2014-12-03 22:41:29 (GMT) |
commit | 172fce9bab61de1ffa89f731b5d10f96e209afc1 (patch) | |
tree | 31aee5a141979fa99bbf88cbf2b7990de0ec3832 /tools/d2c/conv.c | |
parent | f7ef27195f8c9dc35e5e210a333b74fcfae5ad71 (diff) |
Begun to support more than the only 'ARMv7' architecture for ARM (ARM / Thumb16 / Thumb32).
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@433 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'tools/d2c/conv.c')
-rw-r--r-- | tools/d2c/conv.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/tools/d2c/conv.c b/tools/d2c/conv.c index 323f63d..6676edc 100644 --- a/tools/d2c/conv.c +++ b/tools/d2c/conv.c @@ -428,7 +428,7 @@ static bool compute_conv_expr_size(const conv_expr_t *expr, const coding_bits *b break; - case CET_COMPOSED: + case CET_COMPOSED: result = true; *size = 0; @@ -599,11 +599,22 @@ static bool ensure_conv_expr_content_fully_marked(conv_expr_t *expr, const codin { bool found; /* Bilan d'opération à renvoyer*/ raw_bitfield *field; /* Eventuel champ brut associé */ + conv_func *func; /* Eventuelle fonction liée */ + + found = find_var_by_name(bts, lst, name, &field, &func); - found = find_var_by_name(bts, lst, name, &field, NULL); + if (found) + { + if (field != NULL) + mark_raw_bitfield_as_used(field); + else /*if (func != NULL) */ + mark_conv_func(func, bts, lst); - if (found && field != NULL) - mark_raw_bitfield_as_used(field); + printf(" VAR '%s' found (bf=%d fc=%d)\n", name, !!field, !!func); + + + } + else printf(" VAR '%s' not found...\n", name); return found; @@ -663,6 +674,7 @@ static bool ensure_conv_expr_content_fully_declared(conv_expr_t *expr, int fd, c size_t i; /* Boucle de parcours */ /* Si l'expression a déjà été définie lors d'un précédent besoin... */ + printf(" sub declared ? %d -- type = %d\n", sub->declared, sub->type); if (sub->declared) return true; bool declare_by_name(int _f, const coding_bits *_bts, const conv_list *_lst, unsigned int _wide, const char *name) @@ -675,7 +687,9 @@ static bool ensure_conv_expr_content_fully_declared(conv_expr_t *expr, int fd, c if (found && func != NULL) { dprintf(_f, "\t\tuint%u_t val_%s;\n", _wide, name); + printf("========= DECLARE for '%s'\n", name); found = declare_conv_func(func, _f, _bts, _lst, _wide); + printf("========= END DECLARE for '%s'\n", name); } return found; @@ -848,7 +862,7 @@ static bool define_conv_expr(conv_expr_t *expr, int fd, const coding_bits *bits, dprintf(fd, "%lu", expr->number); break; - case CET_COMPOSED: + case CET_COMPOSED: result = compute_conv_expr_size(expr, bits, list, &max_size); @@ -1360,6 +1374,7 @@ bool declare_conv_func(conv_func *func, int fd, const coding_bits *bits, const c bool result; /* Bilan à remonter */ /* Si la fonction a déjà été définie lors d'un précédent besoin... */ + printf(" func declared ? %d\n", func->declared); if (func->declared) return true; if (func->is_expr) |