make "in included from" and "in instatiation from" messages respect

-fno-show-location, patch by Alexei Svitkine (PR4024)

llvm-svn: 69657
This commit is contained in:
Chris Lattner 2009-04-21 03:57:54 +00:00
parent cd6d4b105a
commit 92b29b2f9f
1 changed files with 15 additions and 9 deletions

View File

@ -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.