public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Move allocate_stub_method to stabsread.c
@ 2023-03-10 15:03 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2023-03-10 15:03 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1cd0716eb199963ec63fcafa94699d14bbf45e01

commit 1cd0716eb199963ec63fcafa94699d14bbf45e01
Author: Tom Tromey <tromey@adacore.com>
Date:   Fri Feb 24 13:55:29 2023 -0700

    Move allocate_stub_method to stabsread.c
    
    allocate_stub_method is only called from stabsread.c, and I don't
    think it will be needed anywhere else.  So, move it and make it
    static.  Tested by rebuilding.

Diff:
---
 gdb/gdbtypes.c  | 20 --------------------
 gdb/gdbtypes.h  |  2 --
 gdb/stabsread.c | 20 ++++++++++++++++++++
 3 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 3cdde29c9be..cfd0a1b62c7 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -861,26 +861,6 @@ lookup_methodptr_type (struct type *to_type)
   return mtype;
 }
 
-/* Allocate a stub method whose return type is TYPE.  This apparently
-   happens for speed of symbol reading, since parsing out the
-   arguments to the method is cpu-intensive, the way we are doing it.
-   So, we will fill in arguments later.  This always returns a fresh
-   type.  */
-
-struct type *
-allocate_stub_method (struct type *type)
-{
-  struct type *mtype;
-
-  mtype = alloc_type_copy (type);
-  mtype->set_code (TYPE_CODE_METHOD);
-  mtype->set_length (1);
-  mtype->set_is_stub (true);
-  mtype->set_target_type (type);
-  /* TYPE_SELF_TYPE (mtype) = unknown yet */
-  return mtype;
-}
-
 /* See gdbtypes.h.  */
 
 bool
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index c4889a4a05b..52475d5afb4 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -2312,8 +2312,6 @@ extern void smash_to_memberptr_type (struct type *, struct type *,
 
 extern void smash_to_methodptr_type (struct type *, struct type *);
 
-extern struct type *allocate_stub_method (struct type *);
-
 extern const char *type_name_or_error (struct type *type);
 
 struct struct_elt
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index e1597907778..73f05c44b23 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -1464,6 +1464,26 @@ error_type (const char **pp, struct objfile *objfile)
 }
 \f
 
+/* Allocate a stub method whose return type is TYPE.  This apparently
+   happens for speed of symbol reading, since parsing out the
+   arguments to the method is cpu-intensive, the way we are doing it.
+   So, we will fill in arguments later.  This always returns a fresh
+   type.  */
+
+static struct type *
+allocate_stub_method (struct type *type)
+{
+  struct type *mtype;
+
+  mtype = alloc_type_copy (type);
+  mtype->set_code (TYPE_CODE_METHOD);
+  mtype->set_length (1);
+  mtype->set_is_stub (true);
+  mtype->set_target_type (type);
+  /* TYPE_SELF_TYPE (mtype) = unknown yet */
+  return mtype;
+}
+
 /* Read type information or a type definition; return the type.  Even
    though this routine accepts either type information or a type
    definition, the distinction is relevant--some parts of stabsread.c

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-10 15:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-10 15:03 [binutils-gdb] Move allocate_stub_method to stabsread.c Tom Tromey

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).