GCC Middle and Back End API Reference
Go to the documentation of this file.
1/* Header file for gimple statement walk support.
2 Copyright (C) 2013-2024 Free Software Foundation, Inc.
4This file is part of GCC.
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
23/* Convenience routines to walk all statements of a gimple function.
24 Note that this is useful exclusively before the code is converted
25 into SSA form. Once the program is in SSA form, the standard
26 operand interface should be used to analyze/modify statements. */
29 /* Points to the current statement being walked. */
33 /* Additional data that the callback functions may want to carry
34 through the recursion. */
35 void *info;
37 /* Pointer map used to mark visited tree nodes when calling
38 walk_tree on each operand. If set to NULL, duplicate tree nodes
39 will be visited more than once. */
42 /* Operand returned by the callbacks. This is set when calling
43 walk_gimple_seq. If the walk_stmt_fn or walk_tree_fn callback
44 returns non-NULL, this field will contain the tree returned by
45 the last callback. */
48 /* Indicates whether the operand being examined may be replaced
49 with something that matches is_gimple_val (if true) or something
50 slightly more complicated (if false). "Something" technically
51 means the common subset of is_gimple_lvalue and is_gimple_rhs,
52 but we never try to form anything more complicated than that, so
53 we don't bother checking.
55 Also note that CALLBACK should update this flag while walking the
56 sub-expressions of a statement. For instance, when walking the
57 statement 'foo (&var)', the flag VAL_ONLY will initially be set
58 to true, however, when walking &var, the operand of that
59 ADDR_EXPR does not need to be a GIMPLE value. */
62 /* True if we are currently walking the LHS of an assignment. */
65 /* Optional. Set to true by the callback functions if they made any
66 changes. */
69 /* True if we're interested in location information. */
72 /* True if we've removed the statement that was processed. */
76/* Callback for walk_gimple_stmt. Called for every statement found
77 during traversal. The first argument points to the statement to
78 walk. The second argument is a flag that the callback sets to
79 'true' if it the callback handled all the operands and
80 sub-statements of the statement (the default value of this flag is
81 'false'). The third argument is an anonymous pointer to data
82 to be used by the callback. */
84 struct walk_stmt_info *);
87 struct walk_stmt_info *);
89 struct walk_stmt_info *);
94extern bool walk_stmt_load_store_addr_ops (gimple *, void *,
98extern bool walk_stmt_load_store_ops (gimple *, void *,
101#endif /* GCC_GIMPLE_WALK_H */
Definition hash-set.h:37
union tree_node * tree
Definition coretypes.h:97
tree walk_gimple_op(gimple *, walk_tree_fn, struct walk_stmt_info *)
Definition gimple-walk.cc:187
gimple * walk_gimple_seq_mod(gimple_seq *, walk_stmt_fn, walk_tree_fn, struct walk_stmt_info *)
Definition gimple-walk.cc:44
bool walk_stmt_load_store_ops(gimple *, void *, walk_stmt_load_store_addr_fn, walk_stmt_load_store_addr_fn)
Definition gimple-walk.cc:986
tree walk_gimple_stmt(gimple_stmt_iterator *, walk_stmt_fn, walk_tree_fn, struct walk_stmt_info *)
Definition gimple-walk.cc:595
tree(* walk_stmt_fn)(gimple_stmt_iterator *, bool *, struct walk_stmt_info *)
Definition gimple-walk.h:83
gimple * walk_gimple_seq(gimple_seq, walk_stmt_fn, walk_tree_fn, struct walk_stmt_info *)
Definition gimple-walk.cc:87
bool walk_stmt_load_store_addr_ops(gimple *, void *, walk_stmt_load_store_addr_fn, walk_stmt_load_store_addr_fn, walk_stmt_load_store_addr_fn)
Definition gimple-walk.cc:776
bool(* walk_stmt_load_store_addr_fn)(gimple *, tree, tree, void *)
Definition gimple-walk.h:93
Definition gimple-iterator.h:26
Definition gimple.h:225
Definition gimple-walk.h:28
Definition gimple-walk.h:67
Definition gimple-walk.h:60
BOOL_BITFIELD removed_stmt
Definition gimple-walk.h:73
gimple * stmt
Definition gimple-walk.h:31
hash_set< tree > * pset
Definition gimple-walk.h:40
gimple_stmt_iterator gsi
Definition gimple-walk.h:30
void * info
Definition gimple-walk.h:35
tree callback_result
Definition gimple-walk.h:46
BOOL_BITFIELD want_locations
Definition gimple-walk.h:70
Definition gimple-walk.h:63
Definition system.h:903
#define bool
Definition system.h:893
tree(* walk_tree_fn)(tree *, int *, void *)
Definition tree-core.h:1032