summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp b/llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp
index ecc569dab83..91205d2f01e 100644
--- a/llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp
+++ b/llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp
@@ -53,10 +53,9 @@ void MachineOptimizationRemarkEmitter::emit(
LLVMContext &Ctx = MF.getFunction()->getContext();
- // If a diagnostic has a hotness value, then only emit it if its hotness
- // meets the threshold.
- if (OptDiag.getHotness() &&
- *OptDiag.getHotness() < Ctx.getDiagnosticsHotnessThreshold()) {
+ // Only emit it if its hotness meets the threshold.
+ if (OptDiag.getHotness().getValueOr(0) <
+ Ctx.getDiagnosticsHotnessThreshold()) {
return;
}
OpenPOWER on IntegriCloud