[qfcc] Remove "impossible" code

It is not possible to adorn Class with protocols, so no need to check
for them when checking if a type is a class.
This commit is contained in:
Bill Currie 2020-03-15 20:27:43 +09:00
parent e1140d476a
commit fb33a7f2a7
2 changed files with 1 additions and 10 deletions

View File

@ -116,7 +116,7 @@ struct symbol_s;
int obj_is_id (const struct type_s *type) __attribute__((pure));
int obj_is_class (const struct type_s *type) __attribute__((pure));
int obj_is_Class (const struct type_s *type) __attribute__((pure));
int obj_is_Class (const struct type_s *type) __attribute__((const));
int obj_is_classptr (const struct type_s *type) __attribute__((pure));
int obj_types_assignable (const struct type_s *dst, const struct type_s *src);

View File

@ -345,15 +345,6 @@ obj_is_Class (const type_t *type)
{
if (type == &type_Class)
return 1;
// type may be a qualified Class, in which case it will be a pointer to
// a qualified obj_class struct
if (type->type != ev_pointer)
return 0;
if (!is_struct (type->t.fldptr.type))
return 0;
// if the the symtabs match, then type is Class in disguise
if (type->t.fldptr.type->t.symtab == type_obj_class.t.symtab)
return 1;
return 0;
}