]> granicus.if.org Git - llvm/commitdiff
[opt-viewer] Don't except when debug info is not available.
authorDavide Italiano <davide@freebsd.org>
Thu, 13 Jul 2017 04:19:13 +0000 (04:19 +0000)
committerDavide Italiano <davide@freebsd.org>
Thu, 13 Jul 2017 04:19:13 +0000 (04:19 +0000)
For records without DebugLoc we simply skip the caller location in
map_remarks.

Fixes PR33764.

Patch by Simon Whittaker!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307880 91177308-0d34-0410-b5e6-96231b3b80d8

tools/opt-viewer/opt-viewer.py

index 5e5daf7feb0de081a4576f112ec87b31003a50c3..e6dd6a0286fe7beb48504eb2ad75b08d11ce87cf 100755 (executable)
@@ -178,7 +178,10 @@ def map_remarks(all_remarks):
             for arg in remark.Args:
                 caller = arg.get('Caller')
                 if caller:
-                    context.caller_loc[caller] = arg['DebugLoc']
+                    try:
+                        context.caller_loc[caller] = arg['DebugLoc']
+                    except KeyError:
+                        pass
 
 
 def generate_report(all_remarks,