<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Daniel,<br>
<br>
The removal was discussed on the mailing list back in March
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/pipermail/llvm-dev/2018-March/122097.html">http://lists.llvm.org/pipermail/llvm-dev/2018-March/122097.html</a>,
but you make a good point: an email to let people know that the
change is actually in and with some instructions would be a good
thing to do. I'll look into it now.<br>
<br>
Regarding the quick replace -> remove, this was also part of
the email (and also the review of the change). It was done so
quickly because every day people would add new uses of the DEBUG()
macro as it would have kept working the same way, which would then
left us with two equivalent macros for a long time.<br>
<br>
With regards to the sed command I provided, I thought sed would be
"fairly recent" on all systems, but it seems like the version
shipped with macOS is quite dated (or at least lacks features).<br>
I tried rewriting it with awk but I had the same issue.<br>
Currently I have this perl one which worked fine on both Linux
(Ubuntu 16.04) and macOS 10.13 with a fresh git clone of
llvm-mirror. <br>
<br>
git grep -l 'DEBUG' | xargs perl -pi -e
's/\bDEBUG\s?\(/LLVM_DEBUG(/g'<br>
<br>
Can you test it out and let me know if it works for you? I'd like
to have one that works on multiple platforms so I can eventually
update the release notes and email llvm-dev with it (in the
"change has been completed" email).<br>
<br>
Thanks,<br>
Nicola<br>
</p>
<br>
<div class="moz-cite-prefix">On 24/05/18 17:43, Daniel Sanders
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:5CE9302B-423A-49EA-A622-24CE5D7C960A@apple.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
Hi Nicola,
<div class=""><br class="">
</div>
<div class="">This removal should get an email on llvm-dev and a
mention in the release notes since there's a lot of out-of-tree
projects that are going to be broken by this change and won't
have noticed the llvm-commits post. In my case I can't find the
earlier commits that added LLVM_DEBUG in my mailbox so I'm not
sure what happened there, maybe it was filtered out for being
too large. Some projects will notice when they're pulling the
trunk into their downstream repo's (like we did :-) ) but there
will also be another wave when we do the next release as there's
also out of tree targets that don't closely track trunk.</div>
<div class=""><br class="">
</div>
<div class="">It's also worth mentioning the merge pain that the
very quick removal is going to cause. I'm reluctant to mention
this since I believe it isn't LLVM's responsibility to account
for it (it's ours) but this case is a bit special in that it's
likely to hit an unusually large number of merges over the next
few years. As bugs are fixed in existing releases, it's common
to merge those fixes into the current code-base so that the bugs
aren't introduced again. Effectively that means that some
branches are using DEBUG() and others are using LLVM_DEBUG() and
the practical result of this is that any merges containing or
near lines with the DEBUG() macro are going result in merge
conflicts. Probably the least painful way to resolve it is to
re-introduce DEBUG() locally but I don't like that solution
because we'll never make the switch. Unfortunately making the
switch on all branches probably isn't an option either. I'm
going to have a think on how best to deal with this.</div>
<div class=""><br class="">
</div>
<div class="">By the way, the sed command from your earlier commit
doesn't work on macOS because -i has a mandatory argument and \b
isn't supported. Even with those issues fixed I end up with:</div>
<div class=""><span style="caret-color: rgb(241, 241, 241); color:
rgb(241, 241, 241); font-family: Menlo; font-size: 11px;
background-color: rgb(0, 0, 0);" class="">sed: RE error:
illegal byte sequence</span></div>
<div class=""><br class="">
</div>
<div class="">This seems to work though:</div>
<div class="">
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(241, 241,
241); background-color: rgb(0, 0, 0);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">for
f in $(grep -rlw --exclude-dir=.git 'DEBUG' .);</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(241, 241,
241); background-color: rgb(0, 0, 0);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">do</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(241, 241,
241); background-color: rgb(0, 0, 0);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">
echo $f</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(241, 241,
241); background-color: rgb(0, 0, 0);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">
sed -i '.bak' -e 's/[[:<:]]DEBUG[[:>:]][
\t]*(/LLVM_DEBUG(/g' $f;</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(241, 241,
241); background-color: rgb(0, 0, 0);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">done</span></div>
</div>
<div class="">
<div><br class="">
</div>
<div>
<blockquote type="cite" class="">
<div class="">On 23 May 2018, at 08:09, Nicola Zaghen via
llvm-commits <<a
href="mailto:llvm-commits@lists.llvm.org" class=""
moz-do-not-send="true">llvm-commits@lists.llvm.org</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Author: nzaghen<br class="">
Date: Wed May 23 08:09:29 2018<br class="">
New Revision: 333091<br class="">
<br class="">
URL: <a
href="http://llvm.org/viewvc/llvm-project?rev=333091&view=rev"
class="" moz-do-not-send="true">http://llvm.org/viewvc/llvm-project?rev=333091&view=rev</a><br
class="">
Log:<br class="">
Remove DEBUG macro.<br class="">
<br class="">
Now that the LLVM_DEBUG() macro landed on the various
sub-projects<br class="">
the DEBUG macro can be removed.<br class="">
Also change the new uses of DEBUG to LLVM_DEBUG.<br
class="">
<br class="">
Differential Revision: <a
href="https://reviews.llvm.org/D46952" class=""
moz-do-not-send="true">https://reviews.llvm.org/D46952</a><br
class="">
<br class="">
<br class="">
Modified:<br class="">
llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASupport.h<br class="">
llvm/trunk/include/llvm/Support/Debug.h<br class="">
llvm/trunk/lib/Target/X86/X86DomainReassignment.cpp<br
class="">
llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp<br
class="">
llvm/trunk/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp<br class="">
llvm/trunk/lib/Transforms/Vectorize/VPlanVerifier.cpp<br
class="">
llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp<br
class="">
<br class="">
Modified:
llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASupport.h<br
class="">
URL: <a
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASupport.h?rev=333091&r1=333090&r2=333091&view=diff"
class="" moz-do-not-send="true">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASupport.h?rev=333091&r1=333090&r2=333091&view=diff</a><br
class="">
==============================================================================<br
class="">
---
llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASupport.h
(original)<br class="">
+++
llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASupport.h
Wed May 23 08:09:29 2018<br class="">
@@ -22,14 +22,6 @@<br class="">
#define NOMINMAX<br class="">
#endif<br class="">
<br class="">
-// llvm/Support/Debug.h unconditionally #defines DEBUG
as a macro.<br class="">
-// DIA headers #define it if it is not already defined,
so we have<br class="">
-// an order of includes problem. The real fix is to
make LLVM use<br class="">
-// something less generic than DEBUG, such as
LLVM_DEBUG(), but it's<br class="">
-// fairly prevalent. So for now, we save the
definition state and<br class="">
-// restore it.<br class="">
-#pragma push_macro("DEBUG")<br class="">
-<br class="">
// atlbase.h has to come before windows.h<br class="">
#include <atlbase.h><br class="">
#include <windows.h><br class="">
@@ -39,6 +31,4 @@<br class="">
#include <dia2.h><br class="">
#include <diacreate.h><br class="">
<br class="">
-#pragma pop_macro("DEBUG")<br class="">
-<br class="">
#endif // LLVM_DEBUGINFO_PDB_DIA_DIASUPPORT_H<br
class="">
<br class="">
Modified: llvm/trunk/include/llvm/Support/Debug.h<br
class="">
URL: <a
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Debug.h?rev=333091&r1=333090&r2=333091&view=diff"
class="" moz-do-not-send="true">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Debug.h?rev=333091&r1=333090&r2=333091&view=diff</a><br
class="">
==============================================================================<br
class="">
--- llvm/trunk/include/llvm/Support/Debug.h (original)<br
class="">
+++ llvm/trunk/include/llvm/Support/Debug.h Wed May 23
08:09:29 2018<br class="">
@@ -118,8 +118,6 @@ raw_ostream &dbgs();<br class="">
//<br class="">
#define LLVM_DEBUG(X) DEBUG_WITH_TYPE(DEBUG_TYPE, X)<br
class="">
<br class="">
-#define DEBUG(X) LLVM_DEBUG(X)<br class="">
-<br class="">
} // end namespace llvm<br class="">
<br class="">
#endif // LLVM_SUPPORT_DEBUG_H<br class="">
<br class="">
Modified:
llvm/trunk/lib/Target/X86/X86DomainReassignment.cpp<br
class="">
URL: <a
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86DomainReassignment.cpp?rev=333091&r1=333090&r2=333091&view=diff"
class="" moz-do-not-send="true">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86DomainReassignment.cpp?rev=333091&r1=333090&r2=333091&view=diff</a><br
class="">
==============================================================================<br
class="">
--- llvm/trunk/lib/Target/X86/X86DomainReassignment.cpp
(original)<br class="">
+++ llvm/trunk/lib/Target/X86/X86DomainReassignment.cpp
Wed May 23 08:09:29 2018<br class="">
@@ -753,7 +753,7 @@ bool
X86DomainReassignment::runOnMachine<br class="">
}<br class="">
<br class="">
for (Closure &C : Closures) {<br class="">
- DEBUG(C.dump(MRI));<br class="">
+ LLVM_DEBUG(C.dump(MRI));<br class="">
if (isReassignmentProfitable(C, MaskDomain)) {<br
class="">
reassign(C, MaskDomain);<br class="">
++NumClosuresConverted;<br class="">
<br class="">
Modified:
llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp<br
class="">
URL: <a
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=333091&r1=333090&r2=333091&view=diff"
class="" moz-do-not-send="true">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=333091&r1=333090&r2=333091&view=diff</a><br
class="">
==============================================================================<br
class="">
--- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp
(original)<br class="">
+++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Wed
May 23 08:09:29 2018<br class="">
@@ -645,8 +645,8 @@ void
MergeFunctions::filterInstsUnrelate<br class="">
static bool isThunkProfitable(Function * F) {<br
class="">
if (F->size() == 1) {<br class="">
if (F->front().size() <= 2) {<br class="">
- DEBUG(dbgs() << "isThunkProfitable: "
<< F->getName()<br class="">
- << " is too small to bother
creating a thunk for\n");<br class="">
+ LLVM_DEBUG(dbgs() << "isThunkProfitable: "
<< F->getName()<br class="">
+ << " is too small to
bother creating a thunk for\n");<br class="">
return false;<br class="">
}<br class="">
}<br class="">
<br class="">
Modified:
llvm/trunk/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp<br
class="">
URL: <a
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp?rev=333091&r1=333090&r2=333091&view=diff"
class="" moz-do-not-send="true">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp?rev=333091&r1=333090&r2=333091&view=diff</a><br
class="">
==============================================================================<br
class="">
---
llvm/trunk/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp
(original)<br class="">
+++
llvm/trunk/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp
Wed May 23 08:09:29 2018<br class="">
@@ -116,7 +116,7 @@ VPBasicBlock
*PlainCFGBuilder::getOrCrea<br class="">
return BlockIt->second;<br class="">
<br class="">
// Create new VPBB.<br class="">
- DEBUG(dbgs() << "Creating VPBasicBlock for "
<< BB->getName() << "\n");<br class="">
+ LLVM_DEBUG(dbgs() << "Creating VPBasicBlock for
" << BB->getName() << "\n");<br class="">
VPBasicBlock *VPBB = new
VPBasicBlock(BB->getName());<br class="">
BB2VPBB[BB] = VPBB;<br class="">
VPBB->setParent(TopRegion);<br class="">
@@ -314,7 +314,7 @@ void
VPlanHCFGBuilder::buildHierarchical<br class="">
PlainCFGBuilder PCFGBuilder(TheLoop, LI, Plan);<br
class="">
VPRegionBlock *TopRegion =
PCFGBuilder.buildPlainCFG();<br class="">
Plan.setEntry(TopRegion);<br class="">
- DEBUG(Plan.setName("HCFGBuilder: Plain CFG\n");
dbgs() << Plan);<br class="">
+ LLVM_DEBUG(Plan.setName("HCFGBuilder: Plain CFG\n");
dbgs() << Plan);<br class="">
<br class="">
Verifier.verifyHierarchicalCFG(TopRegion);<br class="">
}<br class="">
<br class="">
Modified:
llvm/trunk/lib/Transforms/Vectorize/VPlanVerifier.cpp<br
class="">
URL: <a
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/VPlanVerifier.cpp?rev=333091&r1=333090&r2=333091&view=diff"
class="" moz-do-not-send="true">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/VPlanVerifier.cpp?rev=333091&r1=333090&r2=333091&view=diff</a><br
class="">
==============================================================================<br
class="">
---
llvm/trunk/lib/Transforms/Vectorize/VPlanVerifier.cpp
(original)<br class="">
+++
llvm/trunk/lib/Transforms/Vectorize/VPlanVerifier.cpp
Wed May 23 08:09:29 2018<br class="">
@@ -120,7 +120,7 @@ void
VPlanVerifier::verifyHierarchicalCF<br class="">
if (!EnableHCFGVerifier)<br class="">
return;<br class="">
<br class="">
- DEBUG(dbgs() << "Verifying VPlan H-CFG.\n");<br
class="">
+ LLVM_DEBUG(dbgs() << "Verifying VPlan
H-CFG.\n");<br class="">
assert(!TopRegion->getParent() && "VPlan
Top Region should have no parent.");<br class="">
verifyRegionRec(TopRegion);<br class="">
}<br class="">
<br class="">
Modified:
llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp<br
class="">
URL: <a
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp?rev=333091&r1=333090&r2=333091&view=diff"
class="" moz-do-not-send="true">http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp?rev=333091&r1=333090&r2=333091&view=diff</a><br
class="">
==============================================================================<br
class="">
--- llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp
(original)<br class="">
+++ llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp Wed
May 23 08:09:29 2018<br class="">
@@ -4063,7 +4063,7 @@ std::vector<Matcher *>
GlobalISelEmitter<br class="">
}<br class="">
ProcessCurrentGroup();<br class="">
<br class="">
- DEBUG(dbgs() << "NumGroups: " <<
NumGroups << "\n");<br class="">
+ LLVM_DEBUG(dbgs() << "NumGroups: " <<
NumGroups << "\n");<br class="">
assert(CurrentGroup->empty() && "The last
group wasn't properly processed");<br class="">
return OptRules;<br class="">
}<br class="">
<br class="">
<br class="">
_______________________________________________<br
class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" class=""
moz-do-not-send="true">llvm-commits@lists.llvm.org</a><br
class="">
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>
<br>
</body>
</html>