[PATCH] D40404: [APInt] Don't print debug messages from the APInt knuth division algorithm by default
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 24 11:13:55 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL318963: [APInt] Don't print debug messages from the APInt knuth division algorithm by… (authored by ctopper).
Changed prior to commit:
https://reviews.llvm.org/D40404?vs=124114&id=124233#toc
Repository:
rL LLVM
https://reviews.llvm.org/D40404
Files:
llvm/trunk/lib/Support/APInt.cpp
Index: llvm/trunk/lib/Support/APInt.cpp
===================================================================
--- llvm/trunk/lib/Support/APInt.cpp
+++ llvm/trunk/lib/Support/APInt.cpp
@@ -1252,6 +1252,14 @@
// b denotes the base of the number system. In our case b is 2^32.
const uint64_t b = uint64_t(1) << 32;
+// The DEBUG macros here tend to be spam in the debug output if you're not
+// debugging this code. Disable them unless KNUTH_DEBUG is defined.
+#pragma push_macro("DEBUG")
+#ifndef KNUTH_DEBUG
+#undef DEBUG
+#define DEBUG(X) do {} while (true)
+#endif
+
DEBUG(dbgs() << "KnuthDiv: m=" << m << " n=" << n << '\n');
DEBUG(dbgs() << "KnuthDiv: original:");
DEBUG(for (int i = m+n; i >=0; i--) dbgs() << " " << u[i]);
@@ -1391,6 +1399,8 @@
DEBUG(dbgs() << '\n');
}
DEBUG(dbgs() << '\n');
+
+#pragma pop_macro("DEBUG")
}
void APInt::divide(const WordType *LHS, unsigned lhsWords, const WordType *RHS,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40404.124233.patch
Type: text/x-patch
Size: 940 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171124/930e73a7/attachment.bin>
More information about the llvm-commits
mailing list