diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-09-25 22:31:58 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-09-25 22:31:58 +0000 |
commit | 8be5c159df96c88880a50086a41efc86b89a46a4 (patch) | |
tree | 1ebab4c7feda3df655cd667b0fc38baf9b17e29d /lib/Frontend/TextDiagnosticPrinter.cpp | |
parent | b9c398b25b9c24769fb30b90c3805a500806e06f (diff) |
Actually remove the members of CaretDiagnostic no longer in use for
tracking the start and stop of macro expansion suppression. Also remove
the Columns variable which was just a convenience variable based on
DiagOpts. Instead we materialize it in the one piece of code that cared.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140475 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/TextDiagnosticPrinter.cpp')
-rw-r--r-- | lib/Frontend/TextDiagnosticPrinter.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/Frontend/TextDiagnosticPrinter.cpp b/lib/Frontend/TextDiagnosticPrinter.cpp index 214ee44eee..ca060b6d66 100644 --- a/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/lib/Frontend/TextDiagnosticPrinter.cpp @@ -314,17 +314,14 @@ class CaretDiagnostic { const SourceManager &SM; const LangOptions &LangOpts; const DiagnosticOptions &DiagOpts; - const unsigned Columns, MacroSkipStart, MacroSkipEnd; public: CaretDiagnostic(TextDiagnosticPrinter &Printer, raw_ostream &OS, const SourceManager &SM, const LangOptions &LangOpts, - const DiagnosticOptions &DiagOpts, - unsigned Columns) - : Printer(Printer), OS(OS), SM(SM), LangOpts(LangOpts), DiagOpts(DiagOpts), - Columns(Columns), MacroSkipStart(0), MacroSkipEnd(0) { + const DiagnosticOptions &DiagOpts) + : Printer(Printer), OS(OS), SM(SM), LangOpts(LangOpts), DiagOpts(DiagOpts) { } /// \brief Emit the caret diagnostic text. @@ -506,6 +503,7 @@ public: // If the source line is too long for our terminal, select only the // "interesting" source region within that line. + unsigned Columns = DiagOpts.MessageLength; if (Columns && SourceLine.size() > Columns) SelectInterestingSourceRegion(SourceLine, CaretLine, FixItInsertionLine, CaretEndColNo, Columns); @@ -766,14 +764,13 @@ void TextDiagnosticPrinter::EmitCaretDiagnostic( SourceLocation Loc, SmallVectorImpl<CharSourceRange>& Ranges, const SourceManager &SM, - ArrayRef<FixItHint> Hints, - unsigned Columns) { + ArrayRef<FixItHint> Hints) { assert(LangOpts && "Unexpected diagnostic outside source file processing"); assert(DiagOpts && "Unexpected diagnostic without options set"); // FIXME: Remove this method and have clients directly build and call Emit on // the CaretDiagnostic object. - CaretDiagnostic CaretDiag(*this, OS, SM, *LangOpts, *DiagOpts, Columns); + CaretDiagnostic CaretDiag(*this, OS, SM, *LangOpts, *DiagOpts); unsigned MacroDepth = 0; CaretDiag.Emit(Loc, Ranges, Hints, MacroDepth); } @@ -1246,8 +1243,7 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level, EmitCaretDiagnostic(LastLoc, Ranges, LastLoc.getManager(), llvm::makeArrayRef(Info.getFixItHints(), - Info.getNumFixItHints()), - DiagOpts->MessageLength); + Info.getNumFixItHints())); } OS.flush(); |