[PATCH] D43624: Change DEBUG() macro to LLVM_DEBUG()

Nicola Zaghen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 16 09:02:12 PDT 2018


Nicola added a comment.

In https://reviews.llvm.org/D43624#1040234, @kuhar wrote:

> In https://reviews.llvm.org/D43624#1040196, @Nicola wrote:
>
> > Updated the patch to trunk at 327699. I don't have commit rights so I cannot submit it, can you do it?
> >
> > Should I open a review to change the DEBUG() macro in clang too? They use the LLVM one, so not having it will introduce build breaks. The patch for them should be quite small.
>
>
> Note that there are much more (sub)projects within LLVM that use the DEBUG macro the patch shouldn't break. There are also countless downstream projects that will be affected and some other people will have to refactor them.


I understand the concern, that's why I checked the "main" projects: libcxx, lld, compiler-rt and lldb and none of them use the macro. clang is the only one that does (as far as I can tell)
Which other projects should I be checking?

>> The DEBUG() macro is too generic so it might clash with other projects.
> 
> I understand the argument and agree in general, but are there some known problems with such clashes? I think this patch is going to cause quite a hassle to many users and I would like to understand the motivation better. Maybe it would be a better idea to explain the situation in more detail and post it as an RFC on llvm-dev.

There are (were, at least?) clashes with other open source projects, such as MESA: https://lists.freedesktop.org/archives/mesa-dev/2016-July/124111.html and they ended up renaming DEBUG into MESA_DEBUG to avoid clashing with LLVM.
Thanks for pointing out about the RFC, I didn't think about it. I'll write up a post for llvm-dev in the coming days.

> Have you thought of leaving the old DEBUG macro around and making it an alias for the new LLVM_DEBUG? The old macro can be considered deprecated for some time before it gets completely removed, but this way the could give users some time to transition instead of breaking everything at once.

I did think about leaving the old DEBUG macro around, that would make things easier on the breakage side. The issue is that we would need a way to deprecate the macro so that people stop using it and switch to the new one.
We could have a transition period in which we have both macros, but the "old" DEBUG macro should eventually be removed.


https://reviews.llvm.org/D43624





More information about the llvm-commits mailing list