diff options
author | Tor Egge <Tor.Egge@yahooinc.com> | 2023-01-30 22:25:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-30 22:25:30 +0100 |
commit | f50103b7c5f4702c2d8fa7b4f2963f633ea9d54a (patch) | |
tree | eaeac5cb02c5c15db3a47a2eadcd6be7bdcafaa3 | |
parent | a1b6a7d75da69fd01f7734dbbc40d4ab18f7c077 (diff) | |
parent | 3173d8e4c68b28ae5b38e824d38bee268c0cc8db (diff) |
Merge pull request #25806 from vespa-engine/balder/gc-void-winline-pragmav8.118.21
GC some void inline pragmas
8 files changed, 54 insertions, 40 deletions
diff --git a/searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp b/searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp index ad20684bd04..7caed5c2b56 100644 --- a/searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp +++ b/searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp @@ -5,9 +5,6 @@ #include <vespa/vespalib/data/slime/slime.h> #include <vespa/vespalib/data/slime/binary_format.h> -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Winline" - using ::search::UniqueIssues; using Converter = ::search::engine::ProtoConverter; @@ -640,5 +637,3 @@ TEST_F(MonitorReplyTest, require_that_is_blocking_writes_is_converted) { //----------------------------------------------------------------------------- GTEST_MAIN_RUN_ALL_TESTS() - -#pragma GCC diagnostic pop diff --git a/searchlib/src/tests/engine/proto_rpc_adapter/proto_rpc_adapter_test.cpp b/searchlib/src/tests/engine/proto_rpc_adapter/proto_rpc_adapter_test.cpp index 92caf1ad2dc..9c5e000c314 100644 --- a/searchlib/src/tests/engine/proto_rpc_adapter/proto_rpc_adapter_test.cpp +++ b/searchlib/src/tests/engine/proto_rpc_adapter/proto_rpc_adapter_test.cpp @@ -14,9 +14,6 @@ #include <thread> #include <chrono> -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Winline" - using namespace search::engine; using vespalib::Slime; @@ -222,5 +219,3 @@ TEST_F(ProtoRpcAdapterTest, require_that_proto_rpc_ping_works) { //----------------------------------------------------------------------------- GTEST_MAIN_RUN_ALL_TESTS() - -#pragma GCC diagnostic pop diff --git a/searchlib/src/tests/queryeval/filter_search/filter_search_test.cpp b/searchlib/src/tests/queryeval/filter_search/filter_search_test.cpp index 6c344d787ab..fdac3c582b1 100644 --- a/searchlib/src/tests/queryeval/filter_search/filter_search_test.cpp +++ b/searchlib/src/tests/queryeval/filter_search/filter_search_test.cpp @@ -1,7 +1,5 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#pragma GCC diagnostic ignored "-Winline" - #include <vespa/searchlib/queryeval/simpleresult.h> #include <vespa/searchlib/queryeval/emptysearch.h> #include <vespa/searchlib/queryeval/full_search.h> @@ -209,9 +207,8 @@ struct Combine { using factory_fun = std::function<std::unique_ptr<SearchIterator>(const Blueprint::Children &, bool, Constraint)>; factory_fun fun; Blueprint::Children list; - Combine(factory_fun fun_in, const Children &child_list) : fun(fun_in), list() { - child_list.apply(*this); - } + Combine(factory_fun fun_in, const Children &child_list); + ~Combine(); void addChild(std::unique_ptr<Blueprint> child) { list.push_back(std::move(child)); } @@ -220,6 +217,14 @@ struct Combine { } }; +Combine::Combine(factory_fun fun_in, const Children &child_list) + : fun(fun_in), list() +{ + child_list.apply(*this); +} + +Combine::~Combine() = default; + // enable Make-ing source blender struct SourceBlenderAdapter { NullSelector selector; @@ -265,7 +270,8 @@ struct EquivAdapter { struct WeightedSetTermAdapter { FieldSpec field; WeightedSetTermBlueprint blueprint; - WeightedSetTermAdapter() : field("foo", 3, 7), blueprint(field) {} + WeightedSetTermAdapter(); + ~WeightedSetTermAdapter(); void addChild(std::unique_ptr<Blueprint> child) { blueprint.addTerm(std::move(child), 100); } @@ -274,11 +280,15 @@ struct WeightedSetTermAdapter { } }; +WeightedSetTermAdapter::WeightedSetTermAdapter() : field("foo", 3, 7), blueprint(field) {} +WeightedSetTermAdapter::~WeightedSetTermAdapter() = default; + // enable Make-ing dot product struct DotProductAdapter { FieldSpec field; DotProductBlueprint blueprint; - DotProductAdapter() : field("foo", 3, 7), blueprint(field) {} + DotProductAdapter(); + ~DotProductAdapter(); void addChild(std::unique_ptr<Blueprint> child) { auto child_field = blueprint.getNextChildField(field); auto term = std::make_unique<LeafProxy>(child_field, std::move(child)); @@ -289,6 +299,9 @@ struct DotProductAdapter { } }; +DotProductAdapter::DotProductAdapter() : field("foo", 3, 7), blueprint(field) {} +DotProductAdapter::~DotProductAdapter() = default; + // enable Make-ing parallel weak and struct ParallelWeakAndAdapter { FieldSpec field; @@ -308,7 +321,8 @@ struct ParallelWeakAndAdapter { struct SameElementAdapter { FieldSpec field; SameElementBlueprint blueprint; - SameElementAdapter() : field("foo", 5, 11), blueprint(field, false) {} + SameElementAdapter(); + ~SameElementAdapter(); void addChild(std::unique_ptr<Blueprint> child) { auto child_field = blueprint.getNextChildField("foo", 3); auto term = std::make_unique<LeafProxy>(child_field, std::move(child)); @@ -319,6 +333,9 @@ struct SameElementAdapter { } }; +SameElementAdapter::SameElementAdapter() : field("foo", 5, 11), blueprint(field, false) {} +SameElementAdapter::~SameElementAdapter() = default; + // Make a specific intermediate-ish blueprint that you can add // children to. Satisfies the FilterFactory concept. template <FilterFactory T> diff --git a/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp b/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp index ebda61dd820..121591723e2 100644 --- a/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp @@ -16,4 +16,6 @@ FieldSpecBaseList::~FieldSpecBaseList() = default; FieldSpecList::~FieldSpecList() = default; +FieldSpec::~FieldSpec() = default; + } diff --git a/searchlib/src/vespa/searchlib/queryeval/field_spec.h b/searchlib/src/vespa/searchlib/queryeval/field_spec.h index 0d66de954ad..f37403471ac 100644 --- a/searchlib/src/vespa/searchlib/queryeval/field_spec.h +++ b/searchlib/src/vespa/searchlib/queryeval/field_spec.h @@ -43,6 +43,7 @@ public: : FieldSpecBase(fieldId, handle, isFilter_), _name(name) {} + ~FieldSpec(); const vespalib::string & getName() const { return _name; } private: diff --git a/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.cpp b/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.cpp index 025103e4e3d..d481d7d2ce9 100644 --- a/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.cpp +++ b/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.cpp @@ -8,8 +8,6 @@ LOG_SETUP(".slobrok.server.local_rpc_monitor_map"); namespace slobrok { -#pragma GCC diagnostic ignored "-Winline" - namespace { struct ChainedCompletionHandler : CompletionHandler { @@ -25,9 +23,11 @@ struct ChainedCompletionHandler : CompletionHandler { first->doneHandler(result); second->doneHandler(result); } - ~ChainedCompletionHandler() override {} + ~ChainedCompletionHandler() override; }; +ChainedCompletionHandler::~ChainedCompletionHandler() = default; + } void LocalRpcMonitorMap::DelayedTasks::PerformTask() { @@ -45,6 +45,12 @@ void LocalRpcMonitorMap::DelayedTasks::PerformTask() { } } +LocalRpcMonitorMap::PerService::~PerService() = default; +LocalRpcMonitorMap::PerService::PerService(PerService &&) noexcept = default; +LocalRpcMonitorMap::PerService & LocalRpcMonitorMap::PerService::operator =(PerService &&) noexcept = default; + +LocalRpcMonitorMap::RemovedData::~RemovedData() = default; + LocalRpcMonitorMap::LocalRpcMonitorMap(FNET_Scheduler *scheduler, MappingMonitorFactory mappingMonitorFactory) : _delayedTasks(scheduler, *this), @@ -178,7 +184,6 @@ void LocalRpcMonitorMap::removeLocal(const ServiceMapping &mapping) { _dispatcher.remove(mapping); } _mappingMonitor->start(mapping, false); - return; } void LocalRpcMonitorMap::add(const ServiceMapping &mapping) { diff --git a/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.h b/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.h index c57dec240b8..7469f14063c 100644 --- a/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.h +++ b/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.h @@ -59,7 +59,7 @@ private: _target(target) {} - ~DelayedTasks() { Kill(); } + ~DelayedTasks() override { Kill(); } }; DelayedTasks _delayedTasks; @@ -69,26 +69,24 @@ private: bool localOnly; std::unique_ptr<CompletionHandler> inflight; vespalib::string spec; + PerService(bool up_in, bool local_only, std::unique_ptr<CompletionHandler> inflight_in, vespalib::stringref spec_in) + : up(up_in), localOnly(local_only), inflight(std::move(inflight_in)), spec(spec_in) + {} + PerService(const PerService &) = delete; + PerService & operator=(const PerService &) = delete; + PerService(PerService &&) noexcept; + PerService & operator =(PerService &&) noexcept; + ~PerService(); }; - PerService localService(const ServiceMapping &mapping, + static PerService localService(const ServiceMapping &mapping, std::unique_ptr<CompletionHandler> inflight) { - return PerService{ - .up = false, - .localOnly = true, - .inflight = std::move(inflight), - .spec = mapping.spec - }; + return {false, true, std::move(inflight), mapping.spec}; } - PerService globalService(const ServiceMapping &mapping) { - return PerService{ - .up = false, - .localOnly = false, - .inflight = {}, - .spec = mapping.spec - }; + static PerService globalService(const ServiceMapping &mapping) { + return {false, false, {}, mapping.spec}; } using Map = std::map<vespalib::string, PerService>; @@ -111,6 +109,7 @@ private: bool up; bool localOnly; std::unique_ptr<CompletionHandler> inflight; + ~RemovedData(); }; RemovedData removeFromMap(Map::iterator iter); @@ -118,12 +117,12 @@ private: public: LocalRpcMonitorMap(FNET_Scheduler *scheduler, MappingMonitorFactory mappingMonitorFactory); - ~LocalRpcMonitorMap(); + ~LocalRpcMonitorMap() override; MapSource &dispatcher() { return _dispatcher; } ServiceMapHistory & history(); - bool wouldConflict(const ServiceMapping &mapping) const; + [[nodiscard]] bool wouldConflict(const ServiceMapping &mapping) const; /** for use by register API, will call doneHandler() on inflight script */ void addLocal(const ServiceMapping &mapping, diff --git a/slobrok/src/vespa/slobrok/server/service_mapping.h b/slobrok/src/vespa/slobrok/server/service_mapping.h index bd92a075303..61729a37d8f 100644 --- a/slobrok/src/vespa/slobrok/server/service_mapping.h +++ b/slobrok/src/vespa/slobrok/server/service_mapping.h @@ -15,7 +15,7 @@ struct ServiceMapping { ~ServiceMapping(); ServiceMapping& operator=(const ServiceMapping& rhs); - bool operator== (const ServiceMapping &other) const { + bool operator== (const ServiceMapping &other) const noexcept { return name == other.name && spec == other.spec; } |