tools/clang/scripts/goma_link.py
def do_main(self, argv):
    """
    This function contains the main code to run. Not intended to be called
    directly. Call main instead, which returns exit status for failing
    subprocesses.
    """
    args = parse_args(argv)
    args.output = self.output_path(argv[1:])
    if args.output is None:
      return self._no_codegen(args)
    if args.gomacc:
      self.gomacc = args.gomacc
    if args.no_gomacc:
      self.gomacc = None
    if args.jobs:
      self.jobs = int(args.jobs)

    basename = os.path.basename(args.output)
    # Only generate tailored native object files for targets on the allow list.
    # TODO: Find a better way to structure this. There are three different
    # ways we can perform linking: Local ThinLTO, distributed ThinLTO,
    # and distributed ThinLTO with common object files.
    # We expect the distributed ThinLTO variants to be faster, but
    # common object files cannot be used when -fsplit-lto-unit is in effect.
    # Currently, we don't detect this situation. We could, but it might
    # be better to instead move this logic out of this script and into
    # the build system.
    use_common_objects = not (args.allowlist or basename in self.ALLOWLIST)
    common_dir = 'common_objs'
    gen_dir = 'lto.' + basename
    params = self.analyze_args(args, gen_dir, common_dir, use_common_objects)
    # If we determined that no distributed code generation need be done, just
    # invoke the original command.
    if params is None:
      return self._no_codegen(args)
    if use_common_objects:
      objs = [x[0] for x in params.codegen]
      ensure_file(common_dir + '/empty.thinlto.bc')
    ninjaname = gen_dir + '/build.ninja'
    self.gen_ninja(ninjaname, params, gen_dir)
    if args.generate:
      sys.stderr.write('Generated ninja file %s\n' % (shquote(ninjaname), ))
    else:
      cmd = [autoninja(), '-f', ninjaname]
      if self.jobs:
        cmd.extend(['-j', str(self.jobs)])
      report_run(cmd)
    return 0

    This function contains the main code to run. Not intended to be called
    directly. Call main instead, which returns exit status for failing
    subprocesses.
    
This function contains the main code to run. Not intended to be called
directly. Call main instead, which returns exit status for failing
subprocesses.
This function contains the main code to run . Not intended to be called directly . Call main instead which returns exit status for failing subprocesses .
def do_main(self, argv):
    args = parse_args(argv)
    args.output = self.output_path(argv[1:])
    if args.output is None:
      return self._no_codegen(args)
    if args.gomacc:
      self.gomacc = args.gomacc
    if args.no_gomacc:
      self.gomacc = None
    if args.jobs:
      self.jobs = int(args.jobs)
    basename = os.path.basename(args.output)
    use_common_objects = not (args.allowlist or basename in self.ALLOWLIST)
    common_dir = 'common_objs'
    gen_dir = 'lto.' + basename
    params = self.analyze_args(args, gen_dir, common_dir, use_common_objects)
    if params is None:
      return self._no_codegen(args)
    if use_common_objects:
      objs = [x[0] for x in params.codegen]
      ensure_file(common_dir + '/empty.thinlto.bc')
    ninjaname = gen_dir + '/build.ninja'
    self.gen_ninja(ninjaname, params, gen_dir)
    if args.generate:
      sys.stderr.write('Generated ninja file %s\n' % (shquote(ninjaname), ))
    else:
      cmd = [autoninja(), '-f', ninjaname]
      if self.jobs:
        cmd.extend(['-j', str(self.jobs)])
      report_run(cmd)
    return 0
def do_main ( self , argv ) : args = parse_args ( argv ) args . output = self . output_path ( argv [ 1 : ] ) if args . output is None : return self . _no_codegen ( args ) if args . gomacc : self . gomacc = args . gomacc if args . no_gomacc : self . gomacc = None if args . jobs : self . jobs = int ( args . jobs ) basename = os . path . basename ( args . output ) use_common_objects = not ( args . allowlist or basename in self . ALLOWLIST ) common_dir = 'common_objs' gen_dir = 'lto.' + basename params = self . analyze_args ( args , gen_dir , common_dir , use_common_objects ) if params is None : return self . _no_codegen ( args ) if use_common_objects : objs = [ x [ 0 ] for x in params . codegen ] ensure_file ( common_dir + '/empty.thinlto.bc' ) ninjaname = gen_dir + '/build.ninja' self . gen_ninja ( ninjaname , params , gen_dir ) if args . generate : sys . stderr . write ( 'Generated ninja file %s\n' % ( shquote ( ninjaname ) , ) ) else : cmd = [ autoninja ( ) , '-f' , ninjaname ] if self . jobs : cmd . extend ( [ '-j' , str ( self . jobs ) ] ) report_run ( cmd ) return 0
This function contains the main code to run.
This function contains the main code to run .
"""
    This function contains the main code to run. Not intended to be called
    directly. Call main instead, which returns exit status for failing
    subprocesses.
    """ # Only generate tailored native object files for targets on the allow list. # TODO: Find a better way to structure this. There are three different # ways we can perform linking: Local ThinLTO, distributed ThinLTO, # and distributed ThinLTO with common object files. # We expect the distributed ThinLTO variants to be faster, but # common object files cannot be used when -fsplit-lto-unit is in effect. # Currently, we don't detect this situation. We could, but it might # be better to instead move this logic out of this script and into # the build system. # If we determined that no distributed code generation need be done, just # invoke the original command.
self
argv