From patchwork Wed Sep 28 11:28:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 676146 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 3skb790LDpz9sC3 for ; Wed, 28 Sep 2016 21:28:34 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=wXNEl1aY; 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=weWVTmJ1F7JdMDOvg m8Ax4FzDj3tQBa/owhwd6XxhmrVnjTJSjVlqwWC5cCA2NtMmOb/L1ujII3R1WK+H gfy7CTTbJ3aEoJGMsOXekEyarCqG8rQRsDRpcqe7cOMnDZggiKJmv9S+JlqQOWFa jzMSixOvrfiwVIddPc6pfyjItQ= 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=N9VdSIbXD5aoQa7jOe+0QKQ va3E=; b=wXNEl1aYv1vMJZJss0IXYNHFw4aiMteB6sMX9lHWxpKGu+MIAlzibBs 5H3d1cl0l/TnZ++wbwvBQV6H1K0+tphNZbFI3N4OJM31KWlPKcQNdxUJa5F7NrT+ 43kGFCA98Or6Gh2EPBt3c0I6f54Ad6kv6cULS7FiIEL3vK+9Us8U= Received: (qmail 54459 invoked by alias); 28 Sep 2016 11:28:25 -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 54443 invoked by uid 89); 28 Sep 2016 11:28:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=UD:gimple-pretty-print.c, sk:dump_gi X-HELO: mail-qt0-f181.google.com Received: from mail-qt0-f181.google.com (HELO mail-qt0-f181.google.com) (209.85.216.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Sep 2016 11:28:14 +0000 Received: by mail-qt0-f181.google.com with SMTP id 11so20424360qtc.0 for ; Wed, 28 Sep 2016 04:28:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to; bh=7liegL9mhS2tdrUEZTE8L4Gs5cW2Mf5VZQcWU4UedYg=; b=OKpz/+pHNMNqyyWV58TSDvKs/YLyDvl/BT0jF8Fu6q3w40qsu/GMbdMTGZ6qolf/Vn AfUiOqNTxBcvPG8dIvTOIXizK/6HQhRb+Xn07ScutoLVcmGDWm4r5kMTC4UUTd3yOWLC IS0l3sAo4SRPG+2I2O4GQQNeYanMkZR+CNQ2zq3eN14eTIfUjUbzqJCiGnwPWWAf+Vyn Nxt4Fo9EDieCjwIK9b1WEXTR91VRBDwLuWnkdL1GjnRPAxrdySBncQ2VZQ+2MeHOAjUF v7Yy0YcdxsmSTsbOklTLc47Bz7q+iSP0SrzahUAOSJL+tJwIerPbE+wsI3JKTtSWhIDE +N1w== X-Gm-Message-State: AA6/9RmGxI/c3M1iIjekdtVyZd97u9f2+XTVlX1fSjMl82G4CNKKDkxjwvcVaE5jw0uZxw== X-Received: by 10.200.39.85 with SMTP id h21mr33000532qth.142.1475062093073; Wed, 28 Sep 2016 04:28:13 -0700 (PDT) Received: from ?IPv6:2601:181:c003:1930:3fe6:c217:b86a:6e86? ([2601:181:c003:1930:3fe6:c217:b86a:6e86]) by smtp.googlemail.com with ESMTPSA id a94sm3645370qkh.11.2016.09.28.04.28.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Sep 2016 04:28:12 -0700 (PDT) Subject: Re: internal fn pretty printing To: Bernd Schmidt , Richard Guenther , Jakub Jelinek References: <24f3b1f6-f094-34c9-cf8b-ff4caf0147fd@acm.org> Cc: GCC Patches From: Nathan Sidwell Message-ID: <11a246ea-9f50-003d-94e4-a1d2e11d1ee8@acm.org> Date: Wed, 28 Sep 2016 07:28:11 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: On 09/27/16 09:30, Bernd Schmidt wrote: > On 09/27/2016 12:58 PM, Nathan Sidwell wrote: >> In working on some new code I got sufficiently frustrated to implement >> pretty printing on internal function discriminators, as I think one of >> you suggested a while back. With this patch we get: >> >> .data_dep.2 = UNIQUE (OACC_FORK, .data_dep.2, -1); >> >> rather than an obscure raw integer for the first argument. I realized I could simplify the comma separator logic, by checking i for non-zeroness before emitting the arg. Committed as obvious. nathan 2016-09-28 Nathan Sidwell * gimple-pretty-print.c (dump_gimple_call_args): Simplify "' " printing. Index: gimple-pretty-print.c =================================================================== --- gimple-pretty-print.c (revision 240552) +++ gimple-pretty-print.c (working copy) @@ -649,26 +649,21 @@ dump_gimple_call_args (pretty_printer *b { i++; pp_string (buffer, enums[v]); - if (i < gimple_call_num_args (gs)) - pp_string (buffer, ", "); } } } for (; i < gimple_call_num_args (gs); i++) { - dump_generic_node (buffer, gimple_call_arg (gs, i), 0, flags, false); - if (i < gimple_call_num_args (gs) - 1) + if (i) pp_string (buffer, ", "); + dump_generic_node (buffer, gimple_call_arg (gs, i), 0, flags, false); } if (gimple_call_va_arg_pack_p (gs)) { - if (gimple_call_num_args (gs) > 0) - { - pp_comma (buffer); - pp_space (buffer); - } + if (i) + pp_string (buffer, ", "); pp_string (buffer, "__builtin_va_arg_pack ()"); }