[PATCH] D59894: [opt-viewer] Make filter_=None by default in get_remarks and gather_results

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 11:13:09 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL357106: [opt-viewer] Make filter_=None by default in get_remarks and gather_results (authored by paquette, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D59894?vs=192482&id=192486#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59894/new/

https://reviews.llvm.org/D59894

Files:
  llvm/trunk/tools/opt-viewer/optrecord.py


Index: llvm/trunk/tools/opt-viewer/optrecord.py
===================================================================
--- llvm/trunk/tools/opt-viewer/optrecord.py
+++ llvm/trunk/tools/opt-viewer/optrecord.py
@@ -265,7 +265,7 @@
         return "red"
 
 
-def get_remarks(input_file, filter_):
+def get_remarks(input_file, filter_=None):
     max_hotness = 0
     all_remarks = dict()
     file_remarks = defaultdict(functools.partial(defaultdict, list))
@@ -273,14 +273,16 @@
     with open(input_file) as f:
         docs = yaml.load_all(f, Loader=Loader)
 
-        filter_e = re.compile(filter_)
+        filter_e = None
+        if filter_:
+            filter_e = re.compile(filter_)
         for remark in docs:
             remark.canonicalize()
             # Avoid remarks withoug debug location or if they are duplicated
             if not hasattr(remark, 'DebugLoc') or remark.key in all_remarks:
                 continue
 
-            if filter_ and not filter_e.search(remark.Pass):
+            if filter_e and not filter_e.search(remark.Pass):
                 continue
 
             all_remarks[remark.key] = remark
@@ -297,7 +299,7 @@
     return max_hotness, all_remarks, file_remarks
 
 
-def gather_results(filenames, num_jobs, should_print_progress, filter_):
+def gather_results(filenames, num_jobs, should_print_progress, filter_=None):
     if should_print_progress:
         print('Reading YAML files...')
     if not Remark.demangler_proc:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59894.192486.patch
Type: text/x-patch
Size: 1468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190327/31936914/attachment.bin>


More information about the llvm-commits mailing list