From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 08F503858D3C; Fri, 10 Mar 2023 15:03:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 08F503858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678460591; bh=hVM50KlZ/TaSvtJ8gwQCupQcOhN+62l2JqjMd67Oy5g=; h=From:To:Subject:Date:From; b=hRJ4+mU5CRaDd3Uie+MQrVnEZSDQnrdzneSQsdSjJT4gXBpUidbKA1GIpGmwNKNs4 JDfE1ugNvdzM+PpnmDzO3cBQ6ZafUc8yValALKXfQ9wdpabTpdY53Vs/QRE+fu4MJH GaaWHP7vi2d90En5JUvTDiWzwqysgVL6IELGTCwQ= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Move allocate_stub_method to stabsread.c X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: a4d5aec71e097837ee314eca612f71a3d85b6b3f X-Git-Newrev: 1cd0716eb199963ec63fcafa94699d14bbf45e01 Message-Id: <20230310150311.08F503858D3C@sourceware.org> Date: Fri, 10 Mar 2023 15:03:11 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D1cd0716eb199= 963ec63fcafa94699d14bbf45e01 commit 1cd0716eb199963ec63fcafa94699d14bbf45e01 Author: Tom Tromey Date: Fri Feb 24 13:55:29 2023 -0700 Move allocate_stub_method to stabsread.c =20 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; } =20 -/* 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 =3D 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) =3D unknown yet */ - return mtype; -} - /* See gdbtypes.h. */ =20 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 *, s= truct type *, =20 extern void smash_to_methodptr_type (struct type *, struct type *); =20 -extern struct type *allocate_stub_method (struct type *); - extern const char *type_name_or_error (struct type *type); =20 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) } =0C =20 +/* 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 =3D 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) =3D 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