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
This commit is contained in:
Tyler Nowicki 2014-07-18 19:36:04 +00:00
parent 6a33571ba9
commit 8530b6eee0
2 changed files with 9 additions and 9 deletions

View File

@ -51,7 +51,7 @@ enum DiagnosticKind {
DK_OptimizationRemark,
DK_OptimizationRemarkMissed,
DK_OptimizationRemarkAnalysis,
DK_OptimizationWarning,
DK_OptimizationFailure,
DK_FirstPluginKind
};
@ -412,8 +412,8 @@ void emitOptimizationRemarkAnalysis(LLVMContext &Ctx, const char *PassName,
const Function &Fn, const DebugLoc &DLoc,
const Twine &Msg);
/// Diagnostic information for optimization warnings.
class DiagnosticInfoOptimizationWarning
/// Diagnostic information for optimization failures.
class DiagnosticInfoOptimizationFailure
: public DiagnosticInfoOptimizationBase {
public:
/// \p Fn is the function where the diagnostic is being emitted. \p DLoc is
@ -422,13 +422,13 @@ public:
/// location. \p Msg is the message to show. Note that this class does not
/// copy this message, so this reference must be valid for the whole life time
/// of the diagnostic.
DiagnosticInfoOptimizationWarning(const Function &Fn, const DebugLoc &DLoc,
DiagnosticInfoOptimizationFailure(const Function &Fn, const DebugLoc &DLoc,
const Twine &Msg)
: DiagnosticInfoOptimizationBase(DK_OptimizationWarning, DS_Warning,
: DiagnosticInfoOptimizationBase(DK_OptimizationFailure, DS_Warning,
nullptr, Fn, DLoc, Msg) {}
static bool classof(const DiagnosticInfo *DI) {
return DI->getKind() == DK_OptimizationWarning;
return DI->getKind() == DK_OptimizationFailure;
}
/// \see DiagnosticInfoOptimizationBase::isEnabled.

View File

@ -190,19 +190,19 @@ void llvm::emitOptimizationRemarkAnalysis(LLVMContext &Ctx,
DiagnosticInfoOptimizationRemarkAnalysis(PassName, Fn, DLoc, Msg));
}
bool DiagnosticInfoOptimizationWarning::isEnabled() const {
bool DiagnosticInfoOptimizationFailure::isEnabled() const {
// Only print warnings.
return getSeverity() == DS_Warning;
}
void llvm::emitLoopVectorizeWarning(LLVMContext &Ctx, const Function &Fn,
const DebugLoc &DLoc, const Twine &Msg) {
Ctx.diagnose(DiagnosticInfoOptimizationWarning(
Ctx.diagnose(DiagnosticInfoOptimizationFailure(
Fn, DLoc, Twine("loop not vectorized: " + Msg)));
}
void llvm::emitLoopInterleaveWarning(LLVMContext &Ctx, const Function &Fn,
const DebugLoc &DLoc, const Twine &Msg) {
Ctx.diagnose(DiagnosticInfoOptimizationWarning(
Ctx.diagnose(DiagnosticInfoOptimizationFailure(
Fn, DLoc, Twine("loop not interleaved: " + Msg)));
}