projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
another test
[libfirm]
/
ir
/
ana
/
absgraph.c
diff --git
a/ir/ana/absgraph.c
b/ir/ana/absgraph.c
index
4f8e6c2
..
efd9c0e
100644
(file)
--- a/
ir/ana/absgraph.c
+++ b/
ir/ana/absgraph.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 1995-200
7
University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-200
8
University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
*
* This file is part of libFirm.
*
@@
-21,14
+21,15
@@
* @file absgraph.c
* @author Sebastian Hack
* @date 20.04.2007
* @file absgraph.c
* @author Sebastian Hack
* @date 20.04.2007
- * @version $Id
:
$
+ * @version $Id$
* @summary
*
* Abstract graph implementations for the CFG of a ir_graph.
* @summary
*
* Abstract graph implementations for the CFG of a ir_graph.
- *
- * Copyright (C) 2007 Universitaet Karlsruhe
- * Released under the GPL
*/
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "irgraph_t.h"
#include "iredges_t.h"
#include "absgraph.h"
#include "irgraph_t.h"
#include "iredges_t.h"
#include "absgraph.h"
@@
-40,32
+41,51
@@
static void *irg_cfg_succ_get_root(void *self)
return get_irg_start_block(irg);
}
return get_irg_start_block(irg);
}
+static void *irg_cfg_succ_get_end(void *self)
+{
+ ir_graph *irg = self;
+ return get_irg_end_block(irg);
+}
+
static void irg_cfg_succ_grow_succs(void *self, void *node, struct obstack *obst)
{
ir_node *bl = node;
const ir_edge_t *edge;
static void irg_cfg_succ_grow_succs(void *self, void *node, struct obstack *obst)
{
ir_node *bl = node;
const ir_edge_t *edge;
- foreach_block_succ(bl, edge)
+
+ (void) self;
+ foreach_block_succ(bl, edge) {
obstack_ptr_grow(obst, get_edge_src_irn(edge));
obstack_ptr_grow(obst, get_edge_src_irn(edge));
+ }
}
const absgraph_t absgraph_irg_cfg_succ = {
irg_cfg_succ_get_root,
}
const absgraph_t absgraph_irg_cfg_succ = {
irg_cfg_succ_get_root,
- irg_cfg_succ_grow_succs
+ irg_cfg_succ_grow_succs,
+ irg_cfg_succ_get_end
};
static void *irg_cfg_pred_get_root(void *self)
{
};
static void *irg_cfg_pred_get_root(void *self)
{
- return get_irg_end_block(self);
+ return get_irg_end_block((ir_graph*) self);
+}
+
+static void *irg_cfg_pred_get_end(void *self)
+{
+ return get_irg_start_block((ir_graph*) self);
}
static void irg_cfg_pred_grow_succs(void *self, void *node, struct obstack *obst)
{
int i, n;
}
static void irg_cfg_pred_grow_succs(void *self, void *node, struct obstack *obst)
{
int i, n;
- for (i = 0, n = get_irn_arity(node); i < n; ++i)
+
+ (void) self;
+ for (i = 0, n = get_irn_arity(node); i < n; ++i) {
obstack_ptr_grow(obst, get_irn_n(node, i));
obstack_ptr_grow(obst, get_irn_n(node, i));
+ }
}
const absgraph_t absgraph_irg_cfg_pred = {
irg_cfg_pred_get_root,
}
const absgraph_t absgraph_irg_cfg_pred = {
irg_cfg_pred_get_root,
- irg_cfg_pred_grow_succs
+ irg_cfg_pred_grow_succs,
+ irg_cfg_pred_get_end
};
};