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 | 7bea1d42d8cd8c90496b1a3306fc56814cebbde7 (patch) | |
tree | 2807499439264556600b66dac094f257f9bc8635 /clang/lib/Frontend/DiagnosticRenderer.cpp | |
parent | 8c71eba19f267c5ea6561d9d92fbc963cfc88a9c (diff) | |
download | bcm5719-llvm-7bea1d42d8cd8c90496b1a3306fc56814cebbde7.tar.gz bcm5719-llvm-7bea1d42d8cd8c90496b1a3306fc56814cebbde7.zip |
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.
llvm-svn: 203006
Diffstat (limited to 'clang/lib/Frontend/DiagnosticRenderer.cpp')
-rw-r--r-- | clang/lib/Frontend/DiagnosticRenderer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Frontend/DiagnosticRenderer.cpp b/clang/lib/Frontend/DiagnosticRenderer.cpp index 4eee59548c8..b52f0103e6b 100644 --- a/clang/lib/Frontend/DiagnosticRenderer.cpp +++ b/clang/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); } |