[PATCH] D50232: Fix modules build with different technique to suppress Knuth debugging

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 3 02:21:04 PDT 2018


t.p.northover created this revision.
t.p.northover added a reviewer: craig.topper.
Herald added a subscriber: mcrosier.

Currently we use `#pragma push_macro(LLVM_DEBUG)` to fiddle with the LLVM_DEBUG macro so that we can silence debugging the Knuth division algorithm unless it's actually desired. Unfortunately this is incompatible with enabling modules while building LLVM (via `LLVM_ENABLE_MODULES=ON`) because the macro then has incompatible definitions in a single translation unit.

This patch changes the Knuth division function to use a special `KNUTH_DEBUG` throughout, which can be #defined to `LLVM_DEBUG` if debug output is desired. A default implementation doing nothing is provided locally (rather than in `include/llvm/Support/Debug.h`).


Repository:
  rL LLVM

https://reviews.llvm.org/D50232

Files:
  lib/Support/APInt.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50232.158948.patch
Type: text/x-patch
Size: 6299 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180803/401674f1/attachment.bin>


More information about the llvm-commits mailing list