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

Unified Diff: tools/llvm/driver/pnacl-strip.py

Issue 8395028: Move tools/llvm/driver to pnacl/driver. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 9 years, 2 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 | « tools/llvm/driver/pnacl-ranlib.py ('k') | tools/llvm/driver/pnacl-translate.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/llvm/driver/pnacl-strip.py
===================================================================
--- tools/llvm/driver/pnacl-strip.py (revision 7025)
+++ tools/llvm/driver/pnacl-strip.py (working copy)
@@ -1,66 +0,0 @@
-#!/usr/bin/python
-# Copyright (c) 2011 The Native Client Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# IMPORTANT NOTE: If you make local mods to this file, you must run:
-# % tools/llvm/utman.sh driver
-# in order for them to take effect in the scons build. This command
-# updates the copy in the toolchain/ tree.
-#
-
-from driver_tools import *
-
-EXTRA_ENV = {
- 'INPUTS' : '',
- 'OUTPUT' : '',
- 'MODE' : 'all',
- 'OPT_FLAGS_all' : '-disable-opt --strip',
- 'OPT_FLAGS_debug' : '-disable-opt --strip-debug',
- 'STRIP_FLAGS_all' : '-s',
- 'STRIP_FLAGS_debug' : '-S',
-
- 'OPT_FLAGS' : '${OPT_FLAGS_%MODE%}',
- 'STRIP_FLAGS' : '${STRIP_FLAGS_%MODE%}',
-
- 'RUN_OPT' : '${LLVM_OPT} ${OPT_FLAGS} ${input} -o ${output}',
- 'RUN_STRIP' : '${STRIP} ${STRIP_FLAGS} ${input} -o ${output}',
-}
-env.update(EXTRA_ENV)
-
-StripPatterns = [
- ( ('-o','(.*)'), "env.set('OUTPUT', pathtools.normalize($0))"),
- ( ('-o','(.*)'), "env.set('OUTPUT', pathtools.normalize($0))"),
- ( '--strip-all', "env.set('MODE', 'all')"),
- ( '-s', "env.set('MODE', 'all')"),
-
- ( '--strip-debug', "env.set('MODE', 'debug')"),
- ( '-S', "env.set('MODE', 'debug')"),
- ( '(-.*)', UnrecognizedOption),
-
- ( '(.*)', "env.append('INPUTS', pathtools.normalize($0))"),
-]
-
-def main(argv):
- ParseArgs(argv, StripPatterns)
- inputs = env.get('INPUTS')
- output = env.getone('OUTPUT')
-
- if len(inputs) > 1 and output != '':
- Log.Fatal('Cannot have -o with multiple inputs')
-
- for f in inputs:
- if output != '':
- f_output = output
- else:
- f_output = f
- if IsBitcode(f):
- RunWithEnv('${RUN_OPT}', input = f, output = f_output)
- elif IsELF(f):
- RunWithEnv('${RUN_STRIP}', input = f, output = f_output)
- else:
- Log.Fatal('%s: File is neither ELF nor bitcode', pathtools.touser(f))
- return 0
-
-if __name__ == "__main__":
- DriverMain(main)
« no previous file with comments | « tools/llvm/driver/pnacl-ranlib.py ('k') | tools/llvm/driver/pnacl-translate.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698