summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-21 03:57:54 +0000
committerChris Lattner <sabre@nondot.org>2009-04-21 03:57:54 +0000
commit92b29b2f9ff225553c9719ae045f961addd15179 (patch)
treee433cf619244a608833d59c5326006b8cda2dfc3 /clang/lib
parentcd6d4b105ab4874e4a9bc9618d05eca86e5b7ff5 (diff)
downloadbcm5719-llvm-92b29b2f9ff225553c9719ae045f961addd15179.tar.gz
bcm5719-llvm-92b29b2f9ff225553c9719ae045f961addd15179.zip
make "in included from" and "in instatiation from" messages respect
-fno-show-location, patch by Alexei Svitkine (PR4024) llvm-svn: 69657
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Frontend/TextDiagnosticPrinter.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/clang/lib/Frontend/TextDiagnosticPrinter.cpp b/clang/lib/Frontend/TextDiagnosticPrinter.cpp
index 0dd71d7bb38..be69b760fa3 100644
--- a/clang/lib/Frontend/TextDiagnosticPrinter.cpp
+++ b/clang/lib/Frontend/TextDiagnosticPrinter.cpp
@@ -27,9 +27,12 @@ PrintIncludeStack(SourceLocation Loc, const SourceManager &SM) {
// Print out the other include frames first.
PrintIncludeStack(PLoc.getIncludeLoc(), SM);
-
- OS << "In file included from " << PLoc.getFilename()
- << ':' << PLoc.getLine() << ":\n";
+
+ if (ShowLocation)
+ OS << "In file included from " << PLoc.getFilename()
+ << ':' << PLoc.getLine() << ":\n";
+ else
+ OS << "In included file:\n";
}
/// HighlightRange - Given a SourceRange and a line number, highlight (with ~'s)
@@ -129,12 +132,15 @@ void TextDiagnosticPrinter::EmitCaretDiagnostic(SourceLocation Loc,
Ranges[i] = SourceRange(S, E);
}
- // Emit the file/line/column that this expansion came from.
- OS << SM.getBufferName(Loc) << ':' << SM.getInstantiationLineNumber(Loc)
- << ':';
- if (ShowColumn)
- OS << SM.getInstantiationColumnNumber(Loc) << ':';
- OS << " note: instantiated from:\n";
+ if (ShowLocation) {
+ // Emit the file/line/column that this expansion came from.
+ OS << SM.getBufferName(Loc) << ':' << SM.getInstantiationLineNumber(Loc)
+ << ':';
+ if (ShowColumn)
+ OS << SM.getInstantiationColumnNumber(Loc) << ':';
+ OS << ' ';
+ }
+ OS << "note: instantiated from:\n";
}
// Decompose the location into a FID/Offset pair.
OpenPOWER on IntegriCloud