summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/TextDiagnostic.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-11-30 18:38:50 +0000
committerDouglas Gregor <dgregor@apple.com>2012-11-30 18:38:50 +0000
commitaf8f02634b879fac795e8d88961ebe3dd3b02b19 (patch)
tree80e3fb4b01f40615b94f3d596ad64960e3483f7c /clang/lib/Frontend/TextDiagnostic.cpp
parenta820e7feffdb4ed21eead966fc283d5737d43846 (diff)
downloadbcm5719-llvm-af8f02634b879fac795e8d88961ebe3dd3b02b19.tar.gz
bcm5719-llvm-af8f02634b879fac795e8d88961ebe3dd3b02b19.zip
When an error occurs while building a module on demand, provide "While
building module 'Foo' imported from..." notes (the same we we provide "In file included from..." notes) in the diagnostic, so that we know how this module got included in the first place. This is part of <rdar://problem/12696425>. llvm-svn: 169021
Diffstat (limited to 'clang/lib/Frontend/TextDiagnostic.cpp')
-rw-r--r--clang/lib/Frontend/TextDiagnostic.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp
index 35dabad6065..65df875aea3 100644
--- a/clang/lib/Frontend/TextDiagnostic.cpp
+++ b/clang/lib/Frontend/TextDiagnostic.cpp
@@ -884,6 +884,17 @@ void TextDiagnostic::emitIncludeLocation(SourceLocation Loc,
OS << "In included file:\n";
}
+void TextDiagnostic::emitBuildingModuleLocation(SourceLocation Loc,
+ PresumedLoc PLoc,
+ StringRef ModuleName,
+ const SourceManager &SM) {
+ if (DiagOpts->ShowLocation)
+ OS << "While building module '" << ModuleName << "' imported from "
+ << PLoc.getFilename() << ':' << PLoc.getLine() << ":\n";
+ else
+ OS << "While building module '" << ModuleName << "':\n";
+}
+
/// \brief Emit a code snippet and caret line.
///
/// This routine emits a single line's code snippet and caret line..
OpenPOWER on IntegriCloud