]> granicus.if.org Git - llvm/commitdiff
[opt-viewer] Don't fail with remarks without debug location
authorAdam Nemet <anemet@apple.com>
Mon, 14 Nov 2016 18:38:48 +0000 (18:38 +0000)
committerAdam Nemet <anemet@apple.com>
Mon, 14 Nov 2016 18:38:48 +0000 (18:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286861 91177308-0d34-0410-b5e6-96231b3b80d8

utils/opt-viewer/opt-viewer.py

index ee5c7b52e119a0a7716c1c951f4314e29f92678b..bc30618c85437f5167201b192ddadb64fcebf5dc 100755 (executable)
@@ -275,8 +275,8 @@ for input_file in args.yaml_files:
     f = open(input_file)
     docs = yaml.load_all(f)
     for remark in docs:
-        # Avoid duplicated remarks
-        if remark.key in all_remarks:
+        # Avoid remarks withoug debug location or if they are duplicated
+        if not hasattr(remark, 'DebugLoc') or remark.key in all_remarks:
             continue
         all_remarks[remark.key] = remark