Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: pnacl/driver/pnacl-llc.py

Issue 580983002: Remove i686-hosted Linux build and start switching to new directory layout (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: review 2, put back test and build.sh patch from PS5 Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pnacl/driver/driver_tools.py ('k') | pnacl/driver/tests/driver_test_utils.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright (c) 2014 The Native Client Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 # This is a thin wrapper for native LLC. This is not meant to be used by
7 # the user, only by the build system.
8
9 import subprocess
10
11 from driver_env import env
12 import driver_tools
13
14 EXTRA_ENV = {
15 'ARGS' : '',
16 'INPUT' : '',
17 'OUTPUT' : '',
18 # Binary output may go to stdout (when -o was not specified)
19 'HAVE_OUTPUT' : '0',
20 }
21
22 PATTERNS = [
23 (('-o','(.*)'), "env.set('OUTPUT', pathtools.normalize($0))\n" +
24 "env.set('HAVE_OUTPUT', '1')"),
25 ( '(-.*)', "env.append('ARGS', $0)"),
26 ( '(.*)', "env.set('INPUT', $0)"),
27 ]
28
29 def main(argv):
30 env.update(EXTRA_ENV)
31 driver_tools.ParseArgs(argv, PATTERNS)
32
33 driver_tools.CheckPathLength(env.getone('INPUT'))
34 driver_tools.CheckPathLength(env.getone('OUTPUT'))
35
36 driver_tools.Run(
37 '"${LLVM_PNACL_LLC}" ${ARGS} ' +
38 '${HAVE_OUTPUT ? -o ${OUTPUT}} ' +
39 '${INPUT}')
40
41 # only reached in case of no errors
42 return 0
43
44 def get_help(unused_argv):
45 # Set errexit=False -- Do not exit early to allow testing.
46 # For some reason most the llvm tools return non-zero with --help,
47 # while all of the gnu tools return 0 with --help.
48 # On windows, the exit code is also inconsistent =(
49 code, stdout, stderr = driver_tools.Run('${LLVM_PNACL_LLC} -help',
50 redirect_stdout=subprocess.PIPE,
51 redirect_stderr=subprocess.STDOUT,
52 errexit=False)
53
54 help = """
55 LLVM static compiler
56
57 To translate PNaCl bitcode, use pnacl-translate instead.
58
59 """ + stdout
60
61 return help
OLDNEW
« no previous file with comments | « pnacl/driver/driver_tools.py ('k') | pnacl/driver/tests/driver_test_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698