<div dir="ltr"><div class="gmail_quote">On Fri, May 8, 2015 at 9:45 AM Miklos Vajna <<a href="mailto:vmiklos@vmiklos.hu">vmiklos@vmiklos.hu</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm trying to put together a tool based on libtooling that renames a<br>
class' member variable from the commandline.<br>
<br>
I got it to the level that it's useful in practice, but there is one<br>
case I can't handle: when the member variable is used in a macro that<br>
calls another macro.<br>
<br>
Here's how to use the tool:<br>
<br>
- Build it with 'make', then<br>
- bin/tool -dump -old-name=C::nX -new-name=m_nX test.cxx --<br>
<br>
If you replace the call to OUTER() to INNER() in test.cxx, then the<br>
rename is performed correctly. I guess it's something around how I call<br>
the source manager's getImmediateSpellingLoc(), but I'm not sure what's<br></blockquote><div><br></div><div>I think the immediate spelling location is only one level - have you tried just using the spelling location instead?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
the exact problem.<br>
<br>
Any ideas what I'm missing?<br>
<br>
I tested the code only with clang-3.5 that comes by default in openSUSE<br>
13.2, if SVN trunk is different in this regard, please let me know. I'm<br>
attaching the Makefile, the tool itself and the test input.<br>
<br>
Thanks,<br>
<br>
Miklos<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>