From: Adam Nemet Date: Thu, 26 Jan 2017 04:03:18 +0000 (+0000) Subject: [OptDiag] Predicates to check the same type of IR and MIR opt remarks X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=33e0aba0c051b74cdb11b47fbaacf9a72174c0f2;p=llvm [OptDiag] Predicates to check the same type of IR and MIR opt remarks It will be used from clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293145 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/IR/DiagnosticInfo.h b/include/llvm/IR/DiagnosticInfo.h index 23b37a08a85..8361c577f9e 100644 --- a/include/llvm/IR/DiagnosticInfo.h +++ b/include/llvm/IR/DiagnosticInfo.h @@ -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