diff options
Diffstat (limited to 'dev-util/clazy/files')
-rw-r--r-- | dev-util/clazy/files/clazy-1.11-fix-llvm-17.patch | 38 | ||||
-rw-r--r-- | dev-util/clazy/files/clazy-1.11-jobs-for-tests.patch | 41 |
2 files changed, 79 insertions, 0 deletions
diff --git a/dev-util/clazy/files/clazy-1.11-fix-llvm-17.patch b/dev-util/clazy/files/clazy-1.11-fix-llvm-17.patch new file mode 100644 index 000000000000..6550b63a3506 --- /dev/null +++ b/dev-util/clazy/files/clazy-1.11-fix-llvm-17.patch @@ -0,0 +1,38 @@ +From a9aabd821d8be7932c954e1cdd8d4e10f38f8785 Mon Sep 17 00:00:00 2001 +From: Cristian Adam <cristian.adam@gmail.com> +Date: Mon, 14 Aug 2023 18:16:01 +0200 +Subject: [PATCH] Fix compilation with LLVM 17.0.0 (rc2) + +Change-Id: I9d3fc86185c1e7c86145da043e1982d2979b36e9 +--- + .../manuallevel/unexpected-flag-enumerator-value.cpp | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp ++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp +@@ -61,8 +61,13 @@ static bool isIntentionallyNotPowerOf2(E + if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask) + return true; + ++#if LLVM_VERSION_MAJOR >= 17 ++ if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask) ++ return true; ++#else + if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask) + return true; ++#endif + + if (clazy::contains_lower(en->getName(), "mask")) + return true; +@@ -158,7 +163,11 @@ void UnexpectedFlagEnumeratorValue::Visi + + for (EnumConstantDecl* enumerator : enumerators) { + const auto &initVal = enumerator->getInitVal(); ++#if LLVM_VERSION_MAJOR >= 17 ++ if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) { ++#else + if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) { ++#endif + if (isIntentionallyNotPowerOf2(enumerator)) + continue; + const auto value = enumerator->getInitVal().getLimitedValue(); diff --git a/dev-util/clazy/files/clazy-1.11-jobs-for-tests.patch b/dev-util/clazy/files/clazy-1.11-jobs-for-tests.patch new file mode 100644 index 000000000000..372aed3ca09a --- /dev/null +++ b/dev-util/clazy/files/clazy-1.11-jobs-for-tests.patch @@ -0,0 +1,41 @@ +From ab8993c9e10e09cb24210f76bb5e67f01bb37a9e Mon Sep 17 00:00:00 2001 +From: Pino Toscano <pino@kde.org> +Date: Thu, 17 Nov 2022 19:09:47 +0100 +Subject: [PATCH] tests: add -j/--jobs option for run_tests.py + +This way it is possible to customize the number of parallel jobs to +spawn for the tests, instead of unconditionally using all available +CPUs. This can be helpful to run the tests without overloading the +system. + +The default is still the number of available CPUs, so there is no +behaviour change by default. +--- + tests/run_tests.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tests/run_tests.py b/tests/run_tests.py +index bf4967d1..ea03ab4c 100755 +--- a/tests/run_tests.py ++++ b/tests/run_tests.py +@@ -443,6 +443,8 @@ parser.add_argument("--dump-ast", action='store_true', + help='Dump a unit-test AST to file') + parser.add_argument( + "--exclude", help='Comma separated list of checks to ignore') ++parser.add_argument("-j", "--jobs", type=int, default=multiprocessing.cpu_count(), ++ help='Parallel jobs to run (defaults to %(default)s)') + parser.add_argument("check_names", nargs='*', + help="The name of the check whose unit-tests will be run. Defaults to running all checks.") + args = parser.parse_args() +@@ -460,7 +462,7 @@ _verbose = args.verbose + _no_standalone = args.no_standalone + _no_fixits = args.no_fixits + _only_standalone = args.only_standalone +-_num_threads = multiprocessing.cpu_count() ++_num_threads = args.jobs + _lock = threading.Lock() + _was_successful = True + _qt5_installation = find_qt_installation( +-- +2.35.1 + |