[llvm-dev] Errors linking with LLVM 5.0 - dump() missing

David Keaton via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 25 18:47:13 PDT 2017

On 09/25/2017 06:19 PM, Matthias Braun wrote:
>> On Sep 25, 2017, at 6:03 PM, David Keaton via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>> On 09/25/2017 02:53 PM, Matthias Braun via llvm-dev wrote:
>>> The dump methods can be included in the release builds anyway by enabling LLVM_ENABLE_DUMP.
>>      Is there a way to pass LLVM_ENABLE_DUMP into cmake from outside without changing any of the configuration files?  With Chapel's use of LLVM, we try to avoid modifying any of the source files that come from the LLVM distribution.  Our own Makefile that builds Chapel also invokes cmake to build LLVM.  I have tried setting environment variables and passing command-line arguments, and nothing seems to work.
> Looks like nobody got around adding a flag. (this really should be fixed).
> In the meantime `cmake -DCMAKE_CXX_FLAGS="-DLLVM_ENABLE_DUMP"` should do the trick.

      Thank you.  That was the flag we needed.

      Unfortunately, when I tried this just now, I found that the 
declaration of llvm::MachineRegisterInfo::dumpUses() in 
include/llvm/CodeGen/MachineRegisterInfo.h is missing the check against 
LLVM_ENABLE_DUMP.  It has only

#ifndef NDEBUG

which causes the build to fail because the definition in 
lib/CodeGen/MachineRegisterInfo.cpp is guarded by this.

#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)


More information about the llvm-dev mailing list