]> granicus.if.org Git - clang/commitdiff
Be defensive when printing module import locations; the diagnostic printer needs...
authorDouglas Gregor <dgregor@apple.com>
Tue, 18 Dec 2012 23:02:07 +0000 (23:02 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 18 Dec 2012 23:02:07 +0000 (23:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170466 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/TextDiagnostic.cpp

index 651ddd66b4fc1abe9f106bd6b4a1817e00d7a114..aba90f6046b8a2a836846fe34619131d573cb2f3 100644 (file)
@@ -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