On Mon, Oct 29, 2012 at 7:28 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I think I found out something for my purpose. The macro should be CLVM_DEBUG.<br>
<br>
        IdentifierInfo& info = Context.Idents.get("CLVM_DEBUG");<br>
        if(info.hasMacroDefinition()) {<br>
            ...<br>
        }<br></blockquote><div><br></div><div>That looks correct.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
        else {<br>
             // Find SourceLocation of the first/last #define and add<br>
CLVM_DEBUG definition<br>
        }<br>
<br>
Is it safe to do this?<br>
I'm still wondering how to implement the else branch.<br></blockquote><div><br></div><div>Well, that seems not solvable in general, but in a code base that has some style rules, it might be solvable "well enough".</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">
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/Clang-get-list-of-defined-macro-tp4027815p4027816.html" target="_blank">http://clang-developers.42468.n3.nabble.com/Clang-get-list-of-defined-macro-tp4027815p4027816.html</a><br>

<div class="HOEnZb"><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>