Split the DiagnosticInfo class into two disjoint classes:
one for building up the diagnostic that is in flight (DiagnosticBuilder)
and one for pulling structured information out of the diagnostic when
formatting and presenting it.
There is no functionality change with this patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59849 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp
index eebdd1e..4c25287 100644
--- a/lib/Lex/Lexer.cpp
+++ b/lib/Lex/Lexer.cpp
@@ -309,9 +309,9 @@
/// Diag - Forwarding function for diagnostics. This translate a source
/// position in the current buffer into a SourceLocation object for rendering.
-DiagnosticInfo Lexer::Diag(const char *Loc, unsigned DiagID) const {
+DiagnosticBuilder Lexer::Diag(const char *Loc, unsigned DiagID) const {
if (LexingRawMode && Diagnostic::isBuiltinNoteWarningOrExtension(DiagID))
- return DiagnosticInfo(0, FullSourceLoc(), 0);
+ return DiagnosticBuilder();
return PP->Diag(getSourceLocation(Loc), DiagID);
}