summaryrefslogtreecommitdiffstats
path: root/include/clang/Frontend/DiagnosticRenderer.h
diff options
context:
space:
mode:
authorChristof Douma <Christof.Douma@arm.com>2017-06-19 12:41:22 +0000
committerChristof Douma <Christof.Douma@arm.com>2017-06-19 12:41:22 +0000
commit27337711cd7156c2c7f48abe33b4e1f6771a261e (patch)
treeea627c7205ac4ed0ebf73cff0aef7d78a52d7566 /include/clang/Frontend/DiagnosticRenderer.h
parent87050d0737fcc08eda133cf0eb20ed4a71173efd (diff)
Revert "[NFC] Refactor DiagnosticRenderer to use FullSourceLoc"
This reverts commit 305684. This patch breaks extra/tools/clang-tidy git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305688 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/DiagnosticRenderer.h')
-rw-r--r--include/clang/Frontend/DiagnosticRenderer.h81
1 files changed, 48 insertions, 33 deletions
diff --git a/include/clang/Frontend/DiagnosticRenderer.h b/include/clang/Frontend/DiagnosticRenderer.h
index 54a3d692b3..2588feb2b8 100644
--- a/include/clang/Frontend/DiagnosticRenderer.h
+++ b/include/clang/Frontend/DiagnosticRenderer.h
@@ -70,27 +70,33 @@ protected:
DiagnosticOptions *DiagOpts);
virtual ~DiagnosticRenderer();
-
- virtual void emitDiagnosticMessage(FullSourceLoc Loc, PresumedLoc PLoc,
+
+ virtual void emitDiagnosticMessage(SourceLocation Loc, PresumedLoc PLoc,
DiagnosticsEngine::Level Level,
StringRef Message,
ArrayRef<CharSourceRange> Ranges,
+ const SourceManager *SM,
DiagOrStoredDiag Info) = 0;
-
- virtual void emitDiagnosticLoc(FullSourceLoc Loc, PresumedLoc PLoc,
+
+ virtual void emitDiagnosticLoc(SourceLocation Loc, PresumedLoc PLoc,
DiagnosticsEngine::Level Level,
- ArrayRef<CharSourceRange> Ranges) = 0;
+ ArrayRef<CharSourceRange> Ranges,
+ const SourceManager &SM) = 0;
- virtual void emitCodeContext(FullSourceLoc Loc,
+ virtual void emitCodeContext(SourceLocation Loc,
DiagnosticsEngine::Level Level,
- SmallVectorImpl<CharSourceRange> &Ranges,
- ArrayRef<FixItHint> Hints) = 0;
-
- virtual void emitIncludeLocation(FullSourceLoc Loc, PresumedLoc PLoc) = 0;
- virtual void emitImportLocation(FullSourceLoc Loc, PresumedLoc PLoc,
- StringRef ModuleName) = 0;
- virtual void emitBuildingModuleLocation(FullSourceLoc Loc, PresumedLoc PLoc,
- StringRef ModuleName) = 0;
+ SmallVectorImpl<CharSourceRange>& Ranges,
+ ArrayRef<FixItHint> Hints,
+ const SourceManager &SM) = 0;
+
+ virtual void emitIncludeLocation(SourceLocation Loc, PresumedLoc PLoc,
+ const SourceManager &SM) = 0;
+ virtual void emitImportLocation(SourceLocation Loc, PresumedLoc PLoc,
+ StringRef ModuleName,
+ 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) {}
@@ -100,21 +106,25 @@ protected:
private:
void emitBasicNote(StringRef Message);
- void emitIncludeStack(FullSourceLoc Loc, PresumedLoc PLoc,
- DiagnosticsEngine::Level Level);
- void emitIncludeStackRecursively(FullSourceLoc Loc);
- void emitImportStack(FullSourceLoc Loc);
- void emitImportStackRecursively(FullSourceLoc Loc, StringRef ModuleName);
+ void emitIncludeStack(SourceLocation Loc, PresumedLoc PLoc,
+ DiagnosticsEngine::Level Level, const SourceManager &SM);
+ void emitIncludeStackRecursively(SourceLocation Loc, const SourceManager &SM);
+ void emitImportStack(SourceLocation Loc, const SourceManager &SM);
+ void emitImportStackRecursively(SourceLocation Loc, StringRef ModuleName,
+ const SourceManager &SM);
void emitModuleBuildStack(const SourceManager &SM);
- void emitCaret(FullSourceLoc Loc, DiagnosticsEngine::Level Level,
- ArrayRef<CharSourceRange> Ranges, ArrayRef<FixItHint> Hints);
- void emitSingleMacroExpansion(FullSourceLoc Loc,
+ void emitCaret(SourceLocation Loc, DiagnosticsEngine::Level Level,
+ ArrayRef<CharSourceRange> Ranges, ArrayRef<FixItHint> Hints,
+ const SourceManager &SM);
+ void emitSingleMacroExpansion(SourceLocation Loc,
DiagnosticsEngine::Level Level,
- ArrayRef<CharSourceRange> Ranges);
- void emitMacroExpansions(FullSourceLoc Loc, DiagnosticsEngine::Level Level,
+ ArrayRef<CharSourceRange> Ranges,
+ const SourceManager &SM);
+ void emitMacroExpansions(SourceLocation Loc,
+ DiagnosticsEngine::Level Level,
ArrayRef<CharSourceRange> Ranges,
- ArrayRef<FixItHint> Hints);
-
+ ArrayRef<FixItHint> Hints,
+ const SourceManager &SM);
public:
/// \brief Emit a diagnostic.
///
@@ -130,9 +140,10 @@ public:
/// \param FixItHints The FixIt hints active for this diagnostic.
/// \param SM The SourceManager; will be null if the diagnostic came from the
/// frontend, thus \p Loc will be invalid.
- void emitDiagnostic(FullSourceLoc Loc, DiagnosticsEngine::Level Level,
+ void emitDiagnostic(SourceLocation Loc, DiagnosticsEngine::Level Level,
StringRef Message, ArrayRef<CharSourceRange> Ranges,
ArrayRef<FixItHint> FixItHints,
+ const SourceManager *SM,
DiagOrStoredDiag D = (Diagnostic *)nullptr);
void emitStoredDiagnostic(StoredDiagnostic &Diag);
@@ -148,15 +159,19 @@ public:
~DiagnosticNoteRenderer() override;
- void emitIncludeLocation(FullSourceLoc Loc, PresumedLoc PLoc) override;
+ void emitIncludeLocation(SourceLocation Loc, PresumedLoc PLoc,
+ const SourceManager &SM) override;
- void emitImportLocation(FullSourceLoc Loc, PresumedLoc PLoc,
- StringRef ModuleName) override;
+ void emitImportLocation(SourceLocation Loc, PresumedLoc PLoc,
+ StringRef ModuleName,
+ const SourceManager &SM) override;
- void emitBuildingModuleLocation(FullSourceLoc Loc, PresumedLoc PLoc,
- StringRef ModuleName) override;
+ void emitBuildingModuleLocation(SourceLocation Loc, PresumedLoc PLoc,
+ StringRef ModuleName,
+ const SourceManager &SM) override;
- virtual void emitNote(FullSourceLoc Loc, StringRef Message) = 0;
+ virtual void emitNote(SourceLocation Loc, StringRef Message,
+ const SourceManager *SM) = 0;
};
} // end clang namespace
#endif