]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove ada_equal_binop
authorTom Tromey <tromey@adacore.com>
Mon, 8 Sep 2025 16:23:15 +0000 (10:23 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 9 Sep 2025 15:27:28 +0000 (09:27 -0600)
ada_equal_binop can be merged with its sole caller.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/ada-exp.h
gdb/ada-lang.c

index 87e2aa1e1d4a5b2822991203572e657b75cfbe1a..d797cdad75071f64499149110e7bbd800622d248 100644 (file)
@@ -38,10 +38,6 @@ extern struct value *ada_mult_binop (struct type *expect_type,
                                     struct expression *exp,
                                     enum noside noside, enum exp_opcode op,
                                     struct value *arg1, struct value *arg2);
-extern struct value *ada_equal_binop (struct type *expect_type,
-                                     struct expression *exp,
-                                     enum noside noside, enum exp_opcode op,
-                                     struct value *arg1, struct value *arg2);
 extern struct value *ada_ternop_slice (struct expression *exp,
                                       enum noside noside,
                                       struct value *array,
@@ -262,14 +258,7 @@ public:
 
   value *evaluate (struct type *expect_type,
                   struct expression *exp,
-                  enum noside noside) override
-  {
-    value *arg1 = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
-    value *arg2 = std::get<2> (m_storage)->evaluate (arg1->type (),
-                                                    exp, noside);
-    return ada_equal_binop (expect_type, exp, noside, std::get<0> (m_storage),
-                           arg1, arg2);
-  }
+                  enum noside noside) override;
 
   void do_generate_ax (struct expression *exp,
                       struct agent_expr *ax,
index 4ee1a2ad51fae774a8d2ee2a39a808eaa1d3b5df..253b85ed1352ce47ac211f3f229decc7d5c8d637 100644 (file)
@@ -10169,14 +10169,21 @@ ada_mult_binop (struct type *expect_type,
     }
 }
 
-/* A helper function for BINOP_EQUAL and BINOP_NOTEQUAL.  */
+namespace expr
+{
+
+/* Implement BINOP_EQUAL and BINOP_NOTEQUAL.  */
 
 value *
-ada_equal_binop (struct type *expect_type,
-                struct expression *exp,
-                enum noside noside, enum exp_opcode op,
-                struct value *arg1, struct value *arg2)
+ada_binop_equal_operation::evaluate (struct type *expect_type,
+                                    struct expression *exp,
+                                    enum noside noside)
 {
+  enum exp_opcode op = std::get<0> (m_storage);
+  value *arg1 = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
+  value *arg2 = std::get<2> (m_storage)->evaluate (arg1->type (),
+                                                  exp, noside);
+
   int tem;
   if (noside == EVAL_AVOID_SIDE_EFFECTS)
     tem = 0;
@@ -10191,6 +10198,8 @@ ada_equal_binop (struct type *expect_type,
   return value_from_longest (type, tem);
 }
 
+} /* namespace expr */
+
 /* A helper function for TERNOP_SLICE.  */
 
 value *