annotate gcc/gimple-match.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Gimple simplify definitions.
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 Copyright (C) 2011-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
4 Contributed by Richard Guenther <rguenther@suse.de>
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 This file is part of GCC.
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
9 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
10 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
11 version.
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
16 for more details.
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
19 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
20 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 #ifndef GCC_GIMPLE_MATCH_H
kono
parents:
diff changeset
23 #define GCC_GIMPLE_MATCH_H
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 /* Helper to transparently allow tree codes and builtin function codes
kono
parents:
diff changeset
27 exist in one storage entity. */
kono
parents:
diff changeset
28 class code_helper
kono
parents:
diff changeset
29 {
kono
parents:
diff changeset
30 public:
kono
parents:
diff changeset
31 code_helper () {}
kono
parents:
diff changeset
32 code_helper (tree_code code) : rep ((int) code) {}
kono
parents:
diff changeset
33 code_helper (combined_fn fn) : rep (-(int) fn) {}
kono
parents:
diff changeset
34 operator tree_code () const { return (tree_code) rep; }
kono
parents:
diff changeset
35 operator combined_fn () const { return (combined_fn) -rep; }
kono
parents:
diff changeset
36 bool is_tree_code () const { return rep > 0; }
kono
parents:
diff changeset
37 bool is_fn_code () const { return rep < 0; }
kono
parents:
diff changeset
38 int get_rep () const { return rep; }
kono
parents:
diff changeset
39 private:
kono
parents:
diff changeset
40 int rep;
kono
parents:
diff changeset
41 };
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 /* Return whether OPS[0] with CODE is a non-expression result and
kono
parents:
diff changeset
44 a gimple value. */
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 inline bool
kono
parents:
diff changeset
47 gimple_simplified_result_is_gimple_val (code_helper code, tree *ops)
kono
parents:
diff changeset
48 {
kono
parents:
diff changeset
49 return (code.is_tree_code ()
kono
parents:
diff changeset
50 && (TREE_CODE_LENGTH ((tree_code) code) == 0
kono
parents:
diff changeset
51 || ((tree_code) code) == ADDR_EXPR)
kono
parents:
diff changeset
52 && is_gimple_val (ops[0]));
kono
parents:
diff changeset
53 }
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 extern tree (*mprts_hook) (code_helper, tree, tree *);
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 bool gimple_simplify (gimple *, code_helper *, tree *, gimple_seq *,
kono
parents:
diff changeset
58 tree (*)(tree), tree (*)(tree));
kono
parents:
diff changeset
59 bool gimple_resimplify1 (gimple_seq *, code_helper *, tree, tree *,
kono
parents:
diff changeset
60 tree (*)(tree));
kono
parents:
diff changeset
61 bool gimple_resimplify2 (gimple_seq *, code_helper *, tree, tree *,
kono
parents:
diff changeset
62 tree (*)(tree));
kono
parents:
diff changeset
63 bool gimple_resimplify3 (gimple_seq *, code_helper *, tree, tree *,
kono
parents:
diff changeset
64 tree (*)(tree));
kono
parents:
diff changeset
65 tree maybe_push_res_to_seq (code_helper, tree, tree *,
kono
parents:
diff changeset
66 gimple_seq *, tree res = NULL_TREE);
kono
parents:
diff changeset
67 void maybe_build_generic_op (enum tree_code, tree, tree *);
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 #endif /* GCC_GIMPLE_MATCH_H */