gimple-match.h 1.6 KB

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