X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Ftype_identify.c;h=70b899806dba2101ae0ef597e7a63517de01d4cd;hb=ff244fb7355c6120cf0f15ba7911b473bb91c64b;hp=7b4525444bf530820bbd58027cc1218dab432493;hpb=fa4b053e1b708fcf7e7cfa47f6f99e79a38fbfdd;p=libfirm diff --git a/ir/tr/type_identify.c b/ir/tr/type_identify.c index 7b4525444..70b899806 100644 --- a/ir/tr/type_identify.c +++ b/ir/tr/type_identify.c @@ -1,6 +1,6 @@ /* * Project: libFIRM - * File name: ir/tr/type.c + * File name: ir/tr/type_identify.c * Purpose: Representation of types. * Author: Goetz Lindenmaier * Modified by: @@ -11,15 +11,15 @@ */ /** - * file type.c - implementation of the datastructure to hold - * type information. + * @file type_identify.c + * * (C) 2004 by Universitaet Karlsruhe * Goetz Lindenmaier * */ #ifdef HAVE_CONFIG_H -# include +# include "config.h" #endif #include "type_identify_t.h" @@ -36,6 +36,7 @@ #include "irprog_t.h" #include "mangle.h" #include "pset.h" +#include "irtools.h" /* The hash set for types. */ static pset *type_table = NULL; @@ -45,8 +46,8 @@ static hash_types_func_t *hash_types_func; static compare_types_func_t *compare_types_func; int compare_names (const void *tp1, const void *tp2) { - type *t1 = (type *) tp1; - type *t2 = (type *) tp2; + ir_type *t1 = (ir_type *) tp1; + ir_type *t2 = (ir_type *) tp2; return (t1 != t2 && (t1->type_op != t2->type_op || @@ -55,21 +56,21 @@ int compare_names (const void *tp1, const void *tp2) { /* stuff for comparing two types. */ int compare_strict (const void *tp1, const void *tp2) { - type *t1 = (type *) tp1; - type *t2 = (type *) tp2; + ir_type *t1 = (ir_type *) tp1; + ir_type *t2 = (ir_type *) tp2; return t1 != t2; } /* stuff to compute a hash value for a type. */ -int hash_name (type *tp) { - unsigned h = (unsigned)tp->type_op; - h = 9*h + (unsigned)tp->name; +int firm_hash_name (ir_type *tp) { + unsigned h = (unsigned)PTR_TO_INT(tp->type_op); + h = 9*h + (unsigned)PTR_TO_INT(tp->name); return h; } /* The function that hashes a type. */ -type *mature_type(type *tp) { - type *o; +ir_type *mature_type(ir_type *tp) { + ir_type *o; assert(type_table); @@ -84,8 +85,8 @@ type *mature_type(type *tp) { /* The function that hashes a type. */ -type *mature_type_free(type *tp) { - type *o; +ir_type *mature_type_free(ir_type *tp) { + ir_type *o; assert(type_table); @@ -100,8 +101,8 @@ type *mature_type_free(type *tp) { } /* The function that hashes a type. */ -type *mature_type_free_entities(type *tp) { - type *o; +ir_type *mature_type_free_entities(ir_type *tp) { + ir_type *o; assert(type_table); @@ -118,7 +119,7 @@ type *mature_type_free_entities(type *tp) { /* initialize this module */ void init_type_identify(type_identify_if_t *ti_if) { compare_types_func = ti_if && ti_if->cmp ? ti_if->cmp : compare_strict; - hash_types_func = ti_if && ti_if->hash ? ti_if->hash : hash_name; + hash_types_func = ti_if && ti_if->hash ? ti_if->hash : firm_hash_name; type_table = new_pset (compare_types_func, 8); }