tools/binary_size/libsupersize/function_signature.py
def Parse(name):
  """Strips return type and breaks function signature into parts.

  See unit tests for example signatures.

  Returns:
    A tuple of:
    * name without return type (symbol.full_name),
    * full_name without params (symbol.template_name),
    * full_name without params and template args (symbol.name)
  """
  left_paren_idx = _FindParameterListParen(name)

  full_name = name
  if left_paren_idx > 0:
    right_paren_idx = name.rindex(')')
    assert right_paren_idx > left_paren_idx
    space_idx = _FindReturnValueSpace(name, left_paren_idx)
    name_no_params = name[space_idx + 1:left_paren_idx]
    # Special case for top-level lambdas.
    if name_no_params.endswith('}::_FUN'):
      # Don't use |name_no_params| in here since prior _idx will be off if
      # there was a return value.
      name = _NormalizeTopLevelGccLambda(name, left_paren_idx)
      return Parse(name)
    if name_no_params.endswith('::__invoke') and '$' in name_no_params:
      assert '$_' in name_no_params, 'Surprising lambda: ' + name
      name = _NormalizeTopLevelClangLambda(name, left_paren_idx)
      return Parse(name)

    full_name = name[space_idx + 1:]
    name = name_no_params + name[right_paren_idx + 1:]

  template_name = name
  name = _StripTemplateArgs(name)
  return full_name, template_name, name
Strips return type and breaks function signature into parts.

  See unit tests for example signatures.

  Returns:
    A tuple of:
    * name without return type (symbol.full_name),
    * full_name without params (symbol.template_name),
    * full_name without params and template args (symbol.name)
  
Strips return type and breaks function signature into parts.
See unit tests for example signatures.
Strips return type and breaks function signature into parts . See unit tests for example signatures .
def Parse(name):
  left_paren_idx = _FindParameterListParen(name)
  full_name = name
  if left_paren_idx > 0:
    right_paren_idx = name.rindex(')')
    assert right_paren_idx > left_paren_idx
    space_idx = _FindReturnValueSpace(name, left_paren_idx)
    name_no_params = name[space_idx + 1:left_paren_idx]
    if name_no_params.endswith('}::_FUN'):
      name = _NormalizeTopLevelGccLambda(name, left_paren_idx)
      return Parse(name)
    if name_no_params.endswith('::__invoke') and '$' in name_no_params:
      assert '$_' in name_no_params, 'Surprising lambda: ' + name
      name = _NormalizeTopLevelClangLambda(name, left_paren_idx)
      return Parse(name)
    full_name = name[space_idx + 1:]
    name = name_no_params + name[right_paren_idx + 1:]
  template_name = name
  name = _StripTemplateArgs(name)
  return full_name, template_name, name
def Parse ( name ) : left_paren_idx = _FindParameterListParen ( name ) full_name = name if left_paren_idx > 0 : right_paren_idx = name . rindex ( ')' ) assert right_paren_idx > left_paren_idx space_idx = _FindReturnValueSpace ( name , left_paren_idx ) name_no_params = name [ space_idx + 1 : left_paren_idx ] if name_no_params . endswith ( '}::_FUN' ) : name = _NormalizeTopLevelGccLambda ( name , left_paren_idx ) return Parse ( name ) if name_no_params . endswith ( '::__invoke' ) and '$' in name_no_params : assert '$_' in name_no_params , 'Surprising lambda: ' + name name = _NormalizeTopLevelClangLambda ( name , left_paren_idx ) return Parse ( name ) full_name = name [ space_idx + 1 : ] name = name_no_params + name [ right_paren_idx + 1 : ] template_name = name name = _StripTemplateArgs ( name ) return full_name , template_name , name
Strips return type and breaks function signature into parts.
Strips return type and breaks function signature into parts .
"""Strips return type and breaks function signature into parts.

  See unit tests for example signatures.

  Returns:
    A tuple of:
    * name without return type (symbol.full_name),
    * full_name without params (symbol.template_name),
    * full_name without params and template args (symbol.name)
  """ # Special case for top-level lambdas. # Don't use |name_no_params| in here since prior _idx will be off if # there was a return value.
A tuple of:
name without return type (symbol.full_name),
full_name without params (symbol.template_name),
full_name without params and template args (symbol.name)
A tuple of : name without return type ( symbol . full_name ) full_name without params ( symbol . template_name ) full_name without params and template args ( symbol . name )
name