Commit Graph

18 Commits

Author SHA1 Message Date
Daniel Marjamäki 7e8839a991 Addons: Reuse cppcheckdata.simpleMatch 2020-11-11 14:24:55 +01:00
Daniel Marjamäki c6d2e0fae1 Fixed #9830 (Addons should return 0 when success) 2020-08-29 07:44:32 +02:00
Georgy Komarov d977761e76 addons: Reduce memory consumption (#2395)
* addons: Reduce memory consumption

Parse dump files incrementaly using ElementTree.iterparse. Clean unused
resources during parsing.  This method is explained in following
article: https://www.ibm.com/developerworks/xml/library/x-hiperfparse/

Memory consumption was reduced about 30% (measured with mprof),
execution time increased about 5% (measured with time utility).
More description available in PR.

* Switch to lxml and update iterparse routines

Use lxml module instead default xml.etree. Lxml provides convenient
wrappers around iterparse method that accepts `tag` argument. That
easer incremental parsing routines to select specific tags from roottree
like `dump` and `dumps`.

Element.clear() method was replaced by `lxml_clean` because lxml
keeps additional information to nodes that should be removed.

Added note about large consumption RAM on large dump files.
This commit doesn't solve this problem completely, but provides a way
to improve current parser to add incremental Configuration serialization
later.

* Working on iterative parser

* Added iterative Configurations parser

* fix

* Fix varlist iteration

* make sure that standards node was loaded
2019-12-27 08:50:56 +01:00
Sebastian 8a32a210f8
addons: Change shebang to use Python 3 instead of Python 2 (#2361)
Use Python 3 instead of Python 2 if addons are executed directly.
Running cert.py and misra.py against test/cfg/std.c.dump shows that
Python 3 needs only half the time compared to Python 2. I have tested
it repeatedly and the results are always the same. This is no surprise
at all. The memory footprint is very likely also significantly better
but i have not tested it.
2019-11-15 21:38:20 +01:00
IOBYTE e5220bdf0c make ellipsis ... a single token (#2143)
* make ellipsis ... a single token

Using cppcheck -E to preprocess code with ellipsis produces output that
can't be compiled because ... is split into 3 tokens.

* try to fix addon
2019-09-04 08:07:30 +02:00
Daniel Marjamäki 97157046f7 addons: /reportErrorCli/reportError/ 2019-04-14 08:54:53 +02:00
Daniel Marjamäki 466caabbf2 Fixed misc.py test 2019-04-10 07:31:52 +02:00
Daniel Marjamäki f2889d5c82 Try to unify addon output 2019-04-09 20:36:24 +02:00
Daniel Marjamäki d2949adff1 misc.py: Make it possible to run this addon from cppcheck 2019-04-07 21:07:08 +02:00
Oliver Stöneberg 13cf982b77 some small *.py script cleanup (#1328)
* added CLion project folder to .gitignore

* adjusted project name in CMakeLists.txt

* avoid warning when compiling "Debug" with Visual Studio via CMake

There was a GCC-style compiler flag in the common flags in compileroptions.cmake which caused the following warning:
cl : Command line warning D9002 : ignoring unknown option '-O0'

* compileroptions.cmake: restored original formatting

* some small *.py script cleanups
2018-08-05 20:36:21 +02:00
Daniel Marjamäki 975be66c63 String concatenation in array: Improved handling of macros 2018-04-28 23:01:29 +02:00
Daniel Marjamäki 86a9deffbf misc.py: removed bailouts 2018-04-20 08:18:49 +02:00
Daniel Marjamäki 3c48e08e6c misc.py: write debug message when valueType is None 2018-04-19 22:23:34 +02:00
Daniel Marjamäki d181e98d02 misc.py: Added experimental ellipsisStructArg checker that warns when struct is passed to ellipsis function 2018-04-16 13:55:12 +02:00
Daniel Marjamäki d65f00fe2e misc.py: Add check for implicitly virtual functions 2018-04-16 13:16:53 +02:00
Daniel Marjamäki 9579b12be9 misc.py: fixed FP 2018-04-16 12:55:27 +02:00
Daniel Marjamäki 19591298f1 misc.py: Fixed FP for string concatenation 2018-04-16 10:53:29 +02:00
Daniel Marjamäki 7031cc7e22 misc.py: Add addon for some misc checkers 2018-04-13 22:19:47 +02:00