Rename Diagnostic to DiagnosticsEngine as per issue 5397
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140478 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Rewrite/FixItRewriter.cpp b/lib/Rewrite/FixItRewriter.cpp
index 706b6ea..4ef7bc3 100644
--- a/lib/Rewrite/FixItRewriter.cpp
+++ b/lib/Rewrite/FixItRewriter.cpp
@@ -25,7 +25,7 @@
using namespace clang;
-FixItRewriter::FixItRewriter(Diagnostic &Diags, SourceManager &SourceMgr,
+FixItRewriter::FixItRewriter(DiagnosticsEngine &Diags, SourceManager &SourceMgr,
const LangOptions &LangOpts,
FixItOptions *FixItOpts)
: Diags(Diags),
@@ -78,7 +78,7 @@
return Client ? Client->IncludeInDiagnosticCounts() : true;
}
-void FixItRewriter::HandleDiagnostic(Diagnostic::Level DiagLevel,
+void FixItRewriter::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
const DiagnosticInfo &Info) {
// Default implementation (Warnings/errors count).
DiagnosticClient::HandleDiagnostic(DiagLevel, Info);
@@ -86,7 +86,7 @@
Client->HandleDiagnostic(DiagLevel, Info);
// Skip over any diagnostics that are ignored or notes.
- if (DiagLevel <= Diagnostic::Note)
+ if (DiagLevel <= DiagnosticsEngine::Note)
return;
// Make sure that we can perform all of the modifications we
@@ -107,7 +107,8 @@
Diag(Info.getLocation(), diag::note_fixit_in_macro);
// If this was an error, refuse to perform any rewriting.
- if (DiagLevel == Diagnostic::Error || DiagLevel == Diagnostic::Fatal) {
+ if (DiagLevel == DiagnosticsEngine::Error ||
+ DiagLevel == DiagnosticsEngine::Fatal) {
if (++NumFailures == 1)
Diag(Info.getLocation(), diag::note_fixit_unfixed_error);
}
diff --git a/lib/Rewrite/HTMLRewrite.cpp b/lib/Rewrite/HTMLRewrite.cpp
index 3b78158..fae44a3 100644
--- a/lib/Rewrite/HTMLRewrite.cpp
+++ b/lib/Rewrite/HTMLRewrite.cpp
@@ -444,7 +444,7 @@
/// IgnoringDiagClient - This is a diagnostic client that just ignores all
/// diags.
class IgnoringDiagClient : public DiagnosticClient {
- void HandleDiagnostic(Diagnostic::Level DiagLevel,
+ void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
const DiagnosticInfo &Info) {
// Just ignore it.
}
@@ -493,14 +493,14 @@
// Temporarily change the diagnostics object so that we ignore any generated
// diagnostics from this pass.
- Diagnostic TmpDiags(PP.getDiagnostics().getDiagnosticIDs(),
+ DiagnosticsEngine TmpDiags(PP.getDiagnostics().getDiagnosticIDs(),
new IgnoringDiagClient);
// FIXME: This is a huge hack; we reuse the input preprocessor because we want
// its state, but we aren't actually changing it (we hope). This should really
// construct a copy of the preprocessor.
Preprocessor &TmpPP = const_cast<Preprocessor&>(PP);
- Diagnostic *OldDiags = &TmpPP.getDiagnostics();
+ DiagnosticsEngine *OldDiags = &TmpPP.getDiagnostics();
TmpPP.setDiagnostics(TmpDiags);
// Inform the preprocessor that we don't want comments.
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp
index 4f9c174..57d1210 100644
--- a/lib/Rewrite/RewriteObjC.cpp
+++ b/lib/Rewrite/RewriteObjC.cpp
@@ -55,7 +55,7 @@
};
Rewriter Rewrite;
- Diagnostic &Diags;
+ DiagnosticsEngine &Diags;
const LangOptions &LangOpts;
unsigned RewriteFailedDiag;
unsigned TryFinallyContainsReturnDiag;
@@ -172,7 +172,7 @@
void HandleTopLevelSingleDecl(Decl *D);
void HandleDeclInMainFile(Decl *D);
RewriteObjC(std::string inFile, raw_ostream *OS,
- Diagnostic &D, const LangOptions &LOpts,
+ DiagnosticsEngine &D, const LangOptions &LOpts,
bool silenceMacroWarn);
~RewriteObjC() {}
@@ -523,21 +523,22 @@
}
RewriteObjC::RewriteObjC(std::string inFile, raw_ostream* OS,
- Diagnostic &D, const LangOptions &LOpts,
+ DiagnosticsEngine &D, const LangOptions &LOpts,
bool silenceMacroWarn)
: Diags(D), LangOpts(LOpts), InFileName(inFile), OutFile(OS),
SilenceRewriteMacroWarning(silenceMacroWarn) {
IsHeader = IsHeaderFile(inFile);
- RewriteFailedDiag = Diags.getCustomDiagID(Diagnostic::Warning,
+ RewriteFailedDiag = Diags.getCustomDiagID(DiagnosticsEngine::Warning,
"rewriting sub-expression within a macro (may not be correct)");
- TryFinallyContainsReturnDiag = Diags.getCustomDiagID(Diagnostic::Warning,
+ TryFinallyContainsReturnDiag = Diags.getCustomDiagID(
+ DiagnosticsEngine::Warning,
"rewriter doesn't support user-specified control flow semantics "
"for @try/@finally (code may not execute properly)");
}
ASTConsumer *clang::CreateObjCRewriter(const std::string& InFile,
raw_ostream* OS,
- Diagnostic &Diags,
+ DiagnosticsEngine &Diags,
const LangOptions &LOpts,
bool SilenceRewriteMacroWarning) {
return new RewriteObjC(InFile, OS, Diags, LOpts, SilenceRewriteMacroWarning);