Index: pnacl/driver/pnacl-meta.py |
diff --git a/pnacl/driver/pnacl-meta.py b/pnacl/driver/pnacl-meta.py |
index 19487ffb6877a9ddee3ea63155a68bd320414518..cc4b9c8700f6b88a6d2a7370d520f25680a2ba70 100755 |
--- a/pnacl/driver/pnacl-meta.py |
+++ b/pnacl/driver/pnacl-meta.py |
@@ -1,15 +1,15 @@ |
#!/usr/bin/python |
-# Copyright (c) 2011 The Native Client Authors. All rights reserved. |
+# Copyright (c) 2012 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 |
+# % pnacl/build.sh driver |
# in order for them to take effect in the scons build. This command |
# updates the copy in the toolchain/ tree. |
# |
-# Show the PNaCl metadata of a bitcode file |
+# Show the PNaCl metadata of a bitcode file. |
from driver_tools import * |
from driver_env import env |
@@ -28,9 +28,17 @@ def Usage(): |
print "Usage: pnacl-meta [files...]" |
print "Show the PNaCl-specific metadata of a bitcode file" |
+def OutputAll(input_file, metadata): |
+ print pathtools.touser(input_file) + ":" |
+ for k, v in metadata.iteritems(): |
+ if isinstance(v, list): |
+ v = '[ ' + ', '.join(v) + ' ]' |
+ print ' %-12s: %s' % (k, v) |
+ else: |
+ print ' %-12s: %s' % (k, v) |
+ |
def main(argv): |
ParseArgs(argv, META_PATTERNS) |
- |
inputs = env.get('INPUTS') |
if not inputs: |
@@ -41,11 +49,7 @@ def main(argv): |
if not IsBitcode(f): |
Log.Fatal("%s: File is not bitcode", pathtools.touser(f)) |
metadata = GetBitcodeMetadata(f) |
- print pathtools.touser(f) + ":" |
- for k, v in metadata.iteritems(): |
- if isinstance(v, list): |
- v = "[ " + ', '.join(v) + " ]" |
- print " %-12s: %s" % (k, v) |
+ OutputAll(f, metadata) |
return 0 |