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

Function group_by_storage

Tools/c-analyzer/c_analyzer/match.py:184–212  ·  view source on GitHub ↗
(decls, **kwargs)

Source from the content-addressed store, hash-verified

182# grouping with matchers
183
184def group_by_storage(decls, **kwargs):
185 def is_module_global(decl):
186 if not is_module_global_decl(decl):
187 return False
188 if decl.kind == _KIND.VARIABLE:
189 if _info.get_effective_storage(decl) == 'static':
190 # This is covered by is_static_module_global().
191 return False
192 return True
193 def is_static_module_global(decl):
194 if not _match.is_global_var(decl):
195 return False
196 return _info.get_effective_storage(decl) == 'static'
197 def is_static_local(decl):
198 if not _match.is_local_var(decl):
199 return False
200 return _info.get_effective_storage(decl) == 'static'
201 #def is_local(decl):
202 # if not _match.is_local_var(decl):
203 # return False
204 # return _info.get_effective_storage(decl) != 'static'
205 categories = {
206 #'extern': is_extern,
207 'published': is_public_impl,
208 'module-global': is_module_global,
209 'static-module-global': is_static_module_global,
210 'static-local': is_static_local,
211 }
212 return _match.group_by_category(decls, categories, **kwargs)

Callers 1

cmd_checkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…