From 0df1e464f8b9f057bed9219f76013b15de9822a9 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Thu, 13 Jul 2017 04:19:13 +0000 Subject: [PATCH] [opt-viewer] Don't except when debug info is not available. For records without DebugLoc we simply skip the caller location in map_remarks. Fixes PR33764. Patch by Simon Whittaker! llvm-svn: 307880 --- tools/opt-viewer/opt-viewer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/opt-viewer/opt-viewer.py b/tools/opt-viewer/opt-viewer.py index 5e5daf7feb0..e6dd6a0286f 100755 --- a/tools/opt-viewer/opt-viewer.py +++ b/tools/opt-viewer/opt-viewer.py @@ -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,