From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27752 invoked by alias); 6 Aug 2014 17:43:47 -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 27708 invoked by uid 89); 6 Aug 2014 17:43:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 06 Aug 2014 17:43:43 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF4uU-0001m5-4P for gcc-patches@gcc.gnu.org; Wed, 06 Aug 2014 13:22:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF4uT-0001ly-QC for gcc-patches@gcc.gnu.org; Wed, 06 Aug 2014 13:21:58 -0400 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 s76HKuTK029255 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 6 Aug 2014 13:20:57 -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 s76HJ2qq030913; Wed, 6 Aug 2014 13:20:56 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 196/236] Convert various INSN accessors in rtl.h to inline functions Date: Wed, 06 Aug 2014 17:43:00 -0000 Message-Id: <1407345815-14551-197-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-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00666.txt.bz2 gcc/ * rtl.h (INSN_UID): Convert from a macro to a pair of inline functions. Require merely an rtx for now, not an rtx_insn *, or rtx_real_insn *. (BLOCK_FOR_INSN): Likewise. (INSN_LOCATION): Likewise. (INSN_HAS_LOCATION): Convert from a macro to an inline function. --- gcc/rtl.h | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/gcc/rtl.h b/gcc/rtl.h index 640616f..9069ea7 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1191,8 +1191,16 @@ extern void rtl_check_failed_flag (const char *, const_rtx, const char *, /* Holds a unique number for each insn. These are not necessarily sequentially increasing. */ -#define INSN_UID(INSN) \ - (RTL_INSN_CHAIN_FLAG_CHECK ("INSN_UID", (INSN))->u2.insn_uid) +inline int INSN_UID (const_rtx insn) +{ + return RTL_INSN_CHAIN_FLAG_CHECK ("INSN_UID", + (insn))->u2.insn_uid; +} +inline int& INSN_UID (rtx insn) +{ + return RTL_INSN_CHAIN_FLAG_CHECK ("INSN_UID", + (insn))->u2.insn_uid; +} /* Chain insns together in sequence. */ @@ -1223,7 +1231,15 @@ inline rtx& SET_NEXT_INSN (rtx insn) return XEXP (insn, 1); } -#define BLOCK_FOR_INSN(INSN) XBBDEF (INSN, 2) +inline basic_block BLOCK_FOR_INSN (const_rtx insn) +{ + return XBBDEF (insn, 2); +} + +inline basic_block& BLOCK_FOR_INSN (rtx insn) +{ + return XBBDEF (insn, 2); +} /* The body of an insn. */ inline rtx PATTERN (const_rtx insn) @@ -1236,10 +1252,20 @@ inline rtx& PATTERN (rtx insn) return XEXP (insn, 3); } -#define INSN_LOCATION(INSN) XUINT (INSN, 4) +inline unsigned int INSN_LOCATION (const_rtx insn) +{ + return XUINT (insn, 4); +} + +inline unsigned int& INSN_LOCATION (rtx insn) +{ + return XUINT (insn, 4); +} -#define INSN_HAS_LOCATION(INSN) ((LOCATION_LOCUS (INSN_LOCATION (INSN)))\ - != UNKNOWN_LOCATION) +inline bool INSN_HAS_LOCATION (const_rtx insn) +{ + return LOCATION_LOCUS (INSN_LOCATION (insn)) != UNKNOWN_LOCATION; +} /* LOCATION of an RTX if relevant. */ #define RTL_LOCATION(X) (INSN_P (X) ? \ -- 1.8.5.3