From patchwork Tue Dec 1 12:54:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Reutner-Fischer X-Patchwork-Id: 550828 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 63C85140291 for ; Tue, 1 Dec 2015 23:55:29 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Gtk/D/74; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=UzT546oqA/sv gbNumtAOfmFbzmr3yr3UMI3VKYfZ9XURJ6HU2JZdJe0bix4UENLpwOWUPxBc0jmH Vs7CuqtnbITiGDPXrQuAz2redksyb6q5ZAEQS4GgKVCWBNuIh1vhNfxrO7gUpvRF AFF2eNr4MhxTRSqwAibiTuCMxowl4YA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=EiXSjZmMNV7s4u8EKX k5gTEro5k=; b=Gtk/D/74LTM3I4uls68vMChi6+iWiopvYx7teLN/L19701HfQ6 LCl1KoAdD6DmW1FanIJdWFYC+st3MBMwEfsj2g0Uv7+tXkElcKlCgA3HBwvpOjMd P4p30g8G2zjsLq9ssU0XlmtiNkqIQe0BS1oU6mW7i1GVasyc+7ITVjHrU= Received: (qmail 94734 invoked by alias); 1 Dec 2015 12:55:18 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 94712 invoked by uid 89); 1 Dec 2015 12:55:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-wm0-f52.google.com Received: from mail-wm0-f52.google.com (HELO mail-wm0-f52.google.com) (74.125.82.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 01 Dec 2015 12:55:16 +0000 Received: by wmvv187 with SMTP id v187so205192176wmv.1; Tue, 01 Dec 2015 04:55:13 -0800 (PST) X-Received: by 10.194.203.228 with SMTP id kt4mr61294129wjc.58.1448974513293; Tue, 01 Dec 2015 04:55:13 -0800 (PST) Received: from s42.loc (91-119-111-21.dynamic.xdsl-line.inode.at. [91.119.111.21]) by smtp.gmail.com with ESMTPSA id kj3sm51573358wjb.19.2015.12.01.04.55.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2015 04:55:12 -0800 (PST) Received: from cow by s42.loc with local (Exim 4.86) (envelope-from ) id 1a3kSe-000850-LY; Tue, 01 Dec 2015 13:55:12 +0100 From: Bernhard Reutner-Fischer To: fortran@gcc.gnu.org Cc: Bernhard Reutner-Fischer , gcc-patches@gcc.gnu.org Subject: [PATCH] Use gfc_add_*_component defines where appropriate Date: Tue, 1 Dec 2015 13:54:58 +0100 Message-Id: <1448974501-30981-1-git-send-email-rep.dot.nop@gmail.com> X-IsSubscribed: yes A couple of places used gfc_add_component_ref(expr, "string") instead of the defines from gfortran.h Regstrapped without regressions, ok for trunk stage3 now / next stage1? gcc/fortran/ChangeLog 2015-11-29 Bernhard Reutner-Fischer * class.c (gfc_add_class_array_ref): Call gfc_add_data_component() instead of gfc_add_component_ref(). (gfc_get_len_component): Call gfc_add_len_component() instead of gfc_add_component_ref(). * trans-intrinsic.c (gfc_conv_intrinsic_loc): Call gfc_add_data_component() instead of gfc_add_component_ref(). * trans.c (gfc_add_finalizer_call): Call gfc_add_final_component() and gfc_add_size_component() instead of gfc_add_component_ref. Signed-off-by: Bernhard Reutner-Fischer --- gcc/fortran/class.c | 4 ++-- gcc/fortran/trans-intrinsic.c | 2 +- gcc/fortran/trans.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c index 8b49ae9..027cb89 100644 --- a/gcc/fortran/class.c +++ b/gcc/fortran/class.c @@ -258,7 +258,7 @@ gfc_add_class_array_ref (gfc_expr *e) int rank = CLASS_DATA (e)->as->rank; gfc_array_spec *as = CLASS_DATA (e)->as; gfc_ref *ref = NULL; - gfc_add_component_ref (e, "_data"); + gfc_add_data_component (e); e->rank = rank; for (ref = e->ref; ref; ref = ref->next) if (!ref->next) @@ -584,7 +584,7 @@ gfc_get_len_component (gfc_expr *e) ref = ref->next; } /* And replace if with a ref to the _len component. */ - gfc_add_component_ref (ptr, "_len"); + gfc_add_len_component (ptr); return ptr; } diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index 1dabc26..2ef0709 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -7112,7 +7112,7 @@ gfc_conv_intrinsic_loc (gfc_se * se, gfc_expr * expr) if (arg_expr->rank == 0) { if (arg_expr->ts.type == BT_CLASS) - gfc_add_component_ref (arg_expr, "_data"); + gfc_add_data_component (arg_expr); gfc_conv_expr_reference (se, arg_expr); } else diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index 2a91c35..14dad0f 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -1132,11 +1132,11 @@ gfc_add_finalizer_call (stmtblock_t *block, gfc_expr *expr2) final_expr = gfc_copy_expr (expr); gfc_add_vptr_component (final_expr); - gfc_add_component_ref (final_expr, "_final"); + gfc_add_final_component (final_expr); elem_size = gfc_copy_expr (expr); gfc_add_vptr_component (elem_size); - gfc_add_component_ref (elem_size, "_size"); + gfc_add_size_component (elem_size); } gcc_assert (final_expr->expr_type == EXPR_VARIABLE);