From: Adam Nemet Date: Wed, 20 Jul 2016 21:44:22 +0000 (+0000) Subject: [OptDiag] Take the IR Value as a const pointer X-Git-Tag: llvmorg-4.0.0-rc1~14716 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6100d16e7d63b377038a1da54bc25c66779bdafc;p=platform%2Fupstream%2Fllvm.git [OptDiag] Take the IR Value as a const pointer This helps because LoopAccessReport is passed around as a const reference and we derive the basic block passed as the Value parameter from the instruction in LoopAccessReport. llvm-svn: 276191 --- diff --git a/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h b/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h index 4881751..71d989b 100644 --- a/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h +++ b/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h @@ -51,7 +51,7 @@ public: /// where the diagnostic is generated. \p V is the IR Value that identifies /// the code region. \p Msg is the message string to use. void emitOptimizationRemarkMissed(const char *PassName, const DebugLoc &DLoc, - Value *V, const Twine &Msg); + const Value *V, const Twine &Msg); /// \brief Same as above but derives the IR Value for the code region and the /// debug location from the Loop parameter \p L. @@ -63,7 +63,7 @@ private: BlockFrequencyInfo *BFI; - Optional computeHotness(Value *V); + Optional computeHotness(const Value *V); OptimizationRemarkEmitter(const OptimizationRemarkEmitter &) = delete; void operator=(const OptimizationRemarkEmitter &) = delete; diff --git a/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp b/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp index b844db2..910d194 100644 --- a/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp +++ b/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp @@ -20,7 +20,7 @@ using namespace llvm; -Optional OptimizationRemarkEmitter::computeHotness(Value *V) { +Optional OptimizationRemarkEmitter::computeHotness(const Value *V) { if (!BFI) return None; @@ -28,7 +28,8 @@ Optional OptimizationRemarkEmitter::computeHotness(Value *V) { } void OptimizationRemarkEmitter::emitOptimizationRemarkMissed( - const char *PassName, const DebugLoc &DLoc, Value *V, const Twine &Msg) { + const char *PassName, const DebugLoc &DLoc, const Value *V, + const Twine &Msg) { LLVMContext &Ctx = F->getContext(); Ctx.diagnose(DiagnosticInfoOptimizationRemarkMissed(PassName, *F, DLoc, Msg, computeHotness(V)));