tools/binary_size/libsupersize/demangle.py
def _ExtractDemanglablePart(names):
  """For each name in |names|, yields the part that can be demangled."""

  def _IsLowerHex(s):
    return _LOWER_HEX_PATTERN.match(s) is not None

  for name in names:
    # Strip prefixes before '_Z', e.g., '.Lswitch.table.'.
    pos = name.find('_Z')
    if pos > 0:
      name = name[pos:]

    # Some mangled symbols end with '$' followed by 32 lower-case hex digits,
    # and possibly '.cfi'. These interfere with demangling by c++filt, and
    # should be stripped.
    if name.endswith('.cfi'):
      name = name[:-4]
    if len(name) > 33 and name[-33] == '$' and _IsLowerHex(name[-32:]):
      yield name[:-33]
    else:
      yield name
For each name in |names|, yields the part that can be demangled.
For each name in |names|, yields the part that can be demangled.
For each name in |names| yields the part that can be demangled .
def _ExtractDemanglablePart(names):
  def _IsLowerHex(s):
    return _LOWER_HEX_PATTERN.match(s) is not None
  for name in names:
    pos = name.find('_Z')
    if pos > 0:
      name = name[pos:]
    if name.endswith('.cfi'):
      name = name[:-4]
    if len(name) > 33 and name[-33] == '$' and _IsLowerHex(name[-32:]):
      yield name[:-33]
    else:
      yield name
def _ExtractDemanglablePart ( names ) : def _IsLowerHex ( s ) : return _LOWER_HEX_PATTERN . match ( s ) is not None for name in names : pos = name . find ( '_Z' ) if pos > 0 : name = name [ pos : ] if name . endswith ( '.cfi' ) : name = name [ : - 4 ] if len ( name ) > 33 and name [ - 33 ] == '$' and _IsLowerHex ( name [ - 32 : ] ) : yield name [ : - 33 ] else : yield name
For each name in |names|, yields the part that can be demangled.
For each name in |names| yields the part that can be demangled .
"""For each name in |names|, yields the part that can be demangled.""" # Strip prefixes before '_Z', e.g., '.Lswitch.table.'. # Some mangled symbols end with '$' followed by 32 lower-case hex digits, # and possibly '.cfi'. These interfere with demangling by c++filt, and # should be stripped.
names