<div dir="ltr">On Sat, Jan 26, 2013 at 12:52 PM, JohnH <span dir="ltr"><<a href="mailto:jan.hoogerbrugge@gmail.com" target="_blank">jan.hoogerbrugge@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The result of rewriting should be preprocessed code. I can imagine that there<br>
are applications where<br>
you want unpreprocessed output so perhaps the Rewriter class should have the<br>
option to work in<br>
the preprocessed and the unpreprocessed domain.<br></blockquote><div><br></div><div style>As far as I understand, the Rewriter works on the actual source code. We've done refactorings which work inside macros without problems - the hard part is getting the right source locations, the Rewriter deals with whatever source locations you throw at it.</div>
<div style><br></div><div style>Clang has in principle all information you need to deal with macros, but sometimes it's hard to get to them :)</div><div style>You'll obviously not be able to refactor arbitrarily crazy token-pasted code, but I've not seen this to be a problem in practice.</div>
<div style><br></div><div style>Similar problems exist with templates, by the way: for example, if you want to rename Foo::f to Foo::g, and you instantiate a template with Foo which calls f(), you cannot figure out in general whether renaming the call to f() is correct.</div>
<div style><br></div><div style>Cheers,</div><div style>/Manuel</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
--<br>
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/Rewriter-in-a-macro-tp4030056p4030078.html" target="_blank">http://clang-developers.42468.n3.nabble.com/Rewriter-in-a-macro-tp4030056p4030078.html</a><br>

<div class="im HOEnZb">Sent from the Clang Developers mailing list archive at Nabble.com.<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">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>
</div></div></blockquote></div><br></div></div>