summaryrefslogtreecommitdiffstats
path: root/llvm/tools/opt-viewer/opt-viewer.py
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2017-07-17 18:00:41 +0000
committerAdam Nemet <anemet@apple.com>2017-07-17 18:00:41 +0000
commit659d7dbb0e82ab3f13f2e5eb0f6303f22bfd34e4 (patch)
treeab5444df6e6320808699c35cf5b1991864b7158d /llvm/tools/opt-viewer/opt-viewer.py
parent6af25595622bb874060f62b0c4531a1f47a7eaf4 (diff)
downloadbcm5719-llvm-659d7dbb0e82ab3f13f2e5eb0f6303f22bfd34e4.tar.gz
bcm5719-llvm-659d7dbb0e82ab3f13f2e5eb0f6303f22bfd34e4.zip
[opt-viewer] Accept directories that are searched for opt.yaml files
This allows to pass the build directory where all the opt.yaml files are rather than find | xargs which may invoke opt-viewer multiple times producing incomplete html output. The patch generalizes the same functionality from opt-diff. Differential Revision: https://reviews.llvm.org/D35491 llvm-svn: 308200
Diffstat (limited to 'llvm/tools/opt-viewer/opt-viewer.py')
-rwxr-xr-xllvm/tools/opt-viewer/opt-viewer.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/tools/opt-viewer/opt-viewer.py b/llvm/tools/opt-viewer/opt-viewer.py
index e6dd6a0286f..69bcaedb766 100755
--- a/llvm/tools/opt-viewer/opt-viewer.py
+++ b/llvm/tools/opt-viewer/opt-viewer.py
@@ -219,7 +219,11 @@ def generate_report(all_remarks,
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=desc)
- parser.add_argument('yaml_files', nargs='+')
+ parser.add_argument(
+ 'yaml_dirs_or_files',
+ nargs='+',
+ help='List of optimization record files or directories searched '
+ 'for optimization record files.')
parser.add_argument(
'--output-dir',
'-o',
@@ -248,8 +252,14 @@ if __name__ == '__main__':
args = parser.parse_args()
print_progress = not args.no_progress_indicator
+
+ files = optrecord.find_opt_files(args.yaml_dirs_or_files)
+ if not files:
+ parser.error("No *.opt.yaml files found")
+ sys.exit(1)
+
all_remarks, file_remarks, should_display_hotness = \
- optrecord.gather_results(args.yaml_files, args.jobs, print_progress)
+ optrecord.gather_results(files, args.jobs, print_progress)
map_remarks(all_remarks)
OpenPOWER on IntegriCloud