summaryrefslogtreecommitdiff
path: root/dev-util/clazy
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-05-04 22:28:33 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-05-04 22:28:33 +0100
commita978c074e4272bb901fbe4a10de0a7b2af574f17 (patch)
tree8c764c1cc0576389ce22abd317bceba71ea5732d /dev-util/clazy
parent40aaaa64e86ba6710bbeb31c4615a6ce80e75e11 (diff)
gentoo resync : 04.05.2021
Diffstat (limited to 'dev-util/clazy')
-rw-r--r--dev-util/clazy/Manifest4
-rw-r--r--dev-util/clazy/clazy-1.9.ebuild2
-rw-r--r--dev-util/clazy/files/clazy-1.9-llvm12.patch88
-rw-r--r--dev-util/clazy/files/clazy-1.9-llvm13.patch31
4 files changed, 124 insertions, 1 deletions
diff --git a/dev-util/clazy/Manifest b/dev-util/clazy/Manifest
index c0be6c9a09dc..52e2f436d7ff 100644
--- a/dev-util/clazy/Manifest
+++ b/dev-util/clazy/Manifest
@@ -1,3 +1,5 @@
+AUX clazy-1.9-llvm12.patch 3056 BLAKE2B 7c090b17a3a598075fdcaec04df4efc0fb6c2a8d496cc8a9bc3b345eb8bc8f59c6aa4a8d7036c6c6717c5da05d5acd22544a86e0c711cb5f94e3433ffd871351 SHA512 42775ac235092241419315e4282dd7cd5953b55db0b58826ce50ae4a4520833e6575a17d6ace9ea559240bc29d033ad1b16af1f5fb5aed7f751a03e07650e7a5
+AUX clazy-1.9-llvm13.patch 1098 BLAKE2B 6933e7f9e159e4e4d10bcacf67a7f384ca1782d84606e2cde85e4f2bc5007f25e1fef96129de366c9be013ef2f602f7e34a4388576b404c0a913625de99992bf SHA512 a8d4c59236b9329ad1a0db4fc3a21eebc16faa19888c21f6fdf53a3d242dfc955f0902ba95e38f1f0666524d926611b353925e4519e60cca7d6e5d69a3f107f4
DIST clazy-1.9.tar.xz 394856 BLAKE2B 641ca46a31475cf7bd03ba921e390cb2712362dc97b960a519e05c47049927f805d3ef6f1c756b96d3483e8f4b75e2dc41a2419a462ed2e45cbd08c88c07f933 SHA512 2e8bec44a027366263de23c50d14192e310fd38fa2b369afb21413da9cb78da9882b2153daf1784c4c9076cc62e2867b5211c75ff9a1eabcb583e405f20f5912
-EBUILD clazy-1.9.ebuild 985 BLAKE2B 7a16ad813d4ccd87ff16bd9d09654fd8721f9120a997eaf1d60ce6dfe021593e35dd3226cf20a1fbe7fb3956a9bde71b429f272be29cea2d2523021cee04ac3e SHA512 a28a5dcb386604a2cc23e7fbbf928ad559446bc2b7895deb80b3140dc1d12d3b45e03b98f78601fdca4474877e165255cf525c0d1dd0858c66f3909e10319f4e
+EBUILD clazy-1.9.ebuild 1048 BLAKE2B 19aab05c1a0ea51e60164834cd1d18c22537a35224258d5e37bee821b384efa90bbfe98b38362ebed62c667c8ec3e0947cd1ea5ebb2517f1d8ca4f621a135859 SHA512 5a1adc300ca1fd975e07b97b4fb5bce068c2b99afbbdb5701df327060bea1f2afbb77d00bb2ba5d9be795c84641ee235ab076c1a83f1075ad0ecddce260705dd
MISC metadata.xml 249 BLAKE2B ad415db89e5dee1627aa77f44ded9d4e1e5b8217d06c7ca25bbaa3fe92ce67c2b1090957c45a821b407d7927e5af798498aa6a5b903895ee1af8ee20a446c7f7 SHA512 76a5a340b13f0053ca3c5e94ed24380ea8d29b45ac8655419e22eaadb1e4a827c04d2e7e36b65145c4964e6526f656618fc6ac144e277ef53cb7373e6239e3c3
diff --git a/dev-util/clazy/clazy-1.9.ebuild b/dev-util/clazy/clazy-1.9.ebuild
index 9062383103c4..781b51040559 100644
--- a/dev-util/clazy/clazy-1.9.ebuild
+++ b/dev-util/clazy/clazy-1.9.ebuild
@@ -20,6 +20,8 @@ RDEPEND="
"
DEPEND="${RDEPEND}"
+PATCHES=( "${FILESDIR}"/${P}-llvm{12,13}.patch ) # bug 786525
+
src_prepare() {
cmake_src_prepare
diff --git a/dev-util/clazy/files/clazy-1.9-llvm12.patch b/dev-util/clazy/files/clazy-1.9-llvm12.patch
new file mode 100644
index 000000000000..3862f40ad981
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.9-llvm12.patch
@@ -0,0 +1,88 @@
+From 2592a6e3393ebc75e16c91e606ad2015a16295c3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20Sch=C3=A4rf?= <c.schaerf@t-online.de>
+Date: Sat, 23 Jan 2021 15:34:10 +0100
+Subject: [PATCH] Fix build with Clang 12
+
+Required due to Clang changes https://github.com/llvm/llvm-project/commit/b3eff6b7bb31e7ef059a3d238de138849839fbbd and https://github.com/llvm/llvm-project/commit/d758f79e5d381bd4f5122193a9538d89c907c812
+---
+ src/SourceCompatibilityHelpers.h | 26 ++++++++++++++++++++++++++
+ src/SuppressionManager.cpp | 5 ++---
+ 2 files changed, 28 insertions(+), 3 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4db141ab..1737d5a5 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -29,6 +29,7 @@
+ #include <clang/Basic/SourceLocation.h>
+ #include <clang/Basic/SourceManager.h>
+ #include <clang/Frontend/FrontendDiagnostic.h>
++#include <clang/Lex/Lexer.h>
+ #include <clang/Tooling/Core/Diagnostic.h>
+
+ #if defined(CLAZY_USES_BOOST_REGEX)
+@@ -103,6 +104,31 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+ #endif
+ }
+
++inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
++{
++#if LLVM_VERSION_MAJOR >= 12
++ auto buffer = sm.getBufferOrNone(id);
++ *invalid = !buffer.hasValue();
++ return buffer;
++#else
++ return sm.getBuffer(id, invalid);
++#endif
++}
++
++#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);
++}
++#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);
++}
++#endif
++
+ }
+
+ #endif
+diff --git a/src/SuppressionManager.cpp b/src/SuppressionManager.cpp
+index 9d774ea6..9881388d 100644
+--- a/src/SuppressionManager.cpp
++++ b/src/SuppressionManager.cpp
+@@ -24,7 +24,6 @@
+ #include "clazy_stl.h"
+
+ #include <clang/Basic/SourceManager.h>
+-#include <clang/Lex/Lexer.h>
+ #include <clang/Basic/SourceLocation.h>
+ #include <clang/Basic/TokenKinds.h>
+ #include <clang/Lex/Token.h>
+@@ -84,7 +83,7 @@ void SuppressionManager::parseFile(FileID id, const SourceManager &sm, const cla
+ Suppressions &suppressions = (*it).second;
+
+ bool invalid = false;
+- auto buffer = sm.getBuffer(id, &invalid);
++ auto buffer = clazy::getBuffer(sm, id, &invalid);
+ if (invalid) {
+ llvm::errs() << "SuppressionManager::parseFile: Invalid buffer ";
+ if (buffer)
+@@ -92,7 +91,7 @@ void SuppressionManager::parseFile(FileID id, const SourceManager &sm, const cla
+ return;
+ }
+
+- Lexer lexer(id, buffer, sm, lo);
++ auto lexer = clazy::getLexer(id, buffer, sm, lo);
+ lexer.SetCommentRetentionState(true);
+
+ Token token;
+--
+GitLab
+
diff --git a/dev-util/clazy/files/clazy-1.9-llvm13.patch b/dev-util/clazy/files/clazy-1.9-llvm13.patch
new file mode 100644
index 000000000000..9bbac8f7624d
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.9-llvm13.patch
@@ -0,0 +1,31 @@
+From 0bf4e428c76270f4534a0a8df3cf6912157f22ab Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= <bjoern@hazardy.de>
+Date: Sat, 17 Apr 2021 20:57:10 +0200
+Subject: [PATCH] Fix build with LLVM 13
+
+---
+ src/ClazyStandaloneMain.cpp | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/ClazyStandaloneMain.cpp b/src/ClazyStandaloneMain.cpp
+index 41c4fcf9..7b4cf5d3 100644
+--- a/src/ClazyStandaloneMain.cpp
++++ b/src/ClazyStandaloneMain.cpp
+@@ -158,7 +158,13 @@ llvm::IntrusiveRefCntPtr<vfs::FileSystem> getVfsFromFile(const std::string &over
+
+ int main(int argc, const char **argv)
+ {
+- CommonOptionsParser optionsParser(argc, argv, s_clazyCategory, cl::ZeroOrMore);
++ auto expectedParser = CommonOptionsParser::create(argc, argv, s_clazyCategory, cl::ZeroOrMore);
++ if (!expectedParser) {
++ llvm::errs() << expectedParser.takeError();
++ return 1;
++ }
++
++ auto &optionsParser = expectedParser.get();
+ // llvm::errs() << optionsParser.getSourcePathList().size() << "\n";
+
+ if (s_supportedChecks.getValue()) {
+--
+GitLab
+