diff options
author | Christof Douma <Christof.Douma@arm.com> | 2017-06-19 12:41:22 +0000 |
---|---|---|
committer | Christof Douma <Christof.Douma@arm.com> | 2017-06-19 12:41:22 +0000 |
commit | 27337711cd7156c2c7f48abe33b4e1f6771a261e (patch) | |
tree | ea627c7205ac4ed0ebf73cff0aef7d78a52d7566 /tools | |
parent | 87050d0737fcc08eda133cf0eb20ed4a71173efd (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 'tools')
-rw-r--r-- | tools/libclang/CIndexDiagnostic.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/tools/libclang/CIndexDiagnostic.cpp b/tools/libclang/CIndexDiagnostic.cpp index 4e47b25a4b..de223d3043 100644 --- a/tools/libclang/CIndexDiagnostic.cpp +++ b/tools/libclang/CIndexDiagnostic.cpp @@ -110,34 +110,40 @@ public: CurrentSet = &CD.getChildDiagnostics(); } - void emitDiagnosticMessage(FullSourceLoc Loc, PresumedLoc PLoc, - DiagnosticsEngine::Level Level, StringRef Message, + void emitDiagnosticMessage(SourceLocation Loc, PresumedLoc PLoc, + DiagnosticsEngine::Level Level, + StringRef Message, ArrayRef<CharSourceRange> Ranges, + const SourceManager *SM, DiagOrStoredDiag D) override { if (!D.isNull()) return; CXSourceLocation L; - if (Loc.hasManager()) - L = translateSourceLocation(Loc.getManager(), LangOpts, Loc); + if (SM) + L = translateSourceLocation(*SM, LangOpts, Loc); else L = clang_getNullLocation(); CurrentSet->appendDiagnostic( llvm::make_unique<CXDiagnosticCustomNoteImpl>(Message, L)); } - void emitDiagnosticLoc(FullSourceLoc Loc, PresumedLoc PLoc, + void emitDiagnosticLoc(SourceLocation Loc, PresumedLoc PLoc, DiagnosticsEngine::Level Level, - ArrayRef<CharSourceRange> Ranges) override {} + ArrayRef<CharSourceRange> Ranges, + const SourceManager &SM) override {} - void emitCodeContext(FullSourceLoc Loc, DiagnosticsEngine::Level Level, - SmallVectorImpl<CharSourceRange> &Ranges, - ArrayRef<FixItHint> Hints) override {} + void emitCodeContext(SourceLocation Loc, + DiagnosticsEngine::Level Level, + SmallVectorImpl<CharSourceRange>& Ranges, + ArrayRef<FixItHint> Hints, + const SourceManager &SM) override {} - void emitNote(FullSourceLoc Loc, StringRef Message) override { + void emitNote(SourceLocation Loc, StringRef Message, + const SourceManager *SM) override { CXSourceLocation L; - if (Loc.hasManager()) - L = translateSourceLocation(Loc.getManager(), LangOpts, Loc); + if (SM) + L = translateSourceLocation(*SM, LangOpts, Loc); else L = clang_getNullLocation(); CurrentSet->appendDiagnostic( |