Commit Graph

19114 Commits

Author SHA1 Message Date
IOBYTE 48c960f56c template simplifier: better detection of template functions (#1539)
* template simplifier: better detection of template functions

* fix comment
2018-12-22 10:05:10 +01:00
Sebastian b51f19d530
Fix some doxygen warnings/issues in the comments (#1537) 2018-12-21 21:23:03 +01:00
orbitcowboy 5be8e18d65 wxwidgets.cfg: Added some constants from wx/propgridpagestate.h 2018-12-21 14:21:57 +01:00
Rikard Falkeborn 204ce795ba Print test case name in assert
I sometimes find myself wondering which test cases I have broken when I fiddle with some check (since I then can try running these specific tests in the debugger, or make a small change and see if the tests pass). This PR adds the testclass and the test case names to the file and line number. I took special care to cover the case where an assert would be placed directly in the ```run()```-function, i.e., not inside a test case (from what I could see, no such case exists). If there is no need to handle this case, the code can be simplified (there wouldn't be need for the ```teardownTest()```-function for example).

The exact format for how to print the test name is very much up for discussion.
2018-12-21 13:55:24 +01:00
Daniel Marjamäki b97b3b7ef8 astyle formatting
[ci skip]
2018-12-21 13:54:59 +01:00
rebnridgway 431d068339 Several fairly significant optimisations (#1518)
* Code changes for Token::mImpl optimisation

* Added new TokenImpl optimisation

Moving members to the TokenImpl struct reduces the size of the Token class, which is a fairly significant optimisation.  In my testing on Windows with 32-bit Release-PCRE, this change reduced the size of the Token class from 108 bits to 52 bits and reduced run-time of my test case by around 20%.

* Several optimisations

Deleted some code that ran very slowly and did nothing, as there is no need to change a Token's string to null if you are about to delete it.
Added a frontToken to simplifyCalculations to reduce the amount of work it has to do on already-simplified calculations.
Moved template removal to the end of the list as this reduces redundant iteration and saves time.

* Added tok argument to simplifyCalculations

This means callers can avoid unnecessary work if they know which tokens have already been simplified.  Passing nullptr indicates the original behaviour (starting from the front of the list).

* Removed mention of member from another change

* Re-added and optimised some code deleted in error

Changing mTemplateInstantiations to a vector avoids the high cost of doing repeated linear searches.  Changing how the code iterates through the array was necessary because the vector can be resized at several points during the loop, which breaks existing references and iterators.

* Changed mTemplateInstantiations to a vector

This is an optimisation that makes repeated linear searches of this collection significantly faster. 
Also added a copy constructor to TokenAndName so code can make copies of these objects to keep a reference if a vector gets resized.

* A cleaner optimisation to removing template tokens

This reverts the previous change to made mInstantiatedTemplates a vector and the iterator changes to support this, and makes mTypesUsedInTemplateInstantiation so the eraseTokens logic can be unified.

* Reverted vector to list

Also made mTypesUsedInTemplateInstantiation a vector of TokenAndName objects so it can share the same logic as the other members.

* Added member for template simplifier pointer

This can be used more efficiently than marking Tokens with a flag and then searching through all templates to find the one that matches.

* Turned loop inside out

This means we only have to iterate through the std::list once.  std::list is very expensive to iterate through.

* Latest code from danmar and fixed optimisations

In particular I have optimised simplifying template instantiation names as this was incredibly slow because of the number of times it had to iterate through the template instantiation list.  Previous optimisations to this weren't very effective and broke some edge cases.

* Added changes from danmar

Made mExplicitInstantiationsToDelete a vector of TokenAndName to be consistent with the rest of the members, which are cleaned up very efficiently.

* Tokens can have many templateSimplifierPointers

* templateSimplifierPointers must be kept in sync
2018-12-21 13:51:45 +01:00
orbitcowboy e7760c0db1 wxwidgets.cfg: Added support for some constants from wx/grid.h 2018-12-21 09:40:53 +01:00
orbitcowboy 56c42ad760 wxwidgets.cfg: Added support for some constants from wx/defs.h 2018-12-21 09:32:23 +01:00
orbitcowboy ac5ba20e9c wxwidgets.cfg: Added support for some constants from wx/toolbar.h 2018-12-21 09:28:29 +01:00
orbitcowboy 6c3a4d6b27 wxwidgets.cfg: Added support for some constants from wx/brush.h 2018-12-21 09:21:13 +01:00
orbitcowboy a210c021fa wxwidgets.cfg: Added support for some constants from wx/tokenzr.h 2018-12-21 09:15:15 +01:00
orbitcowboy 0934509820 wxwidgets.cfg: Added support for some constants from wx/settings.h 2018-12-21 08:57:33 +01:00
orbitcowboy 3bcf5438b2 wxwidgets.cfg: Added support for WX_DECLARE_OBJARRAY_WITH_DECL. 2018-12-21 08:32:55 +01:00
Sebastian 56d502bf37 donate-cpu.py: Detect and use zlib and gtk library config; fix --help output. (#1534)
* donate-cpu.py: Fix --help output (add --package description)
* donate-cpu.py: Use zlib and gtk library if appropriate.
2018-12-20 21:15:42 +01:00
Sebastian a1a695dcda checkio: Add missing id "invalidScanfFormatWidth_smaller" to errorlist output (#1533) 2018-12-20 21:14:02 +01:00
IOBYTE d528934139 template simplifier: also remove forward declarations when removing expanded templates (#1536) 2018-12-20 20:55:27 +01:00
orbitcowboy becc6f112a wxwidgets.cfg: Added support for constants from wx/log.h 2018-12-20 19:06:26 +01:00
orbitcowboy 78a4b59136 wxwidgets.cfg: Added support for WXDLLIMPEXP_DATA_CORE macro 2018-12-20 18:50:09 +01:00
Sebastian 79d9c5b283
windows.cfg: Enhance support for IO/IOCTL functionality (#1532) 2018-12-20 14:43:48 +01:00
versat 7ff0968853 donate-cpu.py: Fix indentation 2018-12-20 14:26:00 +01:00
amai2012 19e979315f
Correct detection of Microsoft extensions in MathLib::isValidIntegerSuffix. Remove public overloaded implementation which was not used outside mathlib.cpp. (#1531) 2018-12-20 12:20:31 +01:00
amai2012 0f4eac657d Make script less verbose 2018-12-19 22:18:24 +01:00
IOBYTE c31331d085 template simplifier: fix explicit instantiation with types starting with const and ending in * and &. (#1530) 2018-12-19 21:59:59 +01:00
Sebastian f8b8597a9b
windows.cfg: Add support for CreateFileA and CreateFileW (#1529)
References:
https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilea
https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilew
2018-12-19 20:20:05 +01:00
Daniel Marjamäki e2c433a0f8 Fixed #8914 (False positive with unary_function argument) 2018-12-19 19:43:05 +01:00
orbitcowboy ac15c56f49 wxwidgets.cfg: Added support for some missing constants from wx/image.h 2018-12-19 16:55:03 +01:00
orbitcowboy 5b23f21d7f wxwidgets.cfg: Added support for some missing constants from wx/dataview.h 2018-12-19 16:43:46 +01:00
orbitcowboy a4042cc2ef wxwidgets.cfg: Reordered defines, there are no functional change. 2018-12-19 16:41:26 +01:00
orbitcowboy e95d2c968b wxwidgets.cfg: Added support for some missing constants from wx/gauge.h 2018-12-19 16:39:48 +01:00
orbitcowboy e860bc7354 wxwidgets.cfg: Added support for some missing constants from wx/propdlg.h 2018-12-19 16:35:47 +01:00
orbitcowboy 9ed0d03081 wxwidgets.cfg: Added support for some constants from wx/font.h 2018-12-19 16:33:35 +01:00
orbitcowboy 985994f609 wxwidgets.cfg: Added support for some constants from wx/propdlg.h 2018-12-19 16:15:51 +01:00
orbitcowboy f0a365cfdc wxwidgets.cfg: Added support for some constants from wx/utils.h 2018-12-19 16:10:57 +01:00
orbitcowboy 832fb5fe76 wxwidgets.cfg: Added support for some constants from wx/timer.h 2018-12-19 16:06:28 +01:00
orbitcowboy f0eefd69d6 wxwidgets.cfg: Added support for some constants from wx/txtctrl.h 2018-12-19 16:04:36 +01:00
orbitcowboy 23eb8cdbc8 wxwidgets.cfg: Added support for constants from wx/anybutton.h 2018-12-19 15:54:01 +01:00
orbitcowboy a151f313e3 wxwidgets.cfg: Added support for constants from wx/anybutton.h 2018-12-19 15:33:54 +01:00
orbitcowboy ce0ee71b31 wxwidgets.cfg: Added support for constants from wx/filedlg.h 2018-12-19 15:29:01 +01:00
orbitcowboy c3d44b27bd wxwidgets.cfg: Added support for wxWINDOW_STYLE_MASK. 2018-12-19 15:19:42 +01:00
orbitcowboy fdd00a148a wxwidgets.cfg: Added support for more definitions from wx/defs.h. 2018-12-19 15:16:58 +01:00
amai2012 378ffed37e Address compiler warning 2018-12-19 14:39:04 +01:00
PKEuS 34874dd94f Optimization: Removed unnecessary calls to simplifyPath(). The Caller should do this, and our callers (mainly the test suite) more or less do so, as they all supply just dummy paths ("test.cpp") 2018-12-18 20:33:45 +01:00
orbitcowboy b555572f9a wxwidgets.cfg: Added support for constants from wx/valnum.h 2018-12-18 15:40:23 +01:00
orbitcowboy 13c8707b96 wxwidgets.cfg: Added support for DECLARE_APP(app) macro. 2018-12-18 15:34:25 +01:00
orbitcowboy 6768c83155 wxwidgets.cfg: Added support for constants from wx/cmdline.h 2018-12-18 15:31:32 +01:00
orbitcowboy ac7ebd6044 wxwidgets.cfg: Improved support for macros from wx/defs.h 2018-12-18 15:19:04 +01:00
Daniel Marjamäki bc34f0239d Disable the subfunction value flow analysis. It does not work well and needs to be rewritten. There are false positives. 2018-12-18 14:36:49 +01:00
orbitcowboy c58385f58a wxwidgets.cfg: Improved support for more wxWidgets types. 2018-12-18 09:22:41 +01:00
orbitcowboy c080b2750e wxwidgets.cfg: Added support for WXDLLIMPEXP_FWD_CORE. 2018-12-18 08:20:22 +01:00
Paul Fultz II 34330b51d1 Fix issue 8905: Condition 'a==0' is always false
This fixes the FP in:

```cpp
void f(const int a[]){ if (a == 0){} }
```
2018-12-18 08:16:43 +01:00