MCPcopy Index your code
hub / github.com/python/cpython / analyze_decls

Function analyze_decls

Tools/c-analyzer/c_analyzer/__init__.py:47–86  ·  view source on GitHub ↗
(decls, known, *,
                  analyze_resolved=None,
                  handle_unresolved=True,
                  relroot=None,
                  )

Source from the content-addressed store, hash-verified

45
46
47def analyze_decls(decls, known, *,
48 analyze_resolved=None,
49 handle_unresolved=True,
50 relroot=None,
51 ):
52 knowntypes, knowntypespecs = _datafiles.get_known(
53 known,
54 handle_unresolved=handle_unresolved,
55 analyze_resolved=analyze_resolved,
56 relroot=relroot,
57 )
58
59 decls = list(decls)
60 collated = group_by_kinds(decls)
61
62 types = {decl: None for decl in collated['type']}
63 typespecs = _analyze.get_typespecs(types)
64
65 def analyze_decl(decl):
66 return _analyze.analyze_decl(
67 decl,
68 typespecs,
69 knowntypespecs,
70 types,
71 knowntypes,
72 analyze_resolved=analyze_resolved,
73 )
74 _analyze.analyze_type_decls(types, analyze_decl, handle_unresolved)
75 for decl in decls:
76 if decl in types:
77 resolved = types[decl]
78 else:
79 resolved = analyze_decl(decl)
80 if resolved and handle_unresolved:
81 typedeps, _ = resolved
82 if not isinstance(typedeps, TypeDeclaration):
83 if not typedeps or None in typedeps:
84 raise NotImplementedError((decl, resolved))
85
86 yield decl, resolved
87
88
89#######################################

Callers 1

iter_analysis_resultsFunction · 0.85

Calls 3

group_by_kindsFunction · 0.90
listClass · 0.85
analyze_declFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…