<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60601>60601</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            llvm 16 LLVM ERROR: inconsistency in registered CommandLine options 'debug-counter' 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dietmarfrohboese
      </td>
    </tr>
</table>

<pre>
    I use some libraries in an other project. The use of llvm::DebugCounter::instance() resultis in runtime error message:

: CommandLine Error: Option 'debug-counter' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
Aborted (core dumped)

To reproduce the error message:

clang++ -I/usr/lib/llvm/16/include  -march=native -O2 -pipe -ggdb  -fno-exceptions -fno-rtti -std=c++17 -o ./tst2.cpp.o -c ./tst2.cpp && clang++ -march=native -O2 -pipe ./tst2.cpp.o -o ./tst2 -L/usr/lib/llvm/16/lib64 -Wl,-rpath,/usr/lib/llvm/16/lib64 /usr/lib/llvm/16/lib64/libLLVMSupport.a  /usr/lib/llvm/16/lib64/libLLVM-16.so -lrt  -ldl  -lm  /usr/lib64/libz.so  /usr/lib64/libtinfo.so /usr/lib/llvm/16/lib64/libLLVMDemangle.a

file tst2.cpp:

`
#include <llvm/Support/DebugCounter.h>

int main(int argc, char **argv) {
  llvm::DebugCounter &DC = llvm::DebugCounter::instance();
  return 0;
}
`
I tested with llvm-16.0.0_rc1. The llvm 15 works.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVV1vrDYQ_TWzLyMQDMvHPvCw2c1KkVJFSq_ax8rAAG6NjWyT9PbXV4bkZhPdj171xcuOx-ecwTMH4ZwcNHMN-Q3k551Y_Ghs3Un2k7C9NWNj2PGuMd3n-g4Xx-jMxKhkY4WV7FBqFBqNH9nibM2f3PoYP4285poelXqaIDtCdjxzswwns2jPdotI7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