diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-11-30 18:38:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-11-30 18:38:50 +0000 |
commit | af8f02634b879fac795e8d88961ebe3dd3b02b19 (patch) | |
tree | 80e3fb4b01f40615b94f3d596ad64960e3483f7c /clang/lib/Frontend/TextDiagnostic.cpp | |
parent | a820e7feffdb4ed21eead966fc283d5737d43846 (diff) | |
download | bcm5719-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.cpp | 11 |
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.. |