* @date 7.2002
* @version $Id$
*/
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
#include "irnode_t.h"
#include "irgraph_t.h"
* Does not assert whether the backarray is correct -- use
* very careful!
*/
-static unsigned *mere_get_backarray(ir_node *n) {
+static unsigned *mere_get_backarray(ir_node *n)
+{
switch (get_irn_opcode(n)) {
case iro_Block:
if (!get_Block_matured(n)) return NULL;
* Returns backarray if the node can have backedges, else returns
* NULL.
*/
-static unsigned *get_backarray(ir_node *n) {
+static unsigned *get_backarray(ir_node *n)
+{
unsigned *ba = mere_get_backarray(n);
#ifndef NDEBUG
return ba;
}
+#ifndef NDEBUG
/**
* Returns non-zero if node has no backarray, or
* if size of backarray == size of in array.
*/
-static int legal_backarray(ir_node *n) {
+static int legal_backarray(ir_node *n)
+{
unsigned *ba = mere_get_backarray(n);
if (ba && (rbitset_size(ba) != (unsigned) get_irn_arity(n)))
return 0;
return 1;
}
+#endif
-void fix_backedges(struct obstack *obst, ir_node *n) {
+void fix_backedges(struct obstack *obst, ir_node *n)
+{
unsigned *arr = mere_get_backarray(n);
ir_opcode opc;
int arity;
}
#ifdef INTERPROCEDURAL_VIEW
-int is_inter_backedge(ir_node *n, int pos) {
+int is_inter_backedge(ir_node *n, int pos)
+{
int res;
int rem = get_interprocedural_view();
set_interprocedural_view(0);
return res;
}
-int is_intra_backedge(ir_node *n, int pos) {
+int is_intra_backedge(ir_node *n, int pos)
+{
int res;
int rem = get_interprocedural_view();
set_interprocedural_view(1);
/* Returns non-zero if the predecessor pos is a backedge. */
-int is_backedge(ir_node *n, int pos) {
+int is_backedge(ir_node *n, int pos)
+{
unsigned *ba = get_backarray(n);
if (ba)
return rbitset_is_set(ba, pos);
}
/* Remarks that edge pos is a backedge. */
-void set_backedge(ir_node *n, int pos) {
+void set_backedge(ir_node *n, int pos)
+{
unsigned *ba = get_backarray(n);
assert(ba && "can only set backedges at Phi, Filter, Block nodes.");
rbitset_set(ba, pos);
}
/* Remarks that edge pos is a backedge. */
-void set_not_backedge(ir_node *n, int pos) {
+void set_not_backedge(ir_node *n, int pos)
+{
unsigned *ba = get_backarray(n);
assert(ba && "can only set backedges at Phi, Filter, Block nodes.");
rbitset_clear(ba, pos);
}
/* Returns non-zero if n has backedges. */
-int has_backedges(ir_node *n) {
+int has_backedges(ir_node *n)
+{
unsigned *ba = get_backarray(n);
if (ba) {
int arity = get_irn_arity(n);
}
/** Sets all backedge information to zero. */
-void clear_backedges(ir_node *n) {
+void clear_backedges(ir_node *n)
+{
int i, arity;
unsigned *ba;
#ifdef INTERPROCEDURAL_VIEW
}
/* Allocate a new backedge array on the obstack for given size. */
-unsigned *new_backedge_arr(struct obstack *obst, unsigned size) {
+unsigned *new_backedge_arr(struct obstack *obst, unsigned size)
+{
return rbitset_w_size_obstack_alloc(obst, size);
}
/* TODO: add an ir_op operation */
-void new_backedge_info(ir_node *n) {
+void new_backedge_info(ir_node *n)
+{
switch (get_irn_opcode(n)) {
case iro_Block:
n->attr.block.cg_backedge = NULL;