<br><br><div class="gmail_quote">On Fri, Nov 2, 2012 at 10:34 PM, Iestyn Bleasdale-Shepherd <span dir="ltr"><<a href="mailto:iestyn@valvesoftware.com" target="_blank">iestyn@valvesoftware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







<div>
<font face="Calibri"><span style="font-size:11pt">
<div>Hi,</div>
<div> </div>
<div>When using the libclang API, ‘#define’ statements yield cursors, but ‘#undefine’ statements do not.</div>
<div> </div>
<div>Without a record of #undefines, I can’t determine which #defines are extant at any given point in the code, and am thus unable to fully determine dependencies between source files.</div>
<div> </div>
<div>Is it possible to determine which #defines are active for a given source location, or would the addition of #undefine cursors be a reasonable feature request for the libclang API?</div>
<div> </div>
<div> </div>
<div>Thanks!</div><span class="HOEnZb"><font color="#888888">
<div> </div>
<div>iestyn Bleasdale-Shepherd</div>
<div> </div>
</font></span></span></font>
</div><br></blockquote><div><br>Well, you are lucky in that a good chunk of work went on recently into what was called "Macro History" whose goal is exactly to remember every single #define/#undef that a macro encountered in the pre-processing of the translation unit. Therefore, using this macro history, it should be possible to extract this information.<br>
<br>Unfortunately, I do not know the exact API, Alexander Kornienko initiated the work on this, so he probably followed it, I have added him in CC so he can help us figure out exactly where this feature stands.<br><br>-- Matthieu<br>
 </div></div>