2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * @author Matthias Braun
24 * @brief A nodeset. This should be prefered over a simple pset, because it
25 tries to guarantee deterministic behavior.
30 #include "irnodeset.h"
35 #define HashSet ir_nodeset_t
36 #define HashSetIterator ir_nodeset_iterator_t
37 #define ValueType ir_node*
38 #define NullValue NULL
39 #define DeletedValue ((ir_node*)-1)
41 #define Hash(this,value) (value)->node_nr
43 #define Hash(this,value) HASH_PTR(value)
45 #define KeysEqual(this,key1,key2) (key1) == (key2)
46 #define SetRangeEmpty(ptr,size) memset(ptr, 0, (size) * sizeof((ptr)[0]))
48 #define hashset_init ir_nodeset_init
49 #define hashset_init_size ir_nodeset_init_size
50 #define hashset_destroy ir_nodeset_destroy
51 #define hashset_insert ir_nodeset_insert
52 #define hashset_remove ir_nodeset_remove
53 #define hashset_find _ir_nodeset_find
54 #define hashset_size ir_nodeset_size
55 #define hashset_iterator_init ir_nodeset_iterator_init
56 #define hashset_iterator_next ir_nodeset_iterator_next
57 #define hashset_remove_iterator ir_nodeset_remove_iterator
61 int ir_nodeset_contains(const ir_nodeset_t *this, const ir_node *node)
63 return _ir_nodeset_find(this, node) != NULL;