From patchwork Mon Apr 4 12:17:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 605858 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 3qdrbJ5V00z9s4x for ; Mon, 4 Apr 2016 22:17:32 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=W4Xgv5b6; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=kf79ATGALjKqK3RN7YUqnMcywZW8aldQYyrXYcPt9/cDM9glLa q1+ZWD6OSKhI0wiSqM0xx6T66ZbaFa2E/Lwztbn3Ro5aJxxWD3qWnG0t0WeOsLeX qXsl89PsZEr8VcnSXYOtQMMCrzshjz/oqjTo0q1ubf/qoeYSxXeIK7KA0= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=H/fyMUWKJ5eUFAB1y3lNdQ8Ao3k=; b=W4Xgv5b6YrRV2vICa5eJ B9k6UEQjxrEpDY1kDQ3yktZg7nW1YsjRrQkAzG7mn1kF7Usn4QWDM9X7F/sZ8rH0 wNhjP0nWuCJLs/tFW/pxni00uNtM3wrzgxdlG0Qh4AHN9qeAQxL0sMb0rZ8LHLK6 lsJi9pQobva+tef0egQ9lCc= Received: (qmail 47262 invoked by alias); 4 Apr 2016 12:17: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 47253 invoked by uid 89); 4 Apr 2016 12:17:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1370 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 04 Apr 2016 12:17:11 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1an3RN-00038f-K8 from Tom_deVries@mentor.com for gcc-patches@gcc.gnu.org; Mon, 04 Apr 2016 05:17:09 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Mon, 4 Apr 2016 13:17:08 +0100 To: GCC Patches From: Tom de Vries Subject: [PATCH, trivial, 2/3] Fix record-shape escapes in pp_write_text_as_dot_label_to_stream Message-ID: <57025B40.3040403@mentor.com> Date: Mon, 4 Apr 2016 14:17:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 Hi, this patch fixes the classification of the chars '{}<> ' in pp_write_text_as_dot_label_to_stream. They're currently marked as always-escape, but that's incorrect, they should be marked as escape-for-record. Bootstrapped and reg-tested on x86_64. Will commit to stage1 trunk as trivial. Thanks, - Tom Fix record-shape escapes in pp_write_text_as_dot_label_to_stream 2016-04-04 Tom de Vries * pretty-print.c (pp_write_text_as_dot_label_to_stream): Classify chars '{}<> ' as escape-for-record. --- gcc/pretty-print.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c index f6e4b43..c3a90a7 100644 --- a/gcc/pretty-print.c +++ b/gcc/pretty-print.c @@ -170,19 +170,19 @@ pp_write_text_as_dot_label_to_stream (pretty_printer *pp, bool for_record) escape_char = true; break; - /* A pipe is only special for record-shape nodes. */ + /* The following characters are only special for record-shape nodes. */ case '|': + case '{': + case '}': + case '<': + case '>': + case ' ': escape_char = for_record; break; /* The following characters always have to be escaped for use in labels. */ - case '{': - case '}': - case '<': - case '>': case '"': - case ' ': escape_char = true; break;