From: Adam Nemet Date: Mon, 6 Mar 2017 19:15:22 +0000 (+0000) Subject: [opt-diff] Fix the case when the script is invoked with directories X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=079dec76a9a820e41d422b2fdcdf3432cb334461;p=llvm [opt-diff] Fix the case when the script is invoked with directories git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297055 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/opt-viewer/opt-diff.py b/utils/opt-viewer/opt-diff.py index c51e05e2152..8c377860653 100755 --- a/utils/opt-viewer/opt-diff.py +++ b/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__':