From fca73257a803dd8d0524e2e0d6927733c500be78 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Tue, 20 Jul 2021 07:54:58 -0700 Subject: Fix build with upcoming llvm 13 llvm::sys::fs::F_None was removed --- src/FixItExporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FixItExporter.cpp b/src/FixItExporter.cpp index 0a016f2f..508a2b75 100644 --- a/src/FixItExporter.cpp +++ b/src/FixItExporter.cpp @@ -198,7 +198,7 @@ void FixItExporter::Export() auto tuDiag = getTuDiag(); if (!tuDiag.Diagnostics.empty()) { std::error_code EC; - llvm::raw_fd_ostream OS(exportFixes, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream OS(exportFixes, EC, llvm::sys::fs::OF_None); llvm::yaml::Output YAML(OS); YAML << getTuDiag(); } -- cgit v1.2.3 From b74c8729b7b71528c1528579435cda7fdb5d31b4 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Thu, 2 Dec 2021 11:05:51 +0000 Subject: Fix build with some newer gcc complaining about deleted Lexer --- src/SourceCompatibilityHelpers.h | 16 ++++++---------- src/SuppressionManager.cpp | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h index b01f16ac..a3bf2680 100644 --- a/src/SourceCompatibilityHelpers.h +++ b/src/SourceCompatibilityHelpers.h @@ -117,17 +117,13 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in } #if LLVM_VERSION_MAJOR >= 12 -inline clang::Lexer getLexer(clang::FileID id, llvm::Optional inputFile, - const clang::SourceManager &sm, const clang::LangOptions &lo) -{ - return clang::Lexer(id, inputFile.getValue(), sm, lo); -} + +#define GET_LEXER(id, inputFile, sm, lo) \ +clang::Lexer(id, inputFile.getValue(), sm, lo) + #else -inline clang::Lexer getLexer(clang::FileID id, const llvm::MemoryBuffer *inputFile, - const clang::SourceManager &sm, const clang::LangOptions &lo) -{ - return clang::Lexer(id, inputFile, sm, lo); -} +#define GET_LEXER(id, inputFile, sm, lo) \ +clang::Lexer(id, inputFile.getValue(), sm, lo) #endif inline bool isFinal(const clang::CXXRecordDecl *record) diff --git a/src/SuppressionManager.cpp b/src/SuppressionManager.cpp index 9881388d..88c8aa2c 100644 --- a/src/SuppressionManager.cpp +++ b/src/SuppressionManager.cpp @@ -91,7 +91,7 @@ void SuppressionManager::parseFile(FileID id, const SourceManager &sm, const cla return; } - auto lexer = clazy::getLexer(id, buffer, sm, lo); + auto lexer = GET_LEXER(id, buffer, sm, lo); lexer.SetCommentRetentionState(true); Token token; -- cgit v1.2.3