summaryrefslogtreecommitdiff
path: root/test/Scripts
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-10-05 17:56:46 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-10-05 17:56:46 +0000
commit3ef2c9f6d7c79120e0a1ed4e705c613d2abd8684 (patch)
treead12a684a0e3e35684bc5d8ea52140284fce4fa6 /test/Scripts
parentcc1f91c83305c446090c0ae127e1324c3c9eae08 (diff)
downloadllvm-3ef2c9f6d7c79120e0a1ed4e705c613d2abd8684.tar.gz
llvm-3ef2c9f6d7c79120e0a1ed4e705c613d2abd8684.tar.bz2
llvm-3ef2c9f6d7c79120e0a1ed4e705c613d2abd8684.tar.xz
test/coff-dump: Support reading from stdin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115640 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Scripts')
-rwxr-xr-xtest/Scripts/coff-dump.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/Scripts/coff-dump.py b/test/Scripts/coff-dump.py
index 7868c006a4..d734f0a013 100755
--- a/test/Scripts/coff-dump.py
+++ b/test/Scripts/coff-dump.py
@@ -560,7 +560,12 @@ def handle_element(entry):
return handlers[entry[0]](entry)
-Input = open (sys.argv[1], "rb")
+if len(sys.argv) <= 1 or sys.argv[1] == '-':
+ import StringIO
+ Input = StringIO.StringIO(sys.stdin.read())
+else:
+ Input = open (sys.argv[1], "rb")
+
try:
handle_element(file)
finally: