| Age | Commit message (Collapse) | Author |
|
- 94c63de ("Support disabling warnings for redundant assignments")
adds support for disabling warnings in the case where a symbol is
assigned more than once within a .config file but always assigned the
same value.
Contributed by Sebastian Bøe.
- Various other minor code nits.
|
|
Saves a tiny bit of bytecode too.
|
|
|
|
Implicit submenus are created after parsing, in _finalize_tree(), so the
parent can never be a symbol in _parse_block().
|
|
Old code.
|
|
It's set to -1 in every return path, so we can just do it at the
beginning instead.
|
|
|
|
Choice symbols without prompts are pointless and probably nonexistent in
practice, so it's a bit silly to run the no-prompt optimization for
them.
Piggyback copyright year update.
|
|
Saves a tiny bit of bytecode too.
|
|
Already know the value.
|
|
|
|
Also switch to a faster local lookup for the second _T_HELP.
Micro-optimization -- shaves a % or two of the _tokenize() runtime. We
expect a token for valid Kconfig files, so the naming is still fine.
|
|
Support disabling warnings for redundant assignments
|
|
The Linux Kernel's merge_config.sh defaults to disabling warnings for
redundant assignments and has support for enabling them
specifically. This patch reproduces this behaviour in kconfiglib
except that we retaing kconfiglib's default behaviour of enabling the
warnings.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
|
|
|
|
Piggyback some cleanup and redundant comment removal.
|
|
|
|
|
|
- d2a2727 (Implement autoconf.h generation) adds support for generating
C headers in the same format as used for include/generated/autoconf.h
in the kernel, contributed by Carles Cufi from the Zephyr project.
- 5d693b2 (Don't write out 'option env' symbols to C header) makes
it so that attempts to manually set user values on 'option env'
symbols are rejected (though such symbols were never written out to
.config files).
|
|
Simpler.
I realized there's actually no need to follow the node pointers, since
menus and comments never generate output.
|
|
|
|
Oversight. SYMBOL_AUTO (env_var) being set indirectly clears
SYMBOL_WRITE (_write_to_conf) in sym_calc_value(). The .config case was
already fine due to an explicit env_var check.
Even non-visible env. symbols ended up in the header, due to
'option env' internally adding a default.
Disallow user values altogether on 'option env' symbols, even if
specified manually. This matches the C implementation. Add a warning
too.
|
|
Implement autoconf.h generation
|
|
Implement the generation of the C header file that mirrors the .config
files, commonly named autoconf.h.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
|
|
Functions similarly to scripts/kconfig/merge_config.sh from the kernel.
Came up in https://github.com/zephyrproject-rtos/zephyr/pull/5417.
|
|
Not passing -p1 causes the root Makefile to be patched instead of
scripts/kconfig/Makefile, as discovered in
https://github.com/ulfalizer/Kconfiglib/issues/32.
|
|
- Small parsing performance improvements:
80b9198 (Micro-optimize Symbol.__init__() a bit)
626b6ea (Check for type first when parsing properties)
d6aa5cf (Tokenize in _next_line())
- Minor documentation nits (typos, etc.)
|
|
|
|
Copy-paste error.
Piggyback error message consistency nit for help_grep.py.
|
|
|
|
s/_parsing_configs/_parsing_kconfigs/
|
|
|
|
- Remove redundant parentheses in indent_print().
- Use unnumbered replacement fields with format().
|
|
Already have the parent in 'parent'.
|
|
Leftovers
|
|
No need to use a dictionary.
|
|
Rephrase it a bit too.
|
|
Fetching the next line is always followed by tokenization in practice
(outside of help texts), so things can be simplified a bit. Return
True/False to indicate EOF instead of returning the line.
|
|
Most common case. Make it cheap by storing the list of type tokens
separately instead of building the tuple each time through.
Shaves a few % off the runtime for property parsing.
|
|
|
|
Chained assignments turn a bunch of LOAD_CONSTs into DUP_TOPs. Shaves
~10% off the runtime of _lookup_sym().
Do the same for Choice.__init__(), just for consistency. Remove an
accidental duplicated assigment to 'defaults' too.
|
|
Similar to _get_assignable(). Cleaner than setting the cached value at
every 'return'.
|
|
IANAL, but hopefully this should be enough. Don't bundle the license
file. Might be easier to work with if just kconfiglib.py is copied.
|
|
Some were for now-removed APIs, others tested things that are tested
differently now.
|
|
The previous version would accept stuff like
'option env defconfig_list', due to how the tests were laid out.
|
|
|
|
Just a few nits and a small optimization: d890343 (Micro-optimize
write_config() a bit). No bug fixes or functional changes.
|
|
The invalidation is necessary now that no global invalidation is done
before loading a .config.
|
|
Shaves a few % in line_profiler with no loss in readability.
Menus and comments are rare relatively speaking (~10% of all items
written out for alldefconfig), so optimize for the symbol case.
|
|
Bit less redundant.
|