aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range-fold.h
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2023-05-24 09:17:32 -0400
committerAndrew MacLeod <amacleod@redhat.com>2023-05-24 16:40:11 -0400
commit04859bda7730f9f0cc3dc02b1df865bd7d20d388 (patch)
tree22c2814fc393b4da87971b1a827be1736e1f070b /gcc/gimple-range-fold.h
parent71baa009496c9ba6e1f71aebb4e96b03c32b3957 (diff)
downloadgcc-04859bda7730f9f0cc3dc02b1df865bd7d20d388.zip
gcc-04859bda7730f9f0cc3dc02b1df865bd7d20d388.tar.gz
gcc-04859bda7730f9f0cc3dc02b1df865bd7d20d388.tar.bz2
Provide relation queries for a stmt.
Allow fur_list and fold_stmt to be provided a range_query rather than always defaultsing to NULL (which becomes a global query). Also provide a fold_relations () routine which can provide a range_trio for an arbitrary statement using any range_query * gimple-range-fold.cc (fur_list::fur_list): Add range_query param to contructors. (fold_range): Add range_query parameter. (fur_relation::fur_relation): New. (fur_relation::trio): New. (fur_relation::register_relation): New. (fold_relations): New. * gimple-range-fold.h (fold_range): Adjust prototypes. (fold_relations): New.
Diffstat (limited to 'gcc/gimple-range-fold.h')
-rw-r--r--gcc/gimple-range-fold.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/gimple-range-fold.h b/gcc/gimple-range-fold.h
index 68c6d77..939b7a7 100644
--- a/gcc/gimple-range-fold.h
+++ b/gcc/gimple-range-fold.h
@@ -37,9 +37,14 @@ bool fold_range (vrange &v, gimple *s, edge on_edge, range_query *q = NULL);
// These routines the operands to be specified when manually folding.
// Any excess queries will be drawn from the current range_query.
-bool fold_range (vrange &r, gimple *s, vrange &r1);
-bool fold_range (vrange &r, gimple *s, vrange &r1, vrange &r2);
-bool fold_range (vrange &r, gimple *s, unsigned num_elements, vrange **vector);
+bool fold_range (vrange &r, gimple *s, vrange &r1, range_query *q = NULL);
+bool fold_range (vrange &r, gimple *s, vrange &r1, vrange &r2,
+ range_query *q = NULL);
+bool fold_range (vrange &r, gimple *s, unsigned num_elements, vrange **vector,
+ range_query *q = NULL);
+
+// This routine will return a relation trio for stmt S.
+relation_trio fold_relations (gimple *s, range_query *q = NULL);
// Return the type of range which statement S calculates. If the type is
// unsupported or no type can be determined, return NULL_TREE.