public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Subject: [PATCH v2 7/7] More renames in array_operation::evaluate
Date: Tue, 29 Aug 2023 09:34:45 -0600	[thread overview]
Message-ID: <20230829-cleanup-array-op-v2-7-3035458b0443@adacore.com> (raw)
In-Reply-To: <20230829-cleanup-array-op-v2-0-3035458b0443@adacore.com>

array_operation::evaluate has variables named "tem2" and "tem3".  This
patch replaces one with a better name, and entirely removes the other.
---
 gdb/eval.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gdb/eval.c b/gdb/eval.c
index 7c955a4e9eb..81b7aa0cb99 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -2397,10 +2397,9 @@ array_operation::evaluate (struct type *expect_type,
 			   struct expression *exp,
 			   enum noside noside)
 {
-  int tem2 = std::get<0> (m_storage);
-  int tem3 = std::get<1> (m_storage);
+  const int provided_low_bound = std::get<0> (m_storage);
   const std::vector<operation_up> &in_args = std::get<2> (m_storage);
-  const int nargs = tem3 - tem2 + 1;
+  const int nargs = std::get<1> (m_storage) - provided_low_bound + 1;
   struct type *type = expect_type ? check_typedef (expect_type) : nullptr;
 
   if (expect_type != nullptr
@@ -2515,7 +2514,7 @@ array_operation::evaluate (struct type *expect_type,
 	 objects.  */
       argvec[tem] = in_args[tem]->evaluate_with_coercion (exp, noside);
     }
-  return value_array (tem2, argvec);
+  return value_array (provided_low_bound, argvec);
 }
 
 value *

-- 
2.40.1


  parent reply	other threads:[~2023-08-29 15:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29 15:34 [PATCH v2 0/7] Small cleanups " Tom Tromey
2023-08-29 15:34 ` [PATCH v2 1/7] Use gdb::array_view for value_array Tom Tromey
2023-08-29 15:34 ` [PATCH v2 2/7] Declare 'tem' in loop header in array_operation::evaluate Tom Tromey
2023-08-29 15:34 ` [PATCH v2 3/7] Hoist array bounds check " Tom Tromey
2023-08-29 15:34 ` [PATCH v2 4/7] Remove redundant variable from array_operation::evaluate Tom Tromey
2023-08-29 15:34 ` [PATCH v2 5/7] Remove another " Tom Tromey
2023-08-29 15:34 ` [PATCH v2 6/7] Remove "highbound" parameter from value_array Tom Tromey
2023-08-29 17:53   ` Simon Marchi
2023-08-29 18:01     ` Tom Tromey
2023-08-29 15:34 ` Tom Tromey [this message]
2023-08-29 15:58 ` [PATCH v2 0/7] Small cleanups in array_operation::evaluate John Baldwin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230829-cleanup-array-op-v2-7-3035458b0443@adacore.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).