From: Tom Tromey <tom@tromey.com>
To: Simon Marchi <simon.marchi@efficios.com>
Cc: Tom Tromey <tom@tromey.com>,
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 2/2] gdb: remove TYPE_NAME macro
Date: Sat, 16 May 2020 12:18:50 -0600 [thread overview]
Message-ID: <87367z7ng5.fsf@tromey.com> (raw)
In-Reply-To: <62d1efcd-01bf-a23b-7608-4ba1f1bd8ebe@efficios.com> (Simon Marchi's message of "Sat, 16 May 2020 12:35:50 -0400")
>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> 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
next prev parent reply other threads:[~2020-05-16 18:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-14 18:18 [PATCH 1/2] gdb: add type::name / type::set_name Simon Marchi
2020-05-14 18:18 ` [PATCH 2/2] gdb: remove TYPE_NAME macro Simon Marchi
2020-05-16 16:00 ` Tom Tromey
2020-05-16 16:35 ` Simon Marchi
2020-05-16 18:18 ` Tom Tromey [this message]
2020-05-16 19:10 ` Simon Marchi
2020-05-16 19:26 ` Tom Tromey
2020-05-16 19:33 ` Simon Marchi
2020-05-16 15:58 ` [PATCH 1/2] gdb: add type::name / type::set_name Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87367z7ng5.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox