Skip to content

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

Merged
danmar merged 1 commit intocppcheck-opensource:mainfrom
firewave:iscpp
Aug 21, 2022
Merged

refs #11104: do not do C++ processing for C code in parsedecl()#4304
danmar merged 1 commit intocppcheck-opensource:mainfrom
firewave:iscpp

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

@firewave firewave commented Jul 23, 2022

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 firewave marked this pull request as ready for review July 25, 2022 11:07
@danmar danmar merged commit 0e1cd8b into cppcheck-opensource:main Aug 21, 2022
@firewave firewave deleted the iscpp branch August 21, 2022 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants