summaryrefslogtreecommitdiffhomepage
path: root/ir/ana
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-06-27 03:58:31 +0200
committerMatthias Braun <matze@braunis.de>2016-06-27 09:17:15 +0200
commit02a3b1647e34c9a7df3a260ed5f5dc17eba79e54 (patch)
tree22984cbb8c7e858ae57709d72cdeaa00364610ce /ir/ana
parent7af7151a202833b5be1a2468e3864b9f09bff1cf (diff)
Use pdeq_new instead of pdeq
Diffstat (limited to 'ir/ana')
-rw-r--r--ir/ana/constbits.c1
-rw-r--r--ir/ana/dca.c14
-rw-r--r--ir/ana/vrp.c16
3 files changed, 15 insertions, 16 deletions
diff --git a/ir/ana/constbits.c b/ir/ana/constbits.c
index 644af95..2a0328d 100644
--- a/ir/ana/constbits.c
+++ b/ir/ana/constbits.c
@@ -12,7 +12,6 @@
#include <assert.h>
-#include "adt/pdeq.h"
#include "debug.h"
#include "iredges_t.h"
#include "irgwalk.h"
diff --git a/ir/ana/dca.c b/ir/ana/dca.c
index 0fc89a6..8fa5ade 100644
--- a/ir/ana/dca.c
+++ b/ir/ana/dca.c
@@ -20,13 +20,13 @@
#include "debug.h"
#include "irnode_t.h"
#include "tv.h"
-#include "pdeq.h"
+#include "pdeq_new.h"
#include "irgwalk.h"
#include "dca.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg;)
-static pdeq *worklist;
+static deq_t worklist;
/**
* Set cared for bits in irn, possibly putting it on the worklist.
@@ -51,7 +51,7 @@ static void care_for(ir_node *irn, ir_tarval *care)
DBG((dbg, LEVEL_3, "queueing %+F: %T->%T\n", irn, old_care, care));
assert(old_care != tarval_b_true || care == tarval_b_true);
set_irn_link(irn, (void *)care);
- pdeq_putr(worklist, irn);
+ deq_push_pointer_right(&worklist, irn);
} else {
DBG((dbg, LEVEL_3, "no change on %+F: %T\n", irn, old_care, care));
}
@@ -417,13 +417,13 @@ void dca_analyze(ir_graph *irg)
irg_walk_graph(irg, dca_init_node, NULL, 0);
- worklist = new_pdeq();
+ deq_init(&worklist);
care_for(get_irg_end(irg), 0);
- while (!pdeq_empty(worklist)) {
- ir_node *n = (ir_node*)pdeq_getl(worklist);
+ while (!deq_empty(&worklist)) {
+ ir_node *n = deq_pop_pointer_left(ir_node, &worklist);
dca_transfer(n);
}
- del_pdeq(worklist);
+ deq_free(&worklist);
}
diff --git a/ir/ana/vrp.c b/ir/ana/vrp.c
index 504a256..769b95d 100644
--- a/ir/ana/vrp.c
+++ b/ir/ana/vrp.c
@@ -17,7 +17,7 @@
#include "iredges_t.h"
#include "tv.h"
#include "irprintf.h"
-#include "pdeq.h"
+#include "pdeq_new.h"
#include "irnodemap.h"
#include "irhooks.h"
#include "bitset.h"
@@ -26,7 +26,7 @@
DEBUG_ONLY(static firm_dbg_module_t *dbg;)
typedef struct vrp_env_t {
- pdeq *workqueue;
+ deq_t workqueue;
bitset_t *visited;
ir_vrp_info *info;
} vrp_env_t;
@@ -471,7 +471,7 @@ static void vrp_first_pass(ir_node *n, void *e)
foreach_irn_out_r(n, i, succ) {
if (bitset_is_set(env->visited, get_irn_idx(succ))) {
/* we found a loop*/
- pdeq_putr(env->workqueue, succ);
+ deq_push_pointer_right(&env->workqueue, succ);
}
}
}
@@ -515,25 +515,25 @@ void set_vrp_data(ir_graph *irg)
}
vrp_env_t *env = OALLOCZ(&irg->vrp.obst, vrp_env_t);
- env->workqueue = new_pdeq();
env->info = info;
+ deq_init(&env->workqueue);
env->visited = bitset_malloc(get_irg_last_idx(irg));
irg_walk_graph(irg, NULL, vrp_first_pass, env);
free(env->visited);
/* while there are entries in the worklist, continue*/
- while (!pdeq_empty(env->workqueue)) {
- ir_node *node = (ir_node*) pdeq_getl(env->workqueue);
+ while (!deq_empty(&env->workqueue)) {
+ ir_node *node = deq_pop_pointer_left(ir_node, &env->workqueue);
if (vrp_update_node(info, node)) {
/* if something changed, add successors to worklist*/
foreach_irn_out_r(node, i, succ) {
- pdeq_putr(env->workqueue, succ);
+ deq_push_pointer_right(&env->workqueue, succ);
}
}
}
- del_pdeq(env->workqueue);
+ deq_free(&env->workqueue);
}
void free_vrp_data(ir_graph *irg)