diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-12-18 23:02:07 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-12-18 23:02:07 +0000 |
commit | dfc9430bc7536c9f4599d586afce43606337dedb (patch) | |
tree | a762a184eec1010640ce67172e08d5ccfa1f5ad5 /clang/lib/Frontend | |
parent | 00f6c7754b3611fc0bbfe9e0f70de5df1a1af3ba (diff) | |
download | bcm5719-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')
-rw-r--r-- | clang/lib/Frontend/TextDiagnostic.cpp | 2 |
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 |