diff options
Diffstat (limited to 'llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h')
| -rw-r--r-- | llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h b/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h index a99514133e5..4c3b0fb949b 100644 --- a/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h +++ b/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h @@ -67,8 +67,8 @@ public: bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv); - /// \brief Output the remark to the optimization record file. Also send it to - /// the diagnostic handler if remarks are requested for the pass. + /// \brief Output the remark via the diagnostic handler and to the + /// optimization record file. void emit(DiagnosticInfoOptimizationBase &OptDiag); /// \brief Whether we allow for extra compile-time budget to perform more @@ -78,10 +78,9 @@ public: /// use the extra analysis (1) to filter trivial false positives or (2) to /// provide more context so that non-trivial false positives can be quickly /// detected by the user. - bool allowExtraAnalysis() const { - // For now, only allow this with -fsave-optimization-record since the -Rpass - // options are handled in the front-end. - return F->getContext().getDiagnosticsOutputFile(); + bool allowExtraAnalysis(StringRef PassName) const { + return (F->getContext().getDiagnosticsOutputFile() || + F->getContext().getDiagHandlerPtr()->isAnyRemarkEnabled(PassName)); } private: |

