Hello,<div><br></div><div>thanks for everyone that have helped me to sort out the problems. Finally I've managed to make it work correctly to all cases (at least the ones I've found), and I'm glad to share it here if someone is interested:</div>
<div><br></div><div><a href="https://github.com/scooterman/clang-tools">https://github.com/scooterman/clang-tools</a></div><div><br></div><div>There are some minor things that could improve the tool. It would be desirable to not change all constructors, but as while parsing I'm receiving the initializers on the declared order already this would require me to get the original source as string, strip all spaces and newlines, and compare the resulting string with the newly ordered one. I don't know if its worth to do that anyway.</div>
<div><br></div><div>Now the next one I'm thinking to implement is a tool to automatically add default values to variables.</div><div><br></div><div><br></div><div>Thanks again!</div><div><br></div><div><br><br><div class="gmail_quote">
2012/8/19 Philip Craig <span dir="ltr"><<a href="mailto:philipjcraig@gmail.com" target="_blank">philipjcraig@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, Aug 20, 2012 at 11:08 AM, Philip Craig <<a href="mailto:philipjcraig@gmail.com">philipjcraig@gmail.com</a>> wrote:<br>
> On Mon, Aug 20, 2012 at 10:31 AM, Victor Vicente de Carvalho<br>
> <<a href="mailto:victor.v.carvalho@gmail.com">victor.v.carvalho@gmail.com</a>> wrote:<br>
</div><div class="im">>> I've just tried to dump the construct xml using clang -dump-ast-xml, and<br>
>> that's what I've got:<br>
><br>
> That uses DumpXML.cpp, which only has a stub for CXXCtorInitializer,<br>
> so it won't show them. I'm using a tool based on RecursiveASTVisitor<br>
> to dump it instead.<br>
<br>
</div>Try clang -ast-dump instead. It does show all of the<br>
CXXCtorInitializer (in a partially pretty-printed form). And you can<br>
see by changing the member order that the initializer order also<br>
changes.<br>
</blockquote></div><br></div>