Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/include/llvm/IR/DiagnosticInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ class DiagnosticInfoUnsupported : public DiagnosticInfoWithLocationBase {
/// Diagnostic information for MisExpect analysis.
class DiagnosticInfoMisExpect : public DiagnosticInfoWithLocationBase {
public:
DiagnosticInfoMisExpect(const Instruction *Inst, Twine &Msg);
DiagnosticInfoMisExpect(const Instruction *Inst, const Twine &Msg);

/// \see DiagnosticInfo::print.
void print(DiagnosticPrinter &DP) const override;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/IR/DiagnosticInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ std::string DiagnosticInfoOptimizationBase::getMsg() const {
}

DiagnosticInfoMisExpect::DiagnosticInfoMisExpect(const Instruction *Inst,
Twine &Msg)
const Twine &Msg)
: DiagnosticInfoWithLocationBase(DK_MisExpect, DS_Warning,
*Inst->getParent()->getParent(),
Inst->getDebugLoc()),
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Transforms/Utils/MisExpect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,9 @@ void emitMisexpectDiagnostic(Instruction *I, LLVMContext &Ctx,
"Potential performance regression from use of the llvm.expect intrinsic: "
"Annotation was correct on {0} of profiled executions.",
PerString);
Twine Msg(PerString);
Instruction *Cond = getInstCondition(I);
if (isMisExpectDiagEnabled(Ctx))
Ctx.diagnose(DiagnosticInfoMisExpect(Cond, Msg));
Ctx.diagnose(DiagnosticInfoMisExpect(Cond, Twine(PerString)));
OptimizationRemarkEmitter ORE(I->getParent()->getParent());
ORE.emit(OptimizationRemark(DEBUG_TYPE, "misexpect", Cond) << RemStr.str());
}
Expand Down
Loading