<div dir="ltr">Hi all,<br><br>I am trying to create an out-of-tree LLVM project.<br><br>I have written a Test project following the guide in [1] that triggers the problem.<br><br>Pass body is in [2].<br>The CMakeLists.txt file for the "root" directory is in [3]<br>


The CMakeLists.txt file for the "pass" directory is in [4]<br><br>When I run opt --load=libTest.so<br>I trigger the following assertion:<br><br>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.<br>


<br>Note that my pass does not even define any command line option.<br><br>I am using LLVM 3.5 git fa840e7dfb9115a3ac9891d898e7fe2543c65948<br>gcc 4.8.1<br>cmake 2.8.11<br><br>Am I doing anything wrong in the project setup ?<br>


Any help is appreciated.<br><br>Cheers,<br>Alberto<br><br>[1] <a href="http://llvm.org/docs/CMake.html#embedding-llvm-in-your-project" target="_blank">http://llvm.org/docs/CMake.html#embedding-llvm-in-your-project</a><br>

[2] <a href="https://gist.github.com/HariSeldon/9a310312a4e1a0039483#file-test-cpp" target="_blank">https://gist.github.com/HariSeldon/9a310312a4e1a0039483#file-test-cpp</a><br>
[3] <a href="https://gist.github.com/HariSeldon/d979d38cf8ee52d9d134#file-cmakelists-txt" target="_blank">https://gist.github.com/HariSeldon/d979d38cf8ee52d9d134#file-cmakelists-txt</a><br>[4] <a href="https://gist.github.com/HariSeldon/5f60a6bf6b28617593f2#file-cmakelists-txt" target="_blank">https://gist.github.com/HariSeldon/5f60a6bf6b28617593f2#file-cmakelists-txt</a><br>


</div>