[PATCH] D26967: Put opt-viewer critical items in parallel

Adam Nemet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 20:24:48 PST 2016


anemet added inline comments.


================
Comment at: utils/opt-viewer/opt-viewer.py:346
 
-        file_remarks.setdefault(remark.File, dict()).setdefault(remark.Line, []).append(remark)
+    def merge_dicts(dicts):
+        merged = defaultdict(functools.partial(defaultdict, list))
----------------
bcain wrote:
> anemet wrote:
> > merge_file_remark_dicts
> I left this as-is.  It's designed to be an abstract merge among an iterable of dictionaries.
> 
> `[ {'a': [3], }, {'a': [4], }, {'b': [6] }] -> {'a': [3,4,], 'b': [6]}`
> 
> If you feel it would be better with the specific concepts we're leveraging here, I'll change it.
Sounds good, just add a comment at the call then that this is merging the list of remarks at each line of each file.


Repository:
  rL LLVM

https://reviews.llvm.org/D26967





More information about the llvm-commits mailing list