summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/TextDiagnostic.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-12-18 23:02:07 +0000
committerDouglas Gregor <dgregor@apple.com>2012-12-18 23:02:07 +0000
commitdfc9430bc7536c9f4599d586afce43606337dedb (patch)
treea762a184eec1010640ce67172e08d5ccfa1f5ad5 /clang/lib/Frontend/TextDiagnostic.cpp
parent00f6c7754b3611fc0bbfe9e0f70de5df1a1af3ba (diff)
downloadbcm5719-llvm-dfc9430bc7536c9f4599d586afce43606337dedb.tar.gz
bcm5719-llvm-dfc9430bc7536c9f4599d586afce43606337dedb.zip
Be defensive when printing module import locations; the diagnostic printer needs to be robust
llvm-svn: 170466
Diffstat (limited to 'clang/lib/Frontend/TextDiagnostic.cpp')
-rw-r--r--clang/lib/Frontend/TextDiagnostic.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp
index 651ddd66b4f..aba90f6046b 100644
--- a/clang/lib/Frontend/TextDiagnostic.cpp
+++ b/clang/lib/Frontend/TextDiagnostic.cpp
@@ -898,7 +898,7 @@ void TextDiagnostic::emitBuildingModuleLocation(SourceLocation Loc,
PresumedLoc PLoc,
StringRef ModuleName,
const SourceManager &SM) {
- if (DiagOpts->ShowLocation)
+ if (DiagOpts->ShowLocation && PLoc.getFilename())
OS << "While building module '" << ModuleName << "' imported from "
<< PLoc.getFilename() << ':' << PLoc.getLine() << ":\n";
else
OpenPOWER on IntegriCloud