<div dir="ltr">+1, claiming the "DEBUG" macro is pretty hostile. Debug.h is included pretty widely from llvm/include/llvm/*, so we can't claim this is some internal macro that users won't see.</div><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Mar 23, 2018 at 9:18 AM Nicola Zaghen via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
We recently stumbled upon some issues with the DEBUG() macro being<br>
redefined in some internal libraries and some external ones, such as<br>
LLVM. After trying out a few ideas to avoid the problem we thought that<br>
the simplest solution would be to prefix all generic macro names in<br>
order to avoid clashes.<br>
<br>
A quick search showed that Mesa had a similar issue with DEBUG being<br>
used by LLVM and had a couple of proposed patches such as<br>
<a href="https://lists.freedesktop.org/archives/mesa-dev/2016-July/124111.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/archives/mesa-dev/2016-July/124111.html</a><br>
and <a href="https://lists.freedesktop.org/archives/mesa-dev/2016-June/120738.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/archives/mesa-dev/2016-June/120738.html</a><br>
<br>
I noticed that others have left comments in the LLVM source about the<br>
same issue, so I decided to try to replace all DEBUG() uses with<br>
LLVM_DEBUG() and remove the old macro.<br>
A review for the LLVM side of the patch is here:<br>
<a href="https://reviews.llvm.org/D43624" rel="noreferrer" target="_blank">https://reviews.llvm.org/D43624</a>, this was generated mostly by a<br>
find/replace regex.<br>
<br>
This kind of change is quite invasive (~500 files) and might be<br>
disruptive to multiple parties. One possible way to avoid some of the<br>
disruption would be to keep arond the old macro during a transition<br>
period in which it would be "deprecated".<br>
<br>
Thoughts?<br>
<br>
Thanks,<br>
Nicola<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>