Skip to content

Commit

Permalink
Driver extraction for array slices
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed Apr 12, 2014
1 parent 8158053 commit 671d8c5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/cgen.c
Expand Up @@ -5169,6 +5169,21 @@ static void cgen_driver_nets(tree_t t, tree_t *decl,
}
break;

case T_ARRAY_SLICE:
{
tree_t value = tree_value(t);
cgen_driver_nets(value, decl, all_nets, all_length,
driven_nets, driven_length, ctx);

range_t r = tree_range(t);
if (cgen_is_const(r.left) && cgen_is_const(r.right)) {
*driven_nets = cgen_get_slice(*driven_nets, tree_type(value),
NULL, r, ctx);
*driven_length = type_width(tree_type(t));
}
}
break;

default:
assert(false);
}
Expand Down

0 comments on commit 671d8c5

Please sign in to comment.