summaryrefslogtreecommitdiffstats
path: root/llvm/utils/opt-viewer/opt-diff.py
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2017-03-06 19:15:22 +0000
committerAdam Nemet <anemet@apple.com>2017-03-06 19:15:22 +0000
commitb1d026f0fe09af37efb7a245a0183eb9714292ca (patch)
tree4764a27e0b6bb7063f87f735c193e28a7f1161ea /llvm/utils/opt-viewer/opt-diff.py
parent5b8fae5edd57b6a9ca8a282b508bee0537bc7957 (diff)
downloadbcm5719-llvm-b1d026f0fe09af37efb7a245a0183eb9714292ca.tar.gz
bcm5719-llvm-b1d026f0fe09af37efb7a245a0183eb9714292ca.zip
[opt-diff] Fix the case when the script is invoked with directories
llvm-svn: 297055
Diffstat (limited to 'llvm/utils/opt-viewer/opt-diff.py')
-rwxr-xr-xllvm/utils/opt-viewer/opt-diff.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/utils/opt-viewer/opt-diff.py b/llvm/utils/opt-viewer/opt-diff.py
index c51e05e2152..8c377860653 100755
--- a/llvm/utils/opt-viewer/opt-diff.py
+++ b/llvm/utils/opt-viewer/opt-diff.py
@@ -21,6 +21,7 @@ import argparse
from collections import defaultdict
from multiprocessing import cpu_count, Pool
import os, os.path
+import fnmatch
def find_files(dir_or_file):
if os.path.isfile(dir_or_file):
@@ -29,7 +30,8 @@ def find_files(dir_or_file):
all = []
for dir, subdirs, files in os.walk(dir_or_file):
for file in files:
- all.append( os.path.join(dir, file))
+ if fnmatch.fnmatch(file, "*.opt.yaml"):
+ all.append( os.path.join(dir, file))
return all
if __name__ == '__main__':
OpenPOWER on IntegriCloud