projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- get_Block_cfgpred_arr() IS supported, but should not be in the official
[libfirm]
/
ir
/
ana
/
irscc.c
diff --git
a/ir/ana/irscc.c
b/ir/ana/irscc.c
index
4ccbe9a
..
bea7231
100644
(file)
--- a/
ir/ana/irscc.c
+++ b/
ir/ana/irscc.c
@@
-27,16
+27,10
@@
* @date 7.2002
* @version $Id$
*/
* @date 7.2002
* @version $Id$
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
+#include <string.h>
+#include <stdlib.h>
#include "irloop_t.h"
#include "irloop_t.h"
@@
-93,7
+87,7
@@
typedef struct scc_info {
/**
* Allocates a new SCC info on the given obstack.
*/
/**
* Allocates a new SCC info on the given obstack.
*/
-static
INLINE
scc_info *new_scc_info(struct obstack *obst) {
+static
inline
scc_info *new_scc_info(struct obstack *obst) {
scc_info *info = obstack_alloc(obst, sizeof(*info));
memset(info, 0, sizeof(*info));
return info;
scc_info *info = obstack_alloc(obst, sizeof(*info));
memset(info, 0, sizeof(*info));
return info;
@@
-102,7
+96,7
@@
static INLINE scc_info *new_scc_info(struct obstack *obst) {
/**
* Mark node n being on the SCC stack.
*/
/**
* Mark node n being on the SCC stack.
*/
-static
INLINE
void mark_irn_in_stack(ir_node *n) {
+static
inline
void mark_irn_in_stack(ir_node *n) {
scc_info *scc = get_irn_link(n);
assert(scc);
scc->in_stack = 1;
scc_info *scc = get_irn_link(n);
assert(scc);
scc->in_stack = 1;
@@
-111,7
+105,7
@@
static INLINE void mark_irn_in_stack(ir_node *n) {
/**
* Mark node n NOT being on the SCC stack.
*/
/**
* Mark node n NOT being on the SCC stack.
*/
-static
INLINE
void mark_irn_not_in_stack(ir_node *n) {
+static
inline
void mark_irn_not_in_stack(ir_node *n) {
scc_info *scc = get_irn_link(n);
assert(scc);
scc->in_stack = 0;
scc_info *scc = get_irn_link(n);
assert(scc);
scc->in_stack = 0;
@@
-120,7
+114,7
@@
static INLINE void mark_irn_not_in_stack(ir_node *n) {
/**
* Checks if a node is on the SCC stack.
*/
/**
* Checks if a node is on the SCC stack.
*/
-static
INLINE
int irn_is_in_stack(ir_node *n) {
+static
inline
int irn_is_in_stack(ir_node *n) {
scc_info *scc = get_irn_link(n);
assert(scc);
return scc->in_stack;
scc_info *scc = get_irn_link(n);
assert(scc);
return scc->in_stack;
@@
-129,7
+123,7
@@
static INLINE int irn_is_in_stack(ir_node *n) {
/**
* Sets the uplink number for a node.
*/
/**
* Sets the uplink number for a node.
*/
-static
INLINE
void set_irn_uplink(ir_node *n, int uplink) {
+static
inline
void set_irn_uplink(ir_node *n, int uplink) {
scc_info *scc = get_irn_link(n);
assert(scc);
scc->uplink = uplink;
scc_info *scc = get_irn_link(n);
assert(scc);
scc->uplink = uplink;
@@
-147,7
+141,7
@@
static int get_irn_uplink(ir_node *n) {
/**
* Sets the depth-first-search number for a node.
*/
/**
* Sets the depth-first-search number for a node.
*/
-static
INLINE
void set_irn_dfn(ir_node *n, int dfn) {
+static
inline
void set_irn_dfn(ir_node *n, int dfn) {
scc_info *scc = get_irn_link(n);
assert(scc);
scc->dfn = dfn;
scc_info *scc = get_irn_link(n);
assert(scc);
scc->dfn = dfn;
@@
-200,7
+194,7
@@
static int tos = 0; /* top of stack */
/**
* initializes the stack
*/
/**
* initializes the stack
*/
-static
INLINE
void init_stack(void) {
+static
inline
void init_stack(void) {
if (stack) {
ARR_RESIZE(ir_node *, stack, 1000);
} else {
if (stack) {
ARR_RESIZE(ir_node *, stack, 1000);
} else {
@@
-222,7
+216,7
@@
static void finish_stack(void) {
*
* @param n The node to push
*/
*
* @param n The node to push
*/
-static
INLINE
void push(ir_node *n) {
+static
inline
void push(ir_node *n) {
if (tos == ARR_LEN(stack)) {
int nlen = ARR_LEN(stack) * 2;
ARR_RESIZE(ir_node *, stack, nlen);
if (tos == ARR_LEN(stack)) {
int nlen = ARR_LEN(stack) * 2;
ARR_RESIZE(ir_node *, stack, nlen);
@@
-236,7
+230,7
@@
static INLINE void push(ir_node *n) {
*
* @return The topmost node
*/
*
* @return The topmost node
*/
-static
INLINE
ir_node *pop(void) {
+static
inline
ir_node *pop(void) {
ir_node *n = stack[--tos];
mark_irn_not_in_stack(n);
return n;
ir_node *n = stack[--tos];
mark_irn_not_in_stack(n);
return n;
@@
-246,7
+240,7
@@
static INLINE ir_node *pop(void) {
* The nodes up to n belong to the current loop.
* Removes them from the stack and adds them to the current loop.
*/
* The nodes up to n belong to the current loop.
* Removes them from the stack and adds them to the current loop.
*/
-static
INLINE
void pop_scc_to_loop(ir_node *n) {
+static
inline
void pop_scc_to_loop(ir_node *n) {
ir_node *m;
int i = 0;
ir_node *m;
int i = 0;
@@
-295,7
+289,7
@@
static void close_loop(ir_loop *l) {
/* Removes and unmarks all nodes up to n from the stack.
The nodes must be visited once more to assign them to a scc. */
/* Removes and unmarks all nodes up to n from the stack.
The nodes must be visited once more to assign them to a scc. */
-static
INLINE
void pop_scc_unmark_visit(ir_node *n) {
+static
inline
void pop_scc_unmark_visit(ir_node *n) {
ir_node *m = NULL;
while (m != n) {
ir_node *m = NULL;
while (m != n) {
@@
-325,19
+319,19
@@
static ir_loop *new_loop(void) {
/* Initialization steps. **********************************************/
/* Initialization steps. **********************************************/
-static
INLINE
void init_node(ir_node *n, void *env) {
+static
inline
void init_node(ir_node *n, void *env) {
struct obstack *obst = env;
set_irn_link(n, new_scc_info(obst));
clear_backedges(n);
}
struct obstack *obst = env;
set_irn_link(n, new_scc_info(obst));
clear_backedges(n);
}
-static
INLINE
void init_scc_common(void) {
+static
inline
void init_scc_common(void) {
current_dfn = 1;
loop_node_cnt = 0;
init_stack();
}
current_dfn = 1;
loop_node_cnt = 0;
init_stack();
}
-static
INLINE
void init_scc(ir_graph *irg, struct obstack *obst) {
+static
inline
void init_scc(ir_graph *irg, struct obstack *obst) {
init_scc_common();
irg_walk_graph(irg, init_node, NULL, obst);
/*
init_scc_common();
irg_walk_graph(irg, init_node, NULL, obst);
/*
@@
-345,13
+339,13
@@
static INLINE void init_scc(ir_graph *irg, struct obstack *obst) {
*/
}
*/
}
-static
INLINE
void finish_scc(void)
+static
inline
void finish_scc(void)
{
finish_stack();
}
#ifdef INTERPROCEDURAL_VIEW
{
finish_stack();
}
#ifdef INTERPROCEDURAL_VIEW
-static
INLINE
void init_ip_scc(struct obstack *obst) {
+static
inline
void init_ip_scc(struct obstack *obst) {
init_scc_common();
cg_walk(init_node, NULL, obst);
init_scc_common();
cg_walk(init_node, NULL, obst);
@@
-382,7
+376,7
@@
static int is_outermost_Start(ir_node *n) {
}
/* When to walk from nodes to blocks. Only for Control flow operations? */
}
/* When to walk from nodes to blocks. Only for Control flow operations? */
-static
INLINE
int get_start_index(ir_node *n) {
+static
inline
int get_start_index(ir_node *n) {
#undef BLOCK_BEFORE_NODE
#define BLOCK_BEFORE_NODE 1
#undef BLOCK_BEFORE_NODE
#define BLOCK_BEFORE_NODE 1
@@
-425,7
+419,7
@@
static INLINE int get_start_index(ir_node *n) {
*
* @param n the node to check
*/
*
* @param n the node to check
*/
-static
INLINE
int is_possible_loop_head(ir_node *n) {
+static
inline
int is_possible_loop_head(ir_node *n) {
ir_op *op = get_irn_op(n);
return ((op == op_Block) ||
(op == op_Phi) ||
ir_op *op = get_irn_op(n);
return ((op == op_Block) ||
(op == op_Phi) ||
@@
-451,6
+445,8
@@
static int is_head(ir_node *n, ir_node *root) {
if (!is_outermost_Start(n)) {
#ifndef NDEBUG
int uplink = get_irn_uplink(root);
if (!is_outermost_Start(n)) {
#ifndef NDEBUG
int uplink = get_irn_uplink(root);
+#else
+ (void) root;
#endif
arity = get_irn_arity(n);
for (i = get_start_index(n); i < arity; i++) {
#endif
arity = get_irn_arity(n);
for (i = get_start_index(n); i < arity; i++) {
@@
-488,6
+484,8
@@
static int is_endless_head(ir_node *n, ir_node *root) {
if (!is_outermost_Start(n)) {
#ifndef NDEBUG
int uplink = get_irn_uplink(root);
if (!is_outermost_Start(n)) {
#ifndef NDEBUG
int uplink = get_irn_uplink(root);
+#else
+ (void) root;
#endif
arity = get_irn_arity(n);
for (i = get_start_index(n); i < arity; i++) {
#endif
arity = get_irn_arity(n);
for (i = get_start_index(n); i < arity; i++) {
@@
-696,7
+694,7
@@
ir_node *get_projx_link(ir_node *cb_projx) {
#endif
#endif
-static
INLINE
int is_outermost_loop(ir_loop *l) {
+static
inline
int is_outermost_loop(ir_loop *l) {
return l == get_loop_outer_loop(l);
}
return l == get_loop_outer_loop(l);
}
@@
-711,9
+709,8
@@
static INLINE int is_outermost_loop(ir_loop *l) {
* @param n node to start
*/
static void scc(ir_node *n) {
* @param n node to start
*/
static void scc(ir_node *n) {
- if (irn_visited(n))
+ if (irn_visited
_else_mark
(n))
return;
return;
- mark_irn_visited(n);
/* Initialize the node */
set_irn_dfn(n, current_dfn); /* Depth first number for this node */
/* Initialize the node */
set_irn_dfn(n, current_dfn); /* Depth first number for this node */
@@
-812,9
+809,8
@@
static void scc(ir_node *n) {
#ifdef INTERPROCEDURAL_VIEW
static void my_scc(ir_node *n) {
int i;
#ifdef INTERPROCEDURAL_VIEW
static void my_scc(ir_node *n) {
int i;
- if (irn_visited(n))
+ if (irn_visited
_else_mark
(n))
return;
return;
- mark_irn_visited(n);
/* Initialize the node */
set_irn_dfn(n, current_dfn); /* Depth first number for this node */
/* Initialize the node */
set_irn_dfn(n, current_dfn); /* Depth first number for this node */