def MakeSelUniversalScriptForCompiler(infile, outfile, is_pnacl, use_sz):
  script = []
  script.append('readwrite_file objfile %s' % outfile)
  if use_sz:
    modules = 1
    threads = int(env.getone('SZ_THREADS'))
    toolname = 'pnacl-sz'
  else:
    modules = int(env.getone('SPLIT_MODULE'))
    threads = modules
    toolname = 'pnacl-llc'
  if modules > 1:
    script.extend(['readwrite_file objfile%d %s.module%d' % (m, outfile, m)
                   for m in range(1, modules)])
  stream_rate = int(env.getraw('BITCODE_STREAM_RATE'))
  assert stream_rate != 0
  cmdline_len, cmdline_escaped = BuildOverrideCompilerCommandLine(is_pnacl,
                                                                  use_sz)
  assert modules in range(1, 17)
  script.append('rpc StreamInitWithSplit i(%d) h(objfile) ' % threads +
                ' '.join(['h(objfile%d)' % m for m in range(1, modules)] +
                         ['h(invalid)' for x in range(modules, 16)]) +
                ' C(%d,%s) * s()' % (cmdline_len, cmdline_escaped))
  # specify filename, chunk size and rate in bits/s
  script.append('stream_file %s %s %s' % (infile, 64 * 1024, stream_rate))
  script.append('rpc StreamEnd * i() s() s() s()')
  script.append('echo "%s complete"' % toolname)
  script.append('')
  return '\n'.join(script)
Beispiel #2
0
def MakeSelUniversalScriptForLLC(infile, outfile, flags):
  script = []
  script.append('readwrite_file objfile %s' % outfile)
  stream_rate = int(env.getraw('BITCODE_STREAM_RATE'))
  if stream_rate == 0:
    script.append('readonly_file myfile %s' % infile)
    if UseDefaultCommandlineLLC():
      script.append('rpc RunWithDefaultCommandLine  h(myfile) h(objfile) *'
                    ' i() s() s()')
    else:
      cmdline_len, cmdline_escaped = BuildLLCCommandLine(flags)
      script.append('rpc Run h(myfile) h(objfile) C(%d,%s) * i() s() s()' %
                    (cmdline_len, cmdline_escaped))
  else:
    if UseDefaultCommandlineLLC():
      script.append('rpc StreamInit h(objfile) * s()')
    else:
      cmdline_len, cmdline_escaped = BuildLLCCommandLine(flags)
      script.append('rpc StreamInitWithCommandLine h(objfile) C(%d,%s) * s()' %
                    (cmdline_len, cmdline_escaped))
    # specify filename, chunk size and rate in bits/s
    script.append('stream_file %s %s %s' % (infile, 64 * 1024, stream_rate))
    script.append('rpc StreamEnd * i() s() s() s()')
  script.append('echo "llc complete"')
  script.append('')
  return '\n'.join(script)
def MakeSelUniversalScriptForLLC(infile, outfile):
  script = []
  script.append('readwrite_file objfile %s' % outfile)
  stream_rate = int(env.getraw('BITCODE_STREAM_RATE'))
  assert stream_rate != 0
  if UseDefaultCommandlineLLC():
    script.append('rpc StreamInit h(objfile) * s()')
  else:
    cmdline_len, cmdline_escaped = BuildOverrideLLCCommandLine()
    script.append('rpc StreamInitWithOverrides h(objfile) C(%d,%s) * s()' %
                  (cmdline_len, cmdline_escaped))
  # specify filename, chunk size and rate in bits/s
  script.append('stream_file %s %s %s' % (infile, 64 * 1024, stream_rate))
  script.append('rpc StreamEnd * i() s() s() s()')
  script.append('echo "pnacl-llc complete"')
  script.append('')
  return '\n'.join(script)
def MakeSelUniversalScriptForLLC(infile, outfile):
  script = []
  script.append('readwrite_file objfile %s' % outfile)
  stream_rate = int(env.getraw('BITCODE_STREAM_RATE'))
  assert stream_rate != 0
  if UseDefaultCommandlineLLC():
    script.append('rpc StreamInit h(objfile) * s()')
  else:
    cmdline_len, cmdline_escaped = BuildOverrideLLCCommandLine()
    script.append('rpc StreamInitWithOverrides h(objfile) C(%d,%s) * s()' %
                  (cmdline_len, cmdline_escaped))
  # specify filename, chunk size and rate in bits/s
  script.append('stream_file %s %s %s' % (infile, 64 * 1024, stream_rate))
  script.append('rpc StreamEnd * i() s() s() s()')
  script.append('echo "pnacl-llc complete"')
  script.append('')
  return '\n'.join(script)
Beispiel #5
0
def MakeSelUniversalScriptForLLC(infile, outfile, is_pnacl):
    script = []
    script.append('readwrite_file objfile %s' % outfile)
    modules = int(env.getone('SPLIT_MODULE'))
    if modules > 1:
        script.extend([
            'readwrite_file objfile%d %s.module%d' % (m, outfile, m)
            for m in range(1, modules)
        ])
    stream_rate = int(env.getraw('BITCODE_STREAM_RATE'))
    assert stream_rate != 0
    cmdline_len, cmdline_escaped = BuildOverrideLLCCommandLine(is_pnacl)
    assert modules in range(1, 17)
    script.append('rpc StreamInitWithSplit i(%d) h(objfile) ' % modules +
                  ' '.join(['h(objfile%d)' % m for m in range(1, modules)] +
                           ['h(invalid)' for x in range(modules, 16)]) +
                  ' C(%d,%s) * s()' % (cmdline_len, cmdline_escaped))
    # specify filename, chunk size and rate in bits/s
    script.append('stream_file %s %s %s' % (infile, 64 * 1024, stream_rate))
    script.append('rpc StreamEnd * i() s() s() s()')
    script.append('echo "pnacl-llc complete"')
    script.append('')
    return '\n'.join(script)