aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-09-25 22:31:58 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-09-25 22:31:58 +0000
commit8be5c159df96c88880a50086a41efc86b89a46a4 (patch)
tree1ebab4c7feda3df655cd667b0fc38baf9b17e29d
parentb9c398b25b9c24769fb30b90c3805a500806e06f (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
-rw-r--r--include/clang/Frontend/TextDiagnosticPrinter.h2
-rw-r--r--lib/Frontend/TextDiagnosticPrinter.cpp16
2 files changed, 7 insertions, 11 deletions
diff --git a/include/clang/Frontend/TextDiagnosticPrinter.h b/include/clang/Frontend/TextDiagnosticPrinter.h
index 3310426e24..354df101e6 100644
--- a/include/clang/Frontend/TextDiagnosticPrinter.h
+++ b/include/clang/Frontend/TextDiagnosticPrinter.h
@@ -68,7 +68,7 @@ private:
void EmitCaretDiagnostic(SourceLocation Loc,
SmallVectorImpl<CharSourceRange> &Ranges,
const SourceManager &SM,
- ArrayRef<FixItHint> Hints, unsigned Columns);
+ ArrayRef<FixItHint> Hints);
};
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();