summaryrefslogtreecommitdiffstats
path: root/lib/Frontend/DiagnosticRenderer.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-03-05 20:55:36 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-03-05 20:55:36 +0000
commit12b5e1997d34b66062de7accc3a58429d5b8af51 (patch)
tree3f943d0b64831db66eb07a1c4a134bb33f37fad8 /lib/Frontend/DiagnosticRenderer.cpp
parenta889b8ad628ca8640834812b2e144ee8c908a788 (diff)
When building a module from the command line via -emit-module, add an entry to
the module build stack for the module being built, so we can correctly detect recursive module builds. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203006 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/DiagnosticRenderer.cpp')
-rw-r--r--lib/Frontend/DiagnosticRenderer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Frontend/DiagnosticRenderer.cpp b/lib/Frontend/DiagnosticRenderer.cpp
index 4eee59548c..b52f0103e6 100644
--- a/lib/Frontend/DiagnosticRenderer.cpp
+++ b/lib/Frontend/DiagnosticRenderer.cpp
@@ -499,8 +499,11 @@ DiagnosticNoteRenderer::emitBuildingModuleLocation(SourceLocation Loc,
// Generate a note indicating the include location.
SmallString<200> MessageStorage;
llvm::raw_svector_ostream Message(MessageStorage);
- Message << "while building module '" << ModuleName << "' imported from "
- << PLoc.getFilename() << ':' << PLoc.getLine() << ":";
+ if (PLoc.getFilename())
+ Message << "while building module '" << ModuleName << "' imported from "
+ << PLoc.getFilename() << ':' << PLoc.getLine() << ":";
+ else
+ Message << "while building module '" << ModuleName << ":";
emitNote(Loc, Message.str(), &SM);
}