On Tue, Oct 30, 2012 at 2:47 PM, GabrieleCocco <span dir="ltr"><<a href="mailto:cocco@di.unipi.it" target="_blank">cocco@di.unipi.it</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">
Thank you for your answer.<br>
Unfortunately I haven-t been able to solve it yet. I'm find difficulties to<br>
find the source location of macro definitions to remove them.<br>
Moreover, I would like to ask you a question regarding macro expansion and<br>
AST. In the doxygen I read that "Locations from macros, etc are not<br>
rewritable.".<br>
Now, suppose I define a macro like the following:<br>
<br>
#define this_opencl_device(p, d) call_this_opencl_device(p, d);<br>
<br>
where call_this_opencl_device is a stub function only used to mark the code<br>
for analysis. After the analysis I would like to remove this call and<br>
produce a "cleaned" source.<br>
Unfortunately, the rewriter buffer doesn't contain the expanded macro (i.e.<br>
the call) but the macro name itself. Therefore I'm not able to remove it<br>
from the rewriter buffer (I tried).<br>
<br>
Any suggestion to walk around this problem?<br></blockquote><div><br></div><div>Without seeing your code, I'll not be able to help.</div><div><br></div><div>As far as I understand, the rewriter allows you to do textual replacements. Thus, you'll be able to remove macro calls - you'll "just" need to figure out where they are on the text level.</div>
<div><br></div><div><br></div><div>Cheers,</div><div>/Manuel</div><div> <br></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">

<br>
<br>
<br>
--<br>
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/Clang-get-list-of-defined-macro-tp4027815p4027838.html" target="_blank">http://clang-developers.42468.n3.nabble.com/Clang-get-list-of-defined-macro-tp4027815p4027838.html</a><br>

<div class=""><div class="h5">Sent from the Clang Developers mailing list archive at Nabble.com.<br>
_______________________________________________<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>