diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-03-05 20:55:36 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-03-05 20:55:36 +0000 |
commit | 12b5e1997d34b66062de7accc3a58429d5b8af51 (patch) | |
tree | 3f943d0b64831db66eb07a1c4a134bb33f37fad8 /lib/Frontend/DiagnosticRenderer.cpp | |
parent | a889b8ad628ca8640834812b2e144ee8c908a788 (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.cpp | 7 |
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); } |