Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-36876: [c-analyzer tool] Additional CLI updates for "capi" command.#23929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ericsnowcurrently merged 9 commits intopython:masterfromericsnowcurrently:show-capi
Dec 25, 2020
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
Add a basic script to demo the usefulness of the "capi" subcommand.
  • Loading branch information
@ericsnowcurrently
ericsnowcurrently committedDec 25, 2020
commit4c22e90872e747adc1625bc213ca6ba64bc45210
75 changes: 75 additions & 0 deletionsTools/c-analyzer/must-resolve.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
#!/usr/bin/env bash

# Any PyObject exposed via the public API is problematic since it must
# be made per-interpreter. This involves the following:
#
# singletons:
# - None
# - True
# - False
# - NotImplemented
# - Ellipsis
# PyTypeObject:
# - PyExc* [97]
# - static types [81]
#
# In the non-stable API we could use #defines to do the conversion
# transparently (though Py_None is perhaps problematic for performance
# reasons). However, we can't take that approach with the stable API.
# That means we must find all functions (& macros) in the stable API
# (and probably the full public API, for sanity sake) and adjust them.
# This will involve internally converting from the public object to the
# corresponding per-interpreter object.
#
# Note that the only place this solution fails is with direct pointer
# equality checks with the public objects.

# XXX What about saying that the stable API is not sub-interpreter
# compatible?


function run_capi() {
./python Tools/c-analyzer/c-analyzer.py capi \
--no-progress \
--group-by kind \
--func --inline --macro \
--no-show-empty \
--ignore '<must-resolve.ignored>' \
$@
}

echo ''
echo '#################################################'
echo '# All API'
echo '#################################################'
run_capi --format summary Include/*.h Include/cpython/*.h
run_capi --format table Include/*.h Include/cpython/*.h
echo ''
echo ''
echo '#################################################'
echo '# stable API'
echo '#################################################'
echo ''
echo '# public:'
run_capi --format summary --public --no-show-empty Include/*.h
echo ''
echo '# private:'
run_capi --format summary --private --no-show-empty Include/*.h
echo ''
run_capi --format full -v Include/*.h
#run_capi --format full -v --public Include/*.h
#run_capi --format full -v --private Include/*.h
echo ''
echo '#################################################'
echo '# cpython API'
echo '#################################################'
echo ''
echo '# public:'
run_capi --format summary --public --no-show-empty Include/cpython/*.h
echo ''
echo '# private:'
run_capi --format summary --private --no-show-empty Include/cpython/*.h
echo ''
run_capi --format full -v Include/cpython/*.h
#run_capi --format full -v --public Include/cpython/*.h
#run_capi --format full -v --private Include/cpython/*.h

[8]ページ先頭

©2009-2025 Movatter.jp