summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorBrian Gesiak <modocache@gmail.com>2017-06-27 16:46:50 +0000
committerBrian Gesiak <modocache@gmail.com>2017-06-27 16:46:50 +0000
commit9473db43b6cb994d577ea7da5a438f5feb2e817f (patch)
treeaf8ae062820b14bb771fdb59dd6a6b4bf4eeb138 /llvm/utils
parent22322fb6385a77bdffd4d096f0650db8acc48eef (diff)
downloadbcm5719-llvm-9473db43b6cb994d577ea7da5a438f5feb2e817f.tar.gz
bcm5719-llvm-9473db43b6cb994d577ea7da5a438f5feb2e817f.zip
[opt-viewer] Python 3 support in opt-diff.py
Summary: The `file()` builtin is not available in Python 3; use `open()` instead. https://docs.python.org/3.0/whatsnew/3.0.html#builtins Reviewers: anemet, davidxl, davide Reviewed By: davide Subscribers: davide, fhahn, llvm-commits Differential Revision: https://reviews.llvm.org/D34670 llvm-svn: 306423
Diffstat (limited to 'llvm/utils')
-rwxr-xr-xllvm/utils/opt-viewer/opt-diff.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/utils/opt-viewer/opt-diff.py b/llvm/utils/opt-viewer/opt-diff.py
index 2b5d1bbfabb..120f1a15575 100755
--- a/llvm/utils/opt-viewer/opt-diff.py
+++ b/llvm/utils/opt-viewer/opt-diff.py
@@ -66,5 +66,5 @@ if __name__ == '__main__':
r.Added = True
for r in removed:
r.Added = False
- stream = file(args.output, 'w')
- yaml.dump_all(added | removed, stream)
+ with open(args.output, 'w') as stream:
+ yaml.dump_all(added | removed, stream)
OpenPOWER on IntegriCloud