From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69709 invoked by alias); 5 Sep 2018 14:58:04 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 68929 invoked by uid 89); 5 Sep 2018 14:57:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=star X-HELO: mail-wr1-f42.google.com Received: from mail-wr1-f42.google.com (HELO mail-wr1-f42.google.com) (209.85.221.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Sep 2018 14:57:55 +0000 Received: by mail-wr1-f42.google.com with SMTP id o37-v6so8009812wrf.6; Wed, 05 Sep 2018 07:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/aLFPn5KD8JucvCqSOw26NqxKUgzk45rr5RRPlM+vm0=; b=HY4GSFutB5/8y+I4IRsksknBjk8VW3shH5LXskYHQ5gk8evNGwd5OP69sljiAfdSRO y2bWyULJnxLFXT8RljEJtKUswU8RgEoOaXpDhjEKHDf7mN2GmE1SlxvVeIP3mAMM8YCj 4ncaepIhW5QkIC3lUb5Vn2dskvhwJaEBBvSFSJIiad5Y7wi6nVXLsaH0SqECY4IaDhOd nACzRO1ko/Xf6O1wF8IZcZOZbUHy9r1xAlDvNyl3c1IGU+IGLwZch/qn258H+oIUBKbR jlCwa2Yqw1Ro+FqsGLesG1tEHCoff+CJqGzOwvUqhh/dF8Pq6L9corvKcKUnLXdC28oH NJeg== Return-Path: Received: from s46.loc (91-119-125-11.dsl.dynamic.surfer.at. [91.119.125.11]) by smtp.gmail.com with ESMTPSA id n14-v6sm1625279wmc.14.2018.09.05.07.57.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Sep 2018 07:57:51 -0700 (PDT) Received: from cow by s46.loc with local (Exim 4.91) (envelope-from ) id 1fxZFa-00008F-Ns; Wed, 05 Sep 2018 14:57:46 +0000 From: Bernhard Reutner-Fischer To: fortran@gcc.gnu.org Cc: Bernhard Reutner-Fischer , gcc-patches@gcc.gnu.org Subject: [PATCH,FORTRAN 21/29] Use stringpool for module tbp Date: Wed, 05 Sep 2018 14:58:00 -0000 Message-Id: <20180905145732.404-22-rep.dot.nop@gmail.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00034.txt.bz2 From: Bernhard Reutner-Fischer Switch type bound procedures to use the stringpool. gcc/fortran/ChangeLog: 2017-11-24 Bernhard Reutner-Fischer * decl.c (gfc_match_decl_type_spec): Use stringpool. * module.c (mio_expr): Likewise. (mio_typebound_proc): Likewise. (mio_full_typebound_tree): Likewise. (mio_omp_udr_expr): Likewise. --- gcc/fortran/decl.c | 9 +++++---- gcc/fortran/module.c | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index d6a6538f769..cc14a871dfd 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -4049,12 +4049,13 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) { gfc_symbol *upe; gfc_symtree *st; + const char *star_name = gfc_get_string ("%s", "STAR"); ts->type = BT_CLASS; - gfc_find_symbol ("STAR", gfc_current_ns, 1, &upe); + gfc_find_symbol (star_name, gfc_current_ns, 1, &upe); if (upe == NULL) { - upe = gfc_new_symbol ("STAR", gfc_current_ns); - st = gfc_new_symtree (&gfc_current_ns->sym_root, "STAR"); + upe = gfc_new_symbol (star_name, gfc_current_ns); + st = gfc_new_symtree (&gfc_current_ns->sym_root, star_name); st->n.sym = upe; gfc_set_sym_referenced (upe); upe->refs++; @@ -4069,7 +4070,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) } else { - st = gfc_get_tbp_symtree (&gfc_current_ns->sym_root, "STAR"); + st = gfc_get_tbp_symtree (&gfc_current_ns->sym_root, star_name); st->n.sym = upe; upe->refs++; } diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 3b644234921..24e48c94c76 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -3585,9 +3585,9 @@ mio_expr (gfc_expr **ep) case 3: break; default: - require_atom (ATOM_STRING); - e->value.function.isym = gfc_find_function (atom_string); - free (atom_string); + const char *name; + mio_pool_string (&name); + e->value.function.isym = gfc_find_function (name); } } @@ -3872,6 +3872,7 @@ mio_typebound_proc (gfc_typebound_proc** proc) while (peek_atom () != ATOM_RPAREN) { gfc_symtree** sym_root; + const char *name; g = gfc_get_tbp_generic (); g->specific = NULL; @@ -3879,10 +3880,9 @@ mio_typebound_proc (gfc_typebound_proc** proc) mio_integer (&iop); g->is_operator = (bool) iop; - require_atom (ATOM_STRING); + mio_pool_string (&name); sym_root = ¤t_f2k_derived->tb_sym_root; - g->specific_st = gfc_get_tbp_symtree (sym_root, atom_string); - free (atom_string); + g->specific_st = gfc_get_tbp_symtree (sym_root, name); g->next = (*proc)->u.generic; (*proc)->u.generic = g; @@ -3928,12 +3928,12 @@ mio_full_typebound_tree (gfc_symtree** root) while (peek_atom () == ATOM_LPAREN) { gfc_symtree* st; + const char *name; mio_lparen (); - require_atom (ATOM_STRING); - st = gfc_get_tbp_symtree (root, atom_string); - free (atom_string); + mio_pool_string (&name); + st = gfc_get_tbp_symtree (root, name); mio_typebound_symtree (st); } @@ -4267,9 +4267,9 @@ mio_omp_udr_expr (gfc_omp_udr *udr, gfc_symbol **sym1, gfc_symbol **sym2, mio_integer (&flag); if (flag) { - require_atom (ATOM_STRING); - ns->code->resolved_isym = gfc_find_subroutine (atom_string); - free (atom_string); + const char *name; + mio_pool_string (&name); + ns->code->resolved_isym = gfc_find_subroutine (name); } else mio_symbol_ref (&ns->code->resolved_sym); -- 2.19.0.rc1