tools/clang/scripts/goma_link.py
def parse_args(args):
  """
  Parses the command line and returns a structure with the results.
  """
  # The basic invocation is to pass in the command line that would be used
  # for a local ThinLTO link. Optionally, this may be preceded by options
  # that set some values for this script. If these optional options are
  # present, they must be followed by '--'.
  ap = argparse.ArgumentParser()
  ap.add_argument('--generate',
                  action='store_true',
                  help='generate ninja file, but do not invoke it.')
  ap.add_argument('--gomacc', help='path to gomacc.')
  ap.add_argument('--jobs', '-j', help='maximum number of concurrent jobs.')
  ap.add_argument('--no-gomacc', action='store_true', help='do not use gomacc.')
  ap.add_argument('--allowlist',
                  action='store_true',
                  help='act as if the target is on the allow list.')
  try:
    splitpos = args.index('--')
  except:
    splitpos = None
  if splitpos:
    parsed = ap.parse_args(args[1:splitpos])
    rest = args[(splitpos + 1):]
  else:
    parsed = ap.parse_args([])
    rest = args[1:]
  parsed.linker = rest[0]
  parsed.linker_args = rest[1:]
  return parsed

  Parses the command line and returns a structure with the results.
  
Parses the command line and returns a structure with the results.
Parses the command line and returns a structure with the results .
def parse_args(args):
  ap = argparse.ArgumentParser()
  ap.add_argument('--generate',
                  action='store_true',
                  help='generate ninja file, but do not invoke it.')
  ap.add_argument('--gomacc', help='path to gomacc.')
  ap.add_argument('--jobs', '-j', help='maximum number of concurrent jobs.')
  ap.add_argument('--no-gomacc', action='store_true', help='do not use gomacc.')
  ap.add_argument('--allowlist',
                  action='store_true',
                  help='act as if the target is on the allow list.')
  try:
    splitpos = args.index('--')
  except:
    splitpos = None
  if splitpos:
    parsed = ap.parse_args(args[1:splitpos])
    rest = args[(splitpos + 1):]
  else:
    parsed = ap.parse_args([])
    rest = args[1:]
  parsed.linker = rest[0]
  parsed.linker_args = rest[1:]
  return parsed
def parse_args ( args ) : ap = argparse . ArgumentParser ( ) ap . add_argument ( '--generate' , action = 'store_true' , help = 'generate ninja file, but do not invoke it.' ) ap . add_argument ( '--gomacc' , help = 'path to gomacc.' ) ap . add_argument ( '--jobs' , '-j' , help = 'maximum number of concurrent jobs.' ) ap . add_argument ( '--no-gomacc' , action = 'store_true' , help = 'do not use gomacc.' ) ap . add_argument ( '--allowlist' , action = 'store_true' , help = 'act as if the target is on the allow list.' ) try : splitpos = args . index ( '--' ) except : splitpos = None if splitpos : parsed = ap . parse_args ( args [ 1 : splitpos ] ) rest = args [ ( splitpos + 1 ) : ] else : parsed = ap . parse_args ( [ ] ) rest = args [ 1 : ] parsed . linker = rest [ 0 ] parsed . linker_args = rest [ 1 : ] return parsed
Parses the command line and returns a structure with the results.
Parses the command line and returns a structure with the results .
"""
  Parses the command line and returns a structure with the results.
  """ # The basic invocation is to pass in the command line that would be used # for a local ThinLTO link. Optionally, this may be preceded by options # that set some values for this script. If these optional options are # present, they must be followed by '--'.
args