Skip to content
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

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

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

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