tools/clang/scripts/goma_link.py
def process_param(param):
      """
      Common code for processing a single parameter from the either the
      command line or an rsp file.
      """

      def helper():
        """
        This exists so that we can use return instead of
        nested if statements to use the first matching case.
        """
        # After -mllvm, just pass on the param.
        if in_mllvm[0]:
          if param.startswith('-Wl,'):
            codegen_params.append(param[4:])
          else:
            codegen_params.append(param)
          in_mllvm[0] = False
          return

        # Check for params that specify LTO optimization level.
        o = extract_opt_level(param)
        if o is not None:
          optlevel[0] = o
          return

        # Check for params that affect code generation.
        cg_param = self.transform_codegen_param(param)
        if cg_param:
          codegen_params.extend(cg_param)
          # No return here, we still want to check for -mllvm.

        # Check for -mllvm.
        match = self.MLLVM_RE.match(param)
        if match and not match.group(2):
          # Next parameter will be the thing to pass to LLVM.
          in_mllvm[0] = True

      # Parameters that override defaults disable the defaults; the
      # final value is set by passing through the parameter.
      if self.DATA_SECTIONS_RE.match(param):
        data_sections[0] = False
      if self.FUNCTION_SECTIONS_RE.match(param):
        function_sections[0] = False

      helper()
      if self.GROUP_RE.match(param):
        return
      index_params.append(param)
      if os.path.exists(param):
        index_inputs.add(param)
        match = self.OBJ_RE.match(param)
        if match and is_bitcode_file(param):
          native = obj_dir + '/' + match.group(1) + '.' + match.group(2)
          if use_common_objects:
            index = common_index
          else:
            index = obj_dir + '/' + param + '.thinlto.bc'
            ensure_file(index)
          codegen.append((os.path.normpath(native), param, index))
        else:
          final_inputs.add(param)
          final_params.append(param)
      elif not self.LTO_RE.match(param):
        final_params.append(param)

      Common code for processing a single parameter from the either the
      command line or an rsp file.
      
Common code for processing a single parameter from the either the
command line or an rsp file.
Common code for processing a single parameter from the either the command line or an rsp file .
def process_param(param):
      def helper():
        if in_mllvm[0]:
          if param.startswith('-Wl,'):
            codegen_params.append(param[4:])
          else:
            codegen_params.append(param)
          in_mllvm[0] = False
          return
        o = extract_opt_level(param)
        if o is not None:
          optlevel[0] = o
          return
        cg_param = self.transform_codegen_param(param)
        if cg_param:
          codegen_params.extend(cg_param)
        match = self.MLLVM_RE.match(param)
        if match and not match.group(2):
          in_mllvm[0] = True
      if self.DATA_SECTIONS_RE.match(param):
        data_sections[0] = False
      if self.FUNCTION_SECTIONS_RE.match(param):
        function_sections[0] = False
      helper()
      if self.GROUP_RE.match(param):
        return
      index_params.append(param)
      if os.path.exists(param):
        index_inputs.add(param)
        match = self.OBJ_RE.match(param)
        if match and is_bitcode_file(param):
          native = obj_dir + '/' + match.group(1) + '.' + match.group(2)
          if use_common_objects:
            index = common_index
          else:
            index = obj_dir + '/' + param + '.thinlto.bc'
            ensure_file(index)
          codegen.append((os.path.normpath(native), param, index))
        else:
          final_inputs.add(param)
          final_params.append(param)
      elif not self.LTO_RE.match(param):
        final_params.append(param)
def process_param ( param ) : def helper ( ) : """
        This exists so that we can use return instead of
        nested if statements to use the first matching case.
        """ if in_mllvm [ 0 ] : if param . startswith ( '-Wl,' ) : codegen_params . append ( param [ 4 : ] ) else : codegen_params . append ( param ) in_mllvm [ 0 ] = False return o = extract_opt_level ( param ) if o is not None : optlevel [ 0 ] = o return cg_param = self . transform_codegen_param ( param ) if cg_param : codegen_params . extend ( cg_param ) match = self . MLLVM_RE . match ( param ) if match and not match . group ( 2 ) : in_mllvm [ 0 ] = True if self . DATA_SECTIONS_RE . match ( param ) : data_sections [ 0 ] = False if self . FUNCTION_SECTIONS_RE . match ( param ) : function_sections [ 0 ] = False helper ( ) if self . GROUP_RE . match ( param ) : return index_params . append ( param ) if os . path . exists ( param ) : index_inputs . add ( param ) match = self . OBJ_RE . match ( param ) if match and is_bitcode_file ( param ) : native = obj_dir + '/' + match . group ( 1 ) + '.' + match . group ( 2 ) if use_common_objects : index = common_index else : index = obj_dir + '/' + param + '.thinlto.bc' ensure_file ( index ) codegen . append ( ( os . path . normpath ( native ) , param , index ) ) else : final_inputs . add ( param ) final_params . append ( param ) elif not self . LTO_RE . match ( param ) : final_params . append ( param )
Common code for processing a single parameter from the either the
command line or an rsp file.
Common code for processing a single parameter from the either the command line or an rsp file .
"""
      Common code for processing a single parameter from the either the
      command line or an rsp file.
      """ """
        This exists so that we can use return instead of
        nested if statements to use the first matching case.
        """ # After -mllvm, just pass on the param. # Check for params that specify LTO optimization level. # Check for params that affect code generation. # No return here, we still want to check for -mllvm. # Check for -mllvm. # Next parameter will be the thing to pass to LLVM. # Parameters that override defaults disable the defaults; the # final value is set by passing through the parameter.
param