[PATCH] Provide the same ABI regardless of NDEBUG

Dmitri Gribenko gribozavr at gmail.com
Sun Feb 15 22:58:37 PST 2015


Hi chandlerc, silvas, t.p.northover,

For projects depending on LLVM, I find it very useful to combine a release-no-asserts build of LLVM with a debug+asserts build of the dependent project.  The motivation is that when developing an dependent project, you are debugging that project itself, not LLVM.  In my usecase, a significant part of the runtime is spent in LLVM optimization passes, so I would like to build LLVM without assertions to get the best performance from this combination.

Currently, `lib/Support/Debug.cpp` changes the set of symbols it provides depending on NDEBUG, while `include/llvm/Support/Debug.h` requires a different extra symbols when NDEBUG is not defined.  Thus, it is not possible to enable assertions in an external project that uses facilities of `Debug.h`.

This patch changes `Debug.cpp` and `Valgrind.cpp` to always define the symbols that other code may depend on when #including LLVM headers without NDEBUG.

http://reviews.llvm.org/D7662

Files:
  lib/Support/Debug.cpp
  lib/Support/Valgrind.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7662.20002.patch
Type: text/x-patch
Size: 4806 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150216/c65f2564/attachment.bin>


More information about the llvm-commits mailing list