summaryrefslogtreecommitdiff
path: root/py/makeqstrdefs.py
AgeCommit message (Collapse)Author
2019-10-04py/makeqstrdefs.py: Remove unused blacklist.Jim Mussared
As of 7d58a197cffa7c0dd3686402d2e381812bb8ddeb, `NULL` should no longer be here because it's allowed (MP_QSTRnull took its place). This entry was preventing the use of MP_QSTR_NULL to mean "NULL" (although this is not currently used). A blacklist should not be needed because it should be possible to intern all strings. Fixes issue #5140.
2019-04-12py/makedefs: Use io.open with utf-8 encoding when processing source.Damien George
In case (user) source code contains utf-8 encoded data and the default locale is not utf-8. See #4592.
2018-03-16py/makeqstrdefs.py: Optimise by using compiled re's so it runs faster.Damien George
By using pre-compiled regexs, using startswith(), and explicitly checking for empty lines (of which around 30% of the input lines are), automatic qstr extraction is speed up by about 10%.
2017-06-09py/makeqstrdefs.py: Make script run correctly with Python 2.6.Damien George
2016-09-09py/makeqstrdefs.py: Use python 2.6 syntax for set creation.Chris Packham
py/makeqstrdefs.py declares that it works with python 2.6 however the syntax used to initialise of a set with values was only added in python 2.7. This leads to build failures when the host system doesn't have python 2.7 or newer. Instead of using the new syntax pass a list of initial values through set() to achieve the same result. This should work for python versions from at least 2.6 onwards. Helped-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Chris Packham <judge.packham@gmail.com>
2016-06-16py/makeqstrdefs.py: Remove restriction that source path can't be absolute.Paul Sokolovsky
That's arbitrary restriction, in case of embedding, a source file path may be absolute. For the purpose of filtering out system includes, checking for ".c" suffix is enough.
2016-04-25py/makeqstrdefs.py: Windows compatibility.stijn
- msvc preprocessor output contains full paths with backslashes so the ':' and '\' characters needs to be erased from the paths as well - use a regex for extraction of filenames from preprocessor output so it can handle both gcc and msvc preprocessor output, and spaces in paths (also thanks to a PR from @travnicekivo for part of that regex) - os.rename will fail on windows if the destination file already exists, so simply attempt to delete that file first
2016-04-25py/makeqstrdefs.py: Remove unused function/variable/import.stijn
2016-04-19py: Divide "split" and "cat" phases of qstr extraction for better efficiency.Paul Sokolovsky
E.g. for stmhal, accumulated preprocessed output may grow large due to bloated vendor headers, and then reprocessing tens of megabytes on each build make take couple of seconds on fast hardware (=> potentially dozens of seconds on slow hardware). So instead, split once after each change, and only cat repetitively (guaranteed to be fast, as there're thousands of lines involved at most).
2016-04-19py/makeqstrdefs.py: Process only CPP line-numbering info.Paul Sokolovsky
Not stuff like "#pragma", etc.
2016-04-19py: Rework QSTR extraction to work in simple and obvious way.Paul Sokolovsky
When there're C files to be (re)compiled, they're all passed first to preprocessor. QSTR references are extracted from preprocessed output and split per original C file. Then all available qstr files (including those generated previously) are catenated together. Only if the resulting content has changed, the output file is written (causing almost global rebuild to pick up potentially renumbered qstr's). Otherwise, it's not updated to not cause spurious rebuilds. Related make rules are split to minimize amount of commands executed in the interim case (when some C files were updated, but no qstrs were changed).
2016-04-16py/makeqstrdefs: Add script to automate extraction of qstr from sources.Pavel Moravec
This script will search for patterns of the form Q(...) and generate a list of them. The original code by Pavel Moravec has been significantly simplified to remove the part that searched for C preprocessor directives (eg #if). This is because all source is now run through CPP before being fed into this script.