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

It will be used from clang.

llvm-svn: 293145
This commit is contained in:
Adam Nemet 2017-01-26 04:03:18 +00:00
parent 80166d4afe
commit 1e0d16cfff
1 changed files with 15 additions and 0 deletions

View 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