diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2011-09-26 01:44:29 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2011-09-26 01:44:29 +0000 |
| commit | d16b42ef9299e6ef02abc0f13ba3a6a9c5a12534 (patch) | |
| tree | 46c205f8bb41c32912667d48fc9568f108e61f18 /clang/lib/Frontend | |
| parent | b1e536bb3a9e25a8bb0e611ed130bf7b4590bf38 (diff) | |
| download | bcm5719-llvm-d16b42ef9299e6ef02abc0f13ba3a6a9c5a12534.tar.gz bcm5719-llvm-d16b42ef9299e6ef02abc0f13ba3a6a9c5a12534.zip | |
Remove support for splitting word-wrapped diagnostic messages on newline
characters. I could find no newline character in a diagnostic message,
and adding an assert to this code never fires in the testsuite.
I think this code is essentially dead, and was previously used for
a different purpose. If I just don't understand how it is we can end up
with a newline here please let me know (with a test case?) and I'll
revert.
llvm-svn: 140497
Diffstat (limited to 'clang/lib/Frontend')
| -rw-r--r-- | clang/lib/Frontend/TextDiagnosticPrinter.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/clang/lib/Frontend/TextDiagnosticPrinter.cpp b/clang/lib/Frontend/TextDiagnosticPrinter.cpp index 6e464f18729..3fd91b2c76f 100644 --- a/clang/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/clang/lib/Frontend/TextDiagnosticPrinter.cpp @@ -1100,17 +1100,7 @@ static bool printWordWrapped(raw_ostream &OS, unsigned Columns, unsigned Column = 0, unsigned Indentation = WordWrapIndentation) { - unsigned Length = Str.size(); - - // If there is a newline in this message somewhere, find that - // newline and split the message into the part before the newline - // (which will be word-wrapped) and the part from the newline one - // (which will be emitted unchanged). - for (unsigned I = 0; I != Length; ++I) - if (Str[I] == '\n') { - Length = I; - break; - } + const unsigned Length = Str.size(); // The string used to indent each line. llvm::SmallString<16> IndentStr; @@ -1148,13 +1138,7 @@ static bool printWordWrapped(raw_ostream &OS, Wrapped = true; } - if (Length == Str.size()) - return Wrapped; // We're done. - - // There is a newline in the message, followed by something that - // will not be word-wrapped. Print that. - OS.write(&Str[Length], Str.size() - Length); - return true; + return Wrapped; } void TextDiagnosticPrinter::HandleDiagnostic(DiagnosticsEngine::Level Level, |

