[cfe-commits] r69657 - /cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
Chris Lattner
sabre at nondot.org
Mon Apr 20 20:57:54 PDT 2009
Author: lattner
Date: Mon Apr 20 22:57:54 2009
New Revision: 69657
URL: http://llvm.org/viewvc/llvm-project?rev=69657&view=rev
Log:
make "in included from" and "in instatiation from" messages respect
-fno-show-location, patch by Alexei Svitkine (PR4024)
Modified:
cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
Modified: cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp?rev=69657&r1=69656&r2=69657&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp Mon Apr 20 22:57:54 2009
@@ -27,9 +27,12 @@
// 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 @@
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.
More information about the cfe-commits
mailing list