<div dir="ltr">On Tue, Sep 3, 2013 at 2:52 PM, Richard <span dir="ltr"><<a href="mailto:legalize@xmission.com" target="_blank">legalize@xmission.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
In article <CAGCO0KgQ5wdA9-8ZZ7kvijTbpBkbLLPmbxCSdNWdaEsZq=<a href="mailto:P6XA@mail.gmail.com">P6XA@mail.gmail.com</a>>,<br>
    Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> writes:<br>
<br>
> Awesome. Thanks for everyone replying. I'll plan to do the rename tonight<br>
> so beware the outstanding patches. =D<br>
<br>
I recently did some playing around with libtooling to understand how<br>
to create an automated refactoring.<br>
<br>
I could contribute it to clang-modernize if people think it's<br>
appropriate.<br>
<br>
The tool replaces an argument list of "(void)" with "()".<br>
<br>
I have it drilling down into most places, but I am still a little<br>
sketchy on how to get it to recognize that:<br>
<br>
        void some_function_taking_fn_ptrs(<br>
                void (*fn_ptr)(void (*fn_void_ptr)(void)));<br>
<br>
should become<br>
<br>
        void some_function_taking_fn_ptrs(<br>
                void (*fn_ptr(void (*fn_void_ptr)()));<br>
<br>
This nesting of function pointer types can obviously occur farther and<br>
farther down into an "inline" type declaration.<br>
<br>
My questions for this audience are:<br>
<br>
1) is this considered a "modernizing" transform that is appropriate<br>
   for clang-modernize?<br></blockquote><div><br></div><div>Maybe?  Some people might consider it more of a style choice.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

2) how do I walk arbitrary type declarations like this without having<br>
   to re-invent parsing the type expressions?<br><br></blockquote><div>You walk type declarations using TypeSourceInfo: FunctionTypeLoc has functions to retrieve the LParen and RParen locations for a function type declaration.</div>
<div><br></div><div>-Eli </div></div></div></div>