From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28155 invoked by alias); 6 Aug 2014 17:19:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 28017 invoked by uid 89); 6 Aug 2014 17:19:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 06 Aug 2014 17:19:16 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s76HJEdG028477 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 6 Aug 2014 13:19:15 -0400 Received: from c64.redhat.com (vpn-239-139.phx2.redhat.com [10.3.239.139]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s76HJ2nu030913; Wed, 6 Aug 2014 13:19:14 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 020/236] Return rtx_insn from get_insns/get_last_insn Date: Wed, 06 Aug 2014 17:20:00 -0000 Message-Id: <1407345815-14551-21-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1407345815-14551-1-git-send-email-dmalcolm@redhat.com> References: <1407345815-14551-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00527.txt.bz2 Ultimately, the underlying fields should become rtx_insn *, but for now we can do this with a checked cast. Note to self: config/m32c/m32c.c: m32c_leaf_function_p directly manipulates x_first_insn and x_last_insn, using sequence_stack. gcc/ * emit-rtl.h (get_insns): Strengthen return type from rtx to rtx_insn *, adding a checked cast for now. (get_last_insn): Likewise. --- gcc/emit-rtl.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h index c72c24f..f97ac49 100644 --- a/gcc/emit-rtl.h +++ b/gcc/emit-rtl.h @@ -74,10 +74,11 @@ extern bool need_atomic_barrier_p (enum memmodel, bool); /* Return the first insn of the current sequence or current function. */ -static inline rtx +static inline rtx_insn * get_insns (void) { - return crtl->emit.x_first_insn; + rtx insn = crtl->emit.x_first_insn; + return as_a_nullable (insn); } /* Specify a new insn as the first in the chain. */ @@ -91,10 +92,11 @@ set_first_insn (rtx insn) /* Return the last insn emitted in current sequence or current function. */ -static inline rtx +static inline rtx_insn * get_last_insn (void) { - return crtl->emit.x_last_insn; + rtx insn = crtl->emit.x_last_insn; + return as_a_nullable (insn); } /* Specify a new insn as the last in the chain. */ -- 1.8.5.3