projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed broken builtins and added some comments
[libfirm]
/
ir
/
lower
/
lower_mux.c
diff --git
a/ir/lower/lower_mux.c
b/ir/lower/lower_mux.c
index
b965442
..
e1c80c0
100644
(file)
--- a/
ir/lower/lower_mux.c
+++ b/
ir/lower/lower_mux.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 1995-20
08
University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-20
11
University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
*
* This file is part of libFirm.
*
@@
-34,7
+34,6
@@
#include "irgwalk.h"
#include "irgmod.h"
#include "ircons.h"
#include "irgwalk.h"
#include "irgmod.h"
#include "ircons.h"
-#include "irvrfy.h"
#include "irpass_t.h"
typedef struct walk_env {
#include "irpass_t.h"
typedef struct walk_env {
@@
-44,7
+43,7
@@
typedef struct walk_env {
static void find_mux_nodes(ir_node *mux, void *ctx)
{
static void find_mux_nodes(ir_node *mux, void *ctx)
{
- walk_env_t *env = ctx;
+ walk_env_t *env =
(walk_env_t*)
ctx;
/* Skip non-mux nodes. */
if (!is_Mux(mux))
/* Skip non-mux nodes. */
if (!is_Mux(mux))
@@
-85,8
+84,8
@@
static void lower_mux_node(ir_node* mux)
* block in-between, so that the phi can be used to select the result
* value from the old mux node in the lower block. */
cond = new_r_Cond(upper_block, get_Mux_sel(mux));
* block in-between, so that the phi can be used to select the result
* value from the old mux node in the lower block. */
cond = new_r_Cond(upper_block, get_Mux_sel(mux));
- trueProj = new_r_Proj(
upper_block,
cond, mode_X, pn_Cond_true);
- falseProj = new_r_Proj(
upper_block,
cond, mode_X, pn_Cond_false);
+ trueProj = new_r_Proj(cond, mode_X, pn_Cond_true);
+ falseProj = new_r_Proj(cond, mode_X, pn_Cond_false);
falseBlock = new_r_Block(irg, 1, &falseProj);
mux_jmps[0] = trueProj;
mux_jmps[1] = new_r_Jmp(falseBlock);
falseBlock = new_r_Block(irg, 1, &falseProj);
mux_jmps[0] = trueProj;
mux_jmps[1] = new_r_Jmp(falseBlock);
@@
-115,7
+114,7
@@
static void lower_mux_node(ir_node* mux)
void lower_mux(ir_graph *irg, lower_mux_callback *cb_func)
{
void lower_mux(ir_graph *irg, lower_mux_callback *cb_func)
{
-
int
i, n_muxes;
+
size_t
i, n_muxes;
walk_env_t env;
/* Scan the graph for mux nodes to lower. */
walk_env_t env;
/* Scan the graph for mux nodes to lower. */
@@
-146,17
+145,17
@@
void lower_mux(ir_graph *irg, lower_mux_callback *cb_func)
DEL_ARR_F(env.muxes);
}
DEL_ARR_F(env.muxes);
}
-struct pass_t {
+
typedef
struct pass_t {
ir_graph_pass_t pass;
lower_mux_callback *cb_func;
ir_graph_pass_t pass;
lower_mux_callback *cb_func;
-};
+}
pass_t
;
/**
* Wrapper to run ir_lower_mux() as an ir_graph pass
*/
static int pass_wrapper(ir_graph *irg, void *context)
{
/**
* Wrapper to run ir_lower_mux() as an ir_graph pass
*/
static int pass_wrapper(ir_graph *irg, void *context)
{
-
struct pass_t *pass =
context;
+
pass_t *pass = (pass_t*)
context;
lower_mux(irg, pass->cb_func);
return 0;
lower_mux(irg, pass->cb_func);
return 0;
@@
-164,7
+163,7
@@
static int pass_wrapper(ir_graph *irg, void *context)
ir_graph_pass_t *lower_mux_pass(const char *name, lower_mux_callback *cb_func)
{
ir_graph_pass_t *lower_mux_pass(const char *name, lower_mux_callback *cb_func)
{
-
struct pass_t *pass = XMALLOCZ(struct
pass_t);
+
pass_t *pass = XMALLOCZ(
pass_t);
pass->cb_func = cb_func;
return def_graph_pass_constructor(
pass->cb_func = cb_func;
return def_graph_pass_constructor(