gcc/
[official-gcc.git] / gcc / gimple-match.h
blobf9e351754844ca3cac6c1e9b965e9bc4e5d90c80
1 /* Gimple simplify definitions.
3 Copyright (C) 2011-2015 Free Software Foundation, Inc.
4 Contributed by Richard Guenther <rguenther@suse.de>
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
11 version.
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 #ifndef GCC_GIMPLE_MATCH_H
23 #define GCC_GIMPLE_MATCH_H
26 /* Helper to transparently allow tree codes and builtin function codes
27 exist in one storage entity. */
28 class code_helper
30 public:
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; }
39 private:
40 int rep;
43 bool gimple_simplify (gimple, code_helper *, tree *, gimple_seq *,
44 tree (*)(tree), tree (*)(tree));
45 tree maybe_push_res_to_seq (code_helper, tree, tree *,
46 gimple_seq *, tree res = NULL_TREE);
47 void maybe_build_generic_op (enum tree_code, tree, tree *, tree, tree);
50 #endif /* GCC_GIMPLE_MATCH_H */