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 | 830ea5b7c75413526c19531f0180fa6e45b98919 (patch) | |
tree | fbc998f5090d858324e3c4d014248eccf2f87863 /include/clang/Frontend | |
parent | 7f2d4804510799a1a19d72b2b089e48370ab8686 (diff) |
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>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169021 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r-- | include/clang/Frontend/DiagnosticRenderer.h | 12 | ||||
-rw-r--r-- | include/clang/Frontend/TextDiagnostic.h | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/include/clang/Frontend/DiagnosticRenderer.h b/include/clang/Frontend/DiagnosticRenderer.h index 086bb137d4..6ca8d89ec9 100644 --- a/include/clang/Frontend/DiagnosticRenderer.h +++ b/include/clang/Frontend/DiagnosticRenderer.h @@ -92,7 +92,10 @@ protected: virtual void emitIncludeLocation(SourceLocation Loc, PresumedLoc PLoc, const SourceManager &SM) = 0; - + virtual void emitBuildingModuleLocation(SourceLocation Loc, PresumedLoc PLoc, + StringRef ModuleName, + const SourceManager &SM) = 0; + virtual void beginDiagnostic(DiagOrStoredDiag D, DiagnosticsEngine::Level Level) {} virtual void endDiagnostic(DiagOrStoredDiag D, @@ -103,6 +106,7 @@ private: void emitIncludeStack(SourceLocation Loc, DiagnosticsEngine::Level Level, const SourceManager &SM); void emitIncludeStackRecursively(SourceLocation Loc, const SourceManager &SM); + void emitModuleBuildPath(const SourceManager &SM); void emitMacroExpansionsAndCarets(SourceLocation Loc, DiagnosticsEngine::Level Level, SmallVectorImpl<CharSourceRange>& Ranges, @@ -149,7 +153,11 @@ public: virtual void emitIncludeLocation(SourceLocation Loc, PresumedLoc PLoc, const SourceManager &SM); - + + virtual void emitBuildingModuleLocation(SourceLocation Loc, PresumedLoc PLoc, + StringRef ModuleName, + const SourceManager &SM); + virtual void emitNote(SourceLocation Loc, StringRef Message, const SourceManager *SM) = 0; }; diff --git a/include/clang/Frontend/TextDiagnostic.h b/include/clang/Frontend/TextDiagnostic.h index 51f841ddd3..859bec2cfe 100644 --- a/include/clang/Frontend/TextDiagnostic.h +++ b/include/clang/Frontend/TextDiagnostic.h @@ -103,6 +103,10 @@ protected: virtual void emitIncludeLocation(SourceLocation Loc, PresumedLoc PLoc, const SourceManager &SM); + virtual void emitBuildingModuleLocation(SourceLocation Loc, PresumedLoc PLoc, + StringRef ModuleName, + const SourceManager &SM); + private: void emitSnippetAndCaret(SourceLocation Loc, DiagnosticsEngine::Level Level, SmallVectorImpl<CharSourceRange>& Ranges, |