From patchwork Mon Nov 14 18:18:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 82163 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1142014qge; Mon, 14 Nov 2016 10:18:46 -0800 (PST) X-Received: by 10.99.61.74 with SMTP id k71mr71404263pga.9.1479147526070; Mon, 14 Nov 2016 10:18:46 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id h75si23141445pfk.290.2016.11.14.10.18.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 10:18:46 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-441391-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-441391-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-441391-patch=linaro.org@gcc.gnu.org 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=h3AaintyOKS9R5zEQlFmU4AFpuEjX2SEdbxzC7KRgJSUPYpMP4 DBatTrAgsTG02YydIRRnNIPekwvmC/5Q0Hoj7V9updiSJf+NU7hUzCztZA/NFU9j /2Hgf8Df8b+UdT2SMVvpDfxCFpYWM/NSbB5a0n8egPhUC5U7kZqw4ZUsw= 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=hb6xjieAzMib8cGOu7ru6zXS3NY=; b=k4kjVEmpemyQ3s7BTtmW Ip5Qg3e+svzMTanK28ie/kY3BV2ooo/FzCSFOO8J/n5Ohk+6xofT4MLXUjIoA7oq xQR97BvijFX0ZhI2mUQ+KKB33/eRTFTnOladseyh3wbwKYSvqfbu4boUtzuKm1wY NSuRf1O5FxA731/L9rDis7k= Received: (qmail 45427 invoked by alias); 14 Nov 2016 18:18:17 -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 44107 invoked by uid 89); 14 Nov 2016 18:18:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: cc-smtpout3.netcologne.de Received: from cc-smtpout3.netcologne.de (HELO cc-smtpout3.netcologne.de) (89.1.8.213) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Nov 2016 18:18:06 +0000 Received: from cc-smtpin2.netcologne.de (cc-smtpin2.netcologne.de [89.1.8.202]) by cc-smtpout3.netcologne.de (Postfix) with ESMTP id 86894128F0; Mon, 14 Nov 2016 19:18:02 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin2.netcologne.de (Postfix) with ESMTP id 82E3511DE7; Mon, 14 Nov 2016 19:18:02 +0100 (CET) Received: from [78.35.170.112] (helo=cc-smtpin2.netcologne.de) by localhost with ESMTP (eXpurgate 4.1.9) (envelope-from ) id 5829ffda-022c-7f0000012729-7f000001d34f-1 for ; Mon, 14 Nov 2016 19:18:02 +0100 Received: from [192.168.178.20] (xdsl-78-35-170-112.netcologne.de [78.35.170.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cc-smtpin2.netcologne.de (Postfix) with ESMTPSA; Mon, 14 Nov 2016 19:18:01 +0100 (CET) To: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Subject: [patch, fortran, committed] Allow dumping of code in Fortran syntax tree Message-ID: Date: Mon, 14 Nov 2016 19:18:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 Hello world, I have just committed the attached patch as obvious. No test case, the function is only supposed to be called when debugging the compiler itself. Regards Thomas 2016-11-14 Thomas Koenig * dump-parse-tree.c (show_code): Add prototype. (gfc_debug_code): New function. (show_code_node): Add space after SELECT TYPE. Index: dump-parse-tree.c =================================================================== --- dump-parse-tree.c (Revision 242335) +++ dump-parse-tree.c (Arbeitskopie) @@ -47,6 +47,7 @@ static FILE *dumpfile; static void show_expr (gfc_expr *p); static void show_code_node (int, gfc_code *); static void show_namespace (gfc_namespace *ns); +static void show_code (int, gfc_code *); /* Allow dumping of an expression in the debugger. */ @@ -62,7 +63,19 @@ gfc_debug_expr (gfc_expr *e) dumpfile = tmp; } +/* Allow for dumping of a piece of code in the debugger. */ +void gfc_debug_code (gfc_code *c); +void +gfc_debug_code (gfc_code *c) +{ + FILE *tmp = dumpfile; + dumpfile = stderr; + show_code (1, c); + fputc ('\n', dumpfile); + dumpfile = tmp; +} + /* Do indentation for a specific level. */ static inline void @@ -1987,7 +2000,7 @@ show_code_node (int level, gfc_code *c) case EXEC_SELECT_TYPE: d = c->block; if (c->op == EXEC_SELECT_TYPE) - fputs ("SELECT TYPE", dumpfile); + fputs ("SELECT TYPE ", dumpfile); else fputs ("SELECT CASE ", dumpfile); show_expr (c->expr1);