Uh oh!
There was an error while loading. Please reload this page.
reduced Tokenizer::isCPP() usage / SymbolDatabase: removed mIsCpp and isCPP() - #5725
Conversation
Tokenizer::isCPP()Tokenizer::isCPP() usagefirewave
commented
Dec 4, 2023
This might also speed up processing C code a bit as we previously forcefully used the C++ handling where it might not have been appropriate. We should merge this after the next release so the impact of the changes might be visible instead of getting lost in months of accumulated differences. |
firewave
commented
Dec 4, 2023
The remaining usages which could be removed is in conjunction with types that wrap a token - and those are sparse. I also think we could switch from |
The tests which failed were added in ff9c04d. Looking at what they were testing for I wonder if these failures might be somewhat related to some regressions which occurred in 2.6: |
firewave
commented
Dec 5, 2023
Further cleanups revealed potential issues/cases with undetermined standards. Those need to be resolved beforehand. Unfortunately that existing handling is quite awkward (surprise) so a fix is not straight forward and I currently can't wrap around it... It potentially might also require some other in-progress stuff to land first... |
firewave
commented
Jan 15, 2024
Requires #5853 to be merged first. |
c488af5 to
e81a560Compare947fb7a to
cc41b98Compare| //--------------------------------------------------------------------------- | ||
| SymbolDatabase::SymbolDatabase(Tokenizer& tokenizer, const Settings& settings, ErrorLogger* errorLogger) | ||
| : mTokenizer(tokenizer), mSettings(settings), mErrorLogger(errorLogger), mIsCpp(mTokenizer.isCPP()) |
There was a problem hiding this comment.
It seems like this could have been left in to avoid the repeated calls on the tokens but the language had not been determined at this point yet so this caused assertions in the unit tests.
I also think it is cleaner to have one less place which provides this information.
Tokenizer::isCPP() usageTokenizer::isCPP() usage and some additional cleanups related to itTokenizer::isCPP() usage and some additional cleanups related to itTokenizer::isCPP() usage / SymbolDatabase: removed mIsCpp and isCPP()c7d6290 to
80a2077Comparec72a06b to
2218041Compare…plicit-constructor` clang-tidy warning
…` clang-tidy and `functionStatic` selfcheck warning
Each
Token(should) be connected to aTokenList.Tokenizerjust encapsulates that so we have no need to check theTokenizerbut can simply ask theToken.Also if we have function calls we pass in a flag to tell it if it is C/C++ we can get rid of that flag and simply ask the
Token. In several cases we were only passing that flag to be used in some underlying calls making it completely unnecessary in the top call.