From 8e0f292f92b5e6d7aa3b24c51b48db882d0d800b Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Sat, 10 Jun 2023 16:28:40 -0400 Subject: Add a hybrid BIT_AND_EXPR operator for integer and pointer. This adds an operator to the unified table for BIT_AND_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. * range-op-mixed.h (operator_bitwise_and): Remove final. * range-op-ptr.cc (pointer_table::pointer_table): Remove BIT_AND_EXPR. (class hybrid_and_operator): New. (range_op_table::initialize_pointer_ops): Add hybrid_and_operator. * range-op.cc (unified_table::unified_table): Comment out BIT_AND_EXPR. --- gcc/range-op.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gcc/range-op.cc') diff --git a/gcc/range-op.cc b/gcc/range-op.cc index e0cd1b1..dcb9221 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -116,9 +116,12 @@ unified_table::unified_table () set (BIT_XOR_EXPR, op_bitwise_xor); // These are in both integer and pointer tables, but pointer has a different - // implementation. These also remain in the pointer table until a pointer - // speifc version is provided. - set (BIT_AND_EXPR, op_bitwise_and); + // implementation. + // If commented out, there is a hybrid version in range-op-ptr.cc which + // is used until there is a pointer range class. Then we can simply + // uncomment the operator here and use the unified version. + + //set (BIT_AND_EXPR, op_bitwise_and); set (BIT_IOR_EXPR, op_bitwise_or); set (MIN_EXPR, op_min); set (MAX_EXPR, op_max); -- cgit v1.1