summaryrefslogtreecommitdiff
path: root/gcc/generic-match.h
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-24 11:00:08 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-24 11:00:08 +0000
commit55534d34935076b37ddc61300b40a225a7d6d526 (patch)
tree826b57b3cced839600a97bf9bbdd9105348dfd6e /gcc/generic-match.h
parent20bce7afafa37207f58659731d6174cef8a50a0a (diff)
downloadgcc-55534d34935076b37ddc61300b40a225a7d6d526.tar.gz
2014-10-24 Richard Biener <rguenther@suse.de>
* genmatch.c (expr::gen_transform): Use fold_buildN_loc and build_call_expr_loc. (dt_simplify::gen): Drop non_lvalue for GIMPLE, use non_lvalue_loc to build it for GENERIC. (decision_tree::gen_generic): Add location argument to generic_simplify prototype. (capture_info): New class. (capture_info::capture_info): New constructor. (capture_info::walk_match): New method. (capture_info::walk_result): New method. (capture_info::walk_c_expr): New method. (dt_simplify::gen): Handle preserving side-effects for GENERIC code generation. (decision_tree::gen_generic): Do not reject operands with TREE_SIDE_EFFECTS. * generic-match.h: New file. * generic-match-head.c: Include generic-match.h, not gimple-match.h. * match.pd: Add some constant folding patterns from fold-const.c. * fold-const.c: Include generic-match.h. (fold_unary_loc): Dispatch to generic_simplify. (fold_ternary_loc): Likewise. (fold_binary_loc): Likewise. Remove patterns now implemented by generic_simplify. * gimple-fold.c (replace_stmt_with_simplification): New function. (fold_stmt_1): Add valueize parameter, dispatch to gimple_simplify. (no_follow_ssa_edges): New function. (fold_stmt): New overload with valueization hook. Use no_follow_ssa_edges for the overload without hook. (fold_stmt_inplace): Likewise. * gimple-fold.h (no_follow_ssa_edges): Declare. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216631 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/generic-match.h')
-rw-r--r--gcc/generic-match.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/generic-match.h b/gcc/generic-match.h
new file mode 100644
index 00000000000..180886068a9
--- /dev/null
+++ b/gcc/generic-match.h
@@ -0,0 +1,33 @@
+/* Generic simplify definitions.
+
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
+ Contributed by Richard Guenther <rguenther@suse.de>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_GENERIC_MATCH_H
+#define GCC_GENERIC_MATCH_H
+
+/* Note the following functions are supposed to be only used from
+ fold_unary_loc, fold_binary_loc and fold_ternary_loc respectively.
+ They are not considered a public API. */
+
+tree generic_simplify (location_t, enum tree_code, tree, tree);
+tree generic_simplify (location_t, enum tree_code, tree, tree, tree);
+tree generic_simplify (location_t, enum tree_code, tree, tree, tree, tree);
+
+#endif /* GCC_GENERIC_MATCH_H */