aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/TextDiagnosticPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-30 17:41:53 +0000
committerChris Lattner <sabre@nondot.org>2009-01-30 17:41:53 +0000
commitb8bf65e342d0872222f7ac10007d2837d7df437f (patch)
treeee931916fab72ed433ab598c1e8d2cf39627912a /lib/Driver/TextDiagnosticPrinter.cpp
parentd7eb846aaf5ee4a8d22c3cd0796d1e7229d46013 (diff)
" Attached is a patch for TextDiagnosticPrinter that adds an optional
parameter that allows users to omit the printing of the source location on a diagnostic. So basically it would omit the "abc.c:5:1: " at the beginning of the line." Patch by Alexei Svitkine! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63396 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/TextDiagnosticPrinter.cpp')
-rw-r--r--lib/Driver/TextDiagnosticPrinter.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Driver/TextDiagnosticPrinter.cpp b/lib/Driver/TextDiagnosticPrinter.cpp
index 36e2d28d2e..27353b8344 100644
--- a/lib/Driver/TextDiagnosticPrinter.cpp
+++ b/lib/Driver/TextDiagnosticPrinter.cpp
@@ -113,10 +113,12 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level,
// Compute the column number.
ColNo = PLoc.getColumn();
- OS << PLoc.getFilename() << ':' << LineNo << ':';
- if (ColNo && ShowColumn)
- OS << ColNo << ':';
- OS << ' ';
+ if (ShowLocation) {
+ OS << PLoc.getFilename() << ':' << LineNo << ':';
+ if (ColNo && ShowColumn)
+ OS << ColNo << ':';
+ OS << ' ';
+ }
}
switch (Level) {