1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[XRay] Move out template and use perfect forwarding

Follow up to D51210.

llvm-svn: 341032
This commit is contained in:
Dean Michael Berris 2018-08-30 08:15:42 +00:00
parent c6f797ac53
commit 570f2b1225

View File

@ -65,11 +65,12 @@ template <size_t Index> struct IndexedMemcpy {
};
template <uint8_t Kind, class... Data>
Error writeMetadata(raw_ostream &OS, Data... Ds) {
Error writeMetadata(raw_ostream &OS, Data&&... Ds) {
MetadataBlob B;
B.Type = 1;
B.RecordKind = Kind;
IndexedMemcpy<0>::Copy(B.Data, std::make_tuple(Ds...));
auto T = std::make_tuple(std::forward<Data>(std::move(Ds))...);
IndexedMemcpy<0>::Copy(B.Data, T);
OS.write(reinterpret_cast<const char *>(&B), sizeof(MetadataBlob));
return Error::success();
}