From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by sourceware.org (Postfix) with ESMTPS id 6955E3857C45 for ; Fri, 24 Feb 2023 20:56:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6955E3857C45 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-il1-x135.google.com with SMTP id 4so512877ilz.6 for ; Fri, 24 Feb 2023 12:56:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1fJYJRKEw6OXpjpKEmztIxsBvW140+E0mhWaLu+5b0o=; b=IPW8zh5+gz8H40VGKIWFhxNw5Ym6ZAmsLyhNZ1jEXpx0R9YEu71MSD6lrkvycoFGrh FTozjoFbutZQLr53/GIdBI9EFSYn6BXS6OmSzh3STd2vTEf1WDaA6N5Y1XJoYdaxfp9v vd9GZ4bh9/FT7KZ4wVQYZ2imfg/8uhF/POsxPxeEfWpbRSyiJSIFKWRXUVJnlYX9LGfJ Yc4UsyZFgGKoJWn1nFuTES+bCvo3SjXk01oMh422TniE5KPzPQjKv6+uYiFUZL99lca2 OvRSAubL2eoxw6Tu1lfKCCKw8H5JWZaHlCRCoEX7X2PETu2AWM2yCEpQhpq8N+XWjPeM 1vfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1fJYJRKEw6OXpjpKEmztIxsBvW140+E0mhWaLu+5b0o=; b=acHpTg2CxmY5zH8I/dQjlQIVddbnQxj3p0K3PhJKzpMok9599dQ5kXUzrmU91iI7lI 8541fYWC8+auRO+9N6Ik7OGn9I+ERKfi/pv1yGF5yNfYBuTen0OHwMFPk9dI973A0m5g i+a4K70FM98YYPPDeaji4EM95ogFAPa1M8REfLSMzgH9uyv+n0HojBeh6UV0dldtOi7+ enUZ7gyctvtfN598Zko+oDVO/KqgHfJaeItx8mWgaZDasJcoAMjAdoIJCIlz0X4COJRV 0HQWR9q7AVilAksaoknGyiplrZC8C/vzrRj3C9mhimEMmVL5RqRu/jRi7B59W1UqNFCL i72w== X-Gm-Message-State: AO0yUKWBiKVq1GIsm9XGkCxU3Kxpko3Ol3mLHW0I/zITNoYWHucDq9Xc OJaAmfgNYORqctSrA0FlaaavtPYBOIjOIC4U X-Google-Smtp-Source: AK7set9rnyK3BCqamH69ouk3paxFyWWWi3c4oBGGeKZ/pDd53TJmm6Sj6SEHTFCT8uRy3p/Zxlnang== X-Received: by 2002:a05:6e02:b42:b0:314:110d:ab69 with SMTP id f2-20020a056e020b4200b00314110dab69mr14009172ilu.6.1677272173629; Fri, 24 Feb 2023 12:56:13 -0800 (PST) Received: from localhost.localdomain (75-166-130-93.hlrn.qwest.net. [75.166.130.93]) by smtp.gmail.com with ESMTPSA id i6-20020a02ca06000000b003b375247f89sm4828607jak.177.2023.02.24.12.56.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 12:56:12 -0800 (PST) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Move allocate_stub_method to stabsread.c Date: Fri, 24 Feb 2023 13:56:03 -0700 Message-Id: <20230224205603.2765694-1-tromey@adacore.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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. --- 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 f22ba44a538..32d195e27c4 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 c2253310666..ce78f05fbc8 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -2311,8 +2311,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 ca9132b37d0..39bb3f32a73 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -1464,6 +1464,26 @@ error_type (const char **pp, struct objfile *objfile) } +/* 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 -- 2.39.1