llvm.org GIT mirror llvm / 8530b6e
Rename DiagnosticInfoOptimizationWarning to DiagnosticInfoOptimizationFailure so the severity of the message is not part of the type name. Reviewed by Alp Toker git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213399 91177308-0d34-0410-b5e6-96231b3b80d8 Tyler Nowicki 5 years ago
2 changed file(s) with 9 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
5050 DK_OptimizationRemark,
5151 DK_OptimizationRemarkMissed,
5252 DK_OptimizationRemarkAnalysis,
53 DK_OptimizationWarning,
53 DK_OptimizationFailure,
5454 DK_FirstPluginKind
5555 };
5656
411411 const Function &Fn, const DebugLoc &DLoc,
412412 const Twine &Msg);
413413
414 /// Diagnostic information for optimization warnings.
415 class DiagnosticInfoOptimizationWarning
414 /// Diagnostic information for optimization failures.
415 class DiagnosticInfoOptimizationFailure
416416 : public DiagnosticInfoOptimizationBase {
417417 public:
418418 /// \p Fn is the function where the diagnostic is being emitted. \p DLoc is
421421 /// location. \p Msg is the message to show. Note that this class does not
422422 /// copy this message, so this reference must be valid for the whole life time
423423 /// of the diagnostic.
424 DiagnosticInfoOptimizationWarning(const Function &Fn, const DebugLoc &DLoc,
424 DiagnosticInfoOptimizationFailure(const Function &Fn, const DebugLoc &DLoc,
425425 const Twine &Msg)
426 : DiagnosticInfoOptimizationBase(DK_OptimizationWarning, DS_Warning,
426 : DiagnosticInfoOptimizationBase(DK_OptimizationFailure, DS_Warning,
427427 nullptr, Fn, DLoc, Msg) {}
428428
429429 static bool classof(const DiagnosticInfo *DI) {
430 return DI->getKind() == DK_OptimizationWarning;
430 return DI->getKind() == DK_OptimizationFailure;
431431 }
432432
433433 /// \see DiagnosticInfoOptimizationBase::isEnabled.
189189 DiagnosticInfoOptimizationRemarkAnalysis(PassName, Fn, DLoc, Msg));
190190 }
191191
192 bool DiagnosticInfoOptimizationWarning::isEnabled() const {
192 bool DiagnosticInfoOptimizationFailure::isEnabled() const {
193193 // Only print warnings.
194194 return getSeverity() == DS_Warning;
195195 }
196196
197197 void llvm::emitLoopVectorizeWarning(LLVMContext &Ctx, const Function &Fn,
198198 const DebugLoc &DLoc, const Twine &Msg) {
199 Ctx.diagnose(DiagnosticInfoOptimizationWarning(
199 Ctx.diagnose(DiagnosticInfoOptimizationFailure(
200200 Fn, DLoc, Twine("loop not vectorized: " + Msg)));
201201 }
202202
203203 void llvm::emitLoopInterleaveWarning(LLVMContext &Ctx, const Function &Fn,
204204 const DebugLoc &DLoc, const Twine &Msg) {
205 Ctx.diagnose(DiagnosticInfoOptimizationWarning(
205 Ctx.diagnose(DiagnosticInfoOptimizationFailure(
206206 Fn, DLoc, Twine("loop not interleaved: " + Msg)));
207207 }