]> granicus.if.org Git - llvm/commitdiff
[OptDiag] Predicates to check the same type of IR and MIR opt remarks
authorAdam Nemet <anemet@apple.com>
Thu, 26 Jan 2017 04:03:18 +0000 (04:03 +0000)
committerAdam Nemet <anemet@apple.com>
Thu, 26 Jan 2017 04:03:18 +0000 (04:03 +0000)
It will be used from clang.

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

include/llvm/IR/DiagnosticInfo.h

index 23b37a08a8566a4fcdd1e05322f7a4c88092b2f2..8361c577f9ea08fd8626df50f81c04037ab859d7 100644 (file)
@@ -451,6 +451,21 @@ public:
             DI->getKind() <= DK_LastMachineRemark);
   }
 
+  bool isPassed() const {
+    return (getKind() == DK_OptimizationRemark ||
+            getKind() == DK_MachineOptimizationRemark);
+  }
+
+  bool isMissed() const {
+    return (getKind() == DK_OptimizationRemarkMissed ||
+            getKind() == DK_MachineOptimizationRemarkMissed);
+  }
+
+  bool isAnalysis() const {
+    return (getKind() == DK_OptimizationRemarkAnalysis ||
+            getKind() == DK_MachineOptimizationRemarkAnalysis);
+  }
+
 protected:
   /// Name of the pass that triggers this report. If this matches the
   /// regular expression given in -Rpass=regexp, then the remark will