/*
* Project: libFIRM
- * File name: ir/tr/type.c
+ * File name: ir/tr/type_identify.c
* Purpose: Representation of types.
* Author: Goetz Lindenmaier
* Modified by:
*/
/**
- * 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 <config.h>
+# include "config.h"
#endif
#include "type_identify_t.h"
#include "irprog_t.h"
#include "mangle.h"
#include "pset.h"
+#include "irtools.h"
/* The hash set for types. */
static pset *type_table = NULL;
}
/* 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 (type *tp) {
+ unsigned h = (unsigned)PTR_TO_INT(tp->type_op);
+ h = 9*h + (unsigned)PTR_TO_INT(tp->name);
return h;
}
}
/* initialize this module */
-void init_type_identify(compare_types_func_t *cmp, hash_types_func_t *hash) {
- compare_types_func = cmp ? cmp : compare_strict;
- hash_types_func = hash ? hash : hash_name;
+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 : firm_hash_name;
type_table = new_pset (compare_types_func, 8);
}