diff --git a/llvm/include/llvm/IR/DiagnosticInfo.h b/llvm/include/llvm/IR/DiagnosticInfo.h index 1d4eddc0959d..a327399b813b 100644 --- a/llvm/include/llvm/IR/DiagnosticInfo.h +++ b/llvm/include/llvm/IR/DiagnosticInfo.h @@ -641,12 +641,13 @@ public: /// remark. \p Loc is the debug location and \p CodeRegion is the region /// that the optimization operates on (currently on block is supported). OptimizationRemarkMissed(const char *PassName, StringRef RemarkName, - const DiagnosticLocation &Loc, Value *CodeRegion); + const DiagnosticLocation &Loc, + const Value *CodeRegion); /// \brief Same as above but \p Inst is used to derive code region and debug /// location. OptimizationRemarkMissed(const char *PassName, StringRef RemarkName, - Instruction *Inst); + const Instruction *Inst); static bool classof(const DiagnosticInfo *DI) { return DI->getKind() == DK_OptimizationRemarkMissed; @@ -681,7 +682,8 @@ public: /// remark. \p Loc is the debug location and \p CodeRegion is the region /// that the optimization operates on (currently on block is supported). OptimizationRemarkAnalysis(const char *PassName, StringRef RemarkName, - const DiagnosticLocation &Loc, Value *CodeRegion); + const DiagnosticLocation &Loc, + const Value *CodeRegion); /// \brief This is ctor variant allows a pass to build an optimization remark /// from an existing remark. @@ -697,7 +699,7 @@ public: /// \brief Same as above but \p Inst is used to derive code region and debug /// location. OptimizationRemarkAnalysis(const char *PassName, StringRef RemarkName, - Instruction *Inst); + const Instruction *Inst); static bool classof(const DiagnosticInfo *DI) { return DI->getKind() == DK_OptimizationRemarkAnalysis; @@ -723,7 +725,8 @@ protected: OptimizationRemarkAnalysis(enum DiagnosticKind Kind, const char *PassName, StringRef RemarkName, - const DiagnosticLocation &Loc, Value *CodeRegion); + const DiagnosticLocation &Loc, + const Value *CodeRegion); }; /// Diagnostic information for optimization analysis remarks related to @@ -757,7 +760,7 @@ public: OptimizationRemarkAnalysisFPCommute(const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, - Value *CodeRegion) + const Value *CodeRegion) : OptimizationRemarkAnalysis(DK_OptimizationRemarkAnalysisFPCommute, PassName, RemarkName, Loc, CodeRegion) {} @@ -796,7 +799,7 @@ public: /// pointer aliasing legality. OptimizationRemarkAnalysisAliasing(const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, - Value *CodeRegion) + const Value *CodeRegion) : OptimizationRemarkAnalysis(DK_OptimizationRemarkAnalysisAliasing, PassName, RemarkName, Loc, CodeRegion) {} @@ -922,7 +925,7 @@ public: /// supported). DiagnosticInfoOptimizationFailure(const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, - Value *CodeRegion); + const Value *CodeRegion); static bool classof(const DiagnosticInfo *DI) { return DI->getKind() == DK_OptimizationFailure; diff --git a/llvm/lib/IR/DiagnosticInfo.cpp b/llvm/lib/IR/DiagnosticInfo.cpp index fccf34a6ccbf..8afb547971c7 100644 --- a/llvm/lib/IR/DiagnosticInfo.cpp +++ b/llvm/lib/IR/DiagnosticInfo.cpp @@ -240,14 +240,14 @@ bool OptimizationRemark::isEnabled(StringRef PassName) { OptimizationRemarkMissed::OptimizationRemarkMissed( const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, - Value *CodeRegion) + const Value *CodeRegion) : DiagnosticInfoIROptimization( DK_OptimizationRemarkMissed, DS_Remark, PassName, RemarkName, *cast(CodeRegion)->getParent(), Loc, CodeRegion) {} OptimizationRemarkMissed::OptimizationRemarkMissed(const char *PassName, StringRef RemarkName, - Instruction *Inst) + const Instruction *Inst) : DiagnosticInfoIROptimization(DK_OptimizationRemarkMissed, DS_Remark, PassName, RemarkName, *Inst->getParent()->getParent(), @@ -260,14 +260,14 @@ bool OptimizationRemarkMissed::isEnabled(StringRef PassName) { OptimizationRemarkAnalysis::OptimizationRemarkAnalysis( const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, - Value *CodeRegion) + const Value *CodeRegion) : DiagnosticInfoIROptimization( DK_OptimizationRemarkAnalysis, DS_Remark, PassName, RemarkName, *cast(CodeRegion)->getParent(), Loc, CodeRegion) {} OptimizationRemarkAnalysis::OptimizationRemarkAnalysis(const char *PassName, StringRef RemarkName, - Instruction *Inst) + const Instruction *Inst) : DiagnosticInfoIROptimization(DK_OptimizationRemarkAnalysis, DS_Remark, PassName, RemarkName, *Inst->getParent()->getParent(), @@ -275,7 +275,7 @@ OptimizationRemarkAnalysis::OptimizationRemarkAnalysis(const char *PassName, OptimizationRemarkAnalysis::OptimizationRemarkAnalysis( enum DiagnosticKind Kind, const char *PassName, StringRef RemarkName, - const DiagnosticLocation &Loc, Value *CodeRegion) + const DiagnosticLocation &Loc, const Value *CodeRegion) : DiagnosticInfoIROptimization(Kind, DS_Remark, PassName, RemarkName, *cast(CodeRegion)->getParent(), Loc, CodeRegion) {} @@ -327,7 +327,7 @@ void llvm::emitOptimizationRemarkAnalysisAliasing(LLVMContext &Ctx, DiagnosticInfoOptimizationFailure::DiagnosticInfoOptimizationFailure( const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, - Value *CodeRegion) + const Value *CodeRegion) : DiagnosticInfoIROptimization( DK_OptimizationFailure, DS_Warning, PassName, RemarkName, *cast(CodeRegion)->getParent(), Loc, CodeRegion) {}