def RunLLC(infile, outfile, filetype): env.push() env.setmany(input=infile, output=outfile, filetype=filetype) if env.getbool('SANDBOXED'): is_shared, soname, needed = RunLLCSandboxed() env.pop() # soname and dt_needed libs are returned from LLC and passed to LD driver_tools.SetBitcodeMetadata(infile, is_shared, soname, needed) else: driver_tools.Run("${RUN_LLC}") # As a side effect, this creates a temporary file if not env.getbool('SAVE_TEMPS'): TempFiles.add(outfile + '.meta') env.pop() return 0
def RunLLC(infile, outfile, filetype): env.push() env.setmany(input=infile, output=outfile, filetype=filetype) if env.getbool('SANDBOXED'): is_shared, soname, needed = RunLLCSandboxed() env.pop() # soname and dt_needed libs are returned from LLC and passed to LD driver_tools.SetBitcodeMetadata(infile, is_shared, soname, needed) else: args = ["${RUN_LLC}"] if driver_tools.IsPNaClBitcode(infile): args.append("-bitcode-format=pnacl") driver_tools.Run(' '.join(args)) env.pop() return 0
def RunCompiler(infile, outfile, outfiletype, use_sz): env.push() env.setmany(input=infile, output=outfile, outfiletype=outfiletype) if env.getbool('SANDBOXED'): RunSandboxedCompiler(use_sz) else: args = ["${RUN_SZ}" if use_sz else "${RUN_LLC}"] if filetype.IsPNaClBitcode(infile): args.append("-bitcode-format=pnacl") elif filetype.IsLLVMBitcode(infile): if not env.getbool('ALLOW_LLVM_BITCODE_INPUT'): Log.Fatal('Translator expects finalized PNaCl bitcode. ' 'Pass --allow-llvm-bitcode-input to override.') driver_tools.Run(' '.join(args)) env.pop() return 0
def RunLLC(infile, outfile, outfiletype): env.push() env.setmany(input=infile, output=outfile, outfiletype=outfiletype) if env.getbool('SANDBOXED'): is_shared, soname, needed = RunLLCSandboxed() # Ignore is_shared, soname, and needed for now, since we aren't # dealing with bitcode shared libraries. env.pop() else: args = ["${RUN_LLC}"] if filetype.IsPNaClBitcode(infile): args.append("-bitcode-format=pnacl") elif filetype.IsLLVMBitcode(infile): if not env.getbool('ALLOW_LLVM_BITCODE_INPUT'): Log.Fatal('Translator expects finalized PNaCl bitcode. ' 'Pass --allow-llvm-bitcode-input to override.') driver_tools.Run(' '.join(args)) env.pop() return 0
def RunWithEnv(cmd, **kwargs): env.push() env.setmany(**kwargs) ret = Run(cmd) env.pop() return ret