From 77e064f6ca53329d7ddabe6688db6e899929cad8 Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 5 Feb 2022 15:04:04 +0100 Subject: [PATCH 1/6] compileroptions.cmake: added workaround for current performance regression in clang-14 --- cmake/compileroptions.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/compileroptions.cmake b/cmake/compileroptions.cmake index 684c93ce076..43e98de456a 100644 --- a/cmake/compileroptions.cmake +++ b/cmake/compileroptions.cmake @@ -51,6 +51,12 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") add_compile_options(-Wsuggest-attribute=noreturn) add_compile_options(-Wno-shadow) # whenever a local variable or type declaration shadows another one elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 14) + if (CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") + # work around performance regression - see https://github.com/llvm/llvm-project/issues/53555 + add_compile_options(-mllvm -inline-deferral) + endif() + endif() add_compile_options_safe(-Wno-documentation-unknown-command) From eb85a13cddac0bc14cd90e1b903c45dd63cab926 Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 5 Feb 2022 15:06:08 +0100 Subject: [PATCH 2/6] compileroptions.cmake: force the usage of DWARF 4 for clang-14 --- cmake/compileroptions.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/compileroptions.cmake b/cmake/compileroptions.cmake index 43e98de456a..03ca2e50a49 100644 --- a/cmake/compileroptions.cmake +++ b/cmake/compileroptions.cmake @@ -56,6 +56,9 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # work around performance regression - see https://github.com/llvm/llvm-project/issues/53555 add_compile_options(-mllvm -inline-deferral) endif() + + # use force DWARF 4 debug format since not all tools might be able to handle DWARF 5 yet - e.g. valgrind on ubuntu 20.04 + add_compile_options(-gdwarf-4) endif() add_compile_options_safe(-Wno-documentation-unknown-command) From cbfbb225e3146885ecc237923a8880d6cdb66a74 Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 5 Feb 2022 15:07:32 +0100 Subject: [PATCH 3/6] fixed some clang-tidy-14 warnings --- tools/triage/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/triage/mainwindow.cpp b/tools/triage/mainwindow.cpp index 48cf58fb979..f6ac96621db 100644 --- a/tools/triage/mainwindow.cpp +++ b/tools/triage/mainwindow.cpp @@ -263,7 +263,7 @@ void MainWindow::showResult(QListWidgetItem *item) const QStringList lines = item->text().split("\n"); if (lines.size() < 2) return; - const QString url = lines[0]; + const QString &url = lines[0]; QString msg = lines[1]; const QRegularExpressionMatch matchRes = mVersionRe.match(msg); if (matchRes.hasMatch()) From a1b13238898ab86aaea30b1f0660d9ea424db3fb Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 5 Feb 2022 15:08:08 +0100 Subject: [PATCH 4/6] clang-tidy.cmake: added run-clang-tidy-14 to list of programs to look for --- cmake/clang_tidy.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/clang_tidy.cmake b/cmake/clang_tidy.cmake index ecedff05633..fb115f8c3a8 100644 --- a/cmake/clang_tidy.cmake +++ b/cmake/clang_tidy.cmake @@ -7,7 +7,7 @@ if (NOT NPROC) endif() message(STATUS "NPROC=${NPROC}") -find_program(RUN_CLANG_TIDY NAMES run-clang-tidy run-clang-tidy-13 run-clang-tidy-12 run-clang-tidy-11 run-clang-tidy-10 run-clang-tidy-9 run-clang-tidy-8) +find_program(RUN_CLANG_TIDY NAMES run-clang-tidy run-clang-tidy-14 run-clang-tidy-13 run-clang-tidy-12 run-clang-tidy-11 run-clang-tidy-10 run-clang-tidy-9 run-clang-tidy-8) message(STATUS "RUN_CLANG_TIDY=${RUN_CLANG_TIDY}") if (RUN_CLANG_TIDY) # disable all compiler warnings since we are just interested in the tidy ones From f959aceaed9f0069ceb902d10666abc10453b447 Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 5 Feb 2022 15:08:43 +0100 Subject: [PATCH 5/6] .clang-tidy: disabled upcoming warning readability-identifier-length we are not interested in --- .clang-tidy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index 960abc5335f..5a5304a9498 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ --- -Checks: '*,-abseil-*,-altera-*,-android-*,-cert-*,-cppcoreguidelines-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-named-parameter,-readability-redundant-member-init,-performance-faster-string-find,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-modernize-use-override,-modernize-pass-by-value,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-misc-unused-using-decls,-modernize-use-emplace,-readability-const-return-type,-performance-unnecessary-value-param,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-readability-non-const-parameter,-misc-non-private-member-variables-in-classes,-bugprone-suspicious-string-compare,-clang-analyzer-*,-bugprone-signed-char-misuse,-readability-make-member-function-const,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-bugprone-suspicious-include,-modernize-replace-random-shuffle,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-modernize-use-equals-delete,-performance-noexcept-move-constructor,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument' +Checks: '*,-abseil-*,-altera-*,-android-*,-cert-*,-cppcoreguidelines-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-named-parameter,-readability-redundant-member-init,-performance-faster-string-find,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-modernize-use-override,-modernize-pass-by-value,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-misc-unused-using-decls,-modernize-use-emplace,-readability-const-return-type,-performance-unnecessary-value-param,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-readability-non-const-parameter,-misc-non-private-member-variables-in-classes,-bugprone-suspicious-string-compare,-clang-analyzer-*,-bugprone-signed-char-misuse,-readability-make-member-function-const,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-bugprone-suspicious-include,-modernize-replace-random-shuffle,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-modernize-use-equals-delete,-performance-noexcept-move-constructor,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument,-readability-identifier-length' WarningsAsErrors: '*' CheckOptions: - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic From 1ad1814c41258ef78e94aecdaf9edbe7e5bfe836 Mon Sep 17 00:00:00 2001 From: firewave Date: Sun, 8 May 2022 22:28:58 +0200 Subject: [PATCH 6/6] compileroptions.cmake: disabled Clang warning -Wbitwise-instead-of-logical for now --- cmake/compileroptions.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/compileroptions.cmake b/cmake/compileroptions.cmake index 03ca2e50a49..f5d4281ee9e 100644 --- a/cmake/compileroptions.cmake +++ b/cmake/compileroptions.cmake @@ -95,6 +95,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options_safe(-Wno-tautological-type-limit-compare) add_compile_options_safe(-Wno-unused-member-function) add_compile_options(-Wno-disabled-macro-expansion) + add_compile_options_safe(-Wno-bitwise-instead-of-logical) # TODO: fix these # warnings we are not interested in add_compile_options(-Wno-four-char-constants)