projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- add a currently non-functioning mtp_property_returns_twice property
[libfirm]
/
ir
/
ana
/
dfs.c
diff --git
a/ir/ana/dfs.c
b/ir/ana/dfs.c
index
ca080d4
..
9fedfee
100644
(file)
--- a/
ir/ana/dfs.c
+++ b/
ir/ana/dfs.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.
*
@@
-26,12
+26,12
@@
*
* Simple depth first search on CFGs.
*/
*
* Simple depth first search on CFGs.
*/
-#ifdef HAVE_CONFIG_H
#include <config.h>
#include <config.h>
-#endif
#include <stdlib.h>
#include <stdlib.h>
+#define DISABLE_STATEV
+
#include <assert.h>
#include "irtools.h"
#include "irprintf.h"
#include <assert.h>
#include "irtools.h"
#include "irprintf.h"
@@
-114,11
+114,11
@@
static void dfs_perform(dfs_t *dfs, void *n, void *anc, int level)
static void classify_edges(dfs_t *dfs)
{
static void classify_edges(dfs_t *dfs)
{
+ dfs_edge_t *edge;
stat_ev_cnt_decl(anc);
stat_ev_cnt_decl(back);
stat_ev_cnt_decl(fwd);
stat_ev_cnt_decl(cross);
stat_ev_cnt_decl(anc);
stat_ev_cnt_decl(back);
stat_ev_cnt_decl(fwd);
stat_ev_cnt_decl(cross);
- dfs_edge_t *edge;
foreach_set (dfs->edges, edge) {
dfs_node_t *src = edge->s;
foreach_set (dfs->edges, edge) {
dfs_node_t *src = edge->s;
@@
-160,7
+160,7
@@
dfs_edge_kind_t dfs_get_edge_kind(const dfs_t *dfs, const void *a, const void *b
dfs_t *dfs_new(const absgraph_t *graph_impl, void *graph_self)
{
dfs_t *dfs_new(const absgraph_t *graph_impl, void *graph_self)
{
- dfs_t *res =
xmalloc(sizeof(res[0])
);
+ dfs_t *res =
XMALLOC(dfs_t
);
dfs_node_t *node;
res->graph_impl = graph_impl;
dfs_node_t *node;
res->graph_impl = graph_impl;
@@
-191,8
+191,8
@@
dfs_t *dfs_new(const absgraph_t *graph_impl, void *graph_self)
classify_edges(res);
assert(res->pre_num == res->post_num);
classify_edges(res);
assert(res->pre_num == res->post_num);
- res->pre_order
= xmalloc(res->pre_num * sizeof(res->pre_order)
);
- res->post_order =
xmalloc(res->post_num * sizeof(res->post_order)
);
+ res->pre_order
= XMALLOCN(dfs_node_t*, res->pre_num
);
+ res->post_order =
XMALLOCN(dfs_node_t*, res->post_num
);
foreach_set (res->nodes, node) {
assert(node->pre_num < res->pre_num);
assert(node->post_num < res->post_num);
foreach_set (res->nodes, node) {
assert(node->pre_num < res->pre_num);
assert(node->post_num < res->post_num);
@@
-249,7
+249,7
@@
static int node_level_cmp(const void *a, const void *b)
void dfs_dump(const dfs_t *dfs, FILE *file)
{
void dfs_dump(const dfs_t *dfs, FILE *file)
{
- dfs_node_t **nodes =
xmalloc(dfs->pre_num * sizeof(nodes[0])
);
+ dfs_node_t **nodes =
XMALLOCN(dfs_node_t*, dfs->pre_num
);
dfs_node_t *node;
dfs_edge_t *edge;
int i, n = 0;
dfs_node_t *node;
dfs_edge_t *edge;
int i, n = 0;