diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-11-30 21:58:49 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-11-30 21:58:49 +0000 |
commit | 22103e3416cfba9780fcd25c9182df5a8acae634 (patch) | |
tree | 2dbef767b712674939978d25be74c87eb56e604f /clang/lib/Frontend/TextDiagnostic.cpp | |
parent | f505d554725faa8737ac01104518310f53f405c8 (diff) | |
download | bcm5719-llvm-22103e3416cfba9780fcd25c9182df5a8acae634.tar.gz bcm5719-llvm-22103e3416cfba9780fcd25c9182df5a8acae634.zip |
When we're emitting a diagnostic with a source location in an imported
module, provide a module import stack similar to what we would get for
an include stack, e.g.,
In module 'DependsOnModule' imported from build-fail-notes.m:4:
In module 'Module' imported from DependsOnModule.framework/Headers/DependsOnModule.h:1:
Inputs/Module.framework/Headers/Module.h:15:12: note: previous definition is here
@interface Module
<rdar://problem/12696425>
llvm-svn: 169042
Diffstat (limited to 'clang/lib/Frontend/TextDiagnostic.cpp')
-rw-r--r-- | clang/lib/Frontend/TextDiagnostic.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp index 65df875aea3..fe82229c919 100644 --- a/clang/lib/Frontend/TextDiagnostic.cpp +++ b/clang/lib/Frontend/TextDiagnostic.cpp @@ -884,6 +884,16 @@ void TextDiagnostic::emitIncludeLocation(SourceLocation Loc, OS << "In included file:\n"; } +void TextDiagnostic::emitImportLocation(SourceLocation Loc, PresumedLoc PLoc, + StringRef ModuleName, + const SourceManager &SM) { + if (DiagOpts->ShowLocation) + OS << "In module '" << ModuleName << "' imported from " + << PLoc.getFilename() << ':' << PLoc.getLine() << ":\n"; + else + OS << "In module " << ModuleName << "':\n"; +} + void TextDiagnostic::emitBuildingModuleLocation(SourceLocation Loc, PresumedLoc PLoc, StringRef ModuleName, |