[LLVMdev] "Duplicate option categories" assertion triggered loading an LLVM-project

Alberto Magni alberto.magni86 at gmail.com
Sat Aug 9 08:48:00 PDT 2014


Hi all,

I am trying to create an out-of-tree LLVM project.

I have written a Test project following the guide in [1] that triggers the
problem.

Pass body is in [2].
The CMakeLists.txt file for the "root" directory is in [3]
The CMakeLists.txt file for the "pass" directory is in [4]

When I run opt --load=libTest.so
I trigger the following assertion:

opt: CommandLine.cpp:134: void
llvm::cl::OptionCategory::registerCategory(): Assertion
`std::count_if(RegisteredOptionCategories->begin(),
RegisteredOptionCategories->end(), [this](const OptionCategory *Category) {
return getName() == Category->getName(); }) == 0 && "Duplicate option
categories"' failed.

Note that my pass does not even define any command line option.

I am using LLVM 3.5 git fa840e7dfb9115a3ac9891d898e7fe2543c65948
gcc 4.8.1
cmake 2.8.11

Am I doing anything wrong in the project setup ?
Any help is appreciated.

Cheers,
Alberto

[1] http://llvm.org/docs/CMake.html#embedding-llvm-in-your-project
[2] https://gist.github.com/HariSeldon/9a310312a4e1a0039483#file-test-cpp
[3]
https://gist.github.com/HariSeldon/d979d38cf8ee52d9d134#file-cmakelists-txt
[4]
https://gist.github.com/HariSeldon/5f60a6bf6b28617593f2#file-cmakelists-txt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140809/f5632610/attachment.html>


More information about the llvm-dev mailing list