1/* Gimple simplify definitions.
2
3   Copyright (C) 2011-2015 Free Software Foundation, Inc.
4   Contributed by Richard Guenther <rguenther@suse.de>
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify it under
9the terms of the GNU General Public License as published by the Free
10Software Foundation; either version 3, or (at your option) any later
11version.
12
13GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14WARRANTY; without even the implied warranty of MERCHANTABILITY or
15FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16for more details.
17
18You should have received a copy of the GNU General Public License
19along with GCC; see the file COPYING3.  If not see
20<http://www.gnu.org/licenses/>.  */
21
22#ifndef GCC_GIMPLE_MATCH_H
23#define GCC_GIMPLE_MATCH_H
24
25
26/* Helper to transparently allow tree codes and builtin function codes
27   exist in one storage entity.  */
28class code_helper
29{
30public:
31  code_helper () {}
32  code_helper (tree_code code) : rep ((int) code) {}
33  code_helper (built_in_function fn) : rep (-(int) fn) {}
34  operator tree_code () const { return (tree_code) rep; }
35  operator built_in_function () const { return (built_in_function) -rep; }
36  bool is_tree_code () const { return rep > 0; }
37  bool is_fn_code () const { return rep < 0; }
38  int get_rep () const { return rep; }
39private:
40  int rep;
41};
42
43bool gimple_simplify (gimple, code_helper *, tree *, gimple_seq *,
44		      tree (*)(tree));
45tree maybe_push_res_to_seq (code_helper, tree, tree *,
46			    gimple_seq *, tree res = NULL_TREE);
47void maybe_build_generic_op (enum tree_code, tree, tree *, tree, tree);
48
49
50#endif  /* GCC_GIMPLE_MATCH_H */
51