1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

Avoid printing a spurious semicolon when there is no filename.

llvm-svn: 94071
This commit is contained in:
Dan Gohman 2010-01-21 10:13:27 +00:00
parent 7bd5379b8c
commit 2d3e1be372

View File

@ -192,18 +192,21 @@ void SMDiagnostic::Print(const char *ProgName, raw_ostream &S) {
if (ProgName && ProgName[0])
S << ProgName << ": ";
if (Filename == "-")
S << "<stdin>";
else
S << Filename;
if (!Filename.empty()) {
if (Filename == "-")
S << "<stdin>";
else
S << Filename;
if (LineNo != -1) {
S << ':' << LineNo;
if (ColumnNo != -1)
S << ':' << (ColumnNo+1);
if (LineNo != -1) {
S << ':' << LineNo;
if (ColumnNo != -1)
S << ':' << (ColumnNo+1);
}
S << ": ";
}
S << ": " << Message << '\n';
S << Message << '\n';
if (LineNo != -1 && ColumnNo != -1 && ShowLine) {
S << LineContents << '\n';