Skip to content

Commit

Permalink
Remove unused vtype_includes function
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed Aug 12, 2023
1 parent 269b68f commit bfd254b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 43 deletions.
43 changes: 1 addition & 42 deletions src/vcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@ const char *vcode_op_string(vcode_op_t op)
return strs[op];
}

LCOV_EXCL_START
static int vcode_dump_reg(vcode_reg_t reg)
{
int printed;
Expand Down Expand Up @@ -1154,7 +1155,6 @@ static int vcode_dump_var(vcode_var_t var, int hops)
}
}

LCOV_EXCL_START
void vcode_dump_with_mark(int mark_op, vcode_dump_fn_t callback, void *arg)
{
assert(active_unit != NULL);
Expand Down Expand Up @@ -2359,47 +2359,6 @@ bool vtype_eq(vcode_type_t a, vcode_type_t b)
}
}

bool vtype_includes(vcode_type_t type, vcode_type_t bounds)
{
const vtype_t *tt = vcode_type_data(type);
const vtype_t *bt = vcode_type_data(bounds);

if (bt->kind == VCODE_TYPE_UARRAY || tt->kind == VCODE_TYPE_UARRAY)
return false;
else if (bt->kind != tt->kind)
return false;

switch (bt->kind) {
case VCODE_TYPE_INT:
return bt->low >= tt->low && bt->high <= tt->high;

case VCODE_TYPE_CARRAY:
case VCODE_TYPE_UARRAY:
case VCODE_TYPE_RECORD:
return vtype_eq(type, bounds);

case VCODE_TYPE_POINTER:
case VCODE_TYPE_ACCESS:
case VCODE_TYPE_OFFSET:
case VCODE_TYPE_FILE:
case VCODE_TYPE_RESOLUTION:
case VCODE_TYPE_CLOSURE:
case VCODE_TYPE_OPAQUE:
case VCODE_TYPE_CONTEXT:
case VCODE_TYPE_DEBUG_LOCUS:
case VCODE_TYPE_TRIGGER:
return false;

case VCODE_TYPE_REAL:
return bt->rlow >= tt->rlow && bt->rhigh <= tt->rhigh;

case VCODE_TYPE_SIGNAL:
return vtype_includes(tt->base, bt->base);
}

return false;
}

void vcode_dump(void)
{
vcode_dump_with_mark(-1, NULL, NULL);
Expand Down
1 change: 0 additions & 1 deletion src/vcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ vcode_type_t vtype_context(ident_t name);
vcode_type_t vtype_debug_locus(void);
vcode_type_t vtype_trigger(void);
bool vtype_eq(vcode_type_t a, vcode_type_t b);
bool vtype_includes(vcode_type_t type, vcode_type_t bounds);
vtype_kind_t vtype_kind(vcode_type_t type);
bool vtype_is_scalar(vcode_type_t type);
bool vtype_is_composite(vcode_type_t type);
Expand Down

0 comments on commit bfd254b

Please sign in to comment.