Token: cache `isCpp()` and `isC()` values
To clean up the mess with the inconsistent language I have local changes that prevents the creation of a TokenList without a language.
@danmar
lib/token.h:1440:10: style: Bit-fields should not be declared [premium-misra-cpp-2023-12.2.1]
bool mIsC : 1;
^
This is not really a bitfield but ensuring that these bools do not blow up the side of the object. This is commonly used in e.g. LLVM code base.
Also there is another (mIsCpp) just below so it seems the check has false negatives.
Also - is there handling that suppressions for premium-* are not being reported as unused with an open-source version (I have not checked the code)?
callgrind step in CI: 64,041,451,567 -> 63,581,639,801
excerpts from selfcheck.
before
Check time: cli/cmdlineparser.cpp: 1056.33s
[...]
Check time: lib/checkio.cpp: 221.528s
[...]
lib/symboldatabase.cpp: 247.606s
Check time: lib/tokenize.cpp: 286.758s
after
Check time: cli/cmdlineparser.cpp: 1027.11s
[...]
Check time: lib/checkio.cpp: 213.18s
[...]
Check time: lib/symboldatabase.cpp: 238.817s
Check time: lib/tokenize.cpp: 276.817s
No feedback in over two weeks - merging.