Skip to content

Token: cache isCpp() and isC() values #6933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 13, 2024
Merged

Conversation

firewave
Copy link
Collaborator

No description provided.

@firewave firewave changed the title Token: cache ìsCpp() and isC() values Token: cache isCpp() and isC() values Oct 18, 2024
@firewave firewave marked this pull request as draft October 18, 2024 14:09
@firewave
Copy link
Collaborator Author

To clean up the mess with the inconsistent language I have local changes that prevents the creation of a TokenList without a language.

@firewave
Copy link
Collaborator Author

@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.

@firewave
Copy link
Collaborator Author

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)?

@firewave
Copy link
Collaborator Author

firewave commented Oct 18, 2024

callgrind step in CI: 64,041,451,567 -> 63,581,639,801

@firewave
Copy link
Collaborator Author

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

@firewave firewave marked this pull request as ready for review October 27, 2024 17:01
pfultz2 pushed a commit to pfultz2/cppcheck that referenced this pull request Nov 5, 2024
Co-authored-by: chrchr-github <chrchr@github>
@firewave
Copy link
Collaborator Author

No feedback in over two weeks - merging.

@firewave firewave merged commit 550243a into danmar:main Nov 13, 2024
66 checks passed
@firewave firewave deleted the tok-cpp branch November 13, 2024 12:32
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.

1 participant