[llvm-dev] REQUIRES_RTTI usage

Viktor Was BSc via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 20 07:11:47 PDT 2019


Hi all,

I've built clang 6.0.1 from source and I'm working on a clang plugin. 

I'm confused about the usage of REQUIRES_RTTI.
the cmake flag LLVM_ENABLE_RTTI is used to generate llvm/clang build files with/without rtti.
When is REQUIRES_RTTI supposed to be used and how? When building llvm/clang or when using clang to build regular software that relies on rtti? Do I have to pass it to eg. ninja or cmake? If cmake, why have REQUIRES_RTTI and LLVM_ENABLE_RTTI?
I've also seen LLVM_REQUIRES_RTTI in the llvm/lib/Transforms/Hello/CMakeLists.txt...

My concrete problem is with loading a plugin which contains an llvm::cl::opt. (unresolved symbol for vtable to llvm::cl::parser). 
I don't understand why it's not working.
llvm/clang are built without rtti (LLVM_ENABLE_RTTI=OFF) and the plugin is also built with -fno-rtti and has only dependencies to llvm libs and std headers (#include <numeric>).

Cheers,
Viktor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190320/356cffed/attachment.html>


More information about the llvm-dev mailing list