Provide the same ABI regardless of NDEBUG
authorDmitri Gribenko <gribozavr@gmail.com>
Thu, 19 Feb 2015 05:30:16 +0000 (05:30 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Thu, 19 Feb 2015 05:30:16 +0000 (05:30 +0000)
commit07aa3556c450258ddab1d9442322e1e8fc3ae7c7
tree9fab9dda08c331579e1610e8b48add74dcba14a2
parent32f3cd95bb06dddf550730b69c332d5e31bcebc2
Provide the same ABI regardless of NDEBUG

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229819 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Debug.cpp
lib/Support/Valgrind.cpp