[cfe-dev] [libTooling] cl::location(x) specified more than once!

Alex Brachet-Mialot via cfe-dev cfe-dev at lists.llvm.org
Sat Apr 4 17:56:21 PDT 2020


I am trying to write an out of tree tool, right now I am just playing
around. But I am running into an issue.

My file could be just
```
#include "clang/ASTMatchers/ASTMatchers.h"
int main() {}
```
when I run this executable with no arguments, it dies with this:
```
: for the --info-output-file option: cl::location(x) specified more than once!
: CommandLine Error: Option 'disable-symbolication' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
```
Also if I add an llvm::cl::OptionCategory even with a very unique name
I get an assertion failure: `Assertion
`count_if(RegisteredOptionCategories, [cat](const OptionCategory
*Category) { return cat->getName() == Category->getName(); }) == 0 &&
"Duplicate option categories"' failed.`

I also tried one building one of the external clang examples
https://clang.llvm.org/docs/ExternalClangExamples.html,
include-what-you-use
https://github.com/include-what-you-use/include-what-you-use and it
also died with:
```
: for the --info-output-file option: cl::location(x) specified more than once!
include-what-you-use:
/homes/abrachet/scratch/llvm-install/llvm/lib/Support/CommandLine.cpp:361:
void (anonymous
namespace)::CommandLineParser::registerCategory(llvm::cl::OptionCategory
*): Assertion `count_if(RegisteredOptionCategories, [cat](const
OptionCategory *Category) { return cat->getName() ==
Category->getName(); }) == 0 && "Duplicate option categories"' failed.
```

I'm really at a loss here. Does anyone know whats going on? Thanks.

Alex


More information about the cfe-dev mailing list