Move is_id() from type to class.

type_id's implementation should remain "private" to class.c
This commit is contained in:
Bill Currie 2012-12-18 20:56:23 +09:00
parent f181772a76
commit 4f81a659b4
4 changed files with 14 additions and 13 deletions

View file

@ -107,6 +107,8 @@ struct expr_s;
struct method_s;
struct symbol_s;
int is_id (const struct type_s *type);
class_t *extract_class (class_type_t *class_type);
const char *get_class_name (class_type_t *class_type, int pretty);
struct symbol_s *class_symbol (class_type_t *class_type, int external);

View file

@ -155,7 +155,6 @@ int is_float (const type_t *type);
int is_scalar (const type_t *type);
int is_math (const type_t *type);
int is_struct (const type_t *type);
int is_id (const type_t *type);
int is_class (const type_t *type);
int is_array (const type_t *type);
int type_assignable (const type_t *dst, const type_t *src);

View file

@ -173,6 +173,18 @@ static struct_def_t object_struct[] = {
{0, 0}
};
int
is_id (const type_t *type)
{
if (type == &type_id)
return 1;
// type may be a qualified id
if (type->type == ev_pointer
&& type->t.fldptr.type == type_id.t.fldptr.type)
return 1;
return 0;
}
static const char *
class_get_key (const void *class, void *unused)
{

View file

@ -694,18 +694,6 @@ is_struct (const type_t *type)
return 0;
}
int
is_id (const type_t *type)
{
if (type == &type_id)
return 1;
// type may be a qualified id
if (type->type == ev_pointer
&& type->t.fldptr.type == type_id.t.fldptr.type)
return 1;
return 0;
}
int
is_class (const type_t *type)
{