This is an archive of the discontinued LLVM Phabricator instance.

[NFC]add mov constructor to DIEValue
AbandonedPublic

Authored by XinWang10 on May 10 2023, 1:36 AM.

Details

Reviewers
None

Diff Detail

Event Timeline

XinWang10 created this revision.May 10 2023, 1:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2023, 1:36 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
XinWang10 requested review of this revision.May 10 2023, 1:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2023, 1:36 AM
barannikov88 added inline comments.
llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h
38

std::move is redundant here, the expression is already xvalue.
The same is true in other places.

barannikov88 added inline comments.May 10 2023, 2:35 AM
llvm/include/llvm/CodeGen/DIE.h
466

It is no more efficient than the copy constructor.
Why do you need it?

XinWang10 added inline comments.May 10 2023, 2:50 AM
llvm/include/llvm/CodeGen/DIE.h
466

Because I think DIEValue could maintain dynamic memory, copy constructor here need to first construct a temporary one and assign to this then destruct it self, couldn't move here be more efficient?

XinWang10 added inline comments.May 10 2023, 2:56 AM
llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h
38

Oh, sorry, my mistake, so you are right, we don't need move construct

XinWang10 abandoned this revision.May 10 2023, 2:56 AM

Thanks for your remind