projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New implementation of tarval module
[libfirm]
/
ir
/
st
/
st.c
diff --git
a/ir/st/st.c
b/ir/st/st.c
index
d9df53f
..
38f7ece
100644
(file)
--- a/
ir/st/st.c
+++ b/
ir/st/st.c
@@
-1,14
+1,14
@@
/* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */
/*
/* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */
/*
-*
* Time-stamp: <Friday, 05.07.2002, 11:06:38
goetz@i44pc2.info.uni-karlsruhe.de>
+*
Time-stamp: <Thursday, 31.10.2002, 16:03:00
goetz@i44pc2.info.uni-karlsruhe.de>
*/
*/
-/**
*
+/**
NAME
st.h
PURPOSE
provide some auxilliary structures for firm graphs.
NAME
st.h
PURPOSE
provide some auxilliary structures for firm graphs.
-
NOTE
S
+ S
not quite complete
HISTORY
liekweg - Feb 26, 2002: Created.
not quite complete
HISTORY
liekweg - Feb 26, 2002: Created.
@@
-16,6
+16,10
@@
$Id$
***/
$Id$
***/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
# include "st.h"
# include "irgwalk.h"
# include "st.h"
# include "irgwalk.h"
@@
-23,7
+27,7
@@
# include <stdio.h>
# ifdef DEBUG_libfirm
# endif /* def DEBUG_libfirm */
# include <stdio.h>
# ifdef DEBUG_libfirm
# endif /* def DEBUG_libfirm */
-# include <
malloc
.h>
+# include <
stdlib
.h>
# include "misc.h"
/* init globals: */
# include "misc.h"
/* init globals: */
@@
-33,8
+37,8
@@
static dtree_t *last = 0;
*/
/* --------------------------------------------------------------------
*/
/* --------------------------------------------------------------------
-*
*
Helper Functions
-*
*
-------------------------------------------------------------------- */
+* Helper Functions
+* -------------------------------------------------------------------- */
/*
Helper function for get_n_blocks
*/
/*
Helper function for get_n_blocks
*/
@@
-48,7
+52,7
@@
static void count_block (ir_node *block, void *env)
# endif /* def DEBUG_libfirm */
fprintf (stdout, "%s: Block(%p) has # (%i)\n",
# endif /* def DEBUG_libfirm */
fprintf (stdout, "%s: Block(%p) has # (%i)\n",
- __FILE__ ":
" __PRETTY_FUNCTION__
, block, *n);
+ __FILE__ ":
count_block"
, block, *n);
(*n) ++;
}
(*n) ++;
}
@@
-70,7
+74,7
@@
static int get_n_blocks (ir_graph *graph)
irg_block_walk (end_block, count_block, NULL, &n);
fprintf (stdout, "%s: Graph(%p) has (%i) blocks\n",
irg_block_walk (end_block, count_block, NULL, &n);
fprintf (stdout, "%s: Graph(%p) has (%i) blocks\n",
- __FILE__ ":
" __PRETTY_FUNCTION__
, graph, n);
+ __FILE__ ":
get_n_blocks"
, graph, n);
return (n);
}
return (n);
}
@@
-127,8
+131,8
@@
static void free_dt (dt_t *dt)
*/
/* --------------------------------------------------------------------
*/
/* --------------------------------------------------------------------
-*
*
Private Functions
-*
*
-------------------------------------------------------------------- */
+* Private Functions
+* -------------------------------------------------------------------- */
/*
Given a graph, find its dominator tree in the global list:
/*
Given a graph, find its dominator tree in the global list:
@@
-326,7
+330,7
@@
static void update_dominators (ir_node *block, void *env)
if (new_mask != old_mask)
{
if (new_mask != old_mask)
{
- w->changed =
TRUE
;
+ w->changed =
true
;
_set_mask (dt, block_index, new_mask);
# ifdef VERBOSE_libfirm
_set_mask (dt, block_index, new_mask);
# ifdef VERBOSE_libfirm
@@
-398,8
+402,8
@@
static ir_node *_get_idom (dt_t *dt, ir_node *block)
}
/* --------------------------------------------------------------------
}
/* --------------------------------------------------------------------
-*
*
Public Functions
-*
*
-------------------------------------------------------------------- */
+* Public Functions
+* -------------------------------------------------------------------- */
/*
Say wether a dominates b
/*
Say wether a dominates b
@@
-505,7
+509,7
@@
void build_dominator_tree (ir_graph *graph)
w->dt = dt;
w->start_block = start_block;
w->dt = dt;
w->start_block = start_block;
- w->changed =
TRUE
; /* at least one walk */
+ w->changed =
true
; /* at least one walk */
/* do the walk: */
{
/* do the walk: */
{
@@
-513,7
+517,7
@@
void build_dominator_tree (ir_graph *graph)
while (w->changed)
{
while (w->changed)
{
- w->changed =
FALSE
;
+ w->changed =
false
;
irg_block_walk (end_block, update_dominators, update_dominators, (void*) w);
walks ++;
}
irg_block_walk (end_block, update_dominators, update_dominators, (void*) w);
walks ++;
}