]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove ada_unop_in_range
authorTom Tromey <tromey@adacore.com>
Mon, 8 Sep 2025 16:21:18 +0000 (10:21 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 9 Sep 2025 15:27:04 +0000 (09:27 -0600)
ada_unop_in_range can be merged with its sole caller.  This change
points out that one of the arguments was not needed.

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

index 8c9bfe8abb2a4ea3e46cb2197ebfaac9bb24c289..87e2aa1e1d4a5b2822991203572e657b75cfbe1a 100644 (file)
@@ -34,10 +34,6 @@ extern struct value *ada_abs (struct type *expect_type,
                              struct expression *exp,
                              enum noside noside, enum exp_opcode op,
                              struct value *arg1);
-extern struct value *ada_unop_in_range (struct type *expect_type,
-                                       struct expression *exp,
-                                       enum noside noside, enum exp_opcode op,
-                                       struct value *arg1, struct type *type);
 extern struct value *ada_mult_binop (struct type *expect_type,
                                     struct expression *exp,
                                     enum noside noside, enum exp_opcode op,
@@ -224,12 +220,7 @@ public:
 
   value *evaluate (struct type *expect_type,
                   struct expression *exp,
-                  enum noside noside) override
-  {
-    value *val = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
-    return ada_unop_in_range (expect_type, exp, noside, UNOP_IN_RANGE,
-                             val, std::get<1> (m_storage));
-  }
+                  enum noside noside) override;
 
   enum exp_opcode opcode () const override
   { return UNOP_IN_RANGE; }
index b62f545e1e37a6fdd2218514a274848a5d2ebed0..4ee1a2ad51fae774a8d2ee2a39a808eaa1d3b5df 100644 (file)
@@ -10041,14 +10041,19 @@ ada_unop_neg (struct type *expect_type,
   return value_neg (arg1);
 }
 
-/* A helper function for UNOP_IN_RANGE.  */
+namespace expr
+{
+
+/* Implement UNOP_IN_RANGE.  */
 
 value *
-ada_unop_in_range (struct type *expect_type,
-                  struct expression *exp,
-                  enum noside noside, enum exp_opcode op,
-                  struct value *arg1, struct type *type)
+ada_unop_range_operation::evaluate (struct type *expect_type,
+                                   struct expression *exp,
+                                   enum noside noside)
 {
+  value *arg1 = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
+  struct type *type = std::get<1> (m_storage);
+
   struct value *arg2, *arg3;
   switch (type->code ())
     {
@@ -10075,6 +10080,8 @@ ada_unop_in_range (struct type *expect_type,
     }
 }
 
+} /* namespace expr */
+
 /* A helper function for OP_ATR_TAG.  */
 
 value *