1 /* src/vm/jit/optimizing/graph.h - control flow graph header
3 Copyright (C) 2005, 2006, 2008
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
31 #include "vm/jit/optimizing/lsra.h"
35 /* # define GRAPH_DEBUG_CHECK */
36 # define GRAPH_DEBUG_VERBOSE
39 #ifdef GRAPH_DEBUG_CHECK
40 # define _GRAPH_CHECK_BOUNDS(i,l,h) assert( ((i) >= (l)) && ((i) < (h)));
41 # define _GRAPH_ASSERT(a) assert((a));
43 # define _GRAPH_CHECK_BOUNDS(i,l,h)
44 # define _GRAPH_ASSERT(a)
49 int header; /* BB Index of subroutine start (SBR_HEADER) */
50 struct graph_element *ret; /* List of possible return BB indizes */
55 struct graph_element {
57 struct graph_element *next;
61 /* #ifdef GRAPH_DEBUG_CHECK */
65 struct graph_element **successor;
67 struct graph_element **predecessor;
70 typedef struct graphdata graphdata;
71 typedef struct graph_element graph_element;
72 typedef graph_element *graphiterator;
74 /* function prototypes */
80 void transform_BB(jitdata *, graphdata *gd);
81 graphdata *graph_init(int basicblockcount);
82 /* Generate the CFG */
83 void graph_make_cfg(jitdata *,graphdata *);
84 void graph_DFS(lsradata *ls, graphdata *gd);
85 int graph_get_first_successor(graphdata *gd, int b_index, graphiterator *i);
86 int graph_get_first_predecessor(graphdata *gd, int b_index, graphiterator *i);
87 int graph_get_next(graphiterator *i);
88 int graph_get_num_predecessor(graphdata *gd, int b_index);
89 int graph_get_num_successor(graphdata *gd, int b_index);
90 bool graph_has_multiple_successors( graphdata *gd, int b_index);
91 bool graph_has_multiple_predecessors( graphdata *gd, int b_index);
97 #endif /* _LSRA_GRAPH_H */
101 * These are local overrides for various environment variables in Emacs.
102 * Please do not remove this and leave it at the end of the file, where
103 * Emacs will automagically detect them.
104 * ---------------------------------------------------------------------
107 * indent-tabs-mode: t