aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergio Martins <smartins@kde.org>2021-12-02 11:06:30 +0000
committerSergio Martins <smartins@kde.org>2021-12-02 11:06:30 +0000
commit4a2aa16895d4ea0a7e96a930cdbfca89bd210ed1 (patch)
tree01a4cd6f964e54ce4d838f76f06e79e00cd25e8c
parent179157bcb75d5cdf338f3f2c31da82569b2d147e (diff)
parentb74c8729b7b71528c1528579435cda7fdb5d31b4 (diff)
Merge branch '1.10'
-rw-r--r--src/SourceCompatibilityHelpers.h16
-rw-r--r--src/SuppressionManager.cpp2
2 files changed, 7 insertions, 11 deletions
diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
index 27309f7f..5588d932 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<llvm::MemoryBufferRef> 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;