diff options
Diffstat (limited to 'clang/tools/libclang/CIndexDiagnostic.cpp')
| -rw-r--r-- | clang/tools/libclang/CIndexDiagnostic.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/clang/tools/libclang/CIndexDiagnostic.cpp b/clang/tools/libclang/CIndexDiagnostic.cpp index 4e47b25a4bf..de223d3043a 100644 --- a/clang/tools/libclang/CIndexDiagnostic.cpp +++ b/clang/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( |

