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 | 813bc7faa74bda8162db3dede57e07bfe764e86e (patch) | |
tree | a6d88ce5f9da78e481cd04e79575a5a17635d75c /lib/Frontend/TextDiagnostic.cpp | |
parent | e77372ac818cf202571dcbf8ab656c8f47ba3423 (diff) |
Be defensive when printing module import locations; the diagnostic printer needs to be robust
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170466 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/TextDiagnostic.cpp')
-rw-r--r-- | lib/Frontend/TextDiagnostic.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Frontend/TextDiagnostic.cpp b/lib/Frontend/TextDiagnostic.cpp index 651ddd66b4..aba90f6046 100644 --- a/lib/Frontend/TextDiagnostic.cpp +++ b/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 |