[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
This commit is contained in:
Adam Nemet 2016-07-20 21:44:22 +00:00
parent 45603dc4d7
commit c8216345a3
2 changed files with 5 additions and 4 deletions

View File

@ -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<uint64_t> computeHotness(Value *V);
Optional<uint64_t> computeHotness(const Value *V);
OptimizationRemarkEmitter(const OptimizationRemarkEmitter &) = delete;
void operator=(const OptimizationRemarkEmitter &) = delete;

View File

@ -20,7 +20,7 @@
using namespace llvm;
Optional<uint64_t> OptimizationRemarkEmitter::computeHotness(Value *V) {
Optional<uint64_t> OptimizationRemarkEmitter::computeHotness(const Value *V) {
if (!BFI)
return None;
@ -28,7 +28,8 @@ Optional<uint64_t> 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)));