Skip to content

Commit

Permalink
[opt-diff] Fix the case when the script is invoked with directories
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297055 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
anemet committed Mar 6, 2017
1 parent a3e49c5 commit 079dec7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/opt-viewer/opt-diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
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):
Expand All @@ -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__':
Expand Down

0 comments on commit 079dec7

Please sign in to comment.