Commit 59e89e3ddf8523be39a8e0a66bacbbdd6a72d069

Authored by Sam Ravnborg
Committed by Michal Marek
1 parent 861b4ea4cc

kconfig: save location of config symbols

When we add a new config symbol save the file/line
so we later can refer to their location.

The information is saved as a property to a config symbol
because we may have multiple definitions of the same symbol.

This has the side-effect that a symbol always has
at least one property.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>

Showing 3 changed files with 5 additions and 0 deletions Side-by-side Diff

scripts/kconfig/expr.h
... ... @@ -132,6 +132,7 @@
132 132 P_SELECT, /* select BAR */
133 133 P_RANGE, /* range 7..100 (for a symbol) */
134 134 P_ENV, /* value from environment variable */
  135 + P_SYMBOL, /* where a symbol is defined */
135 136 };
136 137  
137 138 struct property {
scripts/kconfig/menu.c
... ... @@ -58,6 +58,8 @@
58 58 *last_entry_ptr = menu;
59 59 last_entry_ptr = &menu->next;
60 60 current_entry = menu;
  61 + if (sym)
  62 + menu_add_symbol(P_SYMBOL, sym, NULL);
61 63 }
62 64  
63 65 void menu_end_entry(void)
scripts/kconfig/symbol.c
... ... @@ -961,6 +961,8 @@
961 961 return "select";
962 962 case P_RANGE:
963 963 return "range";
  964 + case P_SYMBOL:
  965 + return "symbol";
964 966 case P_UNKNOWN:
965 967 break;
966 968 }