This is an archive of the discontinued LLVM Phabricator instance.

Include llvm-config.h from Demangle/Compiler.h
AbandonedPublic

Authored by andrew.w.kaylor on Oct 24 2018, 3:36 PM.

Details

Summary

This fixes a problem that was exposed by the recently added ItaniumDemangleTest.cpp unittest.

The problem is that Demangle/Compiler.h checks LLVM_ENABLE_DUMP to see how it should define LLVM_DUMP_METHOD, but it doesn't include llvm-config.h so LLVM_ENABLE_DUMP is always undefined. If you have a build that defines LLVM_ENABLE_DUMP and NDEBUG, then Demangle/Compiler.h and Support/Compiler.h will define LLVM_DUMP_METHOD differently.

You can see this by configuring this way:

cmake -DLLVM_ENABLE_DUMP=true -DCMAKE_BUILD_TYPE="Release" -DLLVM_ENABLE_WERROR=true ../llvm

It isn't clear to me whether or not including llvm-config.h introduces a layering issue, hence the review for a one line change.

Diff Detail

Event Timeline

FYI: this will be fixed by https://reviews.llvm.org/D53538 when that lands.

FYI: this will be fixed by https://reviews.llvm.org/D53538 when that lands.

In that case, nevermind. I can put a temporary fix in our local tree and wait for the refactoring. Thanks!

zturner resigned from this revision.Nov 13 2018, 11:30 AM
andrew.w.kaylor abandoned this revision.Nov 13 2018, 4:52 PM