parameters: (cwd, compile_command, iwyu_args, verbose)
return_statement: return subprocess.call(command, cwd=cwd, shell=True)
docstring: Rewrite compile_command to an IWYU command, and run it.
docstring_summary: Rewrite compile_command to an IWYU command, and run it.
docstring_tokens: Rewrite compile_command to an IWYU command and run it .
function: def run_iwyu(cwd, compile_command, iwyu_args, verbose):
      """ Rewrite compile_command to an IWYU command, and run it. """
      compiler, _, args = compile_command.partition(' ')
      if compiler.endswith('cl.exe'):
          # If the compiler name is cl.exe, let IWYU be cl-compatible
          clang_args = ['--driver-mode=cl']
      else:
          clang_args = []
  
      iwyu_args = ['-Xiwyu ' + a for a in iwyu_args]
      command = ['include-what-you-use'] + clang_args + iwyu_args
      command = '%s %s' % (' '.join(command), args.strip())
  
      if verbose:
          print('%s:' % command)
  
      return subprocess.call(command, cwd=cwd, shell=True)
function_tokens: def run_iwyu ( cwd , compile_command , iwyu_args , verbose ) : compiler , _ , args = compile_command . partition ( ' ' ) if compiler . endswith ( 'cl.exe' ) : # If the compiler name is cl.exe, let IWYU be cl-compatible clang_args = [ '--driver-mode=cl' ] else : clang_args = [ ] iwyu_args = [ '-Xiwyu ' + a for a in iwyu_args ] command = [ 'include-what-you-use' ] + clang_args + iwyu_args command = '%s %s' % ( ' ' . join ( command ) , args . strip ( ) ) if verbose : print ( '%s:' % command ) return subprocess . call ( command , cwd = cwd , shell = True )