diff options
author | Alexander Lohnau <alexander.lohnau@gmx.de> | 2024-02-05 15:19:52 +0100 |
---|---|---|
committer | Alexander Lohnau <alexander.lohnau@gmx.de> | 2024-02-11 14:34:36 +0100 |
commit | a2ef91281b594d9ab31c71a52b93e783caa376eb (patch) | |
tree | 62de8c999ae83c2db76d4029a28eac8add8ab07d | |
parent | 3245a8ce92ec3408fb430bfabd146a2040cacc77 (diff) |
Remove clazy::DiagnosticFix compat helper
-rw-r--r-- | src/FixItExporter.cpp | 3 | ||||
-rw-r--r-- | src/SourceCompatibilityHelpers.h | 9 |
2 files changed, 1 insertions, 11 deletions
diff --git a/src/FixItExporter.cpp b/src/FixItExporter.cpp index 9ee477be..334889e4 100644 --- a/src/FixItExporter.cpp +++ b/src/FixItExporter.cpp @@ -5,7 +5,6 @@ */ #include "FixItExporter.h" -#include "SourceCompatibilityHelpers.h" #include <clang/Basic/SourceManager.h> #include <clang/Frontend/FrontendDiagnostic.h> @@ -152,7 +151,7 @@ void FixItExporter::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const D << Hint.BeforePreviousInsertions << " " << Hint.CodeToInsert << "\n"; llvm::errs() << "R: " << replacement.toString() << "\n"; #endif - clang::tooling::Replacements &Replacements = clazy::DiagnosticFix(ToolingDiag, replacement.getFilePath()); + clang::tooling::Replacements &Replacements = ToolingDiag.Message.Fix[replacement.getFilePath()]; llvm::Error error = Replacements.add(ConvertFixIt(Hint)); if (error) { Diag(Info.getLocation(), diag::note_fixit_failed); diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h index c19e4ab9..dec1a0d5 100644 --- a/src/SourceCompatibilityHelpers.h +++ b/src/SourceCompatibilityHelpers.h @@ -37,15 +37,6 @@ inline bool hasUnusedResultAttr(clang::FunctionDecl *func) return func->getAttr<clang::WarnUnusedResultAttr>() != nullptr; } -inline clang::tooling::Replacements &DiagnosticFix(clang::tooling::Diagnostic &diag, llvm::StringRef filePath) -{ -#if LLVM_VERSION_MAJOR >= 9 - return diag.Message.Fix[filePath]; -#else - return diag.Fix[filePath]; -#endif -} - inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid) { #if LLVM_VERSION_MAJOR >= 16 |