[fidl][llcpp] trivial copy for ResultOf arguments
For values which can be copied (unlike integers), we now use a reference
which avoids a move.
Before: LlcppDomainObject: 1857521
After: LlcppDomainObject: 1846317
Diff: 11204 (0.6% improvement)
Change-Id: I6a6853726427c3c2802a6c858461cbad0bd4da87
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/405054
Reviewed-by: André Pang <apang@google.com>
Reviewed-by: Yifei Teng <yifeit@google.com>
Testability-Review: Yifei Teng <yifeit@google.com>
Commit-Queue: Vincent Belliard <vbelliard@google.com>
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/empty_struct.test.json.llcpp.cc.golden b/garnet/go/src/fidl/compiler/backend/goldens/empty_struct.test.json.llcpp.cc.golden
index 00931ec5..e68c440 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/empty_struct.test.json.llcpp.cc.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/empty_struct.test.json.llcpp.cc.golden
@@ -30,7 +30,7 @@
} // namespace
EmptyProtocol::ResultOf::Send_Impl::Send_Impl(
- ::zx::unowned_channel _client_end, ::llcpp::fidl::test::json::Empty e) {
+ ::zx::unowned_channel _client_end, ::llcpp::fidl::test::json::Empty& e) {
// Destructors can't be called because it will lead to handle double close
// (here and in fidl::Encode).
FIDL_ALIGNDECL uint8_t _request_buffer[sizeof(SendRequest)];
@@ -51,12 +51,12 @@
EmptyProtocol::ResultOf::Send EmptyProtocol::SyncClient::Send(
::llcpp::fidl::test::json::Empty e) {
- return ResultOf::Send(::zx::unowned_channel(this->channel_), std::move(e));
+ return ResultOf::Send(::zx::unowned_channel(this->channel_), e);
}
EmptyProtocol::ResultOf::Send EmptyProtocol::Call::Send(
::zx::unowned_channel _client_end, ::llcpp::fidl::test::json::Empty e) {
- return ResultOf::Send(std::move(_client_end), std::move(e));
+ return ResultOf::Send(std::move(_client_end), e);
}
EmptyProtocol::UnownedResultOf::Send_Impl::Send_Impl(
@@ -125,7 +125,7 @@
EmptyProtocol::ResultOf::SendAndReceive_Impl<
EmptyProtocol::SendAndReceiveResponse>::
SendAndReceive_Impl(::zx::unowned_channel _client_end,
- ::llcpp::fidl::test::json::Empty e) {
+ ::llcpp::fidl::test::json::Empty& e) {
// Destructors can't be called because it will lead to handle double close
// (here and in fidl::Encode).
FIDL_ALIGNDECL uint8_t _request_buffer[sizeof(SendAndReceiveRequest)];
@@ -147,13 +147,12 @@
EmptyProtocol::ResultOf::SendAndReceive
EmptyProtocol::SyncClient::SendAndReceive(::llcpp::fidl::test::json::Empty e) {
- return ResultOf::SendAndReceive(::zx::unowned_channel(this->channel_),
- std::move(e));
+ return ResultOf::SendAndReceive(::zx::unowned_channel(this->channel_), e);
}
EmptyProtocol::ResultOf::SendAndReceive EmptyProtocol::Call::SendAndReceive(
::zx::unowned_channel _client_end, ::llcpp::fidl::test::json::Empty e) {
- return ResultOf::SendAndReceive(std::move(_client_end), std::move(e));
+ return ResultOf::SendAndReceive(std::move(_client_end), e);
}
template <>
@@ -241,7 +240,7 @@
::fidl::StatusAndError EmptyProtocol::ClientImpl::Send(
::llcpp::fidl::test::json::Empty e) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- auto _res = ResultOf::Send(_binding->channel(), std::move(e));
+ auto _res = ResultOf::Send(_binding->channel(), e);
return ::fidl::StatusAndError(_res.status(), _res.error());
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
@@ -261,7 +260,7 @@
EmptyProtocol::ClientImpl::SendAndReceive_Sync(
::llcpp::fidl::test::json::Empty e) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- return ResultOf::SendAndReceive(_binding->channel(), std::move(e));
+ return ResultOf::SendAndReceive(_binding->channel(), e);
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
}
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/empty_struct.test.json.llcpp.h.golden b/garnet/go/src/fidl/compiler/backend/goldens/empty_struct.test.json.llcpp.h.golden
index 880379a..f482058 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/empty_struct.test.json.llcpp.h.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/empty_struct.test.json.llcpp.h.golden
@@ -185,7 +185,7 @@
public:
Send_Impl(::zx::unowned_channel _client_end,
- ::llcpp::fidl::test::json::Empty e);
+ ::llcpp::fidl::test::json::Empty& e);
~Send_Impl() = default;
Send_Impl(Send_Impl&& other) = default;
Send_Impl& operator=(Send_Impl&& other) = default;
@@ -202,7 +202,7 @@
public:
SendAndReceive_Impl(::zx::unowned_channel _client_end,
- ::llcpp::fidl::test::json::Empty e);
+ ::llcpp::fidl::test::json::Empty& e);
~SendAndReceive_Impl() = default;
SendAndReceive_Impl(SendAndReceive_Impl&& other) = default;
SendAndReceive_Impl& operator=(SendAndReceive_Impl&& other) = default;
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/error.test.json.llcpp.cc.golden b/garnet/go/src/fidl/compiler/backend/goldens/error.test.json.llcpp.cc.golden
index a0d1a7c..46ec2ac 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/error.test.json.llcpp.cc.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/error.test.json.llcpp.cc.golden
@@ -28,7 +28,7 @@
} // namespace
template <>
Example::ResultOf::foo_Impl<Example::fooResponse>::foo_Impl(
- ::zx::unowned_channel _client_end, ::fidl::StringView s) {
+ ::zx::unowned_channel _client_end, const ::fidl::StringView& s) {
fooRequest _request(0, s);
auto _encoded = ::fidl::internal::LinearizedAndEncoded<fooRequest>(&_request);
@@ -45,12 +45,12 @@
}
Example::ResultOf::foo Example::SyncClient::foo(::fidl::StringView s) {
- return ResultOf::foo(::zx::unowned_channel(this->channel_), std::move(s));
+ return ResultOf::foo(::zx::unowned_channel(this->channel_), s);
}
Example::ResultOf::foo Example::Call::foo(::zx::unowned_channel _client_end,
::fidl::StringView s) {
- return ResultOf::foo(std::move(_client_end), std::move(s));
+ return ResultOf::foo(std::move(_client_end), s);
}
template <>
@@ -122,7 +122,7 @@
Example::ResultOf::foo Example::ClientImpl::foo_Sync(::fidl::StringView s) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- return ResultOf::foo(_binding->channel(), std::move(s));
+ return ResultOf::foo(_binding->channel(), s);
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
}
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/error.test.json.llcpp.h.golden b/garnet/go/src/fidl/compiler/backend/goldens/error.test.json.llcpp.h.golden
index 825a0a0..12a1197 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/error.test.json.llcpp.h.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/error.test.json.llcpp.h.golden
@@ -236,7 +236,7 @@
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
- foo_Impl(::zx::unowned_channel _client_end, ::fidl::StringView s);
+ foo_Impl(::zx::unowned_channel _client_end, const ::fidl::StringView& s);
~foo_Impl() = default;
foo_Impl(foo_Impl&& other) = default;
foo_Impl& operator=(foo_Impl&& other) = default;
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/inheritance.test.json.llcpp.cc.golden b/garnet/go/src/fidl/compiler/backend/goldens/inheritance.test.json.llcpp.cc.golden
index b855cab..353de06 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/inheritance.test.json.llcpp.cc.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/inheritance.test.json.llcpp.cc.golden
@@ -19,7 +19,7 @@
} // namespace
template <>
super::ResultOf::foo_Impl<super::fooResponse>::foo_Impl(
- ::zx::unowned_channel _client_end, ::fidl::StringView s) {
+ ::zx::unowned_channel _client_end, const ::fidl::StringView& s) {
fooRequest _request(0, s);
auto _encoded = ::fidl::internal::LinearizedAndEncoded<fooRequest>(&_request);
@@ -36,12 +36,12 @@
}
super::ResultOf::foo super::SyncClient::foo(::fidl::StringView s) {
- return ResultOf::foo(::zx::unowned_channel(this->channel_), std::move(s));
+ return ResultOf::foo(::zx::unowned_channel(this->channel_), s);
}
super::ResultOf::foo super::Call::foo(::zx::unowned_channel _client_end,
::fidl::StringView s) {
- return ResultOf::foo(std::move(_client_end), std::move(s));
+ return ResultOf::foo(std::move(_client_end), s);
}
template <>
@@ -113,7 +113,7 @@
super::ResultOf::foo super::ClientImpl::foo_Sync(::fidl::StringView s) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- return ResultOf::foo(_binding->channel(), std::move(s));
+ return ResultOf::foo(_binding->channel(), s);
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
}
@@ -312,7 +312,7 @@
} // namespace
template <>
sub::ResultOf::foo_Impl<sub::fooResponse>::foo_Impl(
- ::zx::unowned_channel _client_end, ::fidl::StringView s) {
+ ::zx::unowned_channel _client_end, const ::fidl::StringView& s) {
fooRequest _request(0, s);
auto _encoded = ::fidl::internal::LinearizedAndEncoded<fooRequest>(&_request);
@@ -329,12 +329,12 @@
}
sub::ResultOf::foo sub::SyncClient::foo(::fidl::StringView s) {
- return ResultOf::foo(::zx::unowned_channel(this->channel_), std::move(s));
+ return ResultOf::foo(::zx::unowned_channel(this->channel_), s);
}
sub::ResultOf::foo sub::Call::foo(::zx::unowned_channel _client_end,
::fidl::StringView s) {
- return ResultOf::foo(std::move(_client_end), std::move(s));
+ return ResultOf::foo(std::move(_client_end), s);
}
template <>
@@ -407,7 +407,7 @@
sub::ResultOf::foo sub::ClientImpl::foo_Sync(::fidl::StringView s) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- return ResultOf::foo(_binding->channel(), std::move(s));
+ return ResultOf::foo(_binding->channel(), s);
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
}
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/inheritance.test.json.llcpp.h.golden b/garnet/go/src/fidl/compiler/backend/goldens/inheritance.test.json.llcpp.h.golden
index 0af2d84..e4a6987 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/inheritance.test.json.llcpp.h.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/inheritance.test.json.llcpp.h.golden
@@ -104,7 +104,7 @@
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
- foo_Impl(::zx::unowned_channel _client_end, ::fidl::StringView s);
+ foo_Impl(::zx::unowned_channel _client_end, const ::fidl::StringView& s);
~foo_Impl() = default;
foo_Impl(foo_Impl&& other) = default;
foo_Impl& operator=(foo_Impl&& other) = default;
@@ -339,7 +339,7 @@
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
- foo_Impl(::zx::unowned_channel _client_end, ::fidl::StringView s);
+ foo_Impl(::zx::unowned_channel _client_end, const ::fidl::StringView& s);
~foo_Impl() = default;
foo_Impl(foo_Impl&& other) = default;
foo_Impl& operator=(foo_Impl&& other) = default;
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/inheritance_with_recursive_decl.test.json.llcpp.cc.golden b/garnet/go/src/fidl/compiler/backend/goldens/inheritance_with_recursive_decl.test.json.llcpp.cc.golden
index 11334f8..36a0b53 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/inheritance_with_recursive_decl.test.json.llcpp.cc.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/inheritance_with_recursive_decl.test.json.llcpp.cc.golden
@@ -20,7 +20,7 @@
} // namespace
Parent::ResultOf::First_Impl::First_Impl(::zx::unowned_channel _client_end,
- ::zx::channel request) {
+ ::zx::channel& request) {
// Destructors can't be called because it will lead to handle double close
// (here and in fidl::Encode).
FIDL_ALIGNDECL uint8_t _request_buffer[sizeof(FirstRequest)];
@@ -40,13 +40,12 @@
}
Parent::ResultOf::First Parent::SyncClient::First(::zx::channel request) {
- return ResultOf::First(::zx::unowned_channel(this->channel_),
- std::move(request));
+ return ResultOf::First(::zx::unowned_channel(this->channel_), request);
}
Parent::ResultOf::First Parent::Call::First(::zx::unowned_channel _client_end,
::zx::channel request) {
- return ResultOf::First(std::move(_client_end), std::move(request));
+ return ResultOf::First(std::move(_client_end), request);
}
Parent::UnownedResultOf::First_Impl::First_Impl(
@@ -114,7 +113,7 @@
::fidl::StatusAndError Parent::ClientImpl::First(::zx::channel request) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- auto _res = ResultOf::First(_binding->channel(), std::move(request));
+ auto _res = ResultOf::First(_binding->channel(), request);
return ::fidl::StatusAndError(_res.status(), _res.error());
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
@@ -195,7 +194,7 @@
} // namespace
Child::ResultOf::First_Impl::First_Impl(::zx::unowned_channel _client_end,
- ::zx::channel request) {
+ ::zx::channel& request) {
// Destructors can't be called because it will lead to handle double close
// (here and in fidl::Encode).
FIDL_ALIGNDECL uint8_t _request_buffer[sizeof(FirstRequest)];
@@ -215,13 +214,12 @@
}
Child::ResultOf::First Child::SyncClient::First(::zx::channel request) {
- return ResultOf::First(::zx::unowned_channel(this->channel_),
- std::move(request));
+ return ResultOf::First(::zx::unowned_channel(this->channel_), request);
}
Child::ResultOf::First Child::Call::First(::zx::unowned_channel _client_end,
::zx::channel request) {
- return ResultOf::First(std::move(_client_end), std::move(request));
+ return ResultOf::First(std::move(_client_end), request);
}
Child::UnownedResultOf::First_Impl::First_Impl(
@@ -288,7 +286,7 @@
}
Child::ResultOf::Second_Impl::Second_Impl(::zx::unowned_channel _client_end,
- ::zx::channel request) {
+ ::zx::channel& request) {
// Destructors can't be called because it will lead to handle double close
// (here and in fidl::Encode).
FIDL_ALIGNDECL uint8_t _request_buffer[sizeof(SecondRequest)];
@@ -308,13 +306,12 @@
}
Child::ResultOf::Second Child::SyncClient::Second(::zx::channel request) {
- return ResultOf::Second(::zx::unowned_channel(this->channel_),
- std::move(request));
+ return ResultOf::Second(::zx::unowned_channel(this->channel_), request);
}
Child::ResultOf::Second Child::Call::Second(::zx::unowned_channel _client_end,
::zx::channel request) {
- return ResultOf::Second(std::move(_client_end), std::move(request));
+ return ResultOf::Second(std::move(_client_end), request);
}
Child::UnownedResultOf::Second_Impl::Second_Impl(
@@ -383,7 +380,7 @@
::fidl::StatusAndError Child::ClientImpl::First(::zx::channel request) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- auto _res = ResultOf::First(_binding->channel(), std::move(request));
+ auto _res = ResultOf::First(_binding->channel(), request);
return ::fidl::StatusAndError(_res.status(), _res.error());
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
@@ -401,7 +398,7 @@
::fidl::StatusAndError Child::ClientImpl::Second(::zx::channel request) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- auto _res = ResultOf::Second(_binding->channel(), std::move(request));
+ auto _res = ResultOf::Second(_binding->channel(), request);
return ::fidl::StatusAndError(_res.status(), _res.error());
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/inheritance_with_recursive_decl.test.json.llcpp.h.golden b/garnet/go/src/fidl/compiler/backend/goldens/inheritance_with_recursive_decl.test.json.llcpp.h.golden
index 45904fd..2c11304 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/inheritance_with_recursive_decl.test.json.llcpp.h.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/inheritance_with_recursive_decl.test.json.llcpp.h.golden
@@ -80,7 +80,7 @@
using Super = ::fidl::internal::StatusAndError;
public:
- First_Impl(::zx::unowned_channel _client_end, ::zx::channel request);
+ First_Impl(::zx::unowned_channel _client_end, ::zx::channel& request);
~First_Impl() = default;
First_Impl(First_Impl&& other) = default;
First_Impl& operator=(First_Impl&& other) = default;
@@ -295,7 +295,7 @@
using Super = ::fidl::internal::StatusAndError;
public:
- First_Impl(::zx::unowned_channel _client_end, ::zx::channel request);
+ First_Impl(::zx::unowned_channel _client_end, ::zx::channel& request);
~First_Impl() = default;
First_Impl(First_Impl&& other) = default;
First_Impl& operator=(First_Impl&& other) = default;
@@ -309,7 +309,7 @@
using Super = ::fidl::internal::StatusAndError;
public:
- Second_Impl(::zx::unowned_channel _client_end, ::zx::channel request);
+ Second_Impl(::zx::unowned_channel _client_end, ::zx::channel& request);
~Second_Impl() = default;
Second_Impl(Second_Impl&& other) = default;
Second_Impl& operator=(Second_Impl&& other) = default;
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/nullable.test.json.llcpp.cc.golden b/garnet/go/src/fidl/compiler/backend/goldens/nullable.test.json.llcpp.cc.golden
index 18678db..4fea6a6 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/nullable.test.json.llcpp.cc.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/nullable.test.json.llcpp.cc.golden
@@ -41,13 +41,12 @@
SimpleProtocol::ResultOf::Add SimpleProtocol::SyncClient::Add(int32_t a,
int32_t b) {
- return ResultOf::Add(::zx::unowned_channel(this->channel_), std::move(a),
- std::move(b));
+ return ResultOf::Add(::zx::unowned_channel(this->channel_), a, b);
}
SimpleProtocol::ResultOf::Add SimpleProtocol::Call::Add(
::zx::unowned_channel _client_end, int32_t a, int32_t b) {
- return ResultOf::Add(std::move(_client_end), std::move(a), std::move(b));
+ return ResultOf::Add(std::move(_client_end), a, b);
}
template <>
@@ -123,7 +122,7 @@
SimpleProtocol::ResultOf::Add SimpleProtocol::ClientImpl::Add_Sync(int32_t a,
int32_t b) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- return ResultOf::Add(_binding->channel(), std::move(a), std::move(b));
+ return ResultOf::Add(_binding->channel(), a, b);
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
}
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/placement_of_attributes.test.json.llcpp.cc.golden b/garnet/go/src/fidl/compiler/backend/goldens/placement_of_attributes.test.json.llcpp.cc.golden
index b8ea74e..4903d13 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/placement_of_attributes.test.json.llcpp.cc.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/placement_of_attributes.test.json.llcpp.cc.golden
@@ -18,7 +18,7 @@
} // namespace
ExampleProtocol::ResultOf::Method_Impl::Method_Impl(
- ::zx::unowned_channel _client_end, ::llcpp::exampleusing::Empty arg) {
+ ::zx::unowned_channel _client_end, ::llcpp::exampleusing::Empty& arg) {
// Destructors can't be called because it will lead to handle double close
// (here and in fidl::Encode).
FIDL_ALIGNDECL uint8_t _request_buffer[sizeof(MethodRequest)];
@@ -39,13 +39,12 @@
ExampleProtocol::ResultOf::Method ExampleProtocol::SyncClient::Method(
::llcpp::exampleusing::Empty arg) {
- return ResultOf::Method(::zx::unowned_channel(this->channel_),
- std::move(arg));
+ return ResultOf::Method(::zx::unowned_channel(this->channel_), arg);
}
ExampleProtocol::ResultOf::Method ExampleProtocol::Call::Method(
::zx::unowned_channel _client_end, ::llcpp::exampleusing::Empty arg) {
- return ResultOf::Method(std::move(_client_end), std::move(arg));
+ return ResultOf::Method(std::move(_client_end), arg);
}
ExampleProtocol::UnownedResultOf::Method_Impl::Method_Impl(
@@ -114,7 +113,7 @@
::fidl::StatusAndError ExampleProtocol::ClientImpl::Method(
::llcpp::exampleusing::Empty arg) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- auto _res = ResultOf::Method(_binding->channel(), std::move(arg));
+ auto _res = ResultOf::Method(_binding->channel(), arg);
return ::fidl::StatusAndError(_res.status(), _res.error());
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/placement_of_attributes.test.json.llcpp.h.golden b/garnet/go/src/fidl/compiler/backend/goldens/placement_of_attributes.test.json.llcpp.h.golden
index 17ade39..01cd351 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/placement_of_attributes.test.json.llcpp.h.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/placement_of_attributes.test.json.llcpp.h.golden
@@ -465,7 +465,7 @@
public:
Method_Impl(::zx::unowned_channel _client_end,
- ::llcpp::exampleusing::Empty arg);
+ ::llcpp::exampleusing::Empty& arg);
~Method_Impl() = default;
Method_Impl(Method_Impl&& other) = default;
Method_Impl& operator=(Method_Impl&& other) = default;
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/protocol_request.test.json.llcpp.cc.golden b/garnet/go/src/fidl/compiler/backend/goldens/protocol_request.test.json.llcpp.cc.golden
index a4838af..19db22e 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/protocol_request.test.json.llcpp.cc.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/protocol_request.test.json.llcpp.cc.golden
@@ -196,7 +196,7 @@
}
Parent::ResultOf::TakeChild_Impl::TakeChild_Impl(
- ::zx::unowned_channel _client_end, ::zx::channel c) {
+ ::zx::unowned_channel _client_end, ::zx::channel& c) {
// Destructors can't be called because it will lead to handle double close
// (here and in fidl::Encode).
FIDL_ALIGNDECL uint8_t _request_buffer[sizeof(TakeChildRequest)];
@@ -216,13 +216,12 @@
}
Parent::ResultOf::TakeChild Parent::SyncClient::TakeChild(::zx::channel c) {
- return ResultOf::TakeChild(::zx::unowned_channel(this->channel_),
- std::move(c));
+ return ResultOf::TakeChild(::zx::unowned_channel(this->channel_), c);
}
Parent::ResultOf::TakeChild Parent::Call::TakeChild(
::zx::unowned_channel _client_end, ::zx::channel c) {
- return ResultOf::TakeChild(std::move(_client_end), std::move(c));
+ return ResultOf::TakeChild(std::move(_client_end), c);
}
Parent::UnownedResultOf::TakeChild_Impl::TakeChild_Impl(
@@ -289,7 +288,7 @@
}
Parent::ResultOf::TakeChildRequest_Impl::TakeChildRequest_Impl(
- ::zx::unowned_channel _client_end, ::zx::channel r) {
+ ::zx::unowned_channel _client_end, ::zx::channel& r) {
// Destructors can't be called because it will lead to handle double close
// (here and in fidl::Encode).
FIDL_ALIGNDECL uint8_t _request_buffer[sizeof(TakeChildRequestRequest)];
@@ -311,13 +310,12 @@
Parent::ResultOf::TakeChildRequest Parent::SyncClient::TakeChildRequest(
::zx::channel r) {
- return ResultOf::TakeChildRequest(::zx::unowned_channel(this->channel_),
- std::move(r));
+ return ResultOf::TakeChildRequest(::zx::unowned_channel(this->channel_), r);
}
Parent::ResultOf::TakeChildRequest Parent::Call::TakeChildRequest(
::zx::unowned_channel _client_end, ::zx::channel r) {
- return ResultOf::TakeChildRequest(std::move(_client_end), std::move(r));
+ return ResultOf::TakeChildRequest(std::move(_client_end), r);
}
Parent::UnownedResultOf::TakeChildRequest_Impl::TakeChildRequest_Impl(
@@ -532,7 +530,7 @@
::fidl::StatusAndError Parent::ClientImpl::TakeChild(::zx::channel c) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- auto _res = ResultOf::TakeChild(_binding->channel(), std::move(c));
+ auto _res = ResultOf::TakeChild(_binding->channel(), c);
return ::fidl::StatusAndError(_res.status(), _res.error());
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
@@ -550,7 +548,7 @@
::fidl::StatusAndError Parent::ClientImpl::TakeChildRequest(::zx::channel r) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- auto _res = ResultOf::TakeChildRequest(_binding->channel(), std::move(r));
+ auto _res = ResultOf::TakeChildRequest(_binding->channel(), r);
return ::fidl::StatusAndError(_res.status(), _res.error());
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/protocol_request.test.json.llcpp.h.golden b/garnet/go/src/fidl/compiler/backend/goldens/protocol_request.test.json.llcpp.h.golden
index 5669965..13a8263 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/protocol_request.test.json.llcpp.h.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/protocol_request.test.json.llcpp.h.golden
@@ -244,7 +244,7 @@
using Super = ::fidl::internal::StatusAndError;
public:
- TakeChild_Impl(::zx::unowned_channel _client_end, ::zx::channel c);
+ TakeChild_Impl(::zx::unowned_channel _client_end, ::zx::channel& c);
~TakeChild_Impl() = default;
TakeChild_Impl(TakeChild_Impl&& other) = default;
TakeChild_Impl& operator=(TakeChild_Impl&& other) = default;
@@ -259,7 +259,8 @@
using Super = ::fidl::internal::StatusAndError;
public:
- TakeChildRequest_Impl(::zx::unowned_channel _client_end, ::zx::channel r);
+ TakeChildRequest_Impl(::zx::unowned_channel _client_end,
+ ::zx::channel& r);
~TakeChildRequest_Impl() = default;
TakeChildRequest_Impl(TakeChildRequest_Impl&& other) = default;
TakeChildRequest_Impl& operator=(TakeChildRequest_Impl&& other) = default;
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/protocols.test.json.llcpp.cc.golden b/garnet/go/src/fidl/compiler/backend/goldens/protocols.test.json.llcpp.cc.golden
index 193fea5b..db3cbc6 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/protocols.test.json.llcpp.cc.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/protocols.test.json.llcpp.cc.golden
@@ -68,12 +68,12 @@
}
Transitional::ResultOf::Request Transitional::SyncClient::Request(int64_t x) {
- return ResultOf::Request(::zx::unowned_channel(this->channel_), std::move(x));
+ return ResultOf::Request(::zx::unowned_channel(this->channel_), x);
}
Transitional::ResultOf::Request Transitional::Call::Request(
::zx::unowned_channel _client_end, int64_t x) {
- return ResultOf::Request(std::move(_client_end), std::move(x));
+ return ResultOf::Request(std::move(_client_end), x);
}
template <>
@@ -168,12 +168,12 @@
}
Transitional::ResultOf::OneWay Transitional::SyncClient::OneWay(int64_t x) {
- return ResultOf::OneWay(::zx::unowned_channel(this->channel_), std::move(x));
+ return ResultOf::OneWay(::zx::unowned_channel(this->channel_), x);
}
Transitional::ResultOf::OneWay Transitional::Call::OneWay(
::zx::unowned_channel _client_end, int64_t x) {
- return ResultOf::OneWay(std::move(_client_end), std::move(x));
+ return ResultOf::OneWay(std::move(_client_end), x);
}
Transitional::UnownedResultOf::OneWay_Impl::OneWay_Impl(
@@ -242,7 +242,7 @@
Transitional::ResultOf::Request Transitional::ClientImpl::Request_Sync(
int64_t x) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- return ResultOf::Request(_binding->channel(), std::move(x));
+ return ResultOf::Request(_binding->channel(), x);
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
}
@@ -324,7 +324,7 @@
::fidl::StatusAndError Transitional::ClientImpl::OneWay(int64_t x) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- auto _res = ResultOf::OneWay(_binding->channel(), std::move(x));
+ auto _res = ResultOf::OneWay(_binding->channel(), x);
return ::fidl::StatusAndError(_res.status(), _res.error());
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
@@ -648,13 +648,12 @@
ChannelProtocol::ResultOf::MethodA ChannelProtocol::SyncClient::MethodA(
int64_t a, int64_t b) {
- return ResultOf::MethodA(::zx::unowned_channel(this->channel_), std::move(a),
- std::move(b));
+ return ResultOf::MethodA(::zx::unowned_channel(this->channel_), a, b);
}
ChannelProtocol::ResultOf::MethodA ChannelProtocol::Call::MethodA(
::zx::unowned_channel _client_end, int64_t a, int64_t b) {
- return ResultOf::MethodA(std::move(_client_end), std::move(a), std::move(b));
+ return ResultOf::MethodA(std::move(_client_end), a, b);
}
ChannelProtocol::UnownedResultOf::MethodA_Impl::MethodA_Impl(
@@ -746,13 +745,12 @@
ChannelProtocol::ResultOf::MethodB ChannelProtocol::SyncClient::MethodB(
int64_t a, int64_t b) {
- return ResultOf::MethodB(::zx::unowned_channel(this->channel_), std::move(a),
- std::move(b));
+ return ResultOf::MethodB(::zx::unowned_channel(this->channel_), a, b);
}
ChannelProtocol::ResultOf::MethodB ChannelProtocol::Call::MethodB(
::zx::unowned_channel _client_end, int64_t a, int64_t b) {
- return ResultOf::MethodB(std::move(_client_end), std::move(a), std::move(b));
+ return ResultOf::MethodB(std::move(_client_end), a, b);
}
template <>
@@ -829,7 +827,7 @@
template <>
ChannelProtocol::ResultOf::
MutateSocket_Impl<ChannelProtocol::MutateSocketResponse>::MutateSocket_Impl(
- ::zx::unowned_channel _client_end, ::zx::socket a) {
+ ::zx::unowned_channel _client_end, ::zx::socket& a) {
// Destructors can't be called because it will lead to handle double close
// (here and in fidl::Encode).
FIDL_ALIGNDECL uint8_t _request_buffer[sizeof(MutateSocketRequest)];
@@ -851,13 +849,12 @@
ChannelProtocol::ResultOf::MutateSocket
ChannelProtocol::SyncClient::MutateSocket(::zx::socket a) {
- return ResultOf::MutateSocket(::zx::unowned_channel(this->channel_),
- std::move(a));
+ return ResultOf::MutateSocket(::zx::unowned_channel(this->channel_), a);
}
ChannelProtocol::ResultOf::MutateSocket ChannelProtocol::Call::MutateSocket(
::zx::unowned_channel _client_end, ::zx::socket a) {
- return ResultOf::MutateSocket(std::move(_client_end), std::move(a));
+ return ResultOf::MutateSocket(std::move(_client_end), a);
}
template <>
@@ -940,8 +937,7 @@
::fidl::StatusAndError ChannelProtocol::ClientImpl::MethodA(int64_t a,
int64_t b) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- auto _res =
- ResultOf::MethodA(_binding->channel(), std::move(a), std::move(b));
+ auto _res = ResultOf::MethodA(_binding->channel(), a, b);
return ::fidl::StatusAndError(_res.status(), _res.error());
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
@@ -961,7 +957,7 @@
ChannelProtocol::ResultOf::MethodB ChannelProtocol::ClientImpl::MethodB_Sync(
int64_t a, int64_t b) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- return ResultOf::MethodB(_binding->channel(), std::move(a), std::move(b));
+ return ResultOf::MethodB(_binding->channel(), a, b);
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
}
@@ -1045,7 +1041,7 @@
ChannelProtocol::ResultOf::MutateSocket
ChannelProtocol::ClientImpl::MutateSocket_Sync(::zx::socket a) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- return ResultOf::MutateSocket(_binding->channel(), std::move(a));
+ return ResultOf::MutateSocket(_binding->channel(), a);
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
}
@@ -1742,7 +1738,7 @@
WithAndWithoutRequestResponse::ResultOf::WithRequestNoResponse_Impl::
WithRequestNoResponse_Impl(::zx::unowned_channel _client_end,
- ::fidl::StringView arg) {
+ const ::fidl::StringView& arg) {
WithRequestNoResponseRequest _request(0, arg);
auto _encoded =
@@ -1764,14 +1760,13 @@
WithAndWithoutRequestResponse::SyncClient::WithRequestNoResponse(
::fidl::StringView arg) {
return ResultOf::WithRequestNoResponse(::zx::unowned_channel(this->channel_),
- std::move(arg));
+ arg);
}
WithAndWithoutRequestResponse::ResultOf::WithRequestNoResponse
WithAndWithoutRequestResponse::Call::WithRequestNoResponse(
::zx::unowned_channel _client_end, ::fidl::StringView arg) {
- return ResultOf::WithRequestNoResponse(std::move(_client_end),
- std::move(arg));
+ return ResultOf::WithRequestNoResponse(std::move(_client_end), arg);
}
WithAndWithoutRequestResponse::UnownedResultOf::WithRequestNoResponse_Impl::
@@ -1850,7 +1845,7 @@
WithAndWithoutRequestResponse::ResultOf::WithRequestEmptyResponse_Impl<
WithAndWithoutRequestResponse::WithRequestEmptyResponseResponse>::
WithRequestEmptyResponse_Impl(::zx::unowned_channel _client_end,
- ::fidl::StringView arg) {
+ const ::fidl::StringView& arg) {
WithRequestEmptyResponseRequest _request(0, arg);
auto _encoded =
@@ -1873,14 +1868,13 @@
WithAndWithoutRequestResponse::SyncClient::WithRequestEmptyResponse(
::fidl::StringView arg) {
return ResultOf::WithRequestEmptyResponse(
- ::zx::unowned_channel(this->channel_), std::move(arg));
+ ::zx::unowned_channel(this->channel_), arg);
}
WithAndWithoutRequestResponse::ResultOf::WithRequestEmptyResponse
WithAndWithoutRequestResponse::Call::WithRequestEmptyResponse(
::zx::unowned_channel _client_end, ::fidl::StringView arg) {
- return ResultOf::WithRequestEmptyResponse(std::move(_client_end),
- std::move(arg));
+ return ResultOf::WithRequestEmptyResponse(std::move(_client_end), arg);
}
template <>
@@ -1973,7 +1967,7 @@
WithAndWithoutRequestResponse::ResultOf::WithRequestWithResponse_Impl<
WithAndWithoutRequestResponse::WithRequestWithResponseResponse>::
WithRequestWithResponse_Impl(::zx::unowned_channel _client_end,
- ::fidl::StringView arg) {
+ const ::fidl::StringView& arg) {
WithRequestWithResponseRequest _request(0, arg);
auto _encoded =
@@ -1996,14 +1990,13 @@
WithAndWithoutRequestResponse::SyncClient::WithRequestWithResponse(
::fidl::StringView arg) {
return ResultOf::WithRequestWithResponse(
- ::zx::unowned_channel(this->channel_), std::move(arg));
+ ::zx::unowned_channel(this->channel_), arg);
}
WithAndWithoutRequestResponse::ResultOf::WithRequestWithResponse
WithAndWithoutRequestResponse::Call::WithRequestWithResponse(
::zx::unowned_channel _client_end, ::fidl::StringView arg) {
- return ResultOf::WithRequestWithResponse(std::move(_client_end),
- std::move(arg));
+ return ResultOf::WithRequestWithResponse(std::move(_client_end), arg);
}
template <>
@@ -2248,8 +2241,7 @@
WithAndWithoutRequestResponse::ClientImpl::WithRequestNoResponse(
::fidl::StringView arg) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- auto _res =
- ResultOf::WithRequestNoResponse(_binding->channel(), std::move(arg));
+ auto _res = ResultOf::WithRequestNoResponse(_binding->channel(), arg);
return ::fidl::StatusAndError(_res.status(), _res.error());
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
@@ -2270,8 +2262,7 @@
WithAndWithoutRequestResponse::ClientImpl::WithRequestEmptyResponse_Sync(
::fidl::StringView arg) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- return ResultOf::WithRequestEmptyResponse(_binding->channel(),
- std::move(arg));
+ return ResultOf::WithRequestEmptyResponse(_binding->channel(), arg);
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
}
@@ -2357,8 +2348,7 @@
WithAndWithoutRequestResponse::ClientImpl::WithRequestWithResponse_Sync(
::fidl::StringView arg) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- return ResultOf::WithRequestWithResponse(_binding->channel(),
- std::move(arg));
+ return ResultOf::WithRequestWithResponse(_binding->channel(), arg);
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
}
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/protocols.test.json.llcpp.h.golden b/garnet/go/src/fidl/compiler/backend/goldens/protocols.test.json.llcpp.h.golden
index bc95ebe..b71ec98 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/protocols.test.json.llcpp.h.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/protocols.test.json.llcpp.h.golden
@@ -1086,7 +1086,7 @@
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
- MutateSocket_Impl(::zx::unowned_channel _client_end, ::zx::socket a);
+ MutateSocket_Impl(::zx::unowned_channel _client_end, ::zx::socket& a);
~MutateSocket_Impl() = default;
MutateSocket_Impl(MutateSocket_Impl&& other) = default;
MutateSocket_Impl& operator=(MutateSocket_Impl&& other) = default;
@@ -1813,7 +1813,7 @@
public:
WithRequestNoResponse_Impl(::zx::unowned_channel _client_end,
- ::fidl::StringView arg);
+ const ::fidl::StringView& arg);
~WithRequestNoResponse_Impl() = default;
WithRequestNoResponse_Impl(WithRequestNoResponse_Impl&& other) = default;
WithRequestNoResponse_Impl& operator=(
@@ -1831,7 +1831,7 @@
public:
WithRequestEmptyResponse_Impl(::zx::unowned_channel _client_end,
- ::fidl::StringView arg);
+ const ::fidl::StringView& arg);
~WithRequestEmptyResponse_Impl() = default;
WithRequestEmptyResponse_Impl(WithRequestEmptyResponse_Impl&& other) =
default;
@@ -1854,7 +1854,7 @@
public:
WithRequestWithResponse_Impl(::zx::unowned_channel _client_end,
- ::fidl::StringView arg);
+ const ::fidl::StringView& arg);
~WithRequestWithResponse_Impl() = default;
WithRequestWithResponse_Impl(WithRequestWithResponse_Impl&& other) =
default;
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/request_flexible_envelope.test.json.llcpp.cc.golden b/garnet/go/src/fidl/compiler/backend/goldens/request_flexible_envelope.test.json.llcpp.cc.golden
index c4568db..8ea4f6b 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/request_flexible_envelope.test.json.llcpp.cc.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/request_flexible_envelope.test.json.llcpp.cc.golden
@@ -54,8 +54,9 @@
template <>
Protocol::ResultOf::RequestStrictResponseFlexible_Impl<
Protocol::RequestStrictResponseFlexibleResponse>::
- RequestStrictResponseFlexible_Impl(::zx::unowned_channel _client_end,
- ::llcpp::fidl::test::json::StrictFoo s) {
+ RequestStrictResponseFlexible_Impl(
+ ::zx::unowned_channel _client_end,
+ ::llcpp::fidl::test::json::StrictFoo& s) {
RequestStrictResponseFlexibleRequest _request(0, s);
auto _encoded = ::fidl::internal::LinearizedAndEncoded<
@@ -76,14 +77,13 @@
Protocol::SyncClient::RequestStrictResponseFlexible(
::llcpp::fidl::test::json::StrictFoo s) {
return ResultOf::RequestStrictResponseFlexible(
- ::zx::unowned_channel(this->channel_), std::move(s));
+ ::zx::unowned_channel(this->channel_), s);
}
Protocol::ResultOf::RequestStrictResponseFlexible
Protocol::Call::RequestStrictResponseFlexible(
::zx::unowned_channel _client_end, ::llcpp::fidl::test::json::StrictFoo s) {
- return ResultOf::RequestStrictResponseFlexible(std::move(_client_end),
- std::move(s));
+ return ResultOf::RequestStrictResponseFlexible(std::move(_client_end), s);
}
template <>
@@ -175,7 +175,7 @@
Protocol::RequestFlexibleResponseStrictResponse>::
RequestFlexibleResponseStrict_Impl(
::zx::unowned_channel _client_end,
- ::llcpp::fidl::test::json::FlexibleFoo s) {
+ ::llcpp::fidl::test::json::FlexibleFoo& s) {
RequestFlexibleResponseStrictRequest _request(0, s);
auto _encoded = ::fidl::internal::LinearizedAndEncoded<
@@ -196,15 +196,14 @@
Protocol::SyncClient::RequestFlexibleResponseStrict(
::llcpp::fidl::test::json::FlexibleFoo s) {
return ResultOf::RequestFlexibleResponseStrict(
- ::zx::unowned_channel(this->channel_), std::move(s));
+ ::zx::unowned_channel(this->channel_), s);
}
Protocol::ResultOf::RequestFlexibleResponseStrict
Protocol::Call::RequestFlexibleResponseStrict(
::zx::unowned_channel _client_end,
::llcpp::fidl::test::json::FlexibleFoo s) {
- return ResultOf::RequestFlexibleResponseStrict(std::move(_client_end),
- std::move(s));
+ return ResultOf::RequestFlexibleResponseStrict(std::move(_client_end), s);
}
template <>
@@ -296,8 +295,7 @@
Protocol::ClientImpl::RequestStrictResponseFlexible_Sync(
::llcpp::fidl::test::json::StrictFoo s) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- return ResultOf::RequestStrictResponseFlexible(_binding->channel(),
- std::move(s));
+ return ResultOf::RequestStrictResponseFlexible(_binding->channel(), s);
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
}
@@ -387,8 +385,7 @@
Protocol::ClientImpl::RequestFlexibleResponseStrict_Sync(
::llcpp::fidl::test::json::FlexibleFoo s) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
- return ResultOf::RequestFlexibleResponseStrict(_binding->channel(),
- std::move(s));
+ return ResultOf::RequestFlexibleResponseStrict(_binding->channel(), s);
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
}
diff --git a/garnet/go/src/fidl/compiler/backend/goldens/request_flexible_envelope.test.json.llcpp.h.golden b/garnet/go/src/fidl/compiler/backend/goldens/request_flexible_envelope.test.json.llcpp.h.golden
index fa3821a..b809b5a 100644
--- a/garnet/go/src/fidl/compiler/backend/goldens/request_flexible_envelope.test.json.llcpp.h.golden
+++ b/garnet/go/src/fidl/compiler/backend/goldens/request_flexible_envelope.test.json.llcpp.h.golden
@@ -390,7 +390,7 @@
public:
RequestStrictResponseFlexible_Impl(
::zx::unowned_channel _client_end,
- ::llcpp::fidl::test::json::StrictFoo s);
+ ::llcpp::fidl::test::json::StrictFoo& s);
~RequestStrictResponseFlexible_Impl() = default;
RequestStrictResponseFlexible_Impl(
RequestStrictResponseFlexible_Impl&& other) = default;
@@ -415,7 +415,7 @@
public:
RequestFlexibleResponseStrict_Impl(
::zx::unowned_channel _client_end,
- ::llcpp::fidl::test::json::FlexibleFoo s);
+ ::llcpp::fidl::test::json::FlexibleFoo& s);
~RequestFlexibleResponseStrict_Impl() = default;
RequestFlexibleResponseStrict_Impl(
RequestFlexibleResponseStrict_Impl&& other) = default;
diff --git a/tools/fidl/fidlgen_llcpp/templates/fragments/client_sync_methods.tmpl.go b/tools/fidl/fidlgen_llcpp/templates/fragments/client_sync_methods.tmpl.go
index f0cda4d..0eba5205 100644
--- a/tools/fidl/fidlgen_llcpp/templates/fragments/client_sync_methods.tmpl.go
+++ b/tools/fidl/fidlgen_llcpp/templates/fragments/client_sync_methods.tmpl.go
@@ -38,8 +38,7 @@
{{- template "SyncRequestManagedMethodArguments" . }}) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
return ResultOf::{{ .Name }}(_binding->channel()
- {{- if .Request }}, {{ end }}
- {{- template "SyncClientMoveParams" .Request -}}
+ {{- template "CommaPassthroughMessageParams" .Request -}}
);
}
return ::fidl::StatusAndError(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound);
@@ -49,8 +48,7 @@
{{- template "SyncRequestManagedMethodArguments" . }}) {
if (auto _binding = ::fidl::internal::ClientBase::GetBinding()) {
auto _res = ResultOf::{{ .Name }}(_binding->channel()
- {{- if .Request }}, {{ end }}
- {{- template "SyncClientMoveParams" .Request -}}
+ {{- template "CommaPassthroughMessageParams" .Request -}}
);
return ::fidl::StatusAndError(_res.status(), _res.error());
}
diff --git a/tools/fidl/fidlgen_llcpp/templates/fragments/protocol.tmpl.go b/tools/fidl/fidlgen_llcpp/templates/fragments/protocol.tmpl.go
index 8e252c6..1fced7a 100644
--- a/tools/fidl/fidlgen_llcpp/templates/fragments/protocol.tmpl.go
+++ b/tools/fidl/fidlgen_llcpp/templates/fragments/protocol.tmpl.go
@@ -236,7 +236,7 @@
class {{ .Name }}_Impl final : private ::fidl::internal::{{ if .HasResponse -}} OwnedSyncCallBase<ResponseType> {{- else -}} StatusAndError {{- end }} {
using Super = ::fidl::internal::{{ if .HasResponse -}} OwnedSyncCallBase<ResponseType> {{- else -}} StatusAndError {{- end }};
public:
- {{ .Name }}_Impl({{ template "StaticCallSyncRequestManagedMethodArguments" . }});
+ {{ .Name }}_Impl(::zx::unowned_channel _client_end {{- template "CommaMessagePrototype" .Request }});
~{{ .Name }}_Impl() = default;
{{ .Name }}_Impl({{ .Name }}_Impl&& other) = default;
{{ .Name }}_Impl& operator=({{ .Name }}_Impl&& other) = default;
diff --git a/tools/fidl/fidlgen_llcpp/templates/fragments/sync_request_managed.tmpl.go b/tools/fidl/fidlgen_llcpp/templates/fragments/sync_request_managed.tmpl.go
index 35ad66e..2beb99f 100644
--- a/tools/fidl/fidlgen_llcpp/templates/fragments/sync_request_managed.tmpl.go
+++ b/tools/fidl/fidlgen_llcpp/templates/fragments/sync_request_managed.tmpl.go
@@ -28,7 +28,7 @@
{{- define "SyncRequestManagedMethodDefinition" }}
{{ if .HasResponse -}} template <> {{- end }}
{{ .LLProps.ProtocolName }}::ResultOf::{{ .Name }}_Impl {{- if .HasResponse -}} <{{ .LLProps.ProtocolName }}::{{ .Name }}Response> {{- end }}::{{ .Name }}_Impl(
- {{- template "StaticCallSyncRequestManagedMethodArguments" . }}) {
+ ::zx::unowned_channel _client_end {{- template "CommaMessagePrototype" .Request }}) {
{{- if .LLProps.LinearizeRequest }}
{{/* tracking_ptr destructors will be called when _response goes out of scope */}}
@@ -71,8 +71,7 @@
{{ .LLProps.ProtocolName }}::ResultOf::{{ .Name }} {{ .LLProps.ProtocolName }}::SyncClient::{{ .Name }}(
{{- template "SyncRequestManagedMethodArguments" . }}) {
return ResultOf::{{ .Name }}(::zx::unowned_channel(this->channel_)
- {{- if .Request }}, {{ end }}
- {{- template "SyncClientMoveParams" .Request -}}
+ {{- template "CommaPassthroughMessageParams" .Request -}}
);
}
{{- end }}
@@ -81,8 +80,8 @@
{{ .LLProps.ProtocolName }}::ResultOf::{{ .Name }} {{ .LLProps.ProtocolName }}::Call::{{ .Name }}(
{{- template "StaticCallSyncRequestManagedMethodArguments" . }}) {
return ResultOf::{{ .Name }}(std::move(_client_end)
- {{- if .Request }}, {{ end }}
- {{- template "SyncClientMoveParams" .Request }});
+ {{- template "CommaPassthroughMessageParams" .Request -}}
+ );
}
{{- end }}
`