projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove pointless local variables.
[libfirm]
/
ir
/
ir
/
irnodemap.h
diff --git
a/ir/ir/irnodemap.h
b/ir/ir/irnodemap.h
index
b828272
..
69ec94b
100644
(file)
--- a/
ir/ir/irnodemap.h
+++ b/
ir/ir/irnodemap.h
@@
-21,21
+21,20
@@
* @file
* @author Matthias Braun
* @date 30.03.2007
* @file
* @author Matthias Braun
* @date 30.03.2007
- * @brief A nodemap. This should be prefered over a simple pset, because it
+ * @brief A nodemap. This should be prefer
r
ed over a simple pset, because it
* tries to guarantee deterministic behavior. (and is faster)
* @version $Id$
* tries to guarantee deterministic behavior. (and is faster)
* @version $Id$
- * @note Actually the bits to make the behavio
u
r deterministic are not
+ * @note Actually the bits to make the behavior deterministic are not
* implemented yet...
*/
#ifndef _FIRM_IRNODEMAP_H_
#define _FIRM_IRNODEMAP_H_
#include "irnode.h"
* implemented yet...
*/
#ifndef _FIRM_IRNODEMAP_H_
#define _FIRM_IRNODEMAP_H_
#include "irnode.h"
-#include "xmalloc.h"
typedef struct ir_nodemap_entry_t {
typedef struct ir_nodemap_entry_t {
-
const
ir_node *node;
- void
*data;
+ ir_node *node;
+ void *data;
} ir_nodemap_entry_t;
#define HashSet ir_nodemap_t
} ir_nodemap_entry_t;
#define HashSet ir_nodemap_t
@@
-81,7
+80,7
@@
void ir_nodemap_destroy(ir_nodemap_t *nodemap);
* @param node node to insert into the nodemap
* @param data data to associate with the node
*/
* @param node node to insert into the nodemap
* @param data data to associate with the node
*/
-void ir_nodemap_insert(ir_nodemap_t *nodemap,
const
ir_node *node, void *data);
+void ir_nodemap_insert(ir_nodemap_t *nodemap, ir_node *node, void *data);
/**
* Removes a node from a nodemap. Does nothing if the nodemap doesn't contain
/**
* Removes a node from a nodemap. Does nothing if the nodemap doesn't contain
@@
-97,7
+96,7
@@
void ir_nodemap_remove(ir_nodemap_t *nodemap, const ir_node *node);
*
* @param nodemap Pointer to the nodemap
* @param node The pointer to find
*
* @param nodemap Pointer to the nodemap
* @param node The pointer to find
- * @returns
1 if nodemap contains the node, 0 else
+ * @returns
the associated data of the node or NULL
*/
void *ir_nodemap_get(const ir_nodemap_t *nodemap, const ir_node *node);
*/
void *ir_nodemap_get(const ir_nodemap_t *nodemap, const ir_node *node);
@@
-109,7
+108,6
@@
void *ir_nodemap_get(const ir_nodemap_t *nodemap, const ir_node *node);
*/
size_t ir_nodemap_size(const ir_nodemap_t *nodemap);
*/
size_t ir_nodemap_size(const ir_nodemap_t *nodemap);
-#if 0
/**
* Initializes a nodemap iterator. Sets the iterator before the first element in
* the nodemap.
/**
* Initializes a nodemap iterator. Sets the iterator before the first element in
* the nodemap.
@@
-129,7
+127,7
@@
void ir_nodemap_iterator_init(ir_nodemap_iterator_t *iterator,
* @param iterator Pointer to the nodemap iterator.
* @returns Next element in the nodemap or NULL
*/
* @param iterator Pointer to the nodemap iterator.
* @returns Next element in the nodemap or NULL
*/
-ir_node
*
ir_nodemap_iterator_next(ir_nodemap_iterator_t *iterator);
+ir_node
map_entry_t
ir_nodemap_iterator_next(ir_nodemap_iterator_t *iterator);
/**
* Removes the element the iterator currently points to
/**
* Removes the element the iterator currently points to
@@
-139,6
+137,10
@@
ir_node *ir_nodemap_iterator_next(ir_nodemap_iterator_t *iterator);
*/
void ir_nodemap_remove_iterator(ir_nodemap_t *nodemap,
const ir_nodemap_iterator_t *iterator);
*/
void ir_nodemap_remove_iterator(ir_nodemap_t *nodemap,
const ir_nodemap_iterator_t *iterator);
-#endif
+
+#define foreach_ir_nodemap(nodemap, entry, iter) \
+ for (ir_nodemap_iterator_init(&iter, nodemap), \
+ entry = ir_nodemap_iterator_next(&iter); \
+ entry.node != NULL; entry = ir_nodemap_iterator_next(&iter))
#endif
#endif