diff --git a/Utilities/StaticAnalyzers/scripts/callgraph.py b/Utilities/StaticAnalyzers/scripts/callgraph.py index 320d0ae4764d4..154bfe6fbabe8 100755 --- a/Utilities/StaticAnalyzers/scripts/callgraph.py +++ b/Utilities/StaticAnalyzers/scripts/callgraph.py @@ -17,6 +17,11 @@ G = nx.DiGraph() +modules = set() +with open('modules_in_ib.txt', 'r') as m: + for line in m: + modules.add(line.strip()) + h = open('module_to_package.yaml', 'r') module2package = yaml.load(h, Loader=yaml.FullLoader) @@ -59,13 +64,12 @@ callstacks.add(cs) break - report = dict() for key in sorted(module2package.keys()): for value in sorted(module2package[key]): for cs in sorted(callstacks): vre = re.compile(' %s::.*();' % value) - if vre.search(cs): + if vre.search(cs) and value in modules: print(value, key, cs) report.setdefault(key, {}).setdefault(value, []).append(cs) r = open('eventsetuprecord-get.yaml', 'w')