GCC Middle and Back End API Reference
domwalk.h
Go to the documentation of this file.
1 /* Generic dominator tree walker
2  Copyright (C) 2003-2013 Free Software Foundation, Inc.
3  Contributed by Diego Novillo <dnovillo@redhat.com>
4 
5 This file is part of GCC.
6 
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
11 
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
20 
21 typedef void *void_p;
22 
23 /* This is the main data structure for the dominator walker. It provides
24  the callback hooks as well as a convenient place to hang block local
25  data and pass-global data. */
26 
28 {
29  /* This is the direction of the dominator tree we want to walk. i.e.,
30  if it is set to CDI_DOMINATORS, then we walk the dominator tree,
31  if it is set to CDI_POST_DOMINATORS, then we walk the post
32  dominator tree. */
33  ENUM_BITFIELD (cdi_direction) dom_direction : 2;
34 
35  /* Function to initialize block local data.
36 
37  Note that the dominator walker infrastructure may provide a new
38  fresh, and zero'd block local data structure, or it may re-use an
39  existing block local data structure.
40 
41  If the block local structure has items such as virtual arrays, then
42  that allows your optimizer to re-use those arrays rather than
43  creating new ones. */
45  basic_block, bool);
46 
47  /* Function to call before the recursive walk of the dominator children. */
49 
50  /* Function to call after the recursive walk of the dominator children. */
52 
53  /* Global data for a walk through the dominator tree. */
54  void *global_data;
55 
56  /* Stack of any data we need to keep on a per-block basis.
57 
58  If you have no local data, then BLOCK_DATA_STACK will be NULL. */
60 
61  /* Size of the block local data. If this is zero, then it is assumed
62  you have no local data and thus no BLOCK_DATA_STACK as well. */
64 
65  /* From here below are private data. Please do not use this
66  information/data outside domwalk.c. */
67 
68  /* Stack of available block local structures. */
70 };
71