It solved the problem, thanks!<div><br></div><div><br></div><div>Sergejs<br><br><div class="gmail_quote">On Wed, Jan 30, 2013 at 4:42 PM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div class="h5">On Wed, Jan 30, 2013 at 3:37 PM, Sergejs Belajevs <span dir="ltr"><<a href="mailto:sergejs.belajevs@gmail.com" target="_blank">sergejs.belajevs@gmail.com</a>></span> wrote:<br>
</div></div><div class="gmail_extra">
<div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<div><br></div><div>we are working on source-to-source transformation tool based on clang and have a following problem. Example code:</div>
<div><br></div><div>void foo()</div><div>{</div><div> typedef int i32;</div>
<div> typedef i32 s32;</div><div> typedef i32 (*pfun)();</div><div><br></div><div> i32 a = (s32)0x1234u;</div><div>}</div><div><br></div><div>We want to rename i32, s32, pfun and all their occurrences in this function. We tried using VisitDeclRefExpr from clang::RecursiveASTVisitor, but it didn't walk through typedefs. We tried to use VisitTypedefType and it correctly visited all occurrences of i32/s32 for this function, but we haven't figured out how to get location information from clang::TypedefType to make actual renaming possible. </div>
</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br></div><div>What would be a working (best?) way to do it?</div></blockquote><div><br></div></div></div><div>Visit the corresponding TypeLoc (in this case VisitTypedefTypeLoc)</div><div><br></div><div>Cheers,</div>
<div>/Manuel</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br></div><div>Thanks,</div><div>Sergejs</div><div><br></div>
<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>
<br></blockquote></div><br></div></div>
</blockquote></div><br></div>