Remove dead code
This commit is contained in:
parent
b33aa8c11f
commit
0921f3723b
23
types.c
23
types.c
@ -187,29 +187,6 @@ precision_cmp_e compare_precision(type_t *a, type_t *b)
|
||||
else return NUM_PRECISION_INCOMPARABLE;
|
||||
}
|
||||
|
||||
bool is_orderable(type_t *t)
|
||||
{
|
||||
switch (t->tag) {
|
||||
case ArrayType: return is_orderable(Match(t, ArrayType)->item_type);
|
||||
case PointerType: case FunctionType: case TableType: return false;
|
||||
case StructType: {
|
||||
for (arg_t *field = Match(t, StructType)->fields; field; field = field->next) {
|
||||
if (!is_orderable(field->type))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case EnumType: {
|
||||
for (tag_t *tag = Match(t, EnumType)->tags; tag; tag = tag->next) {
|
||||
if (tag->type && !is_orderable(tag->type))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
default: return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool has_heap_memory(type_t *t)
|
||||
{
|
||||
switch (t->tag) {
|
||||
|
1
types.h
1
types.h
@ -113,7 +113,6 @@ type_t *type_or_type(type_t *a, type_t *b);
|
||||
type_t *value_type(type_t *a);
|
||||
typedef enum {NUM_PRECISION_EQUAL, NUM_PRECISION_LESS, NUM_PRECISION_MORE, NUM_PRECISION_INCOMPARABLE} precision_cmp_e;
|
||||
precision_cmp_e compare_precision(type_t *a, type_t *b);
|
||||
bool is_orderable(type_t *t);
|
||||
bool has_heap_memory(type_t *t);
|
||||
bool has_stack_memory(type_t *t);
|
||||
bool can_promote(type_t *actual, type_t *needed);
|
||||
|
Loading…
Reference in New Issue
Block a user