public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/2] gdb: make value_subscripted_rvalue static
Date: Fri, 15 Oct 2021 16:39:06 +0100	[thread overview]
Message-ID: <1ed4806735ae28246d998ec077b7330e74f830a6.1634312255.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1634312255.git.andrew.burgess@embecosm.com>

The function value_subscripted_rvalue is only used in valarith.c, so
lets make it a static function.

There should be no user visible change after this commit.
---
 gdb/valarith.c | 10 ++++++++--
 gdb/value.h    |  4 ----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/gdb/valarith.c b/gdb/valarith.c
index 07472ef7c8a..0e204135bf2 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -29,6 +29,11 @@
 #include "gdbsupport/byte-vector.h"
 #include "gdbarch.h"
 
+/* Forward declarations.  */
+static struct value *value_subscripted_rvalue (struct value *array,
+					       LONGEST index,
+					       LONGEST lowerbound);
+
 /* Define whether or not the C operator '/' truncates towards zero for
    differently signed operands (truncation direction is undefined in C).  */
 
@@ -190,8 +195,9 @@ value_subscript (struct value *array, LONGEST index)
    (eg, a vector register).  This routine used to promote floats
    to doubles, but no longer does.  */
 
-struct value *
-value_subscripted_rvalue (struct value *array, LONGEST index, LONGEST lowerbound)
+static struct value *
+value_subscripted_rvalue (struct value *array, LONGEST index,
+			  LONGEST lowerbound)
 {
   struct type *array_type = check_typedef (value_type (array));
   struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
diff --git a/gdb/value.h b/gdb/value.h
index 45012372dbf..11c22ddf14f 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -1165,10 +1165,6 @@ extern struct value *find_function_in_inferior (const char *,
 
 extern struct value *value_allocate_space_in_inferior (int);
 
-extern struct value *value_subscripted_rvalue (struct value *array,
-					       LONGEST index,
-					       LONGEST lowerbound);
-
 /* User function handler.  */
 
 typedef struct value *(*internal_function_fn) (struct gdbarch *gdbarch,
-- 
2.25.4


  reply	other threads:[~2021-10-15 15:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15 15:39 [PATCH 0/2] Array indexing, lazy values, and C-like languages Andrew Burgess
2021-10-15 15:39 ` Andrew Burgess [this message]
2021-10-15 15:42   ` [PATCH 1/2] gdb: make value_subscripted_rvalue static Simon Marchi
2021-12-03 11:11     ` Andrew Burgess
2021-10-15 15:39 ` [PATCH 2/2] gdb: improve reuse of value contents when fetching array elements Andrew Burgess
2021-12-03 11:11   ` Ping: " Andrew Burgess
2021-12-13 14:18     ` Andrew Burgess

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=1ed4806735ae28246d998ec077b7330e74f830a6.1634312255.git.andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.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).