update.py: Filter defs when indexing refs

Signed-off-by: Maxime Chretien (MixLeNain) <mchretien@linuxmail.org>
This commit is contained in:
Maxime Chretien (MixLeNain) 2020-12-07 11:36:51 +01:00
parent 21fdc0c3ec
commit c7f427b672

View file

@ -54,6 +54,7 @@ tag_ready = Condition() # Waiting for new tags
new_idxes = [] # (new idxes, Event idxes ready, Event defs ready, Event comps ready, Event vers ready)
bindings_idxes = [] # DT bindings documentation files
defs_idxes = {} # Idents definitions stored with (idx*1 000 000 + line) as the key.
tags_done = False # True if all tags have been added to new_idxes
@ -240,6 +241,8 @@ class UpdateDefs(Thread):
type = type.decode()
line = int(line.decode())
defs_idxes[idx*1000000+line] = ident
if db.defs.exists(ident):
obj = db.defs.get(ident)
elif lib.isIdent(ident):
@ -312,6 +315,8 @@ class UpdateRefs(Thread):
tok = prefix + tok
if (db.defs.exists(tok) and
not ( (idx*1000000+line_num) in defs_idxes and
defs_idxes[idx*1000000+line_num] == tok ) and
(family != 'M' or tok.startswith(b'CONFIG_'))):
# We only index CONFIG_??? in makefiles
if tok in idents: