X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firnodeset.h;h=330caa620ae3762bb2cbb6a834763e34e1f6b7a7;hb=af9b9a12e6cd2aaf7a0d71c262f068a516a8735f;hp=d60bf5fb2396abbd2dedb45b09fa3f2d5acd8917;hpb=73a97ce11cc91fd98375f61100075af77c277629;p=libfirm diff --git a/ir/ir/irnodeset.h b/ir/ir/irnodeset.h index d60bf5fb2..330caa620 100644 --- a/ir/ir/irnodeset.h +++ b/ir/ir/irnodeset.h @@ -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. * @@ -48,11 +48,7 @@ #define ValueType ir_node* #define DO_REHASH -#ifdef IR_NODESET_USE_ORDERED_SETS -#include "arrayset.h" -#else #include "hashset.h" -#endif #undef DO_REHASH #undef ValueType @@ -91,8 +87,8 @@ void ir_nodeset_destroy(ir_nodeset_t *nodeset); * @param expected_elements Number of elements expected in the nodeset (roughly) * @return The initialized nodeset */ -static INLINE ir_nodeset_t *ir_nodeset_new(size_t expected_elements) { - ir_nodeset_t *res = xmalloc(sizeof(*res)); +static inline ir_nodeset_t *ir_nodeset_new(size_t expected_elements) { + ir_nodeset_t *res = XMALLOC(ir_nodeset_t); ir_nodeset_init_size(res, expected_elements); return res; } @@ -100,7 +96,7 @@ static INLINE ir_nodeset_t *ir_nodeset_new(size_t expected_elements) { /** * Destroys a nodeset and frees the memory of the nodeset itself. */ -static INLINE void ir_nodeset_del(ir_nodeset_t *nodeset) { +static inline void ir_nodeset_del(ir_nodeset_t *nodeset) { ir_nodeset_destroy(nodeset); xfree(nodeset); } @@ -177,46 +173,4 @@ void ir_nodeset_remove_iterator(ir_nodeset_t *nodeset, irn = ir_nodeset_iterator_next(&iter); \ irn != NULL; irn = ir_nodeset_iterator_next(&iter)) - -#ifdef IR_NODESET_USE_ORDERED_SETS - -/** - * Insert an element quickly into from the set. - * This method may destroy internal invariats of the set (think of sorted arrays). - * All calls to other routines but - * - iteration - * - get the number of elements in the set - * will not work until ir_nodeset_fixup() was called. - * @param nodeset The nodeset. - * @param node The node to insert. - */ -void ir_nodeset_insert_quick(ir_nodeset_t *nodeset, ir_node *node); - -/** - * Remove an element quickly from the set. - * This method may destroy internal invariats of the set (think of sorted arrays). - * All calls to other routines but - * - iteration - * - get the number of elements in the set - * will not work until ir_nodeset_fixup() was called. - * @param nodeset The nodeset. - * @param node The node to delete. - */ -void ir_nodeset_remove_quick(ir_nodeset_t *nodeset, const ir_node *node); - -/** - * Fixes up internal state of the set. - * Is needed when one of the _quick functions was called. - * @param nodeset The nodeset. - */ -void ir_nodeset_fixup(ir_nodeset_t *nodeset); - -#else - -#define ir_nodeset_remove_quick ir_nodeset_remove -#define ir_nodeset_insert_quick ir_nodeset_insert -#define ir_nodeset_fixup(set) - -#endif /* IR_NODESET_USE_ORDERED_SETS */ - #endif