From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22735 invoked by alias); 22 Feb 2017 11:01:11 -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 22649 invoked by uid 89); 22 Feb 2017 11:01:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,URIBL_SBL autolearn=ham version=3.3.2 spammy=H*Ad:D*edu.cn, H*Ad:D*cn, H*F:D*cn, science X-HELO: stu.xidian.edu.cn Received: from stumail.xidian.edu.cn (HELO stu.xidian.edu.cn) (202.117.112.40) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Wed, 22 Feb 2017 11:01:09 +0000 Received: from xry111-laptop (xry111-laptop [171.118.139.181]) by stu.xidian.edu.cn (eYou MTA v8.1.0) with ESMTP id aa031d1ebea251931115e92bdc066e84 for ; Wed, 22 Feb 2017 19:11:20 +0800 X-Eyou-Smtpauth: ryxi@stu.xidian.edu.cn Message-ID: <1487761260.2882.64.camel@stu.xidian.edu.cn> Subject: [PATCH 1/5] Move char_type_p prototype into c-common.h From: Xi Ruoyao To: gcc-patches@gcc.gnu.org Cc: ryxi@stu.xidian.edu.cn Date: Wed, 22 Feb 2017 11:01:00 -0000 Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Eyou-Sender: X-SW-Source: 2017-02/txt/msg01373.txt.bz2 This patch moves prototype of char_type_p into c-common.h, so we can use it in c-family/*. gcc/ChangeLog: 2017-02-22 Xi Ruoyao * c-family/c-common.h (char_type_p): New prototype * c/c-typeck.c (char_type_p): Make the function extern * cp/cp-tree.h (char_type_p): Remove prototype * cp/tree.c (char_type_p): Change the return type to bool ---  gcc/c-family/c-common.h | 1 +  gcc/c/c-typeck.c        | 4 +++-  gcc/cp/cp-tree.h        | 1 -  gcc/cp/tree.c           | 2 +-  4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index 9c28809..72fba56 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -962,6 +962,7 @@ extern tree build_real_imag_expr (location_t, enum tree_code, tree);  extern tree build_unary_op (location_t, enum tree_code, tree, bool);  extern tree build_binary_op (location_t, enum tree_code, tree, tree, int);  extern tree perform_integral_promotions (tree); +extern bool char_type_p (tree);    /* These functions must be defined by each front-end which implements     a variant of the C language.  They are used by port files.  */ diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index ed8ffe4..49b99b5 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -44,6 +44,7 @@ along with GCC; see the file COPYING3.  If not see  #include "gimplify.h"  #include "tree-inline.h"  #include "omp-general.h" +#include "c-family/c-common.h"  #include "c-family/c-objc.h"  #include "c-family/c-ubsan.h"  #include "cilk.h" @@ -3597,7 +3598,7 @@ parser_build_unary_op (location_t loc, enum tree_code code, struct c_expr arg)    /* Returns true if TYPE is a character type, *not* including wchar_t.  */   -static bool +bool  char_type_p (tree type)  {    return (type == char_type_node @@ -5766,6 +5767,7 @@ build_modify_expr (location_t location, tree lhs, tree lhs_origtype,         newrhs = in_late_binary_op ? save_expr (rhs) : c_save_expr (rhs);         rhseval = newrhs;       } +     newrhs = build_binary_op (location,       modifycode, lhs, newrhs, 1);   diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index f53f744..49a36c2 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -6685,7 +6685,6 @@ extern bool cv_qualified_p (const_tree);  extern tree cv_unqualified (tree);  extern special_function_kind special_function_p (const_tree);  extern int count_trees (tree); -extern int char_type_p (tree);  extern void verify_stmt_tree (tree);  extern linkage_kind decl_linkage (tree);  extern duration_kind decl_storage_duration (tree); diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index d3c63b8..e6c17f8 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -4394,7 +4394,7 @@ special_function_p (const_tree decl)    /* Returns nonzero if TYPE is a character type, including wchar_t.  */   -int +bool  char_type_p (tree type)  {    return (same_type_p (type, char_type_node) -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University