Commit Graph

1596 Commits

Author SHA1 Message Date
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
PKEuS 8b9daadd25 Replaced static variable isCPP in Token (was not threadsafe):
- Encapsulate parameters passed through AST compiler functions in a struct
-> Reduces maintenance overhead when changing them
-> Contains parameter indicating if the file is C or C++
- Added eKeyword Token type (at the moment, only true for C++ keyword "delete", but should be set for other keywords as well)
2014-06-14 10:28:12 +02:00
Simon Martin d588ed49b3 Ticket #5868: Ignore variables called like a typedef when substituing typedefs. 2014-06-14 00:50:14 +02:00
Daniel Marjamäki a4a6f3e1be Tokenizer: Removed Tokenizer::simplifyConditionOperator(). Using the AST and ValueFlow, it should be much easier to parse ?: than before. 2014-06-10 19:30:13 +02:00
Simon Martin dc12a73987 Ticket #5907: Properly handle extern declarations in Tokenizer::simplifyVarDecl. 2014-06-08 14:59:58 +02:00
Daniel Marjamäki a41f6077e1 Tokenizer: Use 'podtype' info from library. Partial fix for #5623 2014-06-08 13:28:15 +02:00
Dmitry-Me 7692a306cd Cleanup code - reorder checks and make variable declaration scope narrower. 2014-06-06 18:58:20 +04:00
PKEuS f6c9320aee Fixed incorrect usage of startOfExecutableScope() (Checking time reduced by ~60% (nonlinear) for #5876) 2014-06-05 10:45:26 +02:00
PKEuS 39b64ea5fb Simplify rValue reference arguments without name (&& -> & &) 2014-06-04 18:45:56 +02:00
PKEuS 8db0790407 Tokenizer::tokenize() can now be called without AST being created 2014-06-04 18:45:28 +02:00
PKEuS d93d7401c6 Moved getSourceFilePath(), isC() and isCPP() from Tokenizer to TokenList
Conflicts:
	lib/tokenize.cpp
2014-06-04 18:36:25 +02:00
orbitcowboy 60e80b6fb1 Fixed #5885 - fsanitize=undefined: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' in lib/tokenize.cpp. 2014-05-29 18:25:01 +02:00
Simon Martin c027c526a9 Remove unnecessary declaration (one line before the actual definition... 2014-05-25 22:04:51 +02:00
PKEuS 38aaa46804 Stabilized AST:
- Fixed broken simplification causing crashs when cast was followed by unary minus (real world examples from arch/parisc/math-emu/ (linux-kernel))
- Stabilized determination of unary and binary operators
2014-05-24 19:05:04 +02:00
Simon Martin fcff8d39d9 Ticket #5816: Properly handle template'd template parameters in enum initializers. 2014-05-23 21:25:42 +02:00
orbitcowboy 6183f21070 Fixed CID 1037088 Dereference after null check in Tokenizer::simplifyLabelsCaseDefault. 2014-05-23 21:38:56 +02:00
orbitcowboy d19f676547 Fixed travis build warning (Check Internal). 2014-05-22 18:00:06 +02:00
orbitcowboy 031020ae4a #Fixed 5485: Wrong simplification of numbers like 1e+007 to 1e+007.0 2014-05-22 17:40:15 +02:00
PKEuS d19eabde42 New Check: Compare pointer with '\0' (#4070) 2014-05-21 19:12:07 +02:00
PKEuS 7b1eca700b Fixed bug in setVarId: VarIds for member functions defined inline in class were not properly set 2014-05-21 17:30:58 +02:00
orbitcowboy e3009bdd0b Tokenizer:simplifyKeyword(): Improved matching when the static keyword is removed. 2014-05-13 16:47:55 +02:00
orbitcowboy 90c1016c74 Fixed #5842: remove C99 static keyword between [] in tokenizer. 2014-05-13 16:28:28 +02:00
Alexander Mai be9a566d48 Refactoring/small corrections to fix warnings from clang -fsanitize=undefined 'member call on null pointer' 2014-05-20 21:55:08 +02:00
PKEuS 8cb1f09fc2 Silenced travis errors (avoid false positive) 2014-05-19 20:56:05 +02:00
PKEuS 5fbd58d98d Fixed messages of CheckInternal, fixed a false positive. 2014-05-18 20:39:52 +02:00
PKEuS b162560755 Refactorizations:
- Removed some duplicate nullpointer checks
- Simplified tok->link() on '<' usage.
2014-05-18 17:07:21 +02:00
Simon Martin 69d294c6c4 Ticket #5816: Skip typename in template arguments for enum initializers. 2014-05-17 08:50:12 +02:00
Simon Martin 92cc17110d Ticket #5814: Handle A::B as template parameter for enum initializers. 2014-05-15 21:52:57 +02:00
Daniel Marjamäki 0dfbbd0f80 Fixed #5479 (Tokenizer: don't remove parentheses in code 'a<b<c>>(2)') 2014-05-11 08:22:28 +02:00
PKEuS edd84c0906 Fixed #5773: Don't prepend "std::" to function definitions 2014-05-09 21:58:28 +02:00
Daniel Marjamäki 1541e27e4a Fixed #5533 (False positive: 'Assignment of function parameter has no effect outside the function.') 2014-05-09 18:43:29 +02:00
Simon Martin 512e22d1ba Ticket #5315: Memory leak analysis confused by ((variable).attribute) notation. 2014-05-08 20:58:24 +02:00
Robert Reif ae96491d6c Fixed #5756 (declspec(nothrow) not supported) 2014-05-04 20:47:20 +02:00
Daniel Marjamäki 7d583e639c AST: Fixed handling of '(((typeof(x))*)0)' 2014-05-04 18:36:04 +02:00
Simon Martin b03f36cd71 Ticket #5709: Comma operator not properly tokenized. 2014-05-03 21:35:04 +02:00
Alexander Mai 4815e3c4c5 Fix some segmentation faults seen while reducing #5743 (sorry, no test cases supplied) 2014-04-29 20:16:50 +02:00