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

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 16 08:39:30 PDT 2018


kuhar added a comment.

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.

> 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.

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.



================
Comment at: include/llvm/Support/Debug.h:15
+// In particular, just wrap your code with the LLVM_DEBUG() macro, and it will
+// be
 // enabled automatically if you specify '-debug' on the command-line.
----------------
I think this formatting should be fixed manually


https://reviews.llvm.org/D43624





More information about the llvm-commits mailing list