X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firnodeset.c;h=18d89699c2e1623683a1de3bbb84d06d47f481e6;hb=bae07c0180990bd3295d66435b7d72310ec9485a;hp=dc7e4f109cd2324d5502d10027fb12548fd3f9ab;hpb=1eb61c30357b8d277b4fc25fa18ef258c090ecc5;p=libfirm diff --git a/ir/ir/irnodeset.c b/ir/ir/irnodeset.c index dc7e4f109..18d89699c 100644 --- a/ir/ir/irnodeset.c +++ b/ir/ir/irnodeset.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -21,13 +21,14 @@ * @file * @author Matthias Braun * @date 30.03.2007 - * @brief A nodeset. This should be prefered over a simple pset, because it + * @brief A nodeset. This should be preferred over a simple pset, because it tries to guarantee deterministic behavior. * @version $Id$ */ #include "config.h" #include "irnodeset.h" +#include "irnode_t.h" #include "hashptr.h" #define DO_REHASH @@ -37,20 +38,17 @@ #define ValueType ir_node* #define NullValue NULL #define DeletedValue ((ir_node*)-1) -#ifdef DEBUG_libfirm -#define Hash(this,value) (value)->node_nr -#else -#define Hash(this,value) HASH_PTR(value) -#endif +#define Hash(this,key) ((unsigned)((key)->node_nr)) #define KeysEqual(this,key1,key2) (key1) == (key2) #define SetRangeEmpty(ptr,size) memset(ptr, 0, (size) * sizeof((ptr)[0])) -#define hashset_init ir_nodeset_init +void ir_nodeset_init_(ir_nodeset_t *self); +#define hashset_init ir_nodeset_init_ #define hashset_init_size ir_nodeset_init_size #define hashset_destroy ir_nodeset_destroy #define hashset_insert ir_nodeset_insert #define hashset_remove ir_nodeset_remove -#define hashset_find _ir_nodeset_find +#define hashset_find ir_nodeset_contains #define hashset_size ir_nodeset_size #define hashset_iterator_init ir_nodeset_iterator_init #define hashset_iterator_next ir_nodeset_iterator_next @@ -58,7 +56,7 @@ #include "hashset.c" -int ir_nodeset_contains(const ir_nodeset_t *this, const ir_node *node) +void ir_nodeset_init(ir_nodeset_t *nodeset) { - return _ir_nodeset_find(this, node) != NULL; + ir_nodeset_init_size(nodeset, 16); }