Commit Graph

1631 Commits

Author SHA1 Message Date
PKEuS 6a4319f050 Improved simplifications:
- Rearranged their order to solve problems with typedefs. If we simplify chained declarations before typedef parsing, we have less complex expressions to deal with (#4777).
- Fixed detection of variables hiding enums
2014-08-26 15:21:19 +02:00
PKEuS 2326e78381 Fixed #6058: Don't detect class with unknown macro as variable.
Commented out crashing unit test tokenize33() in VS12
2014-08-26 10:40:00 +02:00
amai2012 e02741c82c #5780 Crash on template code below Tokenizer::setVarId(). Fix several crashes with same location. 2014-08-26 09:12:10 +02:00
Dmitry-Me 67ea470275 Break loop early, cleanup declarations 2014-08-24 20:17:41 +02:00
PKEuS 7f2be2f57c Fixed template bracket linkage in while loop simplification
Ran AStyle
2014-08-23 12:28:54 +02:00
PKEuS c678937538 Fixed more false positives of #6056:
- Implemented nextArgument() for usages before < and > are linked
- slightly optimized nextArgument()
2014-08-20 15:02:52 +02:00
PKEuS 5d50e7e9ae Changed heuristics to detect variable constructor initialization syntax (#6071) 2014-08-19 11:06:52 +02:00
PKEuS eac2d58c9e Fixed fix for #6056 2014-08-18 20:40:43 +02:00
Dmitry-Me 120e8c0674 Make loop termination more explicit. 2014-08-18 14:00:25 +04:00
PKEuS e7754be316 Fixed #6056 - properly detect member functions in setVarId() 2014-08-18 11:07:56 +02:00
PKEuS 5c54f8d0d8 Support namespaces and static member variables in setVarId (only one depth) (#6061) 2014-08-18 10:25:30 +02:00
Daniel Marjamäki a52c122229 Tokenizer::createLinks2: set no template-links in 'if (a < b || c > d)' 2014-08-17 19:03:06 +02:00
Daniel Marjamäki 5cdbe0f42d ValueFlow: Improved value flow after for loop 2014-08-17 10:40:22 +02:00
Daniel Marjamäki 75ec97ad23 Tokenizer::simplifyKnownVariables: Fixed bad simplification in for loop header 2014-08-17 07:39:42 +02:00
Daniel Marjamäki 65f10edcb6 Fixed #5866 (False negative: useless condition or null pointer dereference (null object after while loop, method)) 2014-08-16 18:32:25 +02:00
PKEuS e4b55cf843 Fixed a bug and two warnings introduced recently. 2014-08-06 13:35:39 +02:00
PKEuS adcc8b1634 Implement support for __attribute__((used)) (#3408) 2014-08-06 11:13:58 +02:00
PKEuS fd5ff1bb8b Fixed false positive #6030: inheriting classes is not a variable declaration. 2014-08-06 09:04:03 +02:00
PKEuS 83a80cebeb Fixed order of simplifications (#6029) 2014-08-06 08:39:23 +02:00
PKEuS f3e0df7501 Support C++11 style initialization with {}:
-> Support in setVarId and SymbolDatabase (#4344)
-> Fixed false positives in unused variable checking (#5491, #5494)

Side-effect: Support global variables initialized with brackets (C++03 style) in SymbolDatabase
2014-08-05 15:33:57 +02:00
Daniel Marjamäki 4dc73e3a5b Use Token::simpleMatch for simple pattern 2014-08-01 17:47:02 +02:00
Daniel Marjamäki 3f5da22d2b Tokenizer: Added FIXME for keywords handling 2014-08-01 17:27:35 +02:00
Daniel Marjamäki a943a0739a Tokenizer: Don't remove struct member in Tokenizer::simplifyKeyword() 2014-08-01 17:19:08 +02:00
Dmitry-Me dc03b98e60 Run cheaper check first, don't check the same condition twice. 2014-07-28 14:58:19 +04:00
Dmitry-Me 431453f53e Reuse previously computed values, use more const. 2014-07-25 15:05:13 +04:00
Daniel Marjamäki 2e60f30bfc Merge pull request #372 from Dmitry-Me/dontUseArrayAtWhenItWouldntThrow
Use [], not at() when the index is guaranteed to be valid.
2014-07-23 14:15:42 +02:00
Daniel Marjamäki c5e9da2984 xml dump: add more token attributes 2014-07-21 12:44:53 +02:00
Dmitry-Me cd13232062 Use [], not at() when the index is guaranteed to be valid. 2014-07-21 10:37:08 +04:00
Daniel Marjamäki 328cc7b8f5 Fixed #5996 (false positive: Clarify calculation precedence for '+' and '?'.) 2014-07-19 18:29:53 +02:00
Daniel Marjamäki 946c139043 Merge pull request #367 from Dmitry-Me/fixVariableCapitalization
Fix variable capitalization.
2014-07-18 11:15:17 +02:00
Alexander Mai 55e45add4a Fix compiler warnings 2014-07-17 20:04:56 +02:00
Dmitry-Me f995f67a11 Fix variable capitalization. 2014-07-17 12:38:09 +04:00
Daniel Marjamäki b1e5b015df xml dump: output some more info in the dump 2014-07-16 15:27:13 +02:00
orbitcowboy af6f21308f Tokenizer: Added missing comma in string array initialization (This fixes Coverity-ID: 1226263 Missing comma in a string array initialization). 2014-07-12 12:52:49 +02:00
orbitcowboy 6e5a05104b Fixed copy and paste error (Coverity-ID: 1226262 Copy-paste error). 2014-07-12 12:48:05 +02:00
Daniel Marjamäki b6a9c53826 xml dump: fixed some bad xml output in the token list dump 2014-07-14 19:49:31 +02:00
Daniel Marjamäki 8db5836e3f Fixed #5982 (Add xml dump) 2014-07-14 15:51:45 +02:00
Daniel Marjamäki 954400a382 Add simple xml debug output. When both --xml and --debug is used there will be xml debug output. 2014-07-13 17:21:45 +02:00
Dmitry-Me ba3757dfd3 Bring variables decalaration to where they are really needed. 2014-07-10 11:23:14 +04:00
Dmitry-Me d0cbfeb186 Use references instead of deep copying the strings 2014-07-09 11:21:38 +04:00
Daniel Marjamäki 14def42c99 Fixed #5972 (FP: Buffer is accessed out of bounds) 2014-07-08 16:31:08 +02:00
Daniel Marjamäki d40b77dce2 Removed special 'else if' handling. this is redundant since these are simplified. 2014-07-02 16:16:19 +02:00
Zachary D. Blair f6523e384b Fixed 4979 (Doesn't allow any ordering of int modifiers) 2014-07-01 23:59:04 -07:00
Simon Martin 7b942650c2 Ticket #5952: Simplify redundant parentheses in pointer variable declarations. 2014-06-28 09:36:51 +02:00
PKEuS b20f87faf2 Optimized Tokenizer::simplifyPlatformTypes() once more: Another 3% improvement on Windows.
-> All Token::Match strings are uppercase, so check Token::isUpperCaseName() to avoid comparisons with very slow long Token::Match strings (idea from amai)
Removed duplicate Token::Match call in symboldatabase.cpp
2014-06-25 20:42:59 +02:00
PKEuS 360fd4a565 Speedup Tokenizer::simplifyMathFunctions() and Tokenizer::simplifyPlatformTypes()
-> Speedup on entire checking time (TortoiseSVN code) by 3% (MSVC12, x64, not matchcompiled). Probably only measurable when checking code with Windows platform.
2014-06-25 17:00:59 +02:00
Daniel Marjamäki ae81b09b58 Refactoring: Move isScopeNoReturn implementation to library and reuse it both in ValueFlow and Tokenizer 2014-06-22 19:13:15 +02:00
Alexander Mai 2e3f26ba58 Patch from Dmitry-Me: reorder checks so that cheaper ones go first, reuse previously computed values, return early on edge condition 2014-06-16 21:36:31 +02:00
Simon Martin efb12f0409 Ticket #5268: Properly detect function heads when in Tokenizer::simplifyEnum. 2014-06-15 15:52:58 +02:00
Daniel Marjamäki 17f1841fba Merge pull request #339 from simartin/ticket_5868
Ticket #5868: Ignore variables called like a typedef when substituting typedefs
2014-06-14 12:38:02 +02:00