From patchwork Wed Oct 27 21:11:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Reutner-Fischer X-Patchwork-Id: 1547093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=rcponZD7; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HfhGn6nmDz9sXS for ; Thu, 28 Oct 2021 08:12:33 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 193923858439 for ; Wed, 27 Oct 2021 21:12:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 193923858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635369149; bh=lbRfvPZJeY/MLewzSjK9sbR5ZjRGF/gEHMM0DeRhCqA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=rcponZD7Jk+wl8B75xjENImJXIlInkefExKCoxg3ibro6RUYQMiaFXQxC2myyfWQO ajk35zVYGguNHhHwAK0fcc8H2eax/EwJ4N8vPLdb3L3uDyFZ90Gb8jZfzXLnDFYa3q Vv8MUHZEcuRC1+ehws9HTqpShZJO41dIjsbJgc58= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id D90E73858435; Wed, 27 Oct 2021 21:11:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D90E73858435 Received: by mail-wr1-x435.google.com with SMTP id u18so6382478wrg.5; Wed, 27 Oct 2021 14:11:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lbRfvPZJeY/MLewzSjK9sbR5ZjRGF/gEHMM0DeRhCqA=; b=L0WMGJhs7UixGZzgtxzD1vUULBAc9mfcUVtOsQiQsgqNZ60hJllcQ863AL/+29h7Qd Lk8M2Q/l+AeAYtS51MsMAAaDch/5+ZimuXIGW+ixkMMfqbDuA0mITBZP68yzo0yV8iPZ eQae99JJCdo9X2L2Ca67WWaUmLQnw/BpnFLmYvadTZlNcJDUozRQE0tZfYrZRuI1Y6r6 cnTOPy/NG82zZsKQ+urAxXao4QyCgHcs9Ol8xN6To3vQ0QbZev2lNA39bpTkwTyXZ2BO VQV4EK2DPXPe1Zabl38YTN1dTwhZ01JoNj4l53Fsh5mAKu5QsccapnVOpI9dbCnaesWp MIIA== X-Gm-Message-State: AOAM531D+XeKqIJTZmpU5+3AKMEJnxuQ+VuvYOCUijSkOx0XSIyCdIS/ 9F1UnUc7ymJ4R3bOW3RH1u8= X-Google-Smtp-Source: ABdhPJxLgw1dwOO5/NTn6BagxrZF1qElNDuhRLuDRrvRxRhqiFbcW4xph6HEtGLIRyXuXQo3KVCGDw== X-Received: by 2002:adf:8919:: with SMTP id s25mr72938wrs.185.1635369083644; Wed, 27 Oct 2021 14:11:23 -0700 (PDT) Received: from nbbrfq.weghof (dynamic-2bq7di4u2lfl4qjka9-pd01.res.v6.highway.a1.net. [2001:871:227:33a8:f6a3:c58c:7641:e771]) by smtp.gmail.com with ESMTPSA id o10sm923433wrx.64.2021.10.27.14.11.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 14:11:23 -0700 (PDT) Received: from b by nbbrfq.weghof with local (Exim 4.95) (envelope-from ) id 1mfqCg-001EOm-25; Wed, 27 Oct 2021 23:11:22 +0200 To: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org Subject: [PATCH,Fortran] Fortran: Delete unused decl in gfortran.h Date: Wed, 27 Oct 2021 23:11:13 +0200 Message-Id: <20211027211113.293666-1-rep.dot.nop@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Bernhard Reutner-Fischer via Gcc-patches From: Bernhard Reutner-Fischer Reply-To: Bernhard Reutner-Fischer Cc: Bernhard Reutner-Fischer Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" From: Bernhard Reutner-Fischer Hi! Delete some more declarations without definitions and make some functions static. Bootstrapped and regtested on x86_64-unknown-linux without regressions. Ok for trunk? gcc/fortran/ChangeLog: * decl.c (gfc_insert_kind_parameter_exprs): Make static. * expr.c (gfc_build_init_expr): Make static (gfc_build_default_init_expr): Move below its static helper. * gfortran.h (gfc_insert_kind_parameter_exprs, gfc_add_saved_common, gfc_add_common, gfc_use_derived_tree, gfc_free_charlen, gfc_get_ultimate_derived_super_type, gfc_resolve_oacc_parallel_loop_blocks, gfc_build_init_expr, gfc_iso_c_sub_interface): Delete. * symbol.c (gfc_new_charlen, gfc_get_derived_super_type): Make static. --- gcc/fortran/decl.c | 2 +- gcc/fortran/expr.c | 20 ++++++++++---------- gcc/fortran/gfortran.h | 9 --------- gcc/fortran/symbol.c | 4 ++-- 4 files changed, 13 insertions(+), 22 deletions(-) diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 2788348d1be..e9e23fe1acb 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -3713,7 +3713,7 @@ insert_parameter_exprs (gfc_expr* e, gfc_symbol* sym ATTRIBUTE_UNUSED, } -bool +static bool gfc_insert_kind_parameter_exprs (gfc_expr *e) { return gfc_traverse_expr (e, NULL, &insert_parameter_exprs, 0); diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 4dea840e348..087d822021a 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -4587,21 +4587,12 @@ gfc_check_assign_symbol (gfc_symbol *sym, gfc_component *comp, gfc_expr *rvalue) return true; } -/* Invoke gfc_build_init_expr to create an initializer expression, but do not - * require that an expression be built. */ - -gfc_expr * -gfc_build_default_init_expr (gfc_typespec *ts, locus *where) -{ - return gfc_build_init_expr (ts, where, false); -} - /* Build an initializer for a local integer, real, complex, logical, or character variable, based on the command line flags finit-local-zero, finit-integer=, finit-real=, finit-logical=, and finit-character=. With force, an initializer is ALWAYS generated. */ -gfc_expr * +static gfc_expr * gfc_build_init_expr (gfc_typespec *ts, locus *where, bool force) { gfc_expr *init_expr; @@ -4758,6 +4749,15 @@ gfc_build_init_expr (gfc_typespec *ts, locus *where, bool force) return init_expr; } +/* Invoke gfc_build_init_expr to create an initializer expression, but do not + * require that an expression be built. */ + +gfc_expr * +gfc_build_default_init_expr (gfc_typespec *ts, locus *where) +{ + return gfc_build_init_expr (ts, where, false); +} + /* Apply an initialization expression to a typespec. Can be used for symbols or components. Similar to add_init_expr_to_sym in decl.c; could probably be combined with some effort. */ diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index f7662c59a5d..8c11cf6d18d 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -3116,7 +3116,6 @@ struct gfc_vect_builtin_tuple extern hash_map *gfc_vectorized_builtins; /* Handling Parameterized Derived Types */ -bool gfc_insert_kind_parameter_exprs (gfc_expr *); bool gfc_insert_parameter_exprs (gfc_expr *, gfc_actual_arglist *); match gfc_get_pdt_instance (gfc_actual_arglist *, gfc_symbol **, gfc_actual_arglist **); @@ -3348,11 +3347,9 @@ bool gfc_add_threadprivate (symbol_attribute *, const char *, locus *); bool gfc_add_omp_declare_target (symbol_attribute *, const char *, locus *); bool gfc_add_omp_declare_target_link (symbol_attribute *, const char *, locus *); -bool gfc_add_saved_common (symbol_attribute *, locus *); bool gfc_add_target (symbol_attribute *, locus *); bool gfc_add_dummy (symbol_attribute *, const char *, locus *); bool gfc_add_generic (symbol_attribute *, const char *, locus *); -bool gfc_add_common (symbol_attribute *, locus *); bool gfc_add_in_common (symbol_attribute *, const char *, locus *); bool gfc_add_in_equivalence (symbol_attribute *, const char *, locus *); bool gfc_add_data (symbol_attribute *, const char *, locus *); @@ -3387,7 +3384,6 @@ bool gfc_copy_attr (symbol_attribute *, symbol_attribute *, locus *); int gfc_copy_dummy_sym (gfc_symbol **, gfc_symbol *, int); bool gfc_add_component (gfc_symbol *, const char *, gfc_component **); gfc_symbol *gfc_use_derived (gfc_symbol *); -gfc_symtree *gfc_use_derived_tree (gfc_symtree *); gfc_component *gfc_find_component (gfc_symbol *, const char *, bool, bool, gfc_ref **); @@ -3428,7 +3424,6 @@ void gfc_undo_symbols (void); void gfc_commit_symbols (void); void gfc_commit_symbol (gfc_symbol *); gfc_charlen *gfc_new_charlen (gfc_namespace *, gfc_charlen *); -void gfc_free_charlen (gfc_charlen *, gfc_charlen *); void gfc_free_namespace (gfc_namespace *); void gfc_symbol_init_2 (void); @@ -3448,7 +3443,6 @@ void gfc_traverse_gsymbol (gfc_gsymbol *, void (*)(gfc_gsymbol *, void *), void gfc_typebound_proc* gfc_get_typebound_proc (gfc_typebound_proc*); gfc_symbol* gfc_get_derived_super_type (gfc_symbol*); -gfc_symbol* gfc_get_ultimate_derived_super_type (gfc_symbol*); bool gfc_type_is_extension_of (gfc_symbol *, gfc_symbol *); bool gfc_type_compatible (gfc_typespec *, gfc_typespec *); @@ -3542,7 +3536,6 @@ void gfc_omp_restore_state (struct gfc_omp_saved_state *); void gfc_free_expr_list (gfc_expr_list *); void gfc_resolve_oacc_directive (gfc_code *, gfc_namespace *); void gfc_resolve_oacc_declare (gfc_namespace *); -void gfc_resolve_oacc_parallel_loop_blocks (gfc_code *, gfc_namespace *); void gfc_resolve_oacc_blocks (gfc_code *, gfc_namespace *); void gfc_resolve_oacc_routines (gfc_namespace *); @@ -3599,7 +3592,6 @@ bool gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue, bool gfc_check_assign_symbol (gfc_symbol *, gfc_component *, gfc_expr *); gfc_expr *gfc_build_default_init_expr (gfc_typespec *, locus *); -gfc_expr *gfc_build_init_expr (gfc_typespec *, locus *, bool); void gfc_apply_init (gfc_typespec *, symbol_attribute *, gfc_expr *); bool gfc_has_default_initializer (gfc_symbol *); gfc_expr *gfc_default_initializer (gfc_typespec *); @@ -3665,7 +3657,6 @@ bool gfc_resolve_dim_arg (gfc_expr *); bool gfc_is_formal_arg (void); bool gfc_resolve_substring (gfc_ref *, bool *); void gfc_resolve_substring_charlen (gfc_expr *); -match gfc_iso_c_sub_interface(gfc_code *, gfc_symbol *); gfc_expr *gfc_expr_to_initialize (gfc_expr *); bool gfc_type_is_extensible (gfc_symbol *); bool gfc_resolve_intrinsic (gfc_symbol *, locus *); diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index c77f3f84962..136a96ac87d 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -3985,7 +3985,7 @@ gfc_new_charlen (gfc_namespace *ns, gfc_charlen *old_cl) /* Free the charlen list from cl to end (end is not freed). Free the whole list if end is NULL. */ -void +static void gfc_free_charlen (gfc_charlen *cl, gfc_charlen *end) { gfc_charlen *cl2; @@ -5108,7 +5108,7 @@ gfc_get_derived_super_type (gfc_symbol* derived) /* Get the ultimate super-type of a given derived type. */ -gfc_symbol* +static gfc_symbol* gfc_get_ultimate_derived_super_type (gfc_symbol* derived) { if (!derived->attr.extension)