cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

refs #11104: do not do C++ processing for C code in `parsedecl()`

Open firewave opened this issue 3 years ago • 0 comments

This avoids the expensive C++-specific Library::detect*() calls in parsedecl() for C code. See https://trac.cppcheck.net/ticket/10663 and https://trac.cppcheck.net/ticket/11104 for more details of the underlying issues.

There's possibly more parsing which could be disabled as well as passing the isCpp flag in all cases (see remaining amount of unnecessary calls below).

Scanning https://github.com/firewave/mame_regtest with DISABLE_VALUEFLOW=1 and --enable=all --inconclusive:

Clang 13 2,469,788,235 -> 2,147,720,747 14,138,979 ( 0.66%) /mnt/s/GitHub/cppcheck-fw/lib/library.cpp:Library::detectContainerOrIterator(Token const*, bool*) const [/mnt/s/GitHub/cppcheck-fw/cmake-build-relwithdebinfo-wsl-kali-clang-13/bin/cppcheck]

GCC 12 2,374,494,090 -> 2,094,093,681 14,080,692 ( 0.67%) /mnt/s/GitHub/cppcheck-fw/lib/library.cpp:Library::detectContainer(Token const*, bool) const [/mnt/s/GitHub/cppcheck-fw/cmake-build-relwithdebinfo-wsl-kali-gcc-12/bin/cppcheck]

firewave avatar Jul 23 '22 12:07 firewave