diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2023-06-10 16:35:18 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2023-06-12 10:48:42 -0400 |
commit | 110c1f8d3070919b26646b87e13b9737ff88d606 (patch) | |
tree | dba5349814c309c7ab99bc2401ac622293e8d3ac /gcc/range-op.cc | |
parent | 73cbf402d3df24317ae299f52256ddfa93cca402 (diff) | |
download | gcc-110c1f8d3070919b26646b87e13b9737ff88d606.zip gcc-110c1f8d3070919b26646b87e13b9737ff88d606.tar.gz gcc-110c1f8d3070919b26646b87e13b9737ff88d606.tar.bz2 |
Add a hybrid MAX_EXPR operator for integer and pointer.
This adds an operator to the unified table for MAX_EXPR which will
select either the pointer or integer version based on the type passed
to the method. This is for use until we have a seperate PRANGE class.
THIs also removes the pointer table which is no longer needed.
* range-op-mixed.h (operator_max): Remove final.
* range-op-ptr.cc (pointer_table::pointer_table): Remove MAX_EXPR.
(pointer_table::pointer_table): Remove.
(class hybrid_max_operator): New.
(range_op_table::initialize_pointer_ops): Add hybrid_max_operator.
* range-op.cc (pointer_tree_table): Remove.
(unified_table::unified_table): Comment out MAX_EXPR.
(get_op_handler): Remove check of pointer table.
* range-op.h (class pointer_table): Remove.
Diffstat (limited to 'gcc/range-op.cc')
-rw-r--r-- | gcc/range-op.cc | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 481f3b1..046b769 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -49,8 +49,6 @@ along with GCC; see the file COPYING3. If not see #include "tree-ssa-ccp.h" #include "range-op-mixed.h" -pointer_table pointer_tree_table; - // Instantiate a range_op_table for unified operations. class unified_table : public range_op_table { @@ -124,18 +122,14 @@ unified_table::unified_table () // set (BIT_AND_EXPR, op_bitwise_and); // set (BIT_IOR_EXPR, op_bitwise_or); // set (MIN_EXPR, op_min); - set (MAX_EXPR, op_max); + // set (MAX_EXPR, op_max); } // The tables are hidden and accessed via a simple extern function. range_operator * -get_op_handler (enum tree_code code, tree type) +get_op_handler (enum tree_code code, tree) { - // If this is pointer type and there is pointer specifc routine, use it. - if (POINTER_TYPE_P (type) && pointer_tree_table[code]) - return pointer_tree_table[code]; - return unified_tree_table[code]; } |