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

Unified Diff: llvm2iceinsts.py

Issue 554013002: Subzero: Move python scripts into a common pydir. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crosstest/runtests.sh ('k') | pydir/crosstest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: llvm2iceinsts.py
diff --git a/llvm2iceinsts.py b/llvm2iceinsts.py
deleted file mode 100755
index 29ddd145fa7d526d0c2fc4ef6de53474a0c7a1e9..0000000000000000000000000000000000000000
--- a/llvm2iceinsts.py
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env python2
-
-import argparse
-import itertools
-import os
-import re
-import subprocess
-import sys
-
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'pydir'))
-
-from utils import shellcmd
-
-if __name__ == '__main__':
- desc = 'Run llvm2ice on llvm file to produce ICE instructions.'
- argparser = argparse.ArgumentParser(
- description=desc,
- formatter_class=argparse.ArgumentDefaultsHelpFormatter,
- epilog='''
- Runs in two modes, depending on whether the flag '--pnacl' is specified.
-
- If flag '--pnacl' is omitted, it runs llvm2ice to (directly) generate
- the corresponding ICE instructions.
-
- If flag '--pnacl' is given, it first assembles and freezes the
- llvm source file generating the corresponding PNaCl bitcode
- file. The PNaCl bitcode file is then piped into llvm2ice to
- generate the corresponding ICE instructions.
- ''')
- argparser.add_argument(
- '--llvm2ice', required=False, default='./llvm2ice', metavar='LLVM2ICE',
- help='Path to llvm2ice driver program')
- argparser.add_argument('--llvm-bin-path', required=False,
- default=None, metavar='LLVM_BIN_PATH',
- help='Path to LLVM executables ' +
- '(for building PNaCl files)')
- argparser.add_argument('--pnacl', required=False,
- action='store_true',
- help='Convert llvm source to PNaCl bitcode ' +
- 'file first')
- argparser.add_argument('--echo-cmd', required=False,
- action='store_true',
- help='Trace command that generates ICE instructions')
- argparser.add_argument('llfile', nargs=1,
- metavar='LLVM_FILE',
- help='Llvm source file')
-
- args = argparser.parse_args()
- llvm_bin_path = args.llvm_bin_path
- llfile = args.llfile[0]
-
- cmd = []
- if args.pnacl:
- cmd = [os.path.join(llvm_bin_path, 'llvm-as'), llfile, '-o', '-', '|',
- os.path.join(llvm_bin_path, 'pnacl-freeze'),
- '--allow-local-symbol-tables', '|']
- cmd += [args.llvm2ice, '-verbose', 'inst', '-notranslate']
- if args.pnacl:
- cmd += ['--allow-local-symbol-tables', '--bitcode-format=pnacl']
- else:
- cmd.append(llfile)
-
- stdout_result = shellcmd(cmd, echo=args.echo_cmd)
- if not args.echo_cmd:
- sys.stdout.write(stdout_result)
« no previous file with comments | « crosstest/runtests.sh ('k') | pydir/crosstest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698