<div dir="ltr">Thanks David for the helpful information. Is there a way to filter the predefined macros such as __clang__, __GNUC__, etc.<br><br><div>I could not get the macros defined in my C code with the below code:<br><div>DIMacroNodeArray Macros = DICompUnit->getMacros();</div><div>for (auto *MN : Macros) {</div><div>    if (auto *M = dyn_cast<DIMacro>(MN)) {</div><div>        outs()<< M->getName();</div><div>    }</div><div>}<br><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 13, 2021 at 4:13 PM David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Add -fdebug-macro<br>
<br>
On Tue, Jul 13, 2021 at 4:05 PM Bella V via cfe-users<br>
<<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a>> wrote:<br>
><br>
> Hello All,<br>
><br>
> I'm trying to build a list of macros in a compilation unit using CU->getMacros().<br>
> I do not see the macros field in DICompileUnit output.<br>
> <a href="https://godbolt.org/z/b8cM1Yf7v" rel="noreferrer" target="_blank">https://godbolt.org/z/b8cM1Yf7v</a><br>
><br>
> Please let me know what I'm missing.<br>
><br>
> Many Thanks.<br>
><br>
> _______________________________________________<br>
> cfe-users mailing list<br>
> <a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users</a><br>
</blockquote></div>