Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
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
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
9 commits Select commitHold shift + click to select a range
528c2bc Fix "c-analyzer.py capi --kinds" handling.
ericsnowcurrently33d0547 Clean up incomplete line parsing.
ericsnowcurrentlyf1e3f78 Improve sorting.
ericsnowcurrently112dcae format: brief -> table
ericsnowcurrentlyb11e21b Fix --no-track-progress.
ericsnowcurrentlya76e87b Add --no-show-empty to CLI.
ericsnowcurrentlyea9845c Filter out "ignored" names.
ericsnowcurrently900b41e Force the default groupby.
ericsnowcurrently4c22e90 Add a basic script to demo the usefulness of the "capi" subcommand.
ericsnowcurrentlyFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
PrevPrevious commit
Add a basic script to demo the usefulness of the "capi" subcommand.
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit4c22e90872e747adc1625bc213ca6ba64bc45210
There are no files selected for viewing
75 changes: 75 additions & 0 deletionsTools/c-analyzer/must-resolve.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff 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 |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.