py: clean up use of mp_verbose_flag#19313
Open
dpgeorge wants to merge 2 commits into
Open
Conversation
This variable does nothing in mpy-cross because: - `MICROPY_DEBUG_PRINTERS` is not enabled, so the relevant code in `py/compile.c` that uses `mp_verbose_flag` is unused. - Even if `MICROPY_DEBUG_PRINTERS` was enabled, nothing happens because mpy-cross has `MP_PLAT_PRINT_STRN` defined to do nothing. - `MICROPY_PY_MICROPYTHON_MEM_INFO` is not enabled. So remove it. But keep the `-v` CLI option to not break existing uses of mpy-cross, and keep it compatible with the CLI options of the unix port. Signed-off-by: Damien George <damien@micropython.org>
This stray global variable doesn't really belong in `py/emitglue.c` because it's currently only used by `py/compile.c`. So move it to the state context struct alongside the related compiler settings. Signed-off-by: Damien George <damien@micropython.org>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19313 +/- ##
=======================================
Coverage 98.47% 98.47%
=======================================
Files 176 176
Lines 22845 22846 +1
=======================================
+ Hits 22497 22498 +1
Misses 348 348 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Code size report: |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Remove unused mp_verbose_flag from mpy-cross. This variable does nothing in mpy-cross because:
MICROPY_DEBUG_PRINTERSis not enabled, so the relevant code inpy/compile.cthat usesmp_verbose_flagis unused.MICROPY_DEBUG_PRINTERSwas enabled, nothing happens because mpy-cross hasMP_PLAT_PRINT_STRNdefined to do nothing.MICROPY_PY_MICROPYTHON_MEM_INFOis not enabled.So remove it. But keep the
-vCLI option to not break existing uses of mpy-cross, and keep it compatible with the CLI options of the unix port. There is therefore no functional change.And move mp_verbose_flag to MP_STATE_VM struct. This stray global variable doesn't really belong in
py/emitglue.cbecause it's currently only used bypy/compile.c. So move it to the state context struct alongside the related compiler settings.Testing
mpy-crossstill accepts-vbut does nothing-varguments to unix standard and coverage builds and checked the behaviour was still the sameGenerative AI
Not used.