aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/TextDiagnostic.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-10-16 02:57:39 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-10-16 02:57:39 +0000
commit21a869aace45586125238fde88c477b330618a0b (patch)
tree0a0c93e7dc3a5253ebddab6658d95c18c1d91191 /lib/Frontend/TextDiagnostic.cpp
parent7531f571808201d44002fa38b67ee0a81e5ae936 (diff)
Persist the TextDiagnostic object across multiple diagnostics as long as
the SourceManager doesn't change, and the source files don't change. This greatly simplifies the interfaces and interactions. The lifetime of the TextDiagnostic object forms the 'session' over which we attempt to condense and deduplicate information in diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142104 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/TextDiagnostic.cpp')
-rw-r--r--lib/Frontend/TextDiagnostic.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/Frontend/TextDiagnostic.cpp b/lib/Frontend/TextDiagnostic.cpp
index d1936e3a02..259e05b473 100644
--- a/lib/Frontend/TextDiagnostic.cpp
+++ b/lib/Frontend/TextDiagnostic.cpp
@@ -392,17 +392,9 @@ static bool printWordWrapped(raw_ostream &OS, StringRef Str,
TextDiagnostic::TextDiagnostic(raw_ostream &OS,
const SourceManager &SM,
const LangOptions &LangOpts,
- const DiagnosticOptions &DiagOpts,
- FullSourceLoc LastLoc,
- FullSourceLoc LastIncludeLoc,
- DiagnosticsEngine::Level LastLevel)
- : OS(OS), SM(SM), LangOpts(LangOpts), DiagOpts(DiagOpts),
- LastLoc(LastLoc), LastIncludeLoc(LastIncludeLoc), LastLevel(LastLevel) {
- if (LastLoc.isValid() && &SM != &LastLoc.getManager())
- this->LastLoc = SourceLocation();
- if (LastIncludeLoc.isValid() && &SM != &LastIncludeLoc.getManager())
- this->LastIncludeLoc = SourceLocation();
- }
+ const DiagnosticOptions &DiagOpts)
+ : OS(OS), SM(SM), LangOpts(LangOpts), DiagOpts(DiagOpts), LastLevel() {
+}
void TextDiagnostic::emitDiagnostic(SourceLocation Loc,
DiagnosticsEngine::Level Level,