]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-36876: Fix the C analyzer tool. (GH-22841)
authorEric Snow <ericsnowcurrently@gmail.com>
Fri, 23 Oct 2020 00:42:51 +0000 (18:42 -0600)
committerGitHub <noreply@github.com>
Fri, 23 Oct 2020 00:42:51 +0000 (18:42 -0600)
commit345cd37abe324ad4f60f80e2c3133b8849e54e9b
tree5d965e662dca9dcac19e7eddd63a3d9d0b816fed
parentec388cfb4ede56dace2bb78851ff6f38fa2a6abe
bpo-36876: Fix the C analyzer tool. (GH-22841)

The original tool wasn't working right and it was simpler to create a new one, partially re-using some of the old code. At this point the tool runs properly on the master. (Try: ./python Tools/c-analyzer/c-analyzer.py analyze.)  It take ~40 seconds on my machine to analyze the full CPython code base.

Note that we'll need to iron out some OS-specific stuff (e.g. preprocessor). We're okay though since this tool isn't used yet in our workflow. We will also need to verify the analysis results in detail before activating the check in CI, though I'm pretty sure it's close.

https://bugs.python.org/issue36876
92 files changed:
Lib/test/test_tools/test_c_analyzer/__init__.py [deleted file]
Lib/test/test_tools/test_c_analyzer/__main__.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_common/__init__.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_common/test_files.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_common/test_info.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_common/test_show.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_cpython/__init__.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_cpython/test___main__.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_cpython/test_functional.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_cpython/test_supported.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_parser/__init__.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_parser/test_declarations.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_parser/test_preprocessor.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_symbols/__init__.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_symbols/test_info.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_variables/__init__.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_variables/test_find.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_variables/test_info.py [deleted file]
Lib/test/test_tools/test_c_analyzer/test_variables/test_known.py [deleted file]
Lib/test/test_tools/test_c_analyzer/util.py [deleted file]
Tools/c-analyzer/README
Tools/c-analyzer/c-analyzer.py [new file with mode: 0644]
Tools/c-analyzer/c-globals.py [deleted file]
Tools/c-analyzer/c_analyzer/__init__.py
Tools/c-analyzer/c_analyzer/__main__.py [new file with mode: 0644]
Tools/c-analyzer/c_analyzer/analyze.py [new file with mode: 0644]
Tools/c-analyzer/c_analyzer/common/files.py [deleted file]
Tools/c-analyzer/c_analyzer/common/info.py [deleted file]
Tools/c-analyzer/c_analyzer/common/show.py [deleted file]
Tools/c-analyzer/c_analyzer/datafiles.py [new file with mode: 0644]
Tools/c-analyzer/c_analyzer/info.py [new file with mode: 0644]
Tools/c-analyzer/c_analyzer/parser/declarations.py [deleted file]
Tools/c-analyzer/c_analyzer/parser/find.py [deleted file]
Tools/c-analyzer/c_analyzer/parser/naive.py [deleted file]
Tools/c-analyzer/c_analyzer/parser/preprocessor.py [deleted file]
Tools/c-analyzer/c_analyzer/parser/source.py [deleted file]
Tools/c-analyzer/c_analyzer/symbols/__init__.py [deleted file]
Tools/c-analyzer/c_analyzer/symbols/_nm.py [deleted file]
Tools/c-analyzer/c_analyzer/symbols/find.py [deleted file]
Tools/c-analyzer/c_analyzer/symbols/info.py [deleted file]
Tools/c-analyzer/c_analyzer/variables/__init__.py [deleted file]
Tools/c-analyzer/c_analyzer/variables/find.py [deleted file]
Tools/c-analyzer/c_analyzer/variables/info.py [deleted file]
Tools/c-analyzer/c_analyzer/variables/known.py [deleted file]
Tools/c-analyzer/c_common/__init__.py [new file with mode: 0644]
Tools/c-analyzer/c_common/clsutil.py [moved from Tools/c-analyzer/c_analyzer/common/util.py with 51% similarity]
Tools/c-analyzer/c_common/fsutil.py [new file with mode: 0644]
Tools/c-analyzer/c_common/info.py [moved from Tools/c-analyzer/c_analyzer/common/__init__.py with 100% similarity]
Tools/c-analyzer/c_common/iterutil.py [new file with mode: 0644]
Tools/c-analyzer/c_common/logging.py [new file with mode: 0644]
Tools/c-analyzer/c_common/misc.py [new file with mode: 0644]
Tools/c-analyzer/c_common/scriptutil.py [new file with mode: 0644]
Tools/c-analyzer/c_common/show.py [moved from Tools/c-analyzer/c_analyzer/parser/__init__.py with 100% similarity]
Tools/c-analyzer/c_common/strutil.py [new file with mode: 0644]
Tools/c-analyzer/c_common/tables.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/__init__.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/__main__.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/_state_machine.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/datafiles.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/info.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/parser/__init__.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/parser/_alt.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/parser/_common.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/parser/_compound_decl_body.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/parser/_delim.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/parser/_func_body.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/parser/_global.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/parser/_info.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/parser/_regexes.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/preprocessor/__init__.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/preprocessor/__main__.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/preprocessor/common.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/preprocessor/errors.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/preprocessor/gcc.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/preprocessor/pure.py [new file with mode: 0644]
Tools/c-analyzer/c_parser/source.py [new file with mode: 0644]
Tools/c-analyzer/check-c-globals.py
Tools/c-analyzer/cpython/README [deleted file]
Tools/c-analyzer/cpython/__init__.py
Tools/c-analyzer/cpython/__main__.py
Tools/c-analyzer/cpython/_analyzer.py [new file with mode: 0644]
Tools/c-analyzer/cpython/_generate.py [deleted file]
Tools/c-analyzer/cpython/_parser.py [new file with mode: 0644]
Tools/c-analyzer/cpython/files.py [deleted file]
Tools/c-analyzer/cpython/find.py [deleted file]
Tools/c-analyzer/cpython/ignored.tsv [new file with mode: 0644]
Tools/c-analyzer/cpython/known.py [deleted file]
Tools/c-analyzer/cpython/known.tsv [new file with mode: 0644]
Tools/c-analyzer/cpython/supported.py [deleted file]
Tools/c-analyzer/ignored-globals.txt [deleted file]
Tools/c-analyzer/ignored.tsv [deleted file]
Tools/c-analyzer/known.tsv [deleted file]