forked from OSchip/llvm-project
Be defensive when printing module import locations; the diagnostic printer needs to be robust
llvm-svn: 170466
This commit is contained in:
parent
00f6c7754b
commit
dfc9430bc7
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue