From 4821290d2e6cfe890b80a4c9ab3ee1a53af75906 Mon Sep 17 00:00:00 2001 From: Nico Reissmann Date: Sat, 21 Dec 2024 10:54:03 +0100 Subject: [PATCH] Add modernize-redundant-void-arg check to clang-tidy (#694) --- .clang-tidy | 2 + jlm/rvsdg/binary.cpp | 2 +- jlm/rvsdg/bitstring/concat.cpp | 2 +- jlm/rvsdg/gamma.cpp | 2 +- jlm/rvsdg/node.cpp | 2 +- jlm/rvsdg/nullary.cpp | 2 +- jlm/rvsdg/simple-normal-form.cpp | 2 +- jlm/rvsdg/statemux.cpp | 2 +- jlm/rvsdg/structural-normal-form.cpp | 2 +- jlm/rvsdg/unary.cpp | 2 +- jlm/util/intrusive-hash.hpp | 4 +- jlm/util/intrusive-list.hpp | 8 ++-- tests/jlm/rvsdg/bitstring/bitstring.cpp | 62 ++++++++++++------------- tests/jlm/rvsdg/test-gamma.cpp | 6 +-- tests/jlm/rvsdg/test-graph.cpp | 6 +-- tests/jlm/rvsdg/test-nodes.cpp | 2 +- tests/jlm/rvsdg/test-statemux.cpp | 2 +- tests/jlm/rvsdg/test-topdown.cpp | 2 +- tests/jlm/rvsdg/test-typemismatch.cpp | 2 +- tests/jlm/util/test-intrusive-hash.cpp | 6 +-- tests/jlm/util/test-intrusive-list.cpp | 6 +-- 21 files changed, 64 insertions(+), 62 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 2bcbaae63..dd474def7 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,8 +1,10 @@ --- Checks: '-*, modernize-deprecated-headers, + modernize-redundant-void-arg, ' WarningsAsErrors: ' modernize-deprecated-headers, + modernize-redundant-void-arg, ' \ No newline at end of file diff --git a/jlm/rvsdg/binary.cpp b/jlm/rvsdg/binary.cpp index 60c961e5d..db35d1360 100644 --- a/jlm/rvsdg/binary.cpp +++ b/jlm/rvsdg/binary.cpp @@ -522,7 +522,7 @@ flattened_binary_operation_get_default_normal_form_( } static void __attribute__((constructor)) -register_node_normal_form(void) +register_node_normal_form() { jlm::rvsdg::node_normal_form::register_factory( typeid(jlm::rvsdg::binary_op), diff --git a/jlm/rvsdg/bitstring/concat.cpp b/jlm/rvsdg/bitstring/concat.cpp index e188db419..f250de767 100644 --- a/jlm/rvsdg/bitstring/concat.cpp +++ b/jlm/rvsdg/bitstring/concat.cpp @@ -237,7 +237,7 @@ get_default_normal_form( } static void __attribute__((constructor)) -register_node_normal_form(void) +register_node_normal_form() { jlm::rvsdg::node_normal_form::register_factory( typeid(jlm::rvsdg::bitconcat_op), diff --git a/jlm/rvsdg/gamma.cpp b/jlm/rvsdg/gamma.cpp index ea2b71e9f..3cf53e929 100644 --- a/jlm/rvsdg/gamma.cpp +++ b/jlm/rvsdg/gamma.cpp @@ -471,7 +471,7 @@ gamma_node_get_default_normal_form_( } static void __attribute__((constructor)) -register_node_normal_form(void) +register_node_normal_form() { jlm::rvsdg::node_normal_form::register_factory( typeid(jlm::rvsdg::GammaOperation), diff --git a/jlm/rvsdg/node.cpp b/jlm/rvsdg/node.cpp index f09dca107..46e4b2a7c 100644 --- a/jlm/rvsdg/node.cpp +++ b/jlm/rvsdg/node.cpp @@ -147,7 +147,7 @@ node_get_default_normal_form_( } static void __attribute__((constructor)) -register_node_normal_form(void) +register_node_normal_form() { jlm::rvsdg::node_normal_form::register_factory( typeid(jlm::rvsdg::Operation), diff --git a/jlm/rvsdg/nullary.cpp b/jlm/rvsdg/nullary.cpp index c78350ec0..a8baa960f 100644 --- a/jlm/rvsdg/nullary.cpp +++ b/jlm/rvsdg/nullary.cpp @@ -44,7 +44,7 @@ nullary_operation_get_default_normal_form_( } static void __attribute__((constructor)) -register_node_normal_form(void) +register_node_normal_form() { jlm::rvsdg::node_normal_form::register_factory( typeid(jlm::rvsdg::nullary_op), diff --git a/jlm/rvsdg/simple-normal-form.cpp b/jlm/rvsdg/simple-normal-form.cpp index 07ca14cdb..d2eeee55b 100644 --- a/jlm/rvsdg/simple-normal-form.cpp +++ b/jlm/rvsdg/simple-normal-form.cpp @@ -119,7 +119,7 @@ get_default_normal_form( } static void __attribute__((constructor)) -register_node_normal_form(void) +register_node_normal_form() { jlm::rvsdg::node_normal_form::register_factory( typeid(jlm::rvsdg::SimpleOperation), diff --git a/jlm/rvsdg/statemux.cpp b/jlm/rvsdg/statemux.cpp index 83e27ed92..79621b99d 100644 --- a/jlm/rvsdg/statemux.cpp +++ b/jlm/rvsdg/statemux.cpp @@ -210,7 +210,7 @@ create_mux_normal_form( } static void __attribute__((constructor)) -register_node_normal_form(void) +register_node_normal_form() { jlm::rvsdg::node_normal_form::register_factory( typeid(jlm::rvsdg::mux_op), diff --git a/jlm/rvsdg/structural-normal-form.cpp b/jlm/rvsdg/structural-normal-form.cpp index 122a39a69..bf2aee5d9 100644 --- a/jlm/rvsdg/structural-normal-form.cpp +++ b/jlm/rvsdg/structural-normal-form.cpp @@ -31,7 +31,7 @@ get_default_normal_form( } static void __attribute__((constructor)) -register_node_normal_form(void) +register_node_normal_form() { jlm::rvsdg::node_normal_form::register_factory( typeid(jlm::rvsdg::StructuralOperation), diff --git a/jlm/rvsdg/unary.cpp b/jlm/rvsdg/unary.cpp index e2f4a4304..45f5eb7d6 100644 --- a/jlm/rvsdg/unary.cpp +++ b/jlm/rvsdg/unary.cpp @@ -110,7 +110,7 @@ unary_operation_get_default_normal_form_( } static void __attribute__((constructor)) -register_node_normal_form(void) +register_node_normal_form() { jlm::rvsdg::node_normal_form::register_factory( typeid(jlm::rvsdg::unary_op), diff --git a/jlm/util/intrusive-hash.hpp b/jlm/util/intrusive-hash.hpp index 54d979fc9..bbd8a76c3 100644 --- a/jlm/util/intrusive-hash.hpp +++ b/jlm/util/intrusive-hash.hpp @@ -173,7 +173,7 @@ class intrusive_hash {} inline const iterator & - operator++(void) noexcept + operator++() noexcept { ElementType * next = map_->accessor_.get_next(element_); if (next == nullptr) @@ -262,7 +262,7 @@ class intrusive_hash {} inline const const_iterator & - operator++(void) noexcept + operator++() noexcept { ElementType * next = map_->accessor_.get_next(element_); if (next == nullptr) diff --git a/jlm/util/intrusive-list.hpp b/jlm/util/intrusive-list.hpp index d26adb338..3b743b471 100644 --- a/jlm/util/intrusive-list.hpp +++ b/jlm/util/intrusive-list.hpp @@ -116,7 +116,7 @@ class intrusive_list {} inline const iterator & - operator++(void) noexcept + operator++() noexcept { element_ = list_->accessor_.get_next(element_); return *this; @@ -131,7 +131,7 @@ class intrusive_list } inline const iterator & - operator--(void) noexcept + operator--() noexcept { if (element_) { @@ -216,7 +216,7 @@ class intrusive_list {} inline const const_iterator & - operator++(void) noexcept + operator++() noexcept { element_ = list_->accessor_.get_next(element_); return *this; @@ -231,7 +231,7 @@ class intrusive_list } inline const const_iterator & - operator--(void) noexcept + operator--() noexcept { if (element_) { diff --git a/tests/jlm/rvsdg/bitstring/bitstring.cpp b/tests/jlm/rvsdg/bitstring/bitstring.cpp index 93fda72cb..1a6dbcead 100644 --- a/tests/jlm/rvsdg/bitstring/bitstring.cpp +++ b/tests/jlm/rvsdg/bitstring/bitstring.cpp @@ -11,7 +11,7 @@ #include static int -types_bitstring_arithmetic_test_bitand(void) +types_bitstring_arithmetic_test_bitand() { using namespace jlm::rvsdg; @@ -39,7 +39,7 @@ types_bitstring_arithmetic_test_bitand(void) } static int -types_bitstring_arithmetic_test_bitashr(void) +types_bitstring_arithmetic_test_bitashr() { using namespace jlm::rvsdg; @@ -78,7 +78,7 @@ types_bitstring_arithmetic_test_bitashr(void) } static int -types_bitstring_arithmetic_test_bitdifference(void) +types_bitstring_arithmetic_test_bitdifference() { using namespace jlm::rvsdg; @@ -101,7 +101,7 @@ types_bitstring_arithmetic_test_bitdifference(void) } static int -types_bitstring_arithmetic_test_bitnegate(void) +types_bitstring_arithmetic_test_bitnegate() { using namespace jlm::rvsdg; @@ -129,7 +129,7 @@ types_bitstring_arithmetic_test_bitnegate(void) } static int -types_bitstring_arithmetic_test_bitnot(void) +types_bitstring_arithmetic_test_bitnot() { using namespace jlm::rvsdg; @@ -157,7 +157,7 @@ types_bitstring_arithmetic_test_bitnot(void) } static int -types_bitstring_arithmetic_test_bitor(void) +types_bitstring_arithmetic_test_bitor() { using namespace jlm::rvsdg; @@ -185,7 +185,7 @@ types_bitstring_arithmetic_test_bitor(void) } static int -types_bitstring_arithmetic_test_bitproduct(void) +types_bitstring_arithmetic_test_bitproduct() { using namespace jlm::rvsdg; @@ -214,7 +214,7 @@ types_bitstring_arithmetic_test_bitproduct(void) } static int -types_bitstring_arithmetic_test_bitshiproduct(void) +types_bitstring_arithmetic_test_bitshiproduct() { using namespace jlm::rvsdg; @@ -237,7 +237,7 @@ types_bitstring_arithmetic_test_bitshiproduct(void) } static int -types_bitstring_arithmetic_test_bitshl(void) +types_bitstring_arithmetic_test_bitshl() { using namespace jlm::rvsdg; @@ -269,7 +269,7 @@ types_bitstring_arithmetic_test_bitshl(void) } static int -types_bitstring_arithmetic_test_bitshr(void) +types_bitstring_arithmetic_test_bitshr() { using namespace jlm::rvsdg; @@ -301,7 +301,7 @@ types_bitstring_arithmetic_test_bitshr(void) } static int -types_bitstring_arithmetic_test_bitsmod(void) +types_bitstring_arithmetic_test_bitsmod() { using namespace jlm::rvsdg; @@ -330,7 +330,7 @@ types_bitstring_arithmetic_test_bitsmod(void) } static int -types_bitstring_arithmetic_test_bitsquotient(void) +types_bitstring_arithmetic_test_bitsquotient() { using namespace jlm::rvsdg; @@ -359,7 +359,7 @@ types_bitstring_arithmetic_test_bitsquotient(void) } static int -types_bitstring_arithmetic_test_bitsum(void) +types_bitstring_arithmetic_test_bitsum() { using namespace jlm::rvsdg; @@ -388,7 +388,7 @@ types_bitstring_arithmetic_test_bitsum(void) } static int -types_bitstring_arithmetic_test_bituhiproduct(void) +types_bitstring_arithmetic_test_bituhiproduct() { using namespace jlm::rvsdg; @@ -411,7 +411,7 @@ types_bitstring_arithmetic_test_bituhiproduct(void) } static int -types_bitstring_arithmetic_test_bitumod(void) +types_bitstring_arithmetic_test_bitumod() { using namespace jlm::rvsdg; @@ -440,7 +440,7 @@ types_bitstring_arithmetic_test_bitumod(void) } static int -types_bitstring_arithmetic_test_bituquotient(void) +types_bitstring_arithmetic_test_bituquotient() { using namespace jlm::rvsdg; @@ -469,7 +469,7 @@ types_bitstring_arithmetic_test_bituquotient(void) } static int -types_bitstring_arithmetic_test_bitxor(void) +types_bitstring_arithmetic_test_bitxor() { using namespace jlm::rvsdg; @@ -513,7 +513,7 @@ expect_static_false(jlm::rvsdg::output * port) } static int -types_bitstring_comparison_test_bitequal(void) +types_bitstring_comparison_test_bitequal() { using namespace jlm::rvsdg; @@ -547,7 +547,7 @@ types_bitstring_comparison_test_bitequal(void) } static int -types_bitstring_comparison_test_bitnotequal(void) +types_bitstring_comparison_test_bitnotequal() { using namespace jlm::rvsdg; @@ -581,7 +581,7 @@ types_bitstring_comparison_test_bitnotequal(void) } static int -types_bitstring_comparison_test_bitsgreater(void) +types_bitstring_comparison_test_bitsgreater() { using namespace jlm::rvsdg; @@ -619,7 +619,7 @@ types_bitstring_comparison_test_bitsgreater(void) } static int -types_bitstring_comparison_test_bitsgreatereq(void) +types_bitstring_comparison_test_bitsgreatereq() { using namespace jlm::rvsdg; @@ -660,7 +660,7 @@ types_bitstring_comparison_test_bitsgreatereq(void) } static int -types_bitstring_comparison_test_bitsless(void) +types_bitstring_comparison_test_bitsless() { using namespace jlm::rvsdg; @@ -698,7 +698,7 @@ types_bitstring_comparison_test_bitsless(void) } static int -types_bitstring_comparison_test_bitslesseq(void) +types_bitstring_comparison_test_bitslesseq() { using namespace jlm::rvsdg; @@ -739,7 +739,7 @@ types_bitstring_comparison_test_bitslesseq(void) } static int -types_bitstring_comparison_test_bitugreater(void) +types_bitstring_comparison_test_bitugreater() { using namespace jlm::rvsdg; @@ -777,7 +777,7 @@ types_bitstring_comparison_test_bitugreater(void) } static int -types_bitstring_comparison_test_bitugreatereq(void) +types_bitstring_comparison_test_bitugreatereq() { using namespace jlm::rvsdg; @@ -818,7 +818,7 @@ types_bitstring_comparison_test_bitugreatereq(void) } static int -types_bitstring_comparison_test_bituless(void) +types_bitstring_comparison_test_bituless() { using namespace jlm::rvsdg; @@ -856,7 +856,7 @@ types_bitstring_comparison_test_bituless(void) } static int -types_bitstring_comparison_test_bitulesseq(void) +types_bitstring_comparison_test_bitulesseq() { using namespace jlm::rvsdg; @@ -925,7 +925,7 @@ types_bitstring_comparison_test_bitulesseq(void) "11111111" static int -types_bitstring_test_constant(void) +types_bitstring_test_constant() { using namespace jlm::rvsdg; @@ -961,7 +961,7 @@ types_bitstring_test_constant(void) } static int -types_bitstring_test_normalize(void) +types_bitstring_test_normalize() { using namespace jlm::rvsdg; @@ -1020,7 +1020,7 @@ assert_constant(jlm::rvsdg::output * bitstr, size_t nbits, const char bits[]) } static int -types_bitstring_test_reduction(void) +types_bitstring_test_reduction() { using namespace jlm::rvsdg; @@ -1074,7 +1074,7 @@ types_bitstring_test_reduction(void) } static int -types_bitstring_test_slice_concat(void) +types_bitstring_test_slice_concat() { using namespace jlm::rvsdg; diff --git a/tests/jlm/rvsdg/test-gamma.cpp b/tests/jlm/rvsdg/test-gamma.cpp index 1edfd31e6..40c9aa9c8 100644 --- a/tests/jlm/rvsdg/test-gamma.cpp +++ b/tests/jlm/rvsdg/test-gamma.cpp @@ -12,7 +12,7 @@ #include static void -test_gamma(void) +test_gamma() { using namespace jlm::rvsdg; @@ -49,7 +49,7 @@ test_gamma(void) } static void -test_predicate_reduction(void) +test_predicate_reduction() { using namespace jlm::rvsdg; @@ -81,7 +81,7 @@ test_predicate_reduction(void) } static void -test_invariant_reduction(void) +test_invariant_reduction() { using namespace jlm::rvsdg; diff --git a/tests/jlm/rvsdg/test-graph.cpp b/tests/jlm/rvsdg/test-graph.cpp index 6f8c206e7..c959a5d6e 100644 --- a/tests/jlm/rvsdg/test-graph.cpp +++ b/tests/jlm/rvsdg/test-graph.cpp @@ -66,7 +66,7 @@ test_recursive_prune() JLM_UNIT_TEST_REGISTER("rvsdg/test-graph_prune", test_recursive_prune) static int -test_empty_graph_pruning(void) +test_empty_graph_pruning() { jlm::rvsdg::Graph graph; @@ -84,7 +84,7 @@ test_empty_graph_pruning(void) JLM_UNIT_TEST_REGISTER("rvsdg/test-empty_graph_pruning", test_empty_graph_pruning) static int -test_prune_replace(void) +test_prune_replace() { using namespace jlm::rvsdg; @@ -113,7 +113,7 @@ test_prune_replace(void) JLM_UNIT_TEST_REGISTER("rvsdg/test-prune-replace", test_prune_replace) static int -test_graph(void) +test_graph() { using namespace jlm::rvsdg; diff --git a/tests/jlm/rvsdg/test-nodes.cpp b/tests/jlm/rvsdg/test-nodes.cpp index 2da66e3da..859cce484 100644 --- a/tests/jlm/rvsdg/test-nodes.cpp +++ b/tests/jlm/rvsdg/test-nodes.cpp @@ -10,7 +10,7 @@ #include static void -test_node_copy(void) +test_node_copy() { using namespace jlm::rvsdg; using namespace jlm::tests; diff --git a/tests/jlm/rvsdg/test-statemux.cpp b/tests/jlm/rvsdg/test-statemux.cpp index 82ee7da42..3ab31de1b 100644 --- a/tests/jlm/rvsdg/test-statemux.cpp +++ b/tests/jlm/rvsdg/test-statemux.cpp @@ -81,7 +81,7 @@ test_multiple_origin_reduction() } static int -test_main(void) +test_main() { test_mux_mux_reduction(); test_multiple_origin_reduction(); diff --git a/tests/jlm/rvsdg/test-topdown.cpp b/tests/jlm/rvsdg/test-topdown.cpp index d69c2ba22..64575f88a 100644 --- a/tests/jlm/rvsdg/test-topdown.cpp +++ b/tests/jlm/rvsdg/test-topdown.cpp @@ -190,7 +190,7 @@ test_mutable_traverse() } static int -test_main(void) +test_main() { test_initialization(); test_basic_traversal(); diff --git a/tests/jlm/rvsdg/test-typemismatch.cpp b/tests/jlm/rvsdg/test-typemismatch.cpp index ab55cb267..db6d79101 100644 --- a/tests/jlm/rvsdg/test-typemismatch.cpp +++ b/tests/jlm/rvsdg/test-typemismatch.cpp @@ -9,7 +9,7 @@ #include "test-types.hpp" static int -test_main(void) +test_main() { using namespace jlm::rvsdg; diff --git a/tests/jlm/util/test-intrusive-hash.cpp b/tests/jlm/util/test-intrusive-hash.cpp index d1f90a9b5..fa1a470ca 100644 --- a/tests/jlm/util/test-intrusive-hash.cpp +++ b/tests/jlm/util/test-intrusive-hash.cpp @@ -82,7 +82,7 @@ struct my_stritem typedef jlm::util::intrusive_hash my_strhash; static void -test_int_hash(void) +test_int_hash() { my_hash m; @@ -118,7 +118,7 @@ test_int_hash(void) } static void -test_str_hash(void) +test_str_hash() { my_strhash m; @@ -154,7 +154,7 @@ test_str_hash(void) } static int -test_main(void) +test_main() { test_int_hash(); test_str_hash(); diff --git a/tests/jlm/util/test-intrusive-list.cpp b/tests/jlm/util/test-intrusive-list.cpp index cb8ebb9ff..c41c8617c 100644 --- a/tests/jlm/util/test-intrusive-list.cpp +++ b/tests/jlm/util/test-intrusive-list.cpp @@ -39,7 +39,7 @@ typedef jlm::util::intrusive_list my_list; typedef jlm::util::owner_intrusive_list my_owner_list; static void -test_simple_list(void) +test_simple_list() { my_list l; @@ -80,7 +80,7 @@ test_simple_list(void) } static void -test_owner_list(void) +test_owner_list() { int v1 = 1; int v2 = 2; @@ -143,7 +143,7 @@ test_owner_list(void) } static int -test_main(void) +test_main() { test_simple_list(); test_owner_list();