[llvm] r293145 - [OptDiag] Predicates to check the same type of IR and MIR opt remarks

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 20:03:19 PST 2017


Author: anemet
Date: Wed Jan 25 22:03:18 2017
New Revision: 293145

URL: http://llvm.org/viewvc/llvm-project?rev=293145&view=rev
Log:
[OptDiag] Predicates to check the same type of IR and MIR opt remarks

It will be used from clang.

Modified:
    llvm/trunk/include/llvm/IR/DiagnosticInfo.h

Modified: llvm/trunk/include/llvm/IR/DiagnosticInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DiagnosticInfo.h?rev=293145&r1=293144&r2=293145&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DiagnosticInfo.h (original)
+++ llvm/trunk/include/llvm/IR/DiagnosticInfo.h Wed Jan 25 22:03:18 2017
@@ -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




More information about the llvm-commits mailing list