From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway30.websitewelcome.com (gateway30.websitewelcome.com [192.185.198.26]) by sourceware.org (Postfix) with ESMTPS id E0297386F468 for ; Sat, 16 May 2020 18:18:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E0297386F468 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 49DDF7620 for ; Sat, 16 May 2020 13:18:51 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id a1OdjIYUeSl8qa1OdjdFg4; Sat, 16 May 2020 13:18:51 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=fbRBepur8JQhBTe0x2TlWGL85ZASeVXaWQOfurfdnyU=; b=phQ7A4LxGhUH1NZVEl6O7y+wlC lSz85h7BvT1ZlPZiuPCxfpZdpoltAJJ+PpNBrTywR3PXjG+WqAAYxDfxF5PMXBnMRp0/rIweYex1U xZp2gHyfg4rajtVqYR/4OHg95; Received: from 174-16-104-48.hlrn.qwest.net ([174.16.104.48]:38272 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1ja1Od-000Jgm-0T; Sat, 16 May 2020 12:18:51 -0600 From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , Simon Marchi via Gdb-patches Subject: Re: [PATCH 2/2] gdb: remove TYPE_NAME macro References: <20200514181812.25795-1-simon.marchi@efficios.com> <20200514181812.25795-2-simon.marchi@efficios.com> <877dxb7tuw.fsf@tromey.com> <62d1efcd-01bf-a23b-7608-4ba1f1bd8ebe@efficios.com> X-Attribution: Tom Date: Sat, 16 May 2020 12:18:50 -0600 In-Reply-To: <62d1efcd-01bf-a23b-7608-4ba1f1bd8ebe@efficios.com> (Simon Marchi's message of "Sat, 16 May 2020 12:35:50 -0400") Message-ID: <87367z7ng5.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 174.16.104.48 X-Source-L: No X-Exim-ID: 1ja1Od-000Jgm-0T X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174-16-104-48.hlrn.qwest.net (bapiya) [174.16.104.48]:38272 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 18:18:53 -0000 >>>>> "Simon" == Simon Marchi writes: Simon> No, coccinelle doesn't work on C++ unfortunately. When there's a C++ Simon> construct in a function, it just skips it it seems. Aha, cool. Simon> Also, coccinelle doesn't really allow to specify the output code style, Simon> so it just never puts a space before the parenthesis. I worked around Simon> that by making it use `a_very_unique_string` as the function name in its Simon> output, so I could easily replace it with the desired value with sed: Nice hack. FWIW I wrote some Emacs Lisp to do this kind of transform. However, it is mostly ad hoc -- I rewrite bits of it when I need a new change. I do have one that does the "function form to method form". The main drawbacks of this are that elisp is pretty slow, and of course it's relatively obscure. One of the big advantages is that I also taught it to write the ChangeLog entries... :-) https://github.com/tromey/gdb-refactoring-scripts For example maybe this one could have been done with emacs --script .../rewriter.el method TYPE_NAME name Tom