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

Unified Diff: tools/llvm/driver/pnacl-as.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-arm-as.py ('k') | tools/llvm/driver/pnacl-bclink.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/llvm/driver/pnacl-as.py
===================================================================
--- tools/llvm/driver/pnacl-as.py (revision 7025)
+++ tools/llvm/driver/pnacl-as.py (working copy)
@@ -1,97 +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' : '',
-
- # Options
- 'DIAGNOSTIC' : '0',
-
- 'AS_FLAGS_ARM' : '-mfpu=vfp -march=armv7-a',
- # once we can use llvm's ARM assembler we should use these flags
- #'AS_FLAGS_ARM' : '-assemble -filetype=obj -arch=arm -triple=armv7a-nacl',
- 'AS_FLAGS_X8632' : '-assemble -filetype=obj -arch=x86 -triple=i686-nacl',
- 'AS_FLAGS_X8664' : '-assemble -filetype=obj -arch=x86-64 -triple=x86_64-nacl',
-
- 'RUN_BITCODE_AS' : '${LLVM_AS} ${input} -o ${output}',
- 'RUN_NATIVE_AS' : '${AS_%ARCH%} ${AS_FLAGS_%ARCH%} ${input} -o ${output}',
-}
-env.update(EXTRA_ENV)
-
-ASPatterns = [
- ( '-o(.+)', "env.set('OUTPUT', pathtools.normalize($0))"),
- ( ('-o', '(.+)'), "env.set('OUTPUT', pathtools.normalize($0))"),
-
- ( '(-v|--version)', "env.set('DIAGNOSTIC', '1')"),
-
- # Ignore these assembler flags
- ( '(-Qy)', ""),
- ( ('(--traditional-format)', '.*'), ""),
- ( '(-gstabs)', ""),
- ( '(--gstabs)', ""),
- ( '(-gdwarf2)', ""),
- ( '(--gdwarf2)', ""),
- ( '(--fatal-warnings)', ""),
- ( '(-meabi=.*)', ""),
- ( '(-mfpu=.*)', ""),
- ( '(-march=.*)', ""),
-
- ( '(-.*)', UnrecognizedOption),
-
- # Unmatched parameters should be treated as
- # assembly inputs by the "as" incarnation.
- ( '(.*)', "env.append('INPUTS', pathtools.normalize($0))"),
-]
-
-def main(argv):
- ParseArgs(argv, ASPatterns)
- arch = GetArch()
-
- if env.getbool('DIAGNOSTIC'):
- GetArch(required=True)
- env.set('ARGV', *argv)
- # NOTE: we could probably just print a canned string out instead.
- RunWithLog('${AS_%ARCH%} ${ARGV}')
- return 0
-
- inputs = env.get('INPUTS')
- output = env.getone('OUTPUT')
-
- if len(inputs) != 1:
- Log.Fatal('Expecting exactly one input file')
-
- if arch:
- output_type = 'o'
- else:
- output_type = 'po'
-
- if output == '':
- output = 'a.out'
-
- env.push()
- env.set('input', inputs[0])
- env.set('output', output)
-
- if output_type == 'po':
- # .ll to .po
- RunWithLog("${RUN_BITCODE_AS}")
- else:
- # .s to .o
- RunWithLog("${RUN_NATIVE_AS}")
- env.pop()
- return 0
-
-
-if __name__ == "__main__":
- DriverMain(main)
« no previous file with comments | « tools/llvm/driver/pnacl-arm-as.py ('k') | tools/llvm/driver/pnacl-bclink.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698