comparison gcc/domwalk.h @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* Generic dominator tree walker 1 /* Generic dominator tree walker
2 Copyright (C) 2003-2017 Free Software Foundation, Inc. 2 Copyright (C) 2003-2018 Free Software Foundation, Inc.
3 Contributed by Diego Novillo <dnovillo@redhat.com> 3 Contributed by Diego Novillo <dnovillo@redhat.com>
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify 7 GCC is free software; you can redistribute it and/or modify
30 class dom_walker 30 class dom_walker
31 { 31 {
32 public: 32 public:
33 static const edge STOP; 33 static const edge STOP;
34 34
35 /* Use SKIP_UNREACHBLE_BLOCKS = true when your client can discover 35 /* An enum for determining whether the dom walk should be constrained to
36 that some edges are not executable. 36 blocks reachable by executable edges. */
37 37
38 If a client can discover that a COND, SWITCH or GOTO has a static 38 enum reachability
39 target in the before_dom_children callback, the taken edge should 39 {
40 be returned. The generic walker will clear EDGE_EXECUTABLE on all 40 /* Walk all blocks within the CFG. */
41 edges it can determine are not executable. 41 ALL_BLOCKS,
42 42
43 You can provide a mapping of basic-block index to RPO if you 43 /* Use REACHABLE_BLOCKS when your subclass can discover that some edges
44 have that readily available or you do multiple walks. */ 44 are not executable.
45 dom_walker (cdi_direction direction, bool skip_unreachable_blocks = false, 45
46 int *bb_index_to_rpo = NULL); 46 If a subclass can discover that a COND, SWITCH or GOTO has a static
47 target in the before_dom_children callback, the taken edge should
48 be returned. The generic walker will clear EDGE_EXECUTABLE on all
49 edges it can determine are not executable.
50
51 With REACHABLE_BLOCKS, EDGE_EXECUTABLE will be set on every edge in
52 the dom_walker ctor; the flag will then be cleared on edges that are
53 determined to be not executable. */
54 REACHABLE_BLOCKS,
55
56 /* Identical to REACHABLE_BLOCKS, but the initial state of EDGE_EXECUTABLE
57 will instead be preserved in the ctor, allowing for information about
58 non-executable edges to be merged in from an earlier analysis (and
59 potentially for additional edges to be marked as non-executable). */
60 REACHABLE_BLOCKS_PRESERVING_FLAGS
61 };
62
63 dom_walker (cdi_direction direction, enum reachability = ALL_BLOCKS);
64
65 /* You can provide a mapping of basic-block index to RPO if you
66 have that readily available or you do multiple walks. If you
67 specify NULL as BB_INDEX_TO_RPO dominator children will not be
68 walked in RPO order. */
69 dom_walker (cdi_direction direction, enum reachability, int *bb_index_to_rpo);
47 70
48 ~dom_walker (); 71 ~dom_walker ();
49 72
50 /* Walk the dominator tree. */ 73 /* Walk the dominator tree. */
51 void walk (basic_block); 74 void walk (basic_block);
85 callback. */ 108 callback. */
86 void propagate_unreachable_to_edges (basic_block, FILE *, dump_flags_t); 109 void propagate_unreachable_to_edges (basic_block, FILE *, dump_flags_t);
87 110
88 }; 111 };
89 112
113 extern void set_all_edges_as_executable (function *fn);
114
90 #endif 115 #endif